hotfix
This commit is contained in:
@@ -5,6 +5,7 @@ reconnect_interval = 5
|
||||
|
||||
[bot]
|
||||
command = ["/"]
|
||||
ignore_self_message = true #是否忽略自身消息
|
||||
|
||||
[redis]
|
||||
host = "114.66.58.203"
|
||||
|
||||
@@ -146,6 +146,13 @@ class CommandManager:
|
||||
bot: Bot 实例。
|
||||
event: 已解析的事件对象。
|
||||
"""
|
||||
# --- 全局过滤机器人自身消息 ---
|
||||
# 仅对消息事件生效
|
||||
if event.post_type == 'message' and global_config.bot.get('ignore_self_message', False):
|
||||
|
||||
if hasattr(event, 'user_id') and hasattr(event, 'self_id') and event.user_id == event.self_id:
|
||||
return
|
||||
|
||||
post_type = event.post_type
|
||||
|
||||
if post_type == 'message':
|
||||
|
||||
Reference in New Issue
Block a user