From 4f8b35931a10d67db866ff4f834d085bf5537f8f Mon Sep 17 00:00:00 2001 From: Arne Beer Date: Thu, 7 Nov 2019 11:49:16 +0100 Subject: [PATCH] Send ReplyMarkupRemove on Broadcast --- CHANGELOG.md | 7 ++++--- i18n/English.yml | 2 +- pollbot/telegram/commands/admin.py | 15 +++++++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be847cf7..257b8788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ ## v1.2.0 - Completely revamp the user settings and /start interface -- Add a prompt whenn deleting all polls of a user -- Option to delete specific poll without removing all messages +- Add /settings command as shortcut to settings submenu +- Add a prompt when deleting all polls of a user +- Option to delete specific a poll without removing all messages - Link in settings, which allows anybody to share the poll to arbitrary groups -- New doodle button layout. Old one can still be selectd in style settings +- New doodle button layout. Old one can still be selected in poll styling settings - Lokalise integration - New language Italian diff --git a/i18n/English.yml b/i18n/English.yml index 7eca54e1..83d620e8 100644 --- a/i18n/English.yml +++ b/i18n/English.yml @@ -323,7 +323,7 @@ misc: I really appreciate anything that helps me out and that keeps my server and me running ☺️. - If you like this project, check out my [Patreon page](https://www.patreon.com/nukesor) or support me via [PayPal](https://www.paypal.me/arnebeer). + If you like this project, check out my [Patreon page](https://www.patreon.com/nukesor) or consider supporting me via [PayPal](https://www.paypal.me/arnebeer). If you have any questions, stop by my [support group](https://t.me/nukesors_projects). Have great day! diff --git a/pollbot/telegram/commands/admin.py b/pollbot/telegram/commands/admin.py index 84040946..331a1d55 100644 --- a/pollbot/telegram/commands/admin.py +++ b/pollbot/telegram/commands/admin.py @@ -1,5 +1,6 @@ """Admin related stuff.""" import time +from telegram import ReplyKeyboardRemove from telegram.ext import run_async from telegram.error import BadRequest, Unauthorized @@ -33,7 +34,12 @@ def broadcast(bot, update, session, user): update.message.chat.send_message(f'Sending broadcast to {len(users)} chats.') for user in users: try: - bot.send_message(user.id, message, parse_mode='Markdown') + bot.send_message( + user.id, + message, + parse_mode='Markdown', + reply_markup=ReplyKeyboardRemove(), + ) user.started = True # The chat doesn't exist any longer, delete it @@ -59,4 +65,9 @@ def test_broadcast(bot, update, session, user): """Send the broadcast message to the admin for test purposes.""" message = update.message.text.split(' ', 1)[1].strip() - bot.send_message(user.id, message, parse_mode='Markdown') + bot.send_message( + user.id, + message, + parse_mode='Markdown', + reply_markup=ReplyKeyboardRemove(), + )