mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-16 04:45:27 +00:00
🐛 Fix redeem cooldown error
This commit is contained in:
parent
70f9c41ed8
commit
78b1b1ba15
@ -1 +1 @@
|
||||
Subproject commit fb6a1b6c7c271f73235783267290e849a198d5a8
|
||||
Subproject commit c8e481518e29aff43244afdee1048604ab1e8148
|
@ -1,6 +1,6 @@
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
|
||||
from simnet.errors import RedemptionInvalid, RegionNotSupported, RedemptionClaimed
|
||||
from simnet.errors import RedemptionInvalid, RegionNotSupported, RedemptionClaimed, RedemptionCooldown
|
||||
from telegram import Update, ReplyKeyboardRemove, Message, User, WebAppInfo, ReplyKeyboardMarkup, KeyboardButton
|
||||
from telegram.constants import ChatAction
|
||||
from telegram.ext import CallbackContext, CommandHandler
|
||||
@ -160,4 +160,6 @@ class StartPlugin(Plugin):
|
||||
msg = "兑换码格式不正确,请确认。"
|
||||
except RedemptionClaimed:
|
||||
msg = "此兑换码已经兑换过了。"
|
||||
except RedemptionCooldown as e:
|
||||
msg = e.message
|
||||
await message.reply_text(msg)
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from simnet.errors import RedemptionInvalid, RedemptionClaimed, RegionNotSupported
|
||||
from simnet.errors import RedemptionInvalid, RedemptionClaimed, RegionNotSupported, RedemptionCooldown
|
||||
from telegram import Update
|
||||
from telegram.ext import CallbackContext
|
||||
from telegram.ext import filters
|
||||
@ -45,6 +45,8 @@ class Redeem(Plugin):
|
||||
msg = "兑换码格式不正确,请确认。"
|
||||
except RedemptionClaimed:
|
||||
msg = "此兑换码已经兑换过了。"
|
||||
except RedemptionCooldown as e:
|
||||
msg = e.message
|
||||
reply_message = await message.reply_text(msg)
|
||||
if filters.ChatType.GROUPS.filter(reply_message):
|
||||
self.add_delete_message_job(reply_message)
|
||||
|
Loading…
Reference in New Issue
Block a user