Create a RETURN botton for bot - python-telegram-bot

I'm new to Python-Telegram-Bot
I want to create a bot with return bottom and it means whenever user click the return bottom the bot shows the previous menu to user
Thanks

It's not task of python-telegram-bot. You should handle it. For example save last previous(es) state(s) of user (in DB) and after user decide to return, you redirect user to previous state.

Related

How to save the state of the application when you navigate or close the application in Xamarin.Forms?

My application is about getting the contact information of the user when filing an job application. I want for the user to have the ability to save what he/she initially filled up and when he/she wants to finish filling-up the form the information he/she already filled up will there. Is there a way to save the state of the application so that when the user closes the application or navigate to another page the form that the user filled-up wont be gone?
Depending on the number and types of fields of your application I would use Preferences.
https://learn.microsoft.com/en-us/xamarin/essentials/preferences?tabs=ios

Can outlook web add-in entry page(taskpaneurl) know which task pane button triggers the visit?

My add-in has multiple drop down items when you click the add-in button.
All of them will navigate you to the same log-in page.
But after log in, the app needs to know to which subsequent page the user need to be redirected to.
For example, when I click the "play" button in the drop down, after log in I will be redirected to the play.html. And "study" will be to the study.html.
If the log in page(taskpaneurl) has no such knowledge, I need to have multiple log in page tided to different subsequent pages.
The add-in platform doesn't provide an API for this, but you can do this by providing a query string in your url.

Userfrosting: How to make user login automatically soon after registration

In our usecase, we need to login the user automatically soon after successful registration for enabling, rather forcing the user to:
Change password.
Upload a file.
How to achieve this programmatically, in AccountController's register method?
Ideally, it should be a seamless registration process that ends with the login state in the user dashboard.
Request valuable help / hint / pointers...
Thanks!
The best way to approach this is to take a cue from the password reset controller, which already does this (in this case, it automatically logs the user in after they've selected a new password).
So, add this to the bottom of the register method in AccountController:
// Log out any existing user, and create a new session
if (!$this->_app->user->isGuest()) {
$this->_app->logout(true);
// Restart session
$this->_app->startSession();
}
// Auto-login the user
$this->_app->login($user);
$ms = $this->_app->alerts;
$ms->addMessageTranslated("success", "ACCOUNT_WELCOME", $this->_app->user->export());
You will also need to modify the AJAX callback in register.twig to redirect the user to the home page, instead of the login page:
window.location.replace(site['uri']['public']);
The user will then be automatically redirected to the landing page for their primary group after being logged in.

How can I trigger a javascript Facebook authentication dialog box on an anchor tag?

I have a simple rating system that logged in users can just click and it updates asynchronously.
However, I still want non-logged in users to see the rating mechanism (let's say a simple "up" arrow) but trigger the Facebook authentication popup when they click the link.
Can you help? I have the regular fb:login button working just fine. But how can I trigger this action on a regular anchor tag (in addition to the fb:login button).
You need to call the FB.login method
https://developers.facebook.com/docs/reference/javascript/FB.login/
You can bind this to the button click for non logged in users, on the callback you can register the original rating action or refresh the page.

Implementing a login/logout system

i have a problem with a WP7 app. I want that a user can login into the application, doing some stuff and logout.
Now, then a new user get the phone, it should not be possible to get into the session of the old user (by simply pressing back until the user see the intern data of the previous user who was logged in).
how to make this?
The best thing would be, that when a user press the back button, it will be forwared to the first page of the app. the problem then is, that there will be a loop and the app will not pass the certification because it will not be possible to exit it.
Here is an overview:
loginPage (no return just exiting the app) -> internPage (possibility to logout and return to loginPage)
You can clear the back stack using NavigationService.RemoveBackEntry:
while (this.NavigationService.BackStack.Any())
{
this.NavigationService.RemoveBackEntry();
}
Put this in the OnNavigatedTo of your LoginPage, so pressing back on this page will exit the application. If the LoginPage is the first page the user sees when launching the app (and therefore is the application main page), it should pass certification.
try the nonlinearnavigationservice that way back will unwind your history properly an you back out of the mainpage it will exit your app correctly.
http://create.msdn.com/en-US/education/catalog/article/nln-serv-wp7
why not have the mainpage show the icons for the different users, and a click onto the user would ask for their password?
You cannot change the navigation flow of your application so that the back-button takes you to the first page. This will result in you failing the marketplace certification.
What you could do is handle the application lifecycle events, when the user leaves your application, then navigates back to it via the back-button you application is re-started either from a dormant or tombstoned state.
You can read about the lifecycle here:
http://www.scottlogic.co.uk/blog/colin/2011/10/a-windows-phone-7-1-mango-mvvm-tombstoning-example/
You need to add logic into the Activated event. At this point you could display a logic Popup that ensures the user has to re-enter their credentials to continue using the application.
The best way is to create separate view like UserControl and then show it as Popup when you need user to log in.
This is the way recommended by Microsoft also, and zou won't be having this navigation problems.
Something like this:
enter link description here

Resources