Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to Telegram responses #5257

Merged
merged 4 commits into from
Sep 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pokemongo_bot/event_handlers/telegram_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def run(self):
"/info - info about bot",
"/login <password> - authenticate with the bot; once authenticated, your ID will be registered with the bot and survive bot restarts",
"/logout - remove your ID from the 'authenticated' list",
"/sub <event_name> [<parameters>] - subscribe to event_name, with optional parameters, event_name=all will subscribe to ALL events (LOTS of output!)",
"/sub <event_name> [<parameters>] - subscribe to event_name, with optional parameters, event name=all will subscribe to ALL events (LOTS of output!)",
"/unsub <event_name> [<parameters>] - unsubscribe from event_name; parameters must match the /sub parameters",
"/unsub everything - will remove all subscriptions for this uid",
"/showsubs - show current subscriptions",
Expand Down Expand Up @@ -217,13 +217,16 @@ def run(self):
self.sendMessage(chat_id=update.message.chat_id, parse_mode='HTML', text=(", ".join(self.bot.event_manager._registered_events.keys())))
continue
if update.message.text == "/logout":
self.sendMessage(chat_id=update.message.chat_id, parse_mode='HTML', text=("Logged out."))
self.deauthenticate(update)
continue
if re.match(r'^/sub ', update.message.text):
self.chsub(update.message.text, update.message.chat_id)
self.sendMessage(chat_id=update.message.chat_id, parse_mode='HTML', text=("Subscriptions updated."))
continue
if re.match(r'^/unsub ', update.message.text):
self.chsub(update.message.text, update.message.chat_id)
self.sendMessage(chat_id=update.message.chat_id, parse_mode='HTML', text=("Subscriptions updated."))
continue
if re.match(r'^/showsubs', update.message.text):
self.showsubs(update.message.chat_id)
Expand Down