diff --git a/interactions/__init__.py b/interactions/__init__.py index e4b9cce38..b83f3ae03 100644 --- a/interactions/__init__.py +++ b/interactions/__init__.py @@ -369,12 +369,41 @@ from . import ext __all__ = ( - "__api_version__", - "__py_version__", - "__repo_url__", - "__version__", - "Absent", "ACTION_ROW_MAX_ITEMS", + "COLOR_TYPES", + "CONTEXT_MENU_NAME_LENGTH", + "DISCORD_EPOCH", + "DM", + "EMBED_FIELD_VALUE_LENGTH", + "EMBED_MAX_DESC_LENGTH", + "EMBED_MAX_FIELDS", + "EMBED_MAX_NAME_LENGTH", + "EMBED_TOTAL_MAX", + "GLOBAL_SCOPE", + "MENTION_PREFIX", + "MISSING", + "MODEL_TO_CONVERTER", + "POLL_MAX_ANSWERS", + "POLL_MAX_DURATION_HOURS", + "PREMIUM_GUILD_LIMITS", + "SELECTS_MAX_OPTIONS", + "SELECT_MAX_NAME_LENGTH", + "SLASH_CMD_MAX_DESC_LENGTH", + "SLASH_CMD_MAX_OPTIONS", + "SLASH_CMD_NAME_LENGTH", + "SLASH_OPTION_NAME_LENGTH", + "TYPE_ALL_ACTION", + "TYPE_ALL_CHANNEL", + "TYPE_ALL_TRIGGER", + "TYPE_CHANNEL_MAPPING", + "TYPE_COMPONENT_MAPPING", + "TYPE_DM_CHANNEL", + "TYPE_GUILD_CHANNEL", + "TYPE_MESSAGEABLE_CHANNEL", + "TYPE_THREAD_CHANNEL", + "TYPE_VOICE_CHANNEL", + "UPLOADABLE_TYPE", + "Absent", "ActionRow", "ActiveVoiceState", "Activity", @@ -386,7 +415,6 @@ "ActivityType", "AllowedMentions", "Application", - "application_commands_to_dict", "ApplicationCommandPermission", "ApplicationFlags", "Asset", @@ -397,13 +425,12 @@ "AuditLogEntry", "AuditLogEventType", "AuditLogHistory", - "auto_defer", "AutoArchiveDuration", - "AutocompleteContext", "AutoDefer", - "AutoModerationAction", "AutoModRule", + "AutoModerationAction", "AutoShardedClient", + "AutocompleteContext", "BaseChannel", "BaseChannelConverter", "BaseCommand", @@ -429,79 +456,52 @@ "ChannelMention", "ChannelSelectMenu", "ChannelType", - "check", "Client", "ClientT", "ClientUser", "Color", - "COLOR_TYPES", "Colour", "CommandType", - "component_callback", "ComponentCommand", "ComponentContext", "ComponentType", "ConsumeRest", - "const", - "contexts", - "context_menu", - "CONTEXT_MENU_NAME_LENGTH", "ContextMenu", "ContextMenuContext", "ContextType", "Converter", - "cooldown", "Cooldown", "CooldownSystem", "CronTrigger", - "SlidingWindowSystem", - "ExponentialBackoffSystem", - "LeakyBucketSystem", - "TokenBucketSystem", "CustomEmoji", "CustomEmojiConverter", - "DateTrigger", - "DefaultNotificationLevel", - "DefaultReaction", - "DISCORD_EPOCH", - "DM", - "dm_only", "DMChannel", "DMChannelConverter", "DMConverter", "DMGroup", "DMGroupConverter", + "DateTrigger", + "DefaultNotificationLevel", + "DefaultReaction", "Embed", - "EMBED_FIELD_VALUE_LENGTH", - "EMBED_MAX_DESC_LENGTH", - "EMBED_MAX_FIELDS", - "EMBED_MAX_NAME_LENGTH", - "EMBED_TOTAL_MAX", "EmbedAttachment", "EmbedAuthor", "EmbedField", "EmbedFooter", "EmbedProvider", "Entitlement", - "errors", - "events", "ExplicitContentFilterLevel", - "ext", + "ExponentialBackoffSystem", "Extension", "File", "FlatUIColors", "FlatUIColours", - "ForumSortOrder", "ForumLayoutType", - "get_components_ids", - "get_logger", - "global_autocomplete", - "GLOBAL_SCOPE", + "ForumSortOrder", "GlobalAutoComplete", "GlobalScope", "Greedy", "Guild", - "guild_only", "GuildBan", "GuildCategory", "GuildCategoryConverter", @@ -532,14 +532,10 @@ "GuildWelcomeChannel", "GuildWidget", "GuildWidgetSettings", - "has_any_role", - "has_id", - "has_role", "IDConverter", "InputText", "IntegrationExpireBehaviour", "IntegrationType", - "integration_types", "Intents", "InteractionCommand", "InteractionContext", @@ -550,30 +546,23 @@ "InvitableMixin", "Invite", "InviteTargetType", - "is_owner", - "kwarg_spam", - "listen", + "LeakyBucketSystem", "Listener", "LocalisedDesc", "LocalisedName", "LocalizedDesc", "LocalizedName", - "logger_name", + "MFALevel", "MaterialColors", "MaterialColours", - "max_concurrency", "MaxConcurrency", "Member", "MemberConverter", "MemberFlags", - "MENTION_PREFIX", - "MentionableSelectMenu", "MentionPrefix", "MentionType", + "MentionableSelectMenu", "Message", - "message_context_menu", - "MessageableChannelConverter", - "MessageableMixin", "MessageActivity", "MessageActivityType", "MessageConverter", @@ -582,17 +571,14 @@ "MessageInteractionMetadata", "MessageReference", "MessageType", - "MFALevel", + "MessageableChannelConverter", + "MessageableMixin", "Missing", - "MISSING", "Modal", - "modal_callback", "ModalCommand", "ModalContext", - "MODEL_TO_CONVERTER", - "NoArgumentConverter", "NSFWLevel", - "open_file", + "NoArgumentConverter", "Onboarding", "OnboardingMode", "OnboardingPrompt", @@ -610,25 +596,10 @@ "PollAnswer", "PollAnswerCount", "PollLayoutType", - "POLL_MAX_ANSWERS", - "POLL_MAX_DURATION_HOURS", "PollMedia", "PollResults", - "PREMIUM_GUILD_LIMITS", "PremiumTier", "PremiumType", - "process_allowed_mentions", - "process_color", - "process_colour", - "process_components", - "process_default_reaction", - "process_embeds", - "process_emoji", - "process_emoji_req_format", - "process_message_payload", - "process_message_reference", - "process_permission_overwrites", - "process_thread_tag", "Reaction", "ReactionUsers", "Resolved", @@ -641,38 +612,19 @@ "ScheduledEventPrivacyLevel", "ScheduledEventStatus", "ScheduledEventType", - "SELECT_MAX_NAME_LENGTH", - "SELECTS_MAX_OPTIONS", "Sentinel", "ShortText", "Singleton", - "slash_attachment_option", - "slash_bool_option", - "slash_channel_option", - "SLASH_CMD_MAX_DESC_LENGTH", - "SLASH_CMD_MAX_OPTIONS", - "SLASH_CMD_NAME_LENGTH", - "slash_command", - "slash_default_member_permission", - "slash_float_option", - "slash_int_option", - "slash_mentionable_option", - "slash_option", - "SLASH_OPTION_NAME_LENGTH", - "slash_role_option", - "slash_str_option", - "slash_user_option", "SlashCommand", "SlashCommandChoice", "SlashCommandOption", "SlashCommandParameter", "SlashContext", - "smart_cache", + "SlidingWindowSystem", "Snowflake", - "Snowflake_Type", "SnowflakeConverter", "SnowflakeObject", - "spread_to_rows", + "Snowflake_Type", "StageInstance", "StagePrivacyLevel", "Status", @@ -683,8 +635,6 @@ "StickerTypes", "StringSelectMenu", "StringSelectOption", - "subcommand", - "sync_needed", "SystemChannelFlags", "T", "T_co", @@ -693,46 +643,96 @@ "TeamMember", "TeamMembershipState", "TextStyles", - "ThreadableMixin", "ThreadChannel", "ThreadChannelConverter", "ThreadList", "ThreadMember", "ThreadTag", + "ThreadableMixin", + "TimeTrigger", "Timestamp", "TimestampStyles", - "TimeTrigger", - "to_optional_snowflake", - "to_snowflake", - "to_snowflake_list", - "TYPE_ALL_ACTION", - "TYPE_ALL_CHANNEL", - "TYPE_ALL_TRIGGER", - "TYPE_CHANNEL_MAPPING", - "TYPE_COMPONENT_MAPPING", - "TYPE_DM_CHANNEL", - "TYPE_GUILD_CHANNEL", - "TYPE_MESSAGEABLE_CHANNEL", - "TYPE_THREAD_CHANNEL", - "TYPE_VOICE_CHANNEL", + "TokenBucketSystem", "Typing", - "UPLOADABLE_TYPE", "User", - "user_context_menu", "UserConverter", "UserFlags", "UserSelectMenu", - "utils", "VerificationLevel", "VideoQualityMode", "VoiceChannelConverter", "VoiceRegion", "VoiceState", "Wait", + "WebSocketOPCode", "Webhook", "WebhookMixin", "WebhookTypes", - "WebSocketOPCode", + "__api_version__", + "__py_version__", + "__repo_url__", + "__version__", + "application_commands_to_dict", + "auto_defer", + "check", + "component_callback", + "const", + "context_menu", + "contexts", + "cooldown", + "dm_only", + "errors", + "events", + "ext", + "get_components_ids", + "get_logger", + "global_autocomplete", + "guild_only", + "has_any_role", + "has_id", + "has_role", + "integration_types", + "is_owner", + "kwarg_spam", + "listen", + "logger_name", + "max_concurrency", + "message_context_menu", + "modal_callback", + "open_file", + "process_allowed_mentions", + "process_color", + "process_colour", + "process_components", + "process_default_reaction", + "process_embeds", + "process_emoji", + "process_emoji_req_format", + "process_message_payload", + "process_message_reference", + "process_permission_overwrites", + "process_thread_tag", + "slash_attachment_option", + "slash_bool_option", + "slash_channel_option", + "slash_command", + "slash_default_member_permission", + "slash_float_option", + "slash_int_option", + "slash_mentionable_option", + "slash_option", + "slash_role_option", + "slash_str_option", + "slash_user_option", + "smart_cache", + "spread_to_rows", + "subcommand", + "sync_needed", + "to_optional_snowflake", + "to_snowflake", + "to_snowflake_list", + "user_context_menu", + "utils", ) if "discord" in sys.modules: diff --git a/interactions/api/events/__init__.py b/interactions/api/events/__init__.py index f208fb7c5..ff3b0b0e0 100644 --- a/interactions/api/events/__init__.py +++ b/interactions/api/events/__init__.py @@ -101,14 +101,13 @@ from .base import BaseEvent, GuildEvent, RawGatewayEvent __all__ = ( - "processors", "ApplicationCommandPermissionsUpdate", - "AutocompleteCompletion", - "AutocompleteError", "AutoModCreated", "AutoModDeleted", "AutoModExec", "AutoModUpdated", + "AutocompleteCompletion", + "AutocompleteError", "BanCreate", "BanRemove", "BaseEvent", @@ -141,8 +140,8 @@ "GuildLeft", "GuildMembersChunk", "GuildScheduledEventCreate", - "GuildScheduledEventUpdate", "GuildScheduledEventDelete", + "GuildScheduledEventUpdate", "GuildScheduledEventUserAdd", "GuildScheduledEventUserRemove", "GuildStickersUpdate", @@ -188,8 +187,8 @@ "ThreadCreate", "ThreadDelete", "ThreadListSync", - "ThreadMembersUpdate", "ThreadMemberUpdate", + "ThreadMembersUpdate", "ThreadUpdate", "TypingStart", "VoiceStateUpdate", @@ -200,4 +199,5 @@ "VoiceUserMute", "WebhooksUpdate", "WebsocketReady", + "processors", ) diff --git a/interactions/api/events/discord.py b/interactions/api/events/discord.py index 181ec1eb0..9002c3735 100644 --- a/interactions/api/events/discord.py +++ b/interactions/api/events/discord.py @@ -47,17 +47,17 @@ async def an_event_handler(event: ChannelCreate): "EntitlementDelete", "EntitlementUpdate", "GuildAuditLogEntryCreate", + "GuildAvailable", "GuildEmojisUpdate", "GuildJoin", "GuildLeft", "GuildMembersChunk", "GuildScheduledEventCreate", - "GuildScheduledEventUpdate", "GuildScheduledEventDelete", + "GuildScheduledEventUpdate", "GuildScheduledEventUserAdd", "GuildScheduledEventUserRemove", "GuildStickersUpdate", - "GuildAvailable", "GuildUnavailable", "GuildUpdate", "IntegrationCreate", @@ -90,8 +90,8 @@ async def an_event_handler(event: ChannelCreate): "ThreadCreate", "ThreadDelete", "ThreadListSync", - "ThreadMembersUpdate", "ThreadMemberUpdate", + "ThreadMembersUpdate", "ThreadUpdate", "TypingStart", "VoiceStateUpdate", diff --git a/interactions/api/events/internal.py b/interactions/api/events/internal.py index fa885f319..b03b79c34 100644 --- a/interactions/api/events/internal.py +++ b/interactions/api/events/internal.py @@ -33,31 +33,31 @@ async def an_event_handler(event: ChannelCreate): from interactions import Extension, BaseCommand, Listener __all__ = ( + "AutocompleteCompletion", + "AutocompleteError", "ButtonPressed", + "CallbackAdded", + "CommandCompletion", + "CommandError", "Component", + "ComponentCompletion", + "ComponentError", "Connect", "Disconnect", "Error", - "ShardConnect", - "ShardDisconnect", + "ExtensionCommandParse", + "ExtensionLoad", + "ExtensionUnload", "Login", + "ModalCompletion", + "ModalError", "Ready", "Resume", "Select", + "ShardConnect", + "ShardDisconnect", "Startup", "WebsocketReady", - "CommandError", - "ComponentError", - "AutocompleteError", - "ModalError", - "CommandCompletion", - "ComponentCompletion", - "AutocompleteCompletion", - "ModalCompletion", - "ExtensionLoad", - "ExtensionUnload", - "ExtensionCommandParse", - "CallbackAdded", ) diff --git a/interactions/api/events/processors/__init__.py b/interactions/api/events/processors/__init__.py index 65e0841d5..003fada57 100644 --- a/interactions/api/events/processors/__init__.py +++ b/interactions/api/events/processors/__init__.py @@ -15,11 +15,14 @@ from .entitlement_events import EntitlementEvents __all__ = ( + "AutoModEvents", "ChannelEvents", + "EntitlementEvents", "GuildEvents", "IntegrationEvents", "MemberEvents", "MessageEvents", + "Processor", "ReactionEvents", "RoleEvents", "ScheduledEvents", @@ -27,7 +30,4 @@ "ThreadEvents", "UserEvents", "VoiceEvents", - "Processor", - "AutoModEvents", - "EntitlementEvents", ) diff --git a/interactions/api/events/processors/_template.py b/interactions/api/events/processors/_template.py index 2d8c57f0d..521c15ae5 100644 --- a/interactions/api/events/processors/_template.py +++ b/interactions/api/events/processors/_template.py @@ -10,7 +10,7 @@ from interactions.client.smart_cache import GlobalCache from interactions.api.events.internal import BaseEvent -__all__ = ("Processor", "EventMixinTemplate") +__all__ = ("EventMixinTemplate", "Processor") class Processor: diff --git a/interactions/api/http/route.py b/interactions/api/http/route.py index 4c4de872a..e3e98d45e 100644 --- a/interactions/api/http/route.py +++ b/interactions/api/http/route.py @@ -6,7 +6,7 @@ if TYPE_CHECKING: from interactions.models.discord.snowflake import Snowflake_Type -__all__ = ("Route", "PAYLOAD_TYPE") +__all__ = ("PAYLOAD_TYPE", "Route") PAYLOAD_TYPE = dict[str, int | str | bool | list | None] diff --git a/interactions/api/voice/audio.py b/interactions/api/voice/audio.py index 504b771c6..f89241470 100644 --- a/interactions/api/voice/audio.py +++ b/interactions/api/voice/audio.py @@ -7,7 +7,7 @@ from pathlib import Path from typing import Union, Optional, TYPE_CHECKING -__all__ = ("AudioBuffer", "BaseAudio", "Audio", "AudioVolume", "RawInputAudio") +__all__ = ("Audio", "AudioBuffer", "AudioVolume", "BaseAudio", "RawInputAudio") from interactions.client.const import get_logger from interactions.api.voice.opus import Encoder diff --git a/interactions/api/voice/opus.py b/interactions/api/voice/opus.py index 4157bbc1b..86c37bb07 100644 --- a/interactions/api/voice/opus.py +++ b/interactions/api/voice/opus.py @@ -10,7 +10,7 @@ import attr -__all__ = ["Encoder", "Decoder"] +__all__ = ["Decoder", "Encoder"] from interactions.client.const import MISSING, get_logger diff --git a/interactions/client/__init__.py b/interactions/client/__init__.py index 2f2783052..335967f98 100644 --- a/interactions/client/__init__.py +++ b/interactions/client/__init__.py @@ -43,45 +43,45 @@ from . import utils __all__ = ( - "__version__", - "__repo_url__", - "__py_version__", - "__api_version__", - "get_logger", - "logger_name", - "kwarg_spam", - "DISCORD_EPOCH", "ACTION_ROW_MAX_ITEMS", - "SELECTS_MAX_OPTIONS", - "SELECT_MAX_NAME_LENGTH", "CONTEXT_MENU_NAME_LENGTH", - "SLASH_CMD_NAME_LENGTH", - "SLASH_CMD_MAX_DESC_LENGTH", - "SLASH_CMD_MAX_OPTIONS", - "SLASH_OPTION_NAME_LENGTH", - "EMBED_MAX_NAME_LENGTH", + "DISCORD_EPOCH", + "EMBED_FIELD_VALUE_LENGTH", "EMBED_MAX_DESC_LENGTH", "EMBED_MAX_FIELDS", + "EMBED_MAX_NAME_LENGTH", "EMBED_TOTAL_MAX", - "EMBED_FIELD_VALUE_LENGTH", - "POLL_MAX_ANSWERS", - "POLL_MAX_DURATION_HOURS", - "Singleton", - "Sentinel", - "GlobalScope", - "Missing", - "MentionPrefix", "GLOBAL_SCOPE", - "MISSING", "MENTION_PREFIX", + "MISSING", + "POLL_MAX_ANSWERS", + "POLL_MAX_DURATION_HOURS", "PREMIUM_GUILD_LIMITS", + "SELECTS_MAX_OPTIONS", + "SELECT_MAX_NAME_LENGTH", + "SLASH_CMD_MAX_DESC_LENGTH", + "SLASH_CMD_MAX_OPTIONS", + "SLASH_CMD_NAME_LENGTH", + "SLASH_OPTION_NAME_LENGTH", "Absent", + "AutoShardedClient", + "Client", + "ClientT", + "GlobalScope", + "MentionPrefix", + "Missing", + "Sentinel", + "Singleton", "T", "T_co", - "ClientT", - "Client", - "AutoShardedClient", - "smart_cache", + "__api_version__", + "__py_version__", + "__repo_url__", + "__version__", "errors", + "get_logger", + "kwarg_spam", + "logger_name", + "smart_cache", "utils", ) diff --git a/interactions/client/const.py b/interactions/client/const.py index 47c99d69d..9fc27fbfa 100644 --- a/interactions/client/const.py +++ b/interactions/client/const.py @@ -47,47 +47,47 @@ from typing import TypeVar, Union, Callable, Coroutine, ClassVar, TYPE_CHECKING __all__ = ( - "__version__", - "__repo_url__", - "__py_version__", - "__api_version__", - "get_logger", - "logger_name", - "kwarg_spam", - "DISCORD_EPOCH", "ACTION_ROW_MAX_ITEMS", - "SELECTS_MAX_OPTIONS", - "SELECT_MAX_NAME_LENGTH", + "CLIENT_FEATURE_FLAGS", "CONTEXT_MENU_NAME_LENGTH", - "SLASH_CMD_NAME_LENGTH", - "SLASH_CMD_MAX_DESC_LENGTH", - "SLASH_CMD_MAX_OPTIONS", - "SLASH_OPTION_NAME_LENGTH", - "EMBED_MAX_NAME_LENGTH", + "DISCORD_EPOCH", + "EMBED_FIELD_VALUE_LENGTH", "EMBED_MAX_DESC_LENGTH", "EMBED_MAX_FIELDS", + "EMBED_MAX_NAME_LENGTH", "EMBED_TOTAL_MAX", - "EMBED_FIELD_VALUE_LENGTH", - "Singleton", - "Sentinel", - "GlobalScope", - "Missing", - "MentionPrefix", "GLOBAL_SCOPE", - "MISSING", + "LIB_PATH", "MENTION_PREFIX", + "MISSING", + "NON_RESUMABLE_WEBSOCKET_CLOSE_CODES", + "POLL_MAX_ANSWERS", + "POLL_MAX_DURATION_HOURS", "PREMIUM_GUILD_LIMITS", + "RECOVERABLE_WEBSOCKET_CLOSE_CODES", + "SELECTS_MAX_OPTIONS", + "SELECT_MAX_NAME_LENGTH", + "SLASH_CMD_MAX_DESC_LENGTH", + "SLASH_CMD_MAX_OPTIONS", + "SLASH_CMD_NAME_LENGTH", + "SLASH_OPTION_NAME_LENGTH", "Absent", + "ClientT", + "GlobalScope", + "MentionPrefix", + "Missing", + "Sentinel", + "Singleton", "T", "T_co", - "ClientT", - "LIB_PATH", - "RECOVERABLE_WEBSOCKET_CLOSE_CODES", - "NON_RESUMABLE_WEBSOCKET_CLOSE_CODES", - "CLIENT_FEATURE_FLAGS", + "__api_version__", + "__py_version__", + "__repo_url__", + "__version__", + "get_logger", "has_client_feature", - "POLL_MAX_ANSWERS", - "POLL_MAX_DURATION_HOURS", + "kwarg_spam", + "logger_name", ) _ver_info = sys.version_info diff --git a/interactions/client/errors.py b/interactions/client/errors.py index 09518728c..d09ad9472 100644 --- a/interactions/client/errors.py +++ b/interactions/client/errors.py @@ -12,41 +12,41 @@ from interactions.models.discord.snowflake import Snowflake_Type __all__ = ( - "LibraryException", + "AlreadyDeferred", + "AlreadyResponded", + "BadArgument", + "BadRequest", "BotException", - "GatewayNotFound", - "LoginError", - "HTTPException", + "CommandCheckFailure", + "CommandException", + "CommandOnCooldown", "DiscordError", - "BadRequest", - "Forbidden", - "NotFound", - "RateLimited", - "TooManyChanges", - "WebSocketClosed", - "VoiceWebSocketClosed", - "WebSocketRestart", + "EmptyMessageException", + "EphemeralEditException", + "EventLocationNotProvided", "ExtensionException", - "ExtensionNotFound", "ExtensionLoadException", - "CommandException", - "CommandOnCooldown", + "ExtensionNotFound", + "Forbidden", + "ForeignWebhookException", + "GatewayNotFound", + "HTTPException", + "InteractionException", + "InteractionMissingAccess", + "LibraryException", + "LoginError", "MaxConcurrencyReached", - "CommandCheckFailure", - "BadArgument", "MessageException", - "EmptyMessageException", - "EphemeralEditException", + "NotFound", + "RateLimited", "ThreadException", "ThreadOutsideOfGuild", - "InteractionException", - "InteractionMissingAccess", - "AlreadyDeferred", - "AlreadyResponded", - "ForeignWebhookException", - "EventLocationNotProvided", + "TooManyChanges", "VoiceAlreadyConnected", "VoiceConnectionTimeout", + "VoiceWebSocketClosed", + "WebSocketClosed", + "WebSocketRestart", ) diff --git a/interactions/client/mixins/send.py b/interactions/client/mixins/send.py index 7aeadc03a..65197c1bf 100644 --- a/interactions/client/mixins/send.py +++ b/interactions/client/mixins/send.py @@ -98,8 +98,7 @@ async def send( isinstance(files, Iterable) and any(isinstance(file, interactions.models.discord.message.Attachment) for file in files) ) - or isinstance(files, interactions.models.discord.message.Attachment) - ): + ) or isinstance(files, interactions.models.discord.message.Attachment): raise ValueError( "Attachments are not files. Attachments only contain metadata about the file, not the file itself - to send an attachment, you need to download it first. Check Attachment.url" ) diff --git a/interactions/client/utils/__init__.py b/interactions/client/utils/__init__.py index 68b943b73..538c7f634 100644 --- a/interactions/client/utils/__init__.py +++ b/interactions/client/utils/__init__.py @@ -49,58 +49,58 @@ from .text_utils import mentions __all__ = ( - "define", - "docs", - "field", - "str_validator", + "AnsiBackgrounds", + "AnsiColors", + "AnsiStyles", + "FastJson", "NullCache", "TTLCache", "TTLItem", - "list_converter", - "optional", - "timestamp_converter", - "FastJson", - "get_args", - "get_first_word", - "response_decode", - "escape_mentions", - "find", - "find_all", - "get", - "get_all", - "get_event_name", - "get_object_name", - "get_parameters", - "maybe_coroutine", - "nulled_boolean_get", - "wrap_partial", - "dict_filter", - "dict_filter_none", - "export_converter", - "get_file_mimetype", - "no_export_meta", - "unpack_helper", - "to_dict", - "to_image_data", "ansi_block", "ansi_escape", "ansi_format", "ansi_styled", - "AnsiBackgrounds", - "AnsiColors", - "AnsiStyles", "bg_colors", "bold", "code_block", "colors", + "define", + "dict_filter", + "dict_filter_none", + "docs", + "escape_mentions", + "export_converter", + "field", + "find", + "find_all", + "get", + "get_all", + "get_args", + "get_event_name", + "get_file_mimetype", + "get_first_word", + "get_object_name", + "get_parameters", "inline_code", "italic", "link_in_embed", + "list_converter", + "maybe_coroutine", + "mentions", "no_embed_link", + "no_export_meta", + "nulled_boolean_get", + "optional", "quote_line", + "response_decode", "spoiler", + "str_validator", "strikethrough", "styles", + "timestamp_converter", + "to_dict", + "to_image_data", "underline", - "mentions", + "unpack_helper", + "wrap_partial", ) diff --git a/interactions/client/utils/attr_converters.py b/interactions/client/utils/attr_converters.py index 91c08d18f..0b6979f80 100644 --- a/interactions/client/utils/attr_converters.py +++ b/interactions/client/utils/attr_converters.py @@ -7,7 +7,7 @@ from interactions.client.const import MISSING from interactions.models.discord.timestamp import Timestamp -__all__ = ("timestamp_converter", "list_converter", "optional") +__all__ = ("list_converter", "optional", "timestamp_converter") def timestamp_converter(value: Union[datetime, int, float, str]) -> Timestamp: diff --git a/interactions/client/utils/attr_utils.py b/interactions/client/utils/attr_utils.py index 66fadfd54..f547b6ccc 100644 --- a/interactions/client/utils/attr_utils.py +++ b/interactions/client/utils/attr_utils.py @@ -6,7 +6,7 @@ from interactions.client.const import MISSING, get_logger -__all__ = ("define", "field", "docs", "str_validator") +__all__ = ("define", "docs", "field", "str_validator") class_defaults = { diff --git a/interactions/client/utils/cache.py b/interactions/client/utils/cache.py index 903226266..aaf409b04 100644 --- a/interactions/client/utils/cache.py +++ b/interactions/client/utils/cache.py @@ -5,7 +5,7 @@ import attrs -__all__ = ("TTLItem", "TTLCache", "NullCache") +__all__ = ("NullCache", "TTLCache", "TTLItem") KT = TypeVar("KT") VT = TypeVar("VT") diff --git a/interactions/client/utils/formatting.py b/interactions/client/utils/formatting.py index bdb9027a4..0d2c473e6 100644 --- a/interactions/client/utils/formatting.py +++ b/interactions/client/utils/formatting.py @@ -3,26 +3,26 @@ __all__ = ( + "AnsiBackgrounds", + "AnsiColors", + "AnsiStyles", + "ansi_block", + "ansi_escape", + "ansi_format", + "ansi_styled", + "bg_colors", "bold", + "code_block", + "colors", + "inline_code", "italic", - "underline", - "strikethrough", - "spoiler", - "no_embed_link", "link_in_embed", + "no_embed_link", "quote_line", - "inline_code", - "code_block", - "ansi_block", - "AnsiStyles", - "AnsiColors", - "AnsiBackgrounds", + "spoiler", + "strikethrough", "styles", - "colors", - "bg_colors", - "ansi_format", - "ansi_escape", - "ansi_styled", + "underline", ) diff --git a/interactions/client/utils/input_utils.py b/interactions/client/utils/input_utils.py index 0fa782db1..a970dd89d 100644 --- a/interactions/client/utils/input_utils.py +++ b/interactions/client/utils/input_utils.py @@ -10,7 +10,7 @@ from interactions.client.const import get_logger import importlib.util -__all__ = ("FastJson", "response_decode", "get_args", "get_first_word", "unpack_helper") +__all__ = ("FastJson", "get_args", "get_first_word", "response_decode", "unpack_helper") json_mode = "builtin" diff --git a/interactions/client/utils/misc_utils.py b/interactions/client/utils/misc_utils.py index d1d56c72c..67dfd5797 100755 --- a/interactions/client/utils/misc_utils.py +++ b/interactions/client/utils/misc_utils.py @@ -16,12 +16,12 @@ "find_all", "get", "get_all", - "wrap_partial", - "get_parameters", "get_event_name", "get_object_name", + "get_parameters", "maybe_coroutine", "nulled_boolean_get", + "wrap_partial", ) mention_reg = re.compile(r"@(everyone|here|[!&]?[0-9]{17,20})") diff --git a/interactions/client/utils/serializer.py b/interactions/client/utils/serializer.py index 97ea7a6d7..c105486b2 100644 --- a/interactions/client/utils/serializer.py +++ b/interactions/client/utils/serializer.py @@ -10,13 +10,13 @@ from interactions.models.discord.file import UPLOADABLE_TYPE, File __all__ = ( - "no_export_meta", + "dict_filter", + "dict_filter_none", "export_converter", + "get_file_mimetype", + "no_export_meta", "to_dict", - "dict_filter_none", - "dict_filter", "to_image_data", - "get_file_mimetype", ) no_export_meta = {"no_export": True} diff --git a/interactions/ext/prefixed_commands/__init__.py b/interactions/ext/prefixed_commands/__init__.py index 59e2747e4..ba8efca95 100644 --- a/interactions/ext/prefixed_commands/__init__.py +++ b/interactions/ext/prefixed_commands/__init__.py @@ -6,13 +6,13 @@ from .utils import when_mentioned, when_mentioned_or __all__ = ( - "prefixed_command", "PrefixedCommand", "PrefixedCommandParameter", "PrefixedContext", "PrefixedHelpCommand", "PrefixedInjectedClient", "PrefixedManager", + "prefixed_command", "setup", "when_mentioned", "when_mentioned_or", diff --git a/interactions/ext/prefixed_commands/command.py b/interactions/ext/prefixed_commands/command.py index cbed39f3f..5ac9940a5 100644 --- a/interactions/ext/prefixed_commands/command.py +++ b/interactions/ext/prefixed_commands/command.py @@ -37,8 +37,8 @@ from .context import PrefixedContext __all__ = ( - "PrefixedCommandParameter", "PrefixedCommand", + "PrefixedCommandParameter", "prefixed_command", ) @@ -54,17 +54,17 @@ class PrefixedCommandParameter: """ __slots__ = ( - "name", - "default", - "type", - "kind", + "consume_rest", + "consume_rest_class", "converters", + "default", "greedy", + "kind", + "name", + "no_argument", + "type", "union", "variable", - "consume_rest", - "consume_rest_class", - "no_argument", ) name: str diff --git a/interactions/ext/sentry.py b/interactions/ext/sentry.py index 2d1787f60..0eccc6d12 100644 --- a/interactions/ext/sentry.py +++ b/interactions/ext/sentry.py @@ -23,7 +23,7 @@ from interactions import Client, Extension, listen -__all__ = ("setup", "default_sentry_filter") +__all__ = ("default_sentry_filter", "setup") def default_sentry_filter(event: dict[str, Any], hint: dict[str, Any]) -> Optional[dict[str, Any]]: diff --git a/interactions/models/__init__.py b/interactions/models/__init__.py index c258996e4..7a576edac 100644 --- a/interactions/models/__init__.py +++ b/interactions/models/__init__.py @@ -323,6 +323,20 @@ from .misc import AsyncIterator, Typing __all__ = ( + "COLOR_TYPES", + "DM", + "MODEL_TO_CONVERTER", + "TYPE_ALL_ACTION", + "TYPE_ALL_CHANNEL", + "TYPE_ALL_TRIGGER", + "TYPE_CHANNEL_MAPPING", + "TYPE_COMPONENT_MAPPING", + "TYPE_DM_CHANNEL", + "TYPE_GUILD_CHANNEL", + "TYPE_MESSAGEABLE_CHANNEL", + "TYPE_THREAD_CHANNEL", + "TYPE_VOICE_CHANNEL", + "UPLOADABLE_TYPE", "ActionRow", "ActiveVoiceState", "Activity", @@ -334,7 +348,6 @@ "ActivityType", "AllowedMentions", "Application", - "application_commands_to_dict", "ApplicationCommandPermission", "ApplicationFlags", "Asset", @@ -345,12 +358,11 @@ "AuditLogEntry", "AuditLogEventType", "AuditLogHistory", - "auto_defer", "AutoArchiveDuration", - "AutocompleteContext", "AutoDefer", - "AutoModerationAction", "AutoModRule", + "AutoModerationAction", + "AutocompleteContext", "BaseChannel", "BaseChannelConverter", "BaseCommand", @@ -376,43 +388,31 @@ "ChannelMention", "ChannelSelectMenu", "ChannelType", - "check", "ClientUser", "Color", - "COLOR_TYPES", "Colour", "CommandType", - "component_callback", "ComponentCommand", "ComponentContext", "ComponentType", "ConsumeRest", - "contexts", - "context_menu", "ContextMenu", "ContextMenuContext", "ContextType", "Converter", - "cooldown", "Cooldown", "CooldownSystem", "CronTrigger", - "SlidingWindowSystem", - "ExponentialBackoffSystem", - "LeakyBucketSystem", - "TokenBucketSystem", "CustomEmoji", "CustomEmojiConverter", - "DateTrigger", - "DefaultNotificationLevel", - "DefaultReaction", - "DM", - "dm_only", "DMChannel", "DMChannelConverter", "DMConverter", "DMGroup", "DMGroupConverter", + "DateTrigger", + "DefaultNotificationLevel", + "DefaultReaction", "Embed", "EmbedAttachment", "EmbedAuthor", @@ -421,18 +421,16 @@ "EmbedProvider", "Entitlement", "ExplicitContentFilterLevel", + "ExponentialBackoffSystem", "Extension", "File", "FlatUIColors", "FlatUIColours", - "ForumSortOrder", "ForumLayoutType", - "get_components_ids", - "global_autocomplete", + "ForumSortOrder", "GlobalAutoComplete", "Greedy", "Guild", - "guild_only", "GuildBan", "GuildCategory", "GuildCategoryConverter", @@ -463,14 +461,10 @@ "GuildWelcomeChannel", "GuildWidget", "GuildWidgetSettings", - "has_any_role", - "has_id", - "has_role", "IDConverter", "InputText", "IntegrationExpireBehaviour", "IntegrationType", - "integration_types", "Intents", "InteractionCommand", "InteractionContext", @@ -481,26 +475,22 @@ "InvitableMixin", "Invite", "InviteTargetType", - "is_owner", - "listen", + "LeakyBucketSystem", "Listener", "LocalisedDesc", "LocalisedName", "LocalizedDesc", "LocalizedName", + "MFALevel", "MaterialColors", "MaterialColours", - "max_concurrency", "MaxConcurrency", "Member", "MemberConverter", "MemberFlags", - "MentionableSelectMenu", "MentionType", + "MentionableSelectMenu", "Message", - "message_context_menu", - "MessageableChannelConverter", - "MessageableMixin", "MessageActivity", "MessageActivityType", "MessageConverter", @@ -509,15 +499,13 @@ "MessageInteractionMetadata", "MessageReference", "MessageType", - "MFALevel", + "MessageableChannelConverter", + "MessageableMixin", "Modal", - "modal_callback", "ModalCommand", "ModalContext", - "MODEL_TO_CONVERTER", - "NoArgumentConverter", "NSFWLevel", - "open_file", + "NoArgumentConverter", "Onboarding", "OnboardingMode", "OnboardingPrompt", @@ -539,18 +527,6 @@ "PollResults", "PremiumTier", "PremiumType", - "process_allowed_mentions", - "process_color", - "process_colour", - "process_components", - "process_default_reaction", - "process_embeds", - "process_emoji", - "process_emoji_req_format", - "process_message_payload", - "process_message_reference", - "process_permission_overwrites", - "process_thread_tag", "Reaction", "ReactionUsers", "Resolved", @@ -564,28 +540,16 @@ "ScheduledEventStatus", "ScheduledEventType", "ShortText", - "slash_attachment_option", - "slash_bool_option", - "slash_channel_option", - "slash_command", - "slash_default_member_permission", - "slash_float_option", - "slash_int_option", - "slash_mentionable_option", - "slash_option", - "slash_role_option", - "slash_str_option", - "slash_user_option", "SlashCommand", "SlashCommandChoice", "SlashCommandOption", "SlashCommandParameter", "SlashContext", + "SlidingWindowSystem", "Snowflake", - "Snowflake_Type", "SnowflakeConverter", "SnowflakeObject", - "spread_to_rows", + "Snowflake_Type", "StageInstance", "StagePrivacyLevel", "Status", @@ -596,40 +560,24 @@ "StickerTypes", "StringSelectMenu", "StringSelectOption", - "subcommand", - "sync_needed", "SystemChannelFlags", "Task", "Team", "TeamMember", "TeamMembershipState", "TextStyles", - "ThreadableMixin", "ThreadChannel", "ThreadChannelConverter", "ThreadList", "ThreadMember", "ThreadTag", + "ThreadableMixin", + "TimeTrigger", "Timestamp", "TimestampStyles", - "TimeTrigger", - "to_optional_snowflake", - "to_snowflake", - "to_snowflake_list", - "TYPE_ALL_ACTION", - "TYPE_ALL_CHANNEL", - "TYPE_ALL_TRIGGER", - "TYPE_CHANNEL_MAPPING", - "TYPE_COMPONENT_MAPPING", - "TYPE_DM_CHANNEL", - "TYPE_GUILD_CHANNEL", - "TYPE_MESSAGEABLE_CHANNEL", - "TYPE_THREAD_CHANNEL", - "TYPE_VOICE_CHANNEL", + "TokenBucketSystem", "Typing", - "UPLOADABLE_TYPE", "User", - "user_context_menu", "UserConverter", "UserFlags", "UserSelectMenu", @@ -639,8 +587,60 @@ "VoiceRegion", "VoiceState", "Wait", + "WebSocketOPCode", "Webhook", "WebhookMixin", "WebhookTypes", - "WebSocketOPCode", + "application_commands_to_dict", + "auto_defer", + "check", + "component_callback", + "context_menu", + "contexts", + "cooldown", + "dm_only", + "get_components_ids", + "global_autocomplete", + "guild_only", + "has_any_role", + "has_id", + "has_role", + "integration_types", + "is_owner", + "listen", + "max_concurrency", + "message_context_menu", + "modal_callback", + "open_file", + "process_allowed_mentions", + "process_color", + "process_colour", + "process_components", + "process_default_reaction", + "process_embeds", + "process_emoji", + "process_emoji_req_format", + "process_message_payload", + "process_message_reference", + "process_permission_overwrites", + "process_thread_tag", + "slash_attachment_option", + "slash_bool_option", + "slash_channel_option", + "slash_command", + "slash_default_member_permission", + "slash_float_option", + "slash_int_option", + "slash_mentionable_option", + "slash_option", + "slash_role_option", + "slash_str_option", + "slash_user_option", + "spread_to_rows", + "subcommand", + "sync_needed", + "to_optional_snowflake", + "to_snowflake", + "to_snowflake_list", + "user_context_menu", ) diff --git a/interactions/models/discord/__init__.py b/interactions/models/discord/__init__.py index 21baa4d68..1a3c7e0dd 100644 --- a/interactions/models/discord/__init__.py +++ b/interactions/models/discord/__init__.py @@ -178,6 +178,19 @@ from .voice_state import VoiceRegion, VoiceState __all__ = ( + "COLOR_TYPES", + "DM", + "TYPE_ALL_ACTION", + "TYPE_ALL_CHANNEL", + "TYPE_ALL_TRIGGER", + "TYPE_CHANNEL_MAPPING", + "TYPE_COMPONENT_MAPPING", + "TYPE_DM_CHANNEL", + "TYPE_GUILD_CHANNEL", + "TYPE_MESSAGEABLE_CHANNEL", + "TYPE_THREAD_CHANNEL", + "TYPE_VOICE_CHANNEL", + "UPLOADABLE_TYPE", "ActionRow", "Activity", "ActivityAssets", @@ -198,8 +211,8 @@ "AuditLogEventType", "AuditLogHistory", "AutoArchiveDuration", - "AutoModerationAction", "AutoModRule", + "AutoModerationAction", "BaseChannel", "BaseComponent", "BaseGuild", @@ -218,17 +231,15 @@ "ChannelType", "ClientUser", "Color", - "COLOR_TYPES", "Colour", "CommandType", "ComponentType", "ContextType", "CustomEmoji", - "DefaultNotificationLevel", - "DefaultReaction", - "DM", "DMChannel", "DMGroup", + "DefaultNotificationLevel", + "DefaultReaction", "Embed", "EmbedAttachment", "EmbedAuthor", @@ -240,9 +251,8 @@ "File", "FlatUIColors", "FlatUIColours", - "ForumSortOrder", "ForumLayoutType", - "get_components_ids", + "ForumSortOrder", "Guild", "GuildBan", "GuildCategory", @@ -274,14 +284,14 @@ "InvitableMixin", "Invite", "InviteTargetType", + "MFALevel", "MaterialColors", "MaterialColours", "Member", "MemberFlags", - "MentionableSelectMenu", "MentionType", + "MentionableSelectMenu", "Message", - "MessageableMixin", "MessageActivity", "MessageActivityType", "MessageFlags", @@ -289,10 +299,9 @@ "MessageInteractionMetadata", "MessageReference", "MessageType", - "MFALevel", + "MessageableMixin", "Modal", "NSFWLevel", - "open_file", "Onboarding", "OnboardingMode", "OnboardingPrompt", @@ -311,18 +320,6 @@ "PollResults", "PremiumTier", "PremiumType", - "process_allowed_mentions", - "process_color", - "process_colour", - "process_components", - "process_default_reaction", - "process_embeds", - "process_emoji", - "process_emoji_req_format", - "process_message_payload", - "process_message_reference", - "process_permission_overwrites", - "process_thread_tag", "Reaction", "ReactionUsers", "Role", @@ -335,9 +332,8 @@ "ScheduledEventType", "ShortText", "Snowflake", - "Snowflake_Type", "SnowflakeObject", - "spread_to_rows", + "Snowflake_Type", "StageInstance", "StagePrivacyLevel", "Status", @@ -353,27 +349,13 @@ "TeamMember", "TeamMembershipState", "TextStyles", - "ThreadableMixin", "ThreadChannel", "ThreadList", "ThreadMember", "ThreadTag", + "ThreadableMixin", "Timestamp", "TimestampStyles", - "to_optional_snowflake", - "to_snowflake", - "to_snowflake_list", - "TYPE_ALL_ACTION", - "TYPE_ALL_CHANNEL", - "TYPE_ALL_TRIGGER", - "TYPE_CHANNEL_MAPPING", - "TYPE_COMPONENT_MAPPING", - "TYPE_DM_CHANNEL", - "TYPE_GUILD_CHANNEL", - "TYPE_MESSAGEABLE_CHANNEL", - "TYPE_THREAD_CHANNEL", - "TYPE_VOICE_CHANNEL", - "UPLOADABLE_TYPE", "User", "UserFlags", "UserSelectMenu", @@ -381,9 +363,27 @@ "VideoQualityMode", "VoiceRegion", "VoiceState", + "WebSocketOPCode", "Webhook", "WebhookMixin", "WebhookTypes", - "WebSocketOPCode", + "get_components_ids", + "open_file", + "process_allowed_mentions", + "process_color", + "process_colour", + "process_components", + "process_default_reaction", + "process_embeds", + "process_emoji", + "process_emoji_req_format", + "process_message_payload", + "process_message_reference", + "process_permission_overwrites", + "process_thread_tag", + "spread_to_rows", + "to_optional_snowflake", + "to_snowflake", + "to_snowflake_list", ) from .webhooks import Webhook, WebhookTypes diff --git a/interactions/models/discord/activity.py b/interactions/models/discord/activity.py index 1c5f8b7db..45b550651 100644 --- a/interactions/models/discord/activity.py +++ b/interactions/models/discord/activity.py @@ -11,11 +11,11 @@ from interactions.models.discord.timestamp import Timestamp __all__ = ( - "ActivityTimestamps", - "ActivityParty", + "Activity", "ActivityAssets", + "ActivityParty", "ActivitySecrets", - "Activity", + "ActivityTimestamps", ) diff --git a/interactions/models/discord/auto_mod.py b/interactions/models/discord/auto_mod.py index 860764868..d150297d4 100644 --- a/interactions/models/discord/auto_mod.py +++ b/interactions/models/discord/auto_mod.py @@ -26,7 +26,7 @@ User, ) -__all__ = ("AutoModerationAction", "AutoModRule", "TYPE_ALL_ACTION", "TYPE_ALL_TRIGGER") +__all__ = ("TYPE_ALL_ACTION", "TYPE_ALL_TRIGGER", "AutoModRule", "AutoModerationAction") @attrs.define(eq=False, order=False, hash=False, kw_only=True) diff --git a/interactions/models/discord/channel.py b/interactions/models/discord/channel.py index ff2792ef2..533659a5e 100644 --- a/interactions/models/discord/channel.py +++ b/interactions/models/discord/channel.py @@ -46,36 +46,36 @@ from interactions.models.internal.active_voice_state import ActiveVoiceState __all__ = ( - "ChannelHistory", - "PermissionOverwrite", - "MessageableMixin", - "InvitableMixin", - "ThreadableMixin", - "WebhookMixin", + "DM", + "TYPE_ALL_CHANNEL", + "TYPE_CHANNEL_MAPPING", + "TYPE_DM_CHANNEL", + "TYPE_GUILD_CHANNEL", + "TYPE_MESSAGEABLE_CHANNEL", + "TYPE_THREAD_CHANNEL", + "TYPE_VOICE_CHANNEL", "BaseChannel", + "ChannelHistory", "DMChannel", - "DM", "DMGroup", - "GuildChannel", "GuildCategory", - "GuildNews", - "GuildText", - "ThreadChannel", + "GuildChannel", "GuildForum", - "GuildNewsThread", - "GuildPublicThread", "GuildForumPost", + "GuildNews", + "GuildNewsThread", "GuildPrivateThread", - "GuildVoice", + "GuildPublicThread", "GuildStageVoice", + "GuildText", + "GuildVoice", + "InvitableMixin", + "MessageableMixin", + "PermissionOverwrite", + "ThreadChannel", + "ThreadableMixin", + "WebhookMixin", "process_permission_overwrites", - "TYPE_ALL_CHANNEL", - "TYPE_DM_CHANNEL", - "TYPE_GUILD_CHANNEL", - "TYPE_THREAD_CHANNEL", - "TYPE_VOICE_CHANNEL", - "TYPE_CHANNEL_MAPPING", - "TYPE_MESSAGEABLE_CHANNEL", ) diff --git a/interactions/models/discord/color.py b/interactions/models/discord/color.py index 0dae405a2..bbadf4979 100644 --- a/interactions/models/discord/color.py +++ b/interactions/models/discord/color.py @@ -7,17 +7,17 @@ __all__ = ( "COLOR_TYPES", - "Color", "BrandColors", - "MaterialColors", - "FlatUIColors", - "RoleColors", - "process_color", - "Colour", "BrandColours", - "MaterialColours", + "Color", + "Colour", + "FlatUIColors", "FlatUIColours", + "MaterialColors", + "MaterialColours", + "RoleColors", "RoleColours", + "process_color", "process_colour", ) diff --git a/interactions/models/discord/components.py b/interactions/models/discord/components.py index 495874832..601f2622f 100644 --- a/interactions/models/discord/components.py +++ b/interactions/models/discord/components.py @@ -18,23 +18,23 @@ import interactions.models.discord __all__ = ( - "BaseComponent", - "InteractiveComponent", + "TYPE_COMPONENT_MAPPING", "ActionRow", - "Button", + "BaseComponent", "BaseSelectMenu", + "Button", + "ChannelSelectMenu", + "DefaultableSelectMenu", + "InteractiveComponent", + "MentionableSelectMenu", + "RoleSelectMenu", + "SelectDefaultValues", "StringSelectMenu", "StringSelectOption", "UserSelectMenu", - "RoleSelectMenu", - "MentionableSelectMenu", - "ChannelSelectMenu", + "get_components_ids", "process_components", "spread_to_rows", - "get_components_ids", - "TYPE_COMPONENT_MAPPING", - "SelectDefaultValues", - "DefaultableSelectMenu", ) diff --git a/interactions/models/discord/embed.py b/interactions/models/discord/embed.py index a76897db6..cdea2790b 100644 --- a/interactions/models/discord/embed.py +++ b/interactions/models/discord/embed.py @@ -21,13 +21,13 @@ from interactions.models.discord.timestamp import Timestamp __all__ = ( - "EmbedField", - "EmbedAuthor", + "Embed", "EmbedAttachment", "EmbedAuthor", + "EmbedAuthor", + "EmbedField", "EmbedFooter", "EmbedProvider", - "Embed", "process_embeds", ) diff --git a/interactions/models/discord/emoji.py b/interactions/models/discord/emoji.py index 0364a7e5e..1fd714a68 100644 --- a/interactions/models/discord/emoji.py +++ b/interactions/models/discord/emoji.py @@ -20,7 +20,7 @@ from interactions.models.discord.role import Role from interactions.models.discord.snowflake import Snowflake_Type -__all__ = ("PartialEmoji", "CustomEmoji", "process_emoji_req_format", "process_emoji") +__all__ = ("CustomEmoji", "PartialEmoji", "process_emoji", "process_emoji_req_format") emoji_regex = re.compile(r"?") unicode_emoji_reg = re.compile(r"[^\w\s,’‘“”…–—•◦‣⁃⁎⁏⁒⁓⁺⁻⁼⁽⁾ⁿ₊₋₌₍₎]") # noqa: RUF001 diff --git a/interactions/models/discord/enums.py b/interactions/models/discord/enums.py index c437a619e..2c84a55a3 100644 --- a/interactions/models/discord/enums.py +++ b/interactions/models/discord/enums.py @@ -27,12 +27,12 @@ "InteractionPermissionTypes", "InteractionType", "InviteTargetType", + "MFALevel", "MemberFlags", "MentionType", "MessageActivityType", "MessageFlags", "MessageType", - "MFALevel", "NSFWLevel", "OnboardingMode", "OnboardingPromptType", diff --git a/interactions/models/discord/file.py b/interactions/models/discord/file.py index 63b39779f..4cdcba445 100644 --- a/interactions/models/discord/file.py +++ b/interactions/models/discord/file.py @@ -4,7 +4,7 @@ import attrs -__all__ = ("File", "open_file", "UPLOADABLE_TYPE") +__all__ = ("UPLOADABLE_TYPE", "File", "open_file") @attrs.define(eq=False, order=False, hash=False, kw_only=False) diff --git a/interactions/models/discord/guild.py b/interactions/models/discord/guild.py index ca73a8ca9..a3e27e415 100644 --- a/interactions/models/discord/guild.py +++ b/interactions/models/discord/guild.py @@ -60,21 +60,21 @@ from interactions.client.client import Client __all__ = ( - "GuildBan", - "BulkBanResponse", + "AuditLog", + "AuditLogChange", + "AuditLogEntry", + "AuditLogHistory", "BaseGuild", - "GuildWelcome", - "GuildPreview", + "BulkBanResponse", "Guild", + "GuildBan", + "GuildIntegration", + "GuildPreview", "GuildTemplate", + "GuildWelcome", "GuildWelcomeChannel", - "GuildIntegration", - "GuildWidgetSettings", "GuildWidget", - "AuditLogChange", - "AuditLogEntry", - "AuditLog", - "AuditLogHistory", + "GuildWidgetSettings", ) diff --git a/interactions/models/discord/message.py b/interactions/models/discord/message.py index abe982653..d61e4c260 100644 --- a/interactions/models/discord/message.py +++ b/interactions/models/discord/message.py @@ -56,19 +56,19 @@ from interactions.client import Client __all__ = ( + "AllowedMentions", "Attachment", + "BaseMessage", "ChannelMention", + "Message", "MessageActivity", - "MessageReference", "MessageInteraction", "MessageInteractionMetadata", - "AllowedMentions", - "BaseMessage", - "Message", + "MessageReference", "MessageType", "process_allowed_mentions", - "process_message_reference", "process_message_payload", + "process_message_reference", ) channel_mention = re.compile(r"<#(?P[0-9]{17,})>") diff --git a/interactions/models/discord/onboarding.py b/interactions/models/discord/onboarding.py index 718c27386..c47563210 100644 --- a/interactions/models/discord/onboarding.py +++ b/interactions/models/discord/onboarding.py @@ -16,7 +16,7 @@ to_snowflake_list, ) -__all__ = ("OnboardingPromptOption", "OnboardingPrompt", "Onboarding") +__all__ = ("Onboarding", "OnboardingPrompt", "OnboardingPromptOption") @attrs.define(eq=False, order=False, hash=False, kw_only=True) diff --git a/interactions/models/discord/poll.py b/interactions/models/discord/poll.py index 9051791ef..d1a5fc401 100644 --- a/interactions/models/discord/poll.py +++ b/interactions/models/discord/poll.py @@ -14,11 +14,11 @@ from interactions.models.discord.timestamp import Timestamp __all__ = ( - "PollMedia", + "Poll", "PollAnswer", "PollAnswerCount", + "PollMedia", "PollResults", - "Poll", ) diff --git a/interactions/models/discord/reaction.py b/interactions/models/discord/reaction.py index a5b82936c..61408c31b 100644 --- a/interactions/models/discord/reaction.py +++ b/interactions/models/discord/reaction.py @@ -15,7 +15,7 @@ from interactions.models import Message, TYPE_ALL_CHANNEL from interactions.models.discord.user import User -__all__ = ("ReactionUsers", "Reaction") +__all__ = ("Reaction", "ReactionUsers") class ReactionUsers(AsyncIterator): diff --git a/interactions/models/discord/snowflake.py b/interactions/models/discord/snowflake.py index 233f1d93c..c69f94fb9 100644 --- a/interactions/models/discord/snowflake.py +++ b/interactions/models/discord/snowflake.py @@ -7,12 +7,12 @@ from interactions.client.const import MISSING, Absent, DISCORD_EPOCH __all__ = ( - "to_snowflake", - "to_optional_snowflake", - "to_snowflake_list", "Snowflake", "SnowflakeObject", "Snowflake_Type", + "to_optional_snowflake", + "to_snowflake", + "to_snowflake_list", ) diff --git a/interactions/models/discord/sticker.py b/interactions/models/discord/sticker.py index 18cf732b8..aabe3e51c 100644 --- a/interactions/models/discord/sticker.py +++ b/interactions/models/discord/sticker.py @@ -14,7 +14,7 @@ from interactions.models.discord.user import User from interactions.models.discord.snowflake import Snowflake_Type -__all__ = ("StickerItem", "Sticker", "StickerPack") +__all__ = ("Sticker", "StickerItem", "StickerPack") @attrs.define(eq=False, order=False, hash=False, kw_only=False) diff --git a/interactions/models/discord/team.py b/interactions/models/discord/team.py index fa68b6ec7..87fd78420 100644 --- a/interactions/models/discord/team.py +++ b/interactions/models/discord/team.py @@ -12,7 +12,7 @@ from interactions.models.discord.snowflake import Snowflake_Type, SnowflakeObject from interactions.client import Client -__all__ = ("TeamMember", "Team") +__all__ = ("Team", "TeamMember") @attrs.define(eq=False, order=False, hash=False, kw_only=True) diff --git a/interactions/models/discord/thread.py b/interactions/models/discord/thread.py index 58799086f..7f0936253 100644 --- a/interactions/models/discord/thread.py +++ b/interactions/models/discord/thread.py @@ -23,12 +23,12 @@ from interactions import UPLOADABLE_TYPE, GuildForum __all__ = ( - "ThreadMember", + "DefaultReaction", "ThreadList", + "ThreadMember", "ThreadTag", - "DefaultReaction", - "process_thread_tag", "process_default_reaction", + "process_thread_tag", ) diff --git a/interactions/models/discord/timestamp.py b/interactions/models/discord/timestamp.py index f8d1b81fa..512bb8b0f 100644 --- a/interactions/models/discord/timestamp.py +++ b/interactions/models/discord/timestamp.py @@ -7,7 +7,7 @@ if TYPE_CHECKING: from interactions.models.discord.snowflake import Snowflake_Type, Snowflake -__all__ = ("TimestampStyles", "Timestamp") +__all__ = ("Timestamp", "TimestampStyles") DISCORD_EPOCH = 1420070400000 diff --git a/interactions/models/discord/user.py b/interactions/models/discord/user.py index bfe62efeb..910152356 100644 --- a/interactions/models/discord/user.py +++ b/interactions/models/discord/user.py @@ -30,7 +30,7 @@ from interactions.models.discord.channel import DM, TYPE_GUILD_CHANNEL from interactions.models.discord.voice_state import VoiceState -__all__ = ("BaseUser", "User", "ClientUser", "Member") +__all__ = ("BaseUser", "ClientUser", "Member", "User") class _SendDMMixin(SendMixin): diff --git a/interactions/models/discord/voice_state.py b/interactions/models/discord/voice_state.py index 8e163d0a9..1a05641a3 100644 --- a/interactions/models/discord/voice_state.py +++ b/interactions/models/discord/voice_state.py @@ -17,7 +17,7 @@ from interactions.models.discord.user import Member from interactions.models.discord.snowflake import Snowflake_Type -__all__ = ("VoiceState", "VoiceRegion") +__all__ = ("VoiceRegion", "VoiceState") @attrs.define(eq=False, order=False, hash=False, kw_only=True) diff --git a/interactions/models/discord/webhooks.py b/interactions/models/discord/webhooks.py index 96a614b94..3420ad5e2 100644 --- a/interactions/models/discord/webhooks.py +++ b/interactions/models/discord/webhooks.py @@ -30,7 +30,7 @@ from interactions.models.discord.poll import Poll from interactions.models.discord.sticker import Sticker -__all__ = ("WebhookTypes", "Webhook") +__all__ = ("Webhook", "WebhookTypes") class WebhookTypes(IntEnum): diff --git a/interactions/models/internal/__init__.py b/interactions/models/internal/__init__.py index 92652dae9..794b5f564 100644 --- a/interactions/models/internal/__init__.py +++ b/interactions/models/internal/__init__.py @@ -106,11 +106,10 @@ from .tasks import BaseTrigger, DateTrigger, IntervalTrigger, OrTrigger, Task, TimeTrigger, CronTrigger __all__ = ( + "MODEL_TO_CONVERTER", "ActiveVoiceState", - "application_commands_to_dict", - "auto_defer", - "AutocompleteContext", "AutoDefer", + "AutocompleteContext", "BaseChannelConverter", "BaseCommand", "BaseContext", @@ -120,37 +119,24 @@ "CallbackObject", "CallbackType", "ChannelConverter", - "check", - "component_callback", "ComponentCommand", "ComponentContext", - "contexts", - "context_menu", - "user_context_menu", - "message_context_menu", "ConsumeRest", "ContextMenu", "ContextMenuContext", "Converter", - "cooldown", "Cooldown", "CooldownSystem", "CronTrigger", - "SlidingWindowSystem", - "ExponentialBackoffSystem", - "LeakyBucketSystem", - "TokenBucketSystem", "CustomEmojiConverter", - "DateTrigger", - "dm_only", "DMChannelConverter", "DMConverter", "DMGroupConverter", + "DateTrigger", + "ExponentialBackoffSystem", "Extension", - "global_autocomplete", "GlobalAutoComplete", "Greedy", - "guild_only", "GuildCategoryConverter", "GuildChannelConverter", "GuildConverter", @@ -161,36 +147,61 @@ "GuildStageVoiceConverter", "GuildTextConverter", "GuildVoiceConverter", - "has_any_role", - "has_id", - "has_role", "IDConverter", - "integration_types", "InteractionCommand", "InteractionContext", "IntervalTrigger", - "is_owner", - "listen", + "LeakyBucketSystem", "Listener", "LocalisedDesc", "LocalisedName", "LocalizedDesc", "LocalizedName", - "max_concurrency", "MaxConcurrency", "MemberConverter", - "MessageableChannelConverter", "MessageConverter", - "modal_callback", + "MessageableChannelConverter", "ModalCommand", "ModalContext", - "MODEL_TO_CONVERTER", "NoArgumentConverter", "OptionType", "OrTrigger", "PartialEmojiConverter", "Resolved", "RoleConverter", + "SlashCommand", + "SlashCommandChoice", + "SlashCommandOption", + "SlashCommandParameter", + "SlashContext", + "SlidingWindowSystem", + "SnowflakeConverter", + "Task", + "ThreadChannelConverter", + "TimeTrigger", + "TokenBucketSystem", + "UserConverter", + "VoiceChannelConverter", + "Wait", + "application_commands_to_dict", + "auto_defer", + "check", + "component_callback", + "context_menu", + "contexts", + "cooldown", + "dm_only", + "global_autocomplete", + "guild_only", + "has_any_role", + "has_id", + "has_role", + "integration_types", + "is_owner", + "listen", + "max_concurrency", + "message_context_menu", + "modal_callback", "slash_attachment_option", "slash_bool_option", "slash_channel_option", @@ -203,18 +214,7 @@ "slash_role_option", "slash_str_option", "slash_user_option", - "SlashCommand", - "SlashCommandChoice", - "SlashCommandOption", - "SlashCommandParameter", - "SlashContext", - "SnowflakeConverter", "subcommand", "sync_needed", - "Task", - "ThreadChannelConverter", - "TimeTrigger", - "UserConverter", - "VoiceChannelConverter", - "Wait", + "user_context_menu", ) diff --git a/interactions/models/internal/application_commands.py b/interactions/models/internal/application_commands.py index a9727b8b5..2f9b591d0 100644 --- a/interactions/models/internal/application_commands.py +++ b/interactions/models/internal/application_commands.py @@ -53,36 +53,36 @@ from interactions import Client __all__ = ( - "application_commands_to_dict", - "auto_defer", "CallbackType", - "component_callback", "ComponentCommand", - "contexts", - "context_menu", - "user_context_menu", - "message_context_menu", "ContextMenu", - "global_autocomplete", "GlobalAutoComplete", - "integration_types", "InteractionCommand", "LocalisedDesc", "LocalisedName", "LocalizedDesc", "LocalizedName", - "modal_callback", "ModalCommand", "OptionType", - "slash_command", - "slash_default_member_permission", - "slash_option", "SlashCommand", "SlashCommandChoice", "SlashCommandOption", "SlashCommandParameter", + "application_commands_to_dict", + "auto_defer", + "component_callback", + "context_menu", + "contexts", + "global_autocomplete", + "integration_types", + "message_context_menu", + "modal_callback", + "slash_command", + "slash_default_member_permission", + "slash_option", "subcommand", "sync_needed", + "user_context_menu", ) diff --git a/interactions/models/internal/checks.py b/interactions/models/internal/checks.py index ea52a2622..a36d1b254 100644 --- a/interactions/models/internal/checks.py +++ b/interactions/models/internal/checks.py @@ -5,7 +5,7 @@ from interactions.models.discord.user import Member from interactions.models.internal.context import BaseContext -__all__ = ("has_role", "has_any_role", "has_id", "is_owner", "guild_only", "dm_only") +__all__ = ("dm_only", "guild_only", "has_any_role", "has_id", "has_role", "is_owner") TYPE_CHECK_FUNCTION = Callable[[BaseContext], Awaitable[bool]] diff --git a/interactions/models/internal/converters.py b/interactions/models/internal/converters.py index 6bfba5a72..8f0c163bf 100644 --- a/interactions/models/internal/converters.py +++ b/interactions/models/internal/converters.py @@ -38,36 +38,36 @@ from interactions.models.internal.protocols import Converter __all__ = ( - "NoArgumentConverter", - "IDConverter", - "SnowflakeConverter", - "MemberConverter", - "UserConverter", - "ChannelConverter", + "MODEL_TO_CONVERTER", "BaseChannelConverter", + "ChannelConverter", + "ConsumeRest", + "CustomEmojiConverter", "DMChannelConverter", "DMConverter", "DMGroupConverter", + "Greedy", + "GuildCategoryConverter", "GuildChannelConverter", + "GuildConverter", "GuildNewsConverter", - "GuildCategoryConverter", - "GuildTextConverter", - "ThreadChannelConverter", "GuildNewsThreadConverter", - "GuildPublicThreadConverter", "GuildPrivateThreadConverter", - "VoiceChannelConverter", - "GuildVoiceConverter", + "GuildPublicThreadConverter", "GuildStageVoiceConverter", + "GuildTextConverter", + "GuildVoiceConverter", + "IDConverter", + "MemberConverter", + "MessageConverter", "MessageableChannelConverter", - "RoleConverter", - "GuildConverter", + "NoArgumentConverter", "PartialEmojiConverter", - "CustomEmojiConverter", - "MessageConverter", - "Greedy", - "ConsumeRest", - "MODEL_TO_CONVERTER", + "RoleConverter", + "SnowflakeConverter", + "ThreadChannelConverter", + "UserConverter", + "VoiceChannelConverter", ) diff --git a/interactions/models/internal/cooldowns.py b/interactions/models/internal/cooldowns.py index 03be867a3..b88eb27f9 100644 --- a/interactions/models/internal/cooldowns.py +++ b/interactions/models/internal/cooldowns.py @@ -11,11 +11,11 @@ "Buckets", "Cooldown", "CooldownSystem", - "SlidingWindowSystem", "ExponentialBackoffSystem", "LeakyBucketSystem", - "TokenBucketSystem", "MaxConcurrency", + "SlidingWindowSystem", + "TokenBucketSystem", ) @@ -75,7 +75,7 @@ class CooldownSystem: """ - __slots__ = "rate", "interval", "opened", "_tokens" + __slots__ = "_tokens", "interval", "opened", "rate" def __init__(self, rate: int, interval: float) -> None: self.rate: int = rate @@ -160,7 +160,7 @@ class SlidingWindowSystem(CooldownSystem): """ - __slots__ = "rate", "interval", "timestamps" + __slots__ = "interval", "rate", "timestamps" def __init__(self, rate: int, interval: float) -> None: self.rate: int = rate @@ -323,7 +323,7 @@ class Cooldown: """ - __slots__ = "bucket", "cooldown_repositories", "rate", "interval", "cooldown_system" + __slots__ = "bucket", "cooldown_repositories", "cooldown_system", "interval", "rate" def __init__( self, diff --git a/interactions/models/internal/tasks/__init__.py b/interactions/models/internal/tasks/__init__.py index 1ce865a82..1b4590a2b 100644 --- a/interactions/models/internal/tasks/__init__.py +++ b/interactions/models/internal/tasks/__init__.py @@ -1,4 +1,4 @@ from .triggers import BaseTrigger, IntervalTrigger, DateTrigger, TimeTrigger, OrTrigger, CronTrigger from .task import Task -__all__ = ("BaseTrigger", "IntervalTrigger", "DateTrigger", "TimeTrigger", "OrTrigger", "CronTrigger", "Task") +__all__ = ("BaseTrigger", "CronTrigger", "DateTrigger", "IntervalTrigger", "OrTrigger", "Task", "TimeTrigger") diff --git a/interactions/models/internal/tasks/triggers.py b/interactions/models/internal/tasks/triggers.py index d15a319ea..34b6947b0 100644 --- a/interactions/models/internal/tasks/triggers.py +++ b/interactions/models/internal/tasks/triggers.py @@ -7,7 +7,7 @@ from croniter import croniter -__all__ = ("BaseTrigger", "IntervalTrigger", "DateTrigger", "TimeTrigger", "OrTrigger", "CronTrigger") +__all__ = ("BaseTrigger", "CronTrigger", "DateTrigger", "IntervalTrigger", "OrTrigger", "TimeTrigger") class BaseTrigger(ABC):