mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 03:55:26 +00:00
🐛 Fix get_chat parse args
This commit is contained in:
parent
77f7555bbb
commit
24dfe2ce16
@ -82,8 +82,11 @@ class GetChat(Plugin):
|
||||
|
||||
def get_chat_id(self, context: "ContextTypes.DEFAULT_TYPE") -> Optional[int]:
|
||||
args = self.get_args(context)
|
||||
if args and len(args) > 1 and args[0].isnumeric():
|
||||
return int(args[0])
|
||||
if args:
|
||||
try:
|
||||
return int(args[0])
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def gen_button(chat_id: int) -> "InlineKeyboardMarkup":
|
||||
|
@ -57,8 +57,11 @@ class GroupManage(Plugin):
|
||||
|
||||
def get_chat_id(self, context: "ContextTypes.DEFAULT_TYPE") -> Optional[int]:
|
||||
args = self.get_args(context)
|
||||
if args and len(args) > 1 and args[0].isnumeric():
|
||||
return int(args[0])
|
||||
if args:
|
||||
try:
|
||||
return int(args[0])
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
async def add_block_group(self, chat_id: int):
|
||||
group = await self.group_service.get_group_by_id(chat_id)
|
||||
|
Loading…
Reference in New Issue
Block a user