支持adapter.qq的点击发送按钮事件 (#620)

*  支持adapter.qq的点击发送按钮事件

* 🚨 `pre-commit-ci`修复格式错误

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
季落 2024-02-23 18:27:18 +08:00 committed by GitHub
parent 686ce45263
commit a8f2d68c35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -168,12 +168,12 @@ async def get_notice_message(bot: Bot, ev: Event):
logger.debug('[gsuid] 不支持该 Telegram 事件...')
return
elif bot.adapter.get_name() == 'Discord':
from nonebot.adapters.discord import MessageComponentInteractionEvent
from nonebot.adapters.discord.api import (
ChannelType,
InteractionResponse,
InteractionCallbackType,
)
from nonebot.adapters.discord import MessageComponentInteractionEvent
sender = {}
if isinstance(ev, MessageComponentInteractionEvent):

View File

@ -377,7 +377,10 @@ def _bt(button: Dict):
action = button['action']
if action == -1:
action = 2
enter = None
if action == 1:
action = 2
enter = True
return Button(
render_data=RenderData(
label=button['text'],
@ -391,6 +394,7 @@ def _bt(button: Dict):
specify_role_ids=button['specify_role_ids'],
specify_user_ids=button['specify_user_ids'],
),
enter=enter,
unsupport_tips=button['unsupport_tips'],
data=button['data'],
),