mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 03:55:26 +00:00
🐛 Fix redeem cooldown error
This commit is contained in:
parent
0bff9bbd57
commit
fed24a60f4
@ -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
|
||||
@ -156,4 +156,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