Created
December 6, 2016 10:50
-
-
Save makiftasova/29c60503897409356dbc15a5d5458f26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def command_start(bot, chat_id, args): | |
if args['chat_type'] in ('group', 'supergroup'): | |
bot.broadcast_targets.append(chat_id) | |
async def command_broadcast(bot, chat_id, args): | |
""" | |
args = {'user_id': TELEGRM_USER_ID, 'username': TELEGRAM_USER_NAME, 'params': ['hello', 'world']} | |
""" | |
user_id = args['user_id'] | |
if user_id in bot.mods: | |
message = ' '.join(args['params']) | |
for group in bot.broadcast_targets: | |
await bot.sendMessage(group, message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment