mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-12 06:55:58 +08:00
✨ 支持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:
parent
686ce45263
commit
a8f2d68c35
@ -168,12 +168,12 @@ async def get_notice_message(bot: Bot, ev: Event):
|
|||||||
logger.debug('[gsuid] 不支持该 Telegram 事件...')
|
logger.debug('[gsuid] 不支持该 Telegram 事件...')
|
||||||
return
|
return
|
||||||
elif bot.adapter.get_name() == 'Discord':
|
elif bot.adapter.get_name() == 'Discord':
|
||||||
|
from nonebot.adapters.discord import MessageComponentInteractionEvent
|
||||||
from nonebot.adapters.discord.api import (
|
from nonebot.adapters.discord.api import (
|
||||||
ChannelType,
|
ChannelType,
|
||||||
InteractionResponse,
|
InteractionResponse,
|
||||||
InteractionCallbackType,
|
InteractionCallbackType,
|
||||||
)
|
)
|
||||||
from nonebot.adapters.discord import MessageComponentInteractionEvent
|
|
||||||
|
|
||||||
sender = {}
|
sender = {}
|
||||||
if isinstance(ev, MessageComponentInteractionEvent):
|
if isinstance(ev, MessageComponentInteractionEvent):
|
||||||
|
@ -377,7 +377,10 @@ def _bt(button: Dict):
|
|||||||
action = button['action']
|
action = button['action']
|
||||||
if action == -1:
|
if action == -1:
|
||||||
action = 2
|
action = 2
|
||||||
|
enter = None
|
||||||
|
if action == 1:
|
||||||
|
action = 2
|
||||||
|
enter = True
|
||||||
return Button(
|
return Button(
|
||||||
render_data=RenderData(
|
render_data=RenderData(
|
||||||
label=button['text'],
|
label=button['text'],
|
||||||
@ -391,6 +394,7 @@ def _bt(button: Dict):
|
|||||||
specify_role_ids=button['specify_role_ids'],
|
specify_role_ids=button['specify_role_ids'],
|
||||||
specify_user_ids=button['specify_user_ids'],
|
specify_user_ids=button['specify_user_ids'],
|
||||||
),
|
),
|
||||||
|
enter=enter,
|
||||||
unsupport_tips=button['unsupport_tips'],
|
unsupport_tips=button['unsupport_tips'],
|
||||||
data=button['data'],
|
data=button['data'],
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user