Skip to content

Commit 9cf2948

Browse files
authored
fix(msg_store.py) fix bug
1 parent fd66829 commit 9cf2948

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

user_handlers/msg_store.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ def store_message(update, context):
7878

7979
update_message(chat_id, msg_id, msg_text)
8080
return
81-
82-
if update.message.via_bot.id == context.bot.get_me().username:
83-
return
81+
82+
if update.message.via_bot:
83+
if update.message.via_bot.id == context.bot.get_me().username:
84+
return
8485
'''
8586
这里的 if 判断发言是用户还是频道或者是 group。
8687
需要注意的是,这里并不能排除 BOT,因为 Telegram 为了向后兼容,Anon group 实体会附带有一个 from 参数,里面 is_bot 是 true. 如下

0 commit comments

Comments
 (0)