Skip to content
This repository has been archived by the owner on Sep 30, 2022. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Ayra Hikari <[email protected]>
  • Loading branch information
AyraHikari committed Sep 25, 2018
1 parent c1a5211 commit 9651a0f
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions tg_bot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,13 @@ def help_button(bot: Bot, update: Update):

elif next_match:
next_page = int(next_match.group(1))
bot.edit_message_text(chat_id=query.message.chat_id,
message_id=query.message.message_id,
text=HELP_STRINGS,
bot.edit_message_text(text=HELP_STRINGS,
parse_mode=ParseMode.MARKDOWN,
reply_markup=InlineKeyboardMarkup(
paginate_modules(next_page + 1, HELPABLE, "help")))

elif back_match:
bot.edit_message_text(chat_id=query.message.chat_id,
message_id=query.message.message_id,
text=HELP_STRINGS,
bot.edit_message_text(text=HELP_STRINGS,
parse_mode=ParseMode.MARKDOWN,
reply_markup=InlineKeyboardMarkup(paginate_modules(0, HELPABLE, "help")))

Expand Down Expand Up @@ -299,9 +295,7 @@ def settings_button(bot: Bot, update: Update):
text = "*{}* has the following settings for the *{}* module:\n\n".format(escape_markdown(chat.title),
CHAT_SETTINGS[module].__mod_name__) + \
CHAT_SETTINGS[module].__chat_settings__(chat_id, user.id)
query.message.edit_text(chat_id=query.message.chat_id,
message_id=query.message.message_id,
text=text,
query.message.edit_text(text=text,
parse_mode=ParseMode.MARKDOWN,
reply_markup=InlineKeyboardMarkup(
[[InlineKeyboardButton(text="Back",
Expand All @@ -311,9 +305,7 @@ def settings_button(bot: Bot, update: Update):
chat_id = prev_match.group(1)
curr_page = int(prev_match.group(2))
chat = bot.get_chat(chat_id)
query.message.edit_text(chat_id=query.message.chat_id,
message_id=query.message.message_id,
text="Hi there! There are quite a few settings for {} - go ahead and pick what "
query.message.edit_text(text="Hi there! There are quite a few settings for {} - go ahead and pick what "
"you're interested in.".format(chat.title),
reply_markup=InlineKeyboardMarkup(
paginate_modules(curr_page - 1, CHAT_SETTINGS, "stngs",
Expand All @@ -323,9 +315,7 @@ def settings_button(bot: Bot, update: Update):
chat_id = next_match.group(1)
next_page = int(next_match.group(2))
chat = bot.get_chat(chat_id)
query.message.edit_text(chat_id=query.message.chat_id,
message_id=query.message.message_id,
text="Hi there! There are quite a few settings for {} - go ahead and pick what "
query.message.edit_text(text="Hi there! There are quite a few settings for {} - go ahead and pick what "
"you're interested in.".format(chat.title),
reply_markup=InlineKeyboardMarkup(
paginate_modules(next_page + 1, CHAT_SETTINGS, "stngs",
Expand All @@ -334,9 +324,7 @@ def settings_button(bot: Bot, update: Update):
elif back_match:
chat_id = back_match.group(1)
chat = bot.get_chat(chat_id)
query.message.edit_text(chat_id=query.message.chat_id,
message_id=query.message.message_id,
text="Hi there! There are quite a few settings for {} - go ahead and pick what "
query.message.edit_text(text="Hi there! There are quite a few settings for {} - go ahead and pick what "
"you're interested in.".format(escape_markdown(chat.title)),
parse_mode=ParseMode.MARKDOWN,
reply_markup=InlineKeyboardMarkup(paginate_modules(0, CHAT_SETTINGS, "stngs",
Expand Down

0 comments on commit 9651a0f

Please sign in to comment.