🎨 Add error_callable wrapper in start command

This commit is contained in:
洛水居室 2022-11-13 01:56:38 +08:00
parent 9c60087673
commit 56515a2f9f
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -16,6 +16,7 @@ from core.user.error import UserNotFoundError
from modules.apihelper.hyperion import Verification from modules.apihelper.hyperion import Verification
from plugins.genshin.sign import SignSystem, NeedChallenge from plugins.genshin.sign import SignSystem, NeedChallenge
from plugins.genshin.verification import VerificationSystem from plugins.genshin.verification import VerificationSystem
from utils.decorators.error import error_callable
from utils.decorators.restricts import restricts from utils.decorators.restricts import restricts
from utils.helpers import get_genshin_client from utils.helpers import get_genshin_client
from utils.log import logger from utils.log import logger
@ -28,7 +29,8 @@ class StartPlugin(Plugin):
self.sign_system = SignSystem(redis) self.sign_system = SignSystem(redis)
self.verification_system = VerificationSystem(redis) self.verification_system = VerificationSystem(redis)
@handler(CommandHandler, command="start", block=False) @handler.command("start", block=False)
@error_callable
@restricts() @restricts()
async def start(self, update: Update, context: CallbackContext) -> None: async def start(self, update: Update, context: CallbackContext) -> None:
user = update.effective_user user = update.effective_user