Added different dataclasses
This commit is contained in:
parent
cfff6b2b25
commit
7eb82936e4
29
classes/commandset.py
Normal file
29
classes/commandset.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
from dataclasses import dataclass
|
||||||
|
from typing import List, Union
|
||||||
|
from pyrogram.types import (
|
||||||
|
BotCommandScopeAllChatAdministrators,
|
||||||
|
BotCommandScopeAllGroupChats,
|
||||||
|
BotCommandScopeAllPrivateChats,
|
||||||
|
BotCommandScopeChat,
|
||||||
|
BotCommandScopeChatAdministrators,
|
||||||
|
BotCommandScopeChatMember,
|
||||||
|
BotCommandScopeDefault,
|
||||||
|
BotCommand,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class CommandSet:
|
||||||
|
"""Command stored in PyroClient's 'commands' attribute"""
|
||||||
|
|
||||||
|
commands: List[BotCommand]
|
||||||
|
scope: Union[
|
||||||
|
BotCommandScopeDefault,
|
||||||
|
BotCommandScopeAllPrivateChats,
|
||||||
|
BotCommandScopeAllGroupChats,
|
||||||
|
BotCommandScopeAllChatAdministrators,
|
||||||
|
BotCommandScopeChat,
|
||||||
|
BotCommandScopeChatAdministrators,
|
||||||
|
BotCommandScopeChatMember,
|
||||||
|
] = BotCommandScopeDefault()
|
||||||
|
language_code: str = ""
|
9
classes/pyrocommand.py
Normal file
9
classes/pyrocommand.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class PyroCommand:
|
||||||
|
"""Command stored in PyroClient's 'commands' attribute"""
|
||||||
|
|
||||||
|
command: str
|
||||||
|
description: str
|
Reference in New Issue
Block a user