From 49bd3451153408be000a57433ce8942cdd302af4 Mon Sep 17 00:00:00 2001 From: shiftinv Date: Sun, 30 Apr 2023 17:52:06 +0200 Subject: [PATCH] style: put EventData args on separate lines --- disnake/_event_data.py | 418 ++++++++++++++++++++++++++++++----------- 1 file changed, 308 insertions(+), 110 deletions(-) diff --git a/disnake/_event_data.py b/disnake/_event_data.py index 04fad2e35c..65c4e1cc94 100644 --- a/disnake/_event_data.py +++ b/disnake/_event_data.py @@ -30,145 +30,343 @@ def __init__( EVENT_DATA: Dict[Event, EventData] = { - Event.connect: EventData(type_args=[]), - Event.disconnect: EventData(type_args=[]), + Event.connect: EventData( + type_args=[], + ), + Event.disconnect: EventData( + type_args=[], + ), # FIXME: figure out how to specify varargs for these two if we ever add overloads for @event - Event.error: EventData(type_args=[], event_only=True), - Event.gateway_error: EventData(type_args=[], event_only=True), - Event.ready: EventData(type_args=[]), - Event.resumed: EventData(type_args=[]), - Event.shard_connect: EventData(type_args=["int"]), - Event.shard_disconnect: EventData(type_args=["int"]), - Event.shard_ready: EventData(type_args=["int"]), - Event.shard_resumed: EventData(type_args=["int"]), - Event.socket_event_type: EventData(type_args=["str"]), - Event.socket_raw_receive: EventData(type_args=["str"]), - Event.socket_raw_send: EventData(type_args=["Union[str, bytes]"]), - Event.guild_channel_create: EventData(type_args=["GuildChannel"]), - Event.guild_channel_update: EventData(type_args=["GuildChannel", "GuildChannel"]), - Event.guild_channel_delete: EventData(type_args=["GuildChannel"]), + Event.error: EventData( + type_args=[], + event_only=True, + ), + Event.gateway_error: EventData( + type_args=[], + event_only=True, + ), + Event.ready: EventData( + type_args=[], + ), + Event.resumed: EventData( + type_args=[], + ), + Event.shard_connect: EventData( + type_args=["int"], + ), + Event.shard_disconnect: EventData( + type_args=["int"], + ), + Event.shard_ready: EventData( + type_args=["int"], + ), + Event.shard_resumed: EventData( + type_args=["int"], + ), + Event.socket_event_type: EventData( + type_args=["str"], + ), + Event.socket_raw_receive: EventData( + type_args=["str"], + ), + Event.socket_raw_send: EventData( + type_args=["Union[str, bytes]"], + ), + Event.guild_channel_create: EventData( + type_args=["GuildChannel"], + ), + Event.guild_channel_update: EventData( + type_args=["GuildChannel", "GuildChannel"], + ), + Event.guild_channel_delete: EventData( + type_args=["GuildChannel"], + ), Event.guild_channel_pins_update: EventData( - type_args=["Union[GuildChannel, Thread]", "Optional[datetime]"] + type_args=["Union[GuildChannel, Thread]", "Optional[datetime]"], + ), + Event.invite_create: EventData( + type_args=["Invite"], + ), + Event.invite_delete: EventData( + type_args=["Invite"], + ), + Event.private_channel_update: EventData( + type_args=["GroupChannel", "GroupChannel"], ), - Event.invite_create: EventData(type_args=["Invite"]), - Event.invite_delete: EventData(type_args=["Invite"]), - Event.private_channel_update: EventData(type_args=["GroupChannel", "GroupChannel"]), Event.private_channel_pins_update: EventData( - type_args=["PrivateChannel", "Optional[datetime]"] - ), - Event.webhooks_update: EventData(type_args=["GuildChannel"]), - Event.thread_create: EventData(type_args=["Thread"]), - Event.thread_update: EventData(type_args=["Thread", "Thread"]), - Event.thread_delete: EventData(type_args=["Thread"]), - Event.thread_join: EventData(type_args=["Thread"]), - Event.thread_remove: EventData(type_args=["Thread"]), - Event.thread_member_join: EventData(type_args=["ThreadMember"]), - Event.thread_member_remove: EventData(type_args=["ThreadMember"]), - Event.raw_thread_member_remove: EventData(type_args=["RawThreadMemberRemoveEvent"]), - Event.raw_thread_update: EventData(type_args=["Thread"]), - Event.raw_thread_delete: EventData(type_args=["RawThreadDeleteEvent"]), - Event.guild_join: EventData(type_args=["Guild"]), - Event.guild_remove: EventData(type_args=["Guild"]), - Event.guild_update: EventData(type_args=["Guild", "Guild"]), - Event.guild_available: EventData(type_args=["Guild"]), - Event.guild_unavailable: EventData(type_args=["Guild"]), - Event.guild_role_create: EventData(type_args=["Role"]), - Event.guild_role_delete: EventData(type_args=["Role"]), - Event.guild_role_update: EventData(type_args=["Role", "Role"]), - Event.guild_emojis_update: EventData(type_args=["Guild", "Sequence[Emoji]", "Sequence[Emoji]"]), + type_args=["PrivateChannel", "Optional[datetime]"], + ), + Event.webhooks_update: EventData( + type_args=["GuildChannel"], + ), + Event.thread_create: EventData( + type_args=["Thread"], + ), + Event.thread_update: EventData( + type_args=["Thread", "Thread"], + ), + Event.thread_delete: EventData( + type_args=["Thread"], + ), + Event.thread_join: EventData( + type_args=["Thread"], + ), + Event.thread_remove: EventData( + type_args=["Thread"], + ), + Event.thread_member_join: EventData( + type_args=["ThreadMember"], + ), + Event.thread_member_remove: EventData( + type_args=["ThreadMember"], + ), + Event.raw_thread_member_remove: EventData( + type_args=["RawThreadMemberRemoveEvent"], + ), + Event.raw_thread_update: EventData( + type_args=["Thread"], + ), + Event.raw_thread_delete: EventData( + type_args=["RawThreadDeleteEvent"], + ), + Event.guild_join: EventData( + type_args=["Guild"], + ), + Event.guild_remove: EventData( + type_args=["Guild"], + ), + Event.guild_update: EventData( + type_args=["Guild", "Guild"], + ), + Event.guild_available: EventData( + type_args=["Guild"], + ), + Event.guild_unavailable: EventData( + type_args=["Guild"], + ), + Event.guild_role_create: EventData( + type_args=["Role"], + ), + Event.guild_role_delete: EventData( + type_args=["Role"], + ), + Event.guild_role_update: EventData( + type_args=["Role", "Role"], + ), + Event.guild_emojis_update: EventData( + type_args=["Guild", "Sequence[Emoji]", "Sequence[Emoji]"], + ), Event.guild_stickers_update: EventData( - type_args=["Guild", "Sequence[GuildSticker]", "Sequence[GuildSticker]"] + type_args=["Guild", "Sequence[GuildSticker]", "Sequence[GuildSticker]"], + ), + Event.guild_integrations_update: EventData( + type_args=["Guild"], + ), + Event.guild_scheduled_event_create: EventData( + type_args=["GuildScheduledEvent"], ), - Event.guild_integrations_update: EventData(type_args=["Guild"]), - Event.guild_scheduled_event_create: EventData(type_args=["GuildScheduledEvent"]), Event.guild_scheduled_event_update: EventData( - type_args=["GuildScheduledEvent", "GuildScheduledEvent"] + type_args=["GuildScheduledEvent", "GuildScheduledEvent"], + ), + Event.guild_scheduled_event_delete: EventData( + type_args=["GuildScheduledEvent"], ), - Event.guild_scheduled_event_delete: EventData(type_args=["GuildScheduledEvent"]), Event.guild_scheduled_event_subscribe: EventData( - type_args=["GuildScheduledEvent", "Union[Member, User]"] + type_args=["GuildScheduledEvent", "Union[Member, User]"], ), Event.guild_scheduled_event_unsubscribe: EventData( - type_args=["GuildScheduledEvent", "Union[Member, User]"] + type_args=["GuildScheduledEvent", "Union[Member, User]"], ), Event.raw_guild_scheduled_event_subscribe: EventData( - type_args=["RawGuildScheduledEventUserActionEvent"] + type_args=["RawGuildScheduledEventUserActionEvent"], ), Event.raw_guild_scheduled_event_unsubscribe: EventData( - type_args=["RawGuildScheduledEventUserActionEvent"] + type_args=["RawGuildScheduledEventUserActionEvent"], ), Event.application_command_permissions_update: EventData( - type_args=["GuildApplicationCommandPermissions"] - ), - Event.automod_action_execution: EventData(type_args=["AutoModActionExecution"]), - Event.automod_rule_create: EventData(type_args=["AutoModRule"]), - Event.automod_rule_update: EventData(type_args=["AutoModRule"]), - Event.automod_rule_delete: EventData(type_args=["AutoModRule"]), - Event.audit_log_entry_create: EventData(type_args=["AuditLogEntry"]), - Event.integration_create: EventData(type_args=["Integration"]), - Event.integration_update: EventData(type_args=["Integration"]), - Event.raw_integration_delete: EventData(type_args=["RawIntegrationDeleteEvent"]), - Event.member_join: EventData(type_args=["Member"]), - Event.member_remove: EventData(type_args=["Member"]), - Event.member_update: EventData(type_args=["Member", "Member"]), - Event.raw_member_remove: EventData(type_args=["RawGuildMemberRemoveEvent"]), - Event.raw_member_update: EventData(type_args=["Member"]), - Event.member_ban: EventData(type_args=["Guild", "Union[User, Member]"]), - Event.member_unban: EventData(type_args=["Guild", "User"]), - Event.presence_update: EventData(type_args=["Member", "Member"]), - Event.user_update: EventData(type_args=["User", "User"]), - Event.voice_state_update: EventData(type_args=["Member", "VoiceState", "VoiceState"]), - Event.stage_instance_create: EventData(type_args=["StageInstance"]), - Event.stage_instance_delete: EventData(type_args=["StageInstance", "StageInstance"]), - Event.stage_instance_update: EventData(type_args=["StageInstance"]), - Event.application_command: EventData(type_args=["ApplicationCommandInteraction"]), - Event.application_command_autocomplete: EventData(type_args=["ApplicationCommandInteraction"]), - Event.button_click: EventData(type_args=["MessageInteraction"]), - Event.dropdown: EventData(type_args=["MessageInteraction"]), - Event.interaction: EventData(type_args=["Interaction"]), - Event.message_interaction: EventData(type_args=["MessageInteraction"]), - Event.modal_submit: EventData(type_args=["ModalInteraction"]), - Event.message: EventData(type_args=["Message"]), - Event.message_edit: EventData(type_args=["Message", "Message"]), - Event.message_delete: EventData(type_args=["Message"]), - Event.bulk_message_delete: EventData(type_args=["List[Message]"]), - Event.raw_message_edit: EventData(type_args=["RawMessageUpdateEvent"]), - Event.raw_message_delete: EventData(type_args=["RawMessageDeleteEvent"]), - Event.raw_bulk_message_delete: EventData(type_args=["RawBulkMessageDeleteEvent"]), - Event.reaction_add: EventData(type_args=["Reaction", "Union[Member, User]"]), - Event.reaction_remove: EventData(type_args=["Reaction", "Union[Member, User]"]), - Event.reaction_clear: EventData(type_args=["Message", "List[Reaction]"]), - Event.reaction_clear_emoji: EventData(type_args=["Reaction"]), - Event.raw_reaction_add: EventData(type_args=["RawReactionActionEvent"]), - Event.raw_reaction_remove: EventData(type_args=["RawReactionActionEvent"]), - Event.raw_reaction_clear: EventData(type_args=["RawReactionClearEvent"]), - Event.raw_reaction_clear_emoji: EventData(type_args=["RawReactionClearEmojiEvent"]), + type_args=["GuildApplicationCommandPermissions"], + ), + Event.automod_action_execution: EventData( + type_args=["AutoModActionExecution"], + ), + Event.automod_rule_create: EventData( + type_args=["AutoModRule"], + ), + Event.automod_rule_update: EventData( + type_args=["AutoModRule"], + ), + Event.automod_rule_delete: EventData( + type_args=["AutoModRule"], + ), + Event.audit_log_entry_create: EventData( + type_args=["AuditLogEntry"], + ), + Event.integration_create: EventData( + type_args=["Integration"], + ), + Event.integration_update: EventData( + type_args=["Integration"], + ), + Event.raw_integration_delete: EventData( + type_args=["RawIntegrationDeleteEvent"], + ), + Event.member_join: EventData( + type_args=["Member"], + ), + Event.member_remove: EventData( + type_args=["Member"], + ), + Event.member_update: EventData( + type_args=["Member", "Member"], + ), + Event.raw_member_remove: EventData( + type_args=["RawGuildMemberRemoveEvent"], + ), + Event.raw_member_update: EventData( + type_args=["Member"], + ), + Event.member_ban: EventData( + type_args=["Guild", "Union[User, Member]"], + ), + Event.member_unban: EventData( + type_args=["Guild", "User"], + ), + Event.presence_update: EventData( + type_args=["Member", "Member"], + ), + Event.user_update: EventData( + type_args=["User", "User"], + ), + Event.voice_state_update: EventData( + type_args=["Member", "VoiceState", "VoiceState"], + ), + Event.stage_instance_create: EventData( + type_args=["StageInstance"], + ), + Event.stage_instance_delete: EventData( + type_args=["StageInstance", "StageInstance"], + ), + Event.stage_instance_update: EventData( + type_args=["StageInstance"], + ), + Event.application_command: EventData( + type_args=["ApplicationCommandInteraction"], + ), + Event.application_command_autocomplete: EventData( + type_args=["ApplicationCommandInteraction"], + ), + Event.button_click: EventData( + type_args=["MessageInteraction"], + ), + Event.dropdown: EventData( + type_args=["MessageInteraction"], + ), + Event.interaction: EventData( + type_args=["Interaction"], + ), + Event.message_interaction: EventData( + type_args=["MessageInteraction"], + ), + Event.modal_submit: EventData( + type_args=["ModalInteraction"], + ), + Event.message: EventData( + type_args=["Message"], + ), + Event.message_edit: EventData( + type_args=["Message", "Message"], + ), + Event.message_delete: EventData( + type_args=["Message"], + ), + Event.bulk_message_delete: EventData( + type_args=["List[Message]"], + ), + Event.raw_message_edit: EventData( + type_args=["RawMessageUpdateEvent"], + ), + Event.raw_message_delete: EventData( + type_args=["RawMessageDeleteEvent"], + ), + Event.raw_bulk_message_delete: EventData( + type_args=["RawBulkMessageDeleteEvent"], + ), + Event.reaction_add: EventData( + type_args=["Reaction", "Union[Member, User]"], + ), + Event.reaction_remove: EventData( + type_args=["Reaction", "Union[Member, User]"], + ), + Event.reaction_clear: EventData( + type_args=["Message", "List[Reaction]"], + ), + Event.reaction_clear_emoji: EventData( + type_args=["Reaction"], + ), + Event.raw_reaction_add: EventData( + type_args=["RawReactionActionEvent"], + ), + Event.raw_reaction_remove: EventData( + type_args=["RawReactionActionEvent"], + ), + Event.raw_reaction_clear: EventData( + type_args=["RawReactionClearEvent"], + ), + Event.raw_reaction_clear_emoji: EventData( + type_args=["RawReactionClearEmojiEvent"], + ), Event.typing: EventData( - type_args=["Union[Messageable, ForumChannel]", "Union[User, Member]", "datetime"] + type_args=["Union[Messageable, ForumChannel]", "Union[User, Member]", "datetime"], + ), + Event.raw_typing: EventData( + type_args=["RawTypingEvent"], + ), + Event.command: EventData( + type_args=["commands.Context"], + bot=True, + ), + Event.command_completion: EventData( + type_args=["commands.Context"], + bot=True, ), - Event.raw_typing: EventData(type_args=["RawTypingEvent"]), - Event.command: EventData(type_args=["commands.Context"], bot=True), - Event.command_completion: EventData(type_args=["commands.Context"], bot=True), Event.command_error: EventData( - type_args=["commands.Context", "commands.CommandError"], bot=True + type_args=["commands.Context", "commands.CommandError"], + bot=True, + ), + Event.slash_command: EventData( + type_args=["ApplicationCommandInteraction"], + bot=True, ), - Event.slash_command: EventData(type_args=["ApplicationCommandInteraction"], bot=True), Event.slash_command_completion: EventData( - type_args=["ApplicationCommandInteraction"], bot=True + type_args=["ApplicationCommandInteraction"], + bot=True, ), Event.slash_command_error: EventData( - type_args=["ApplicationCommandInteraction", "commands.CommandError"], bot=True + type_args=["ApplicationCommandInteraction", "commands.CommandError"], + bot=True, + ), + Event.user_command: EventData( + type_args=["ApplicationCommandInteraction"], + bot=True, + ), + Event.user_command_completion: EventData( + type_args=["ApplicationCommandInteraction"], + bot=True, ), - Event.user_command: EventData(type_args=["ApplicationCommandInteraction"], bot=True), - Event.user_command_completion: EventData(type_args=["ApplicationCommandInteraction"], bot=True), Event.user_command_error: EventData( - type_args=["ApplicationCommandInteraction", "commands.CommandError"], bot=True + type_args=["ApplicationCommandInteraction", "commands.CommandError"], + bot=True, + ), + Event.message_command: EventData( + type_args=["ApplicationCommandInteraction"], + bot=True, ), - Event.message_command: EventData(type_args=["ApplicationCommandInteraction"], bot=True), Event.message_command_completion: EventData( - type_args=["ApplicationCommandInteraction"], bot=True + type_args=["ApplicationCommandInteraction"], + bot=True, ), Event.message_command_error: EventData( - type_args=["ApplicationCommandInteraction", "commands.CommandError"], bot=True + type_args=["ApplicationCommandInteraction", "commands.CommandError"], + bot=True, ), }