users.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:tgbot 作者: PaulSonOfLars 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号