mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-12 06:55:58 +08:00
🐛 可以正确接收频道的回复事件 (#505)
This commit is contained in:
parent
59d47210bc
commit
8b0473c331
@ -107,7 +107,12 @@ async def get_notice_message(bot: Bot, ev: Event):
|
||||
|
||||
@get_message.handle()
|
||||
async def get_all_message(bot: Bot, ev: Event):
|
||||
if gsclient is None or not gsclient.is_alive:
|
||||
if gsclient is None:
|
||||
return await connect()
|
||||
|
||||
try:
|
||||
await gsclient.ws.ping()
|
||||
except ConnectionClosed:
|
||||
return await connect()
|
||||
|
||||
# 通用字段获取
|
||||
@ -150,6 +155,10 @@ async def get_all_message(bot: Bot, ev: Event):
|
||||
else:
|
||||
logger.debug('[gsuid] 不支持该 QQ Guild 事件...')
|
||||
return
|
||||
|
||||
if ev.message_reference:
|
||||
reply_msg_id = ev.message_reference.message_id
|
||||
message.append(Message('reply', reply_msg_id))
|
||||
# telegram
|
||||
elif bot.adapter.get_name() == 'Telegram':
|
||||
from nonebot.adapters.telegram.event import (
|
||||
@ -391,6 +400,7 @@ async def connect():
|
||||
global gsclient
|
||||
try:
|
||||
gsclient = await GsClient().async_connect()
|
||||
await gsclient.start()
|
||||
except ConnectionRefusedError:
|
||||
logger.error('Core服务器连接失败...请稍后使用[启动core]命令启动...')
|
||||
|
||||
|
@ -68,7 +68,6 @@ class GsClient:
|
||||
logger.success(f'与[gsuid-core]成功连接! Bot_ID: {BOT_ID}')
|
||||
cls.msg_list = asyncio.queues.Queue()
|
||||
cls.pending = []
|
||||
await self.start()
|
||||
return self
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
|
@ -23,7 +23,7 @@ build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.poetry]
|
||||
name = "nonebot-plugin-genshinuid"
|
||||
version = "4.0.3"
|
||||
version = "4.0.4"
|
||||
description = "支持OneBot(QQ)、OneBotV12、QQ频道、微信、KOOK(开黑啦)、Telegram(电报)、FeiShu(飞书)的全功能NoneBot2原神插件"
|
||||
authors = ["KimigaiiWuyi <444835641@qq.com>"]
|
||||
license = "GPL-3.0-or-later"
|
||||
|
Loading…
x
Reference in New Issue
Block a user