mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-06 04:10:02 +08:00
fit nonebot.beta2
This commit is contained in:
+19
-27
@@ -1,36 +1,28 @@
|
||||
from nonebot.rule import Rule
|
||||
from nonebot.adapters.cqhttp import Bot, MessageEvent
|
||||
from nonebot.adapters.onebot.v11 import Bot, MessageEvent
|
||||
from nonebot.typing import T_State
|
||||
from .config import (
|
||||
GENSHIN_FLAG,
|
||||
PRTS_FLAG,
|
||||
PRETTY_FLAG,
|
||||
GUARDIAN_FLAG,
|
||||
PCR_FLAG,
|
||||
AZUR_FLAG,
|
||||
FGO_FLAG,
|
||||
ONMYOJI_FLAG,
|
||||
)
|
||||
from .config import draw_config
|
||||
|
||||
|
||||
def is_switch(game_name: str) -> Rule:
|
||||
|
||||
async def _is_switch(bot: Bot, event: MessageEvent, state: T_State) -> bool:
|
||||
if game_name == "prts":
|
||||
return PRTS_FLAG
|
||||
if game_name == "genshin":
|
||||
return GENSHIN_FLAG
|
||||
if game_name == "pretty":
|
||||
return PRETTY_FLAG
|
||||
if game_name == "guardian":
|
||||
return GUARDIAN_FLAG
|
||||
if game_name == "pcr":
|
||||
return PCR_FLAG
|
||||
if game_name == "azur":
|
||||
return AZUR_FLAG
|
||||
if game_name == "fgo":
|
||||
return FGO_FLAG
|
||||
if game_name == "onmyoji":
|
||||
return ONMYOJI_FLAG
|
||||
if game_name == 'prts':
|
||||
return draw_config.PRTS_FLAG
|
||||
if game_name == 'genshin':
|
||||
return draw_config.GENSHIN_FLAG
|
||||
if game_name == 'pretty':
|
||||
return draw_config.PRETTY_FLAG
|
||||
if game_name == 'guardian':
|
||||
return draw_config.GUARDIAN_FLAG
|
||||
if game_name == 'pcr':
|
||||
return draw_config.PCR_FLAG
|
||||
if game_name == 'azur':
|
||||
return draw_config.AZUR_FLAG
|
||||
if game_name == 'fgo':
|
||||
return draw_config.FGO_FLAG
|
||||
if game_name == 'onmyoji':
|
||||
return draw_config.ONMYOJI_FLAG
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user