def broadcast(bot, update):
to_send = update.effective_message.text.split(None, 1)
if len(to_send) >= 2:
chats = sql.get_all_chats() or []
for chat in chats:
try:
bot.sendMessage(int(chat.chat_id), to_send[1])
sleep(0.1)
except TelegramError:
print("Couldn't send broadcast to {}, group name {}".format(chat.chat_id, chat.chat_name),
file=sys.stderr)
评论列表
文章目录