Skip to content

Commit 50a9264

Browse files
authored
🐛 私聊消息不需要加上 mention 消息段 (#17)
* 🐛 私聊消息不需要加上 mention 消息段 * ⬆️ 升级 qqguild 适配器开发依赖
1 parent 0afb434 commit 50a9264

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

nonebot_plugin_all4one/middlewares/qqguild.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ async def to_onebot_message(self, event: MessageEvent) -> OneBotMessage:
167167
user_id=event.reply.message.author.id, # type: ignore
168168
)
169169
)
170-
if event.to_me:
170+
# 如果是私聊默认是 to_me 的,不需要再次 @ 机器人
171+
if event.to_me and not isinstance(event, DirectMessageCreateEvent):
171172
message_list.append(OneBotMessageSegment.mention(self.self_id))
172173
for segment in message:
173174
if segment.type == "text":

pdm.lock

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ adapters = [
2929
"nonebot-adapter-onebot @ git+https://github.com/nonebot/adapter-onebot.git",
3030
"nonebot-adapter-telegram @ git+https://github.com/nonebot/adapter-telegram.git",
3131
"nonebot-adapter-console @ git+https://github.com/nonebot/adapter-console.git",
32-
"nonebot-adapter-qqguild @ git+https://github.com/nonebot/adapter-qqguild.git",
32+
"nonebot-adapter-qqguild>=0.2.2",
3333
]
3434
tests = [
3535
"nonebug>=0.3.1",

0 commit comments

Comments
 (0)