34 lines
977 B
Python
Raw Normal View History

2023-06-26 12:19:29 +02:00
from dataclasses import dataclass
2024-12-26 18:36:57 +01:00
from typing import List
2023-06-26 12:19:29 +02:00
try:
from pyrogram.types import (
BotCommand,
BotCommandScopeAllChatAdministrators,
BotCommandScopeAllGroupChats,
BotCommandScopeAllPrivateChats,
BotCommandScopeChat,
BotCommandScopeChatAdministrators,
BotCommandScopeChatMember,
BotCommandScopeDefault,
)
except ImportError as exc:
2024-12-26 18:36:57 +01:00
raise ImportError("You need to install libbot[pyrogram] in order to use this class.") from exc
2023-06-26 12:19:29 +02:00
@dataclass
class CommandSet:
"""Command stored in PyroClient's 'commands' attribute"""
commands: List[BotCommand]
2024-12-26 18:36:57 +01:00
scope: (
BotCommandScopeDefault
| BotCommandScopeAllPrivateChats
| BotCommandScopeAllGroupChats
| BotCommandScopeAllChatAdministrators
| BotCommandScopeChat
| BotCommandScopeChatAdministrators
| BotCommandScopeChatMember
) = BotCommandScopeDefault
2023-06-26 12:19:29 +02:00
language_code: str = ""