Removed legacy usage of Union[]
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import List, Union
|
||||
from typing import List
|
||||
|
||||
try:
|
||||
from pyrogram.types import (
|
||||
@@ -13,9 +13,7 @@ try:
|
||||
BotCommandScopeDefault,
|
||||
)
|
||||
except ImportError as exc:
|
||||
raise ImportError(
|
||||
"You need to install libbot[pyrogram] in order to use this class."
|
||||
) from exc
|
||||
raise ImportError("You need to install libbot[pyrogram] in order to use this class.") from exc
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -23,13 +21,13 @@ class CommandSet:
|
||||
"""Command stored in PyroClient's 'commands' attribute"""
|
||||
|
||||
commands: List[BotCommand]
|
||||
scope: Union[
|
||||
BotCommandScopeDefault,
|
||||
BotCommandScopeAllPrivateChats,
|
||||
BotCommandScopeAllGroupChats,
|
||||
BotCommandScopeAllChatAdministrators,
|
||||
BotCommandScopeChat,
|
||||
BotCommandScopeChatAdministrators,
|
||||
BotCommandScopeChatMember,
|
||||
] = BotCommandScopeDefault
|
||||
scope: (
|
||||
BotCommandScopeDefault
|
||||
| BotCommandScopeAllPrivateChats
|
||||
| BotCommandScopeAllGroupChats
|
||||
| BotCommandScopeAllChatAdministrators
|
||||
| BotCommandScopeChat
|
||||
| BotCommandScopeChatAdministrators
|
||||
| BotCommandScopeChatMember
|
||||
) = BotCommandScopeDefault
|
||||
language_code: str = ""
|
||||
|
Reference in New Issue
Block a user