Skip to content

Commit

Permalink
ci: correct from checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jun 27, 2023
1 parent 532b33f commit 32e8086
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 62 deletions.
8 changes: 4 additions & 4 deletions interactions/api/http/http_requests/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def list_thread_members(self, thread_id: "Snowflake_Type") -> List[discord
async def list_public_archived_threads(
self,
channel_id: "Snowflake_Type",
limit: int = None,
limit: int | None = None,
before: Optional["Snowflake_Type"] = None,
) -> discord_typings.ListThreadsData:
"""
Expand All @@ -108,7 +108,7 @@ async def list_public_archived_threads(
async def list_private_archived_threads(
self,
channel_id: "Snowflake_Type",
limit: int = None,
limit: int | None = None,
before: Optional["Snowflake_Type"] = None,
) -> discord_typings.ListThreadsData:
"""
Expand All @@ -135,7 +135,7 @@ async def list_private_archived_threads(
async def list_joined_private_archived_threads(
self,
channel_id: "Snowflake_Type",
limit: int = None,
limit: int | None = None,
before: Optional["Snowflake_Type"] = None,
) -> discord_typings.ListThreadsData:
"""
Expand Down Expand Up @@ -229,7 +229,7 @@ async def create_forum_thread(
name: str,
auto_archive_duration: int,
message: dict | FormData,
applied_tags: List[str] = None,
applied_tags: List[str] | None = None,
rate_limit_per_user: Absent[int] = MISSING,
files: Absent["UPLOADABLE_TYPE"] = MISSING,
reason: Absent[str] = MISSING,
Expand Down
4 changes: 2 additions & 2 deletions interactions/api/http/http_requests/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async def group_dm_add_recipient(
channel_id: "Snowflake_Type",
user_id: "Snowflake_Type",
access_token: str,
nick: str = None,
nick: str | None = None,
) -> None:
"""
Adds a recipient to a Group DM using their access token.
Expand Down Expand Up @@ -130,7 +130,7 @@ async def group_dm_remove_recipient(self, channel_id: "Snowflake_Type", user_id:
Route("DELETE", "/channels/{channel_id}/recipients/{user_id}", channel_id=channel_id, user_id=user_id)
)

async def modify_current_user_nick(self, guild_id: "Snowflake_Type", nickname: str = None) -> None:
async def modify_current_user_nick(self, guild_id: "Snowflake_Type", nickname: str | None = None) -> None:
"""
Modifies the nickname of the current user in a guild.
Expand Down
10 changes: 6 additions & 4 deletions interactions/api/http/http_requests/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ async def get_guild_webhooks(self, guild_id: "Snowflake_Type") -> List[discord_t
"""
return await self.request(Route("GET", "/guilds/{guild_id}/webhooks", guild_id=guild_id))

async def get_webhook(self, webhook_id: "Snowflake_Type", webhook_token: str = None) -> discord_typings.WebhookData:
async def get_webhook(
self, webhook_id: "Snowflake_Type", webhook_token: str | None = None
) -> discord_typings.WebhookData:
"""
Return the new webhook object for the given id.
Expand All @@ -81,7 +83,7 @@ async def modify_webhook(
name: str,
avatar: Any,
channel_id: "Snowflake_Type",
webhook_token: str = None,
webhook_token: str | None = None,
) -> discord_typings.WebhookData:
"""
Modify a webhook.
Expand All @@ -101,7 +103,7 @@ async def modify_webhook(
payload={"name": name, "avatar": avatar, "channel_id": channel_id},
)

async def delete_webhook(self, webhook_id: "Snowflake_Type", webhook_token: str = None) -> None:
async def delete_webhook(self, webhook_id: "Snowflake_Type", webhook_token: str | None = None) -> None:
"""
Delete a webhook.
Expand All @@ -123,7 +125,7 @@ async def execute_webhook(
webhook_token: str,
payload: dict,
wait: bool = False,
thread_id: "Snowflake_Type" = None,
thread_id: "Snowflake_Type | None" = None,
files: list["UPLOADABLE_TYPE"] | None = None,
) -> Optional[discord_typings.MessageData]:
"""
Expand Down
2 changes: 1 addition & 1 deletion interactions/api/voice/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


class Recorder(threading.Thread):
def __init__(self, v_state, loop, *, output_dir: str = None) -> None:
def __init__(self, v_state, loop, *, output_dir: str | None = None) -> None:
super().__init__()
self.daemon = True

Expand Down
8 changes: 4 additions & 4 deletions interactions/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class Client(
def __init__(
self,
*,
activity: Union[Activity, str] = None,
activity: Union[Activity, str] | None = None,
auto_defer: Absent[Union[AutoDefer, bool]] = MISSING,
autocomplete_context: Type[BaseContext] = AutocompleteContext,
basic_logging: bool = False,
Expand Down Expand Up @@ -1102,7 +1102,7 @@ def predicate(event) -> bool:

async def wait_for_component(
self,
messages: Union[Message, int, list] = None,
messages: Union[Message, int, list] | None = None,
components: Optional[
Union[
List[List[Union["BaseComponent", dict]]],
Expand All @@ -1111,7 +1111,7 @@ async def wait_for_component(
dict,
]
] = None,
check: Absent[Optional[Union[Callable[..., bool], Callable[..., Awaitable[bool]]]]] = None,
check: Absent[Optional[Union[Callable[..., bool], Callable[..., Awaitable[bool]]]]] | None = None,
timeout: Optional[float] = None,
) -> "events.Component":
"""
Expand Down Expand Up @@ -1627,7 +1627,7 @@ async def _sync_commands_with_discord(
self._cache_sync_response(sync_response, cmd_scope)

def get_application_cmd_by_id(
self, cmd_id: "Snowflake_Type", *, scope: "Snowflake_Type" = None
self, cmd_id: "Snowflake_Type", *, scope: "Snowflake_Type | None" = None
) -> Optional[InteractionCommand]:
"""
Get a application command from the internal cache by its ID.
Expand Down
2 changes: 1 addition & 1 deletion interactions/ext/prefixed_commands/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(
self,
name: str,
default: Any = MISSING,
type: Type = None,
type: Type | None = None,
kind: inspect._ParameterKind = inspect._ParameterKind.POSITIONAL_OR_KEYWORD,
converters: Optional[list[Callable[["PrefixedContext", str], Any]]] = None,
greedy: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion interactions/ext/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def on_error_sentry_hook(self: Task, error: Exception) -> None:

def setup(
bot: Client,
token: str = None,
token: str | None = None,
filter: Optional[Callable[[dict[str, Any], dict[str, Any]], Optional[dict[str, Any]]]] = None,
**kwargs,
) -> None:
Expand Down
30 changes: 15 additions & 15 deletions interactions/models/discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async def fetch(self) -> List["models.Message"]:


class ArchivedForumPosts(AsyncIterator):
def __init__(self, channel: "BaseChannel", limit: int = 50, before: Snowflake_Type = None) -> None:
def __init__(self, channel: "BaseChannel", limit: int = 50, before: Snowflake_Type | None = None) -> None:
self.channel: "BaseChannel" = channel
self.before: Snowflake_Type = before
self._more: bool = True
Expand Down Expand Up @@ -281,9 +281,9 @@ def get_message(self, message_id: Snowflake_Type) -> "models.Message":
def history(
self,
limit: int = 100,
before: Snowflake_Type = None,
after: Snowflake_Type = None,
around: Snowflake_Type = None,
before: Snowflake_Type | None = None,
after: Snowflake_Type | None = None,
around: Snowflake_Type | None = None,
) -> ChannelHistory:
"""
Get an async iterator for the history of this channel.
Expand Down Expand Up @@ -387,7 +387,7 @@ async def delete_messages(
else:
await self._client.http.bulk_delete_messages(self.id, message_ids, reason)

async def delete_message(self, message: Union[Snowflake_Type, "models.Message"], reason: str = None) -> None:
async def delete_message(self, message: Union[Snowflake_Type, "models.Message"], reason: str | None = None) -> None:
"""
Delete a single message from a channel.
Expand Down Expand Up @@ -561,7 +561,7 @@ async def create_thread(
invitable: Absent[bool] = MISSING,
rate_limit_per_user: Absent[int] = MISSING,
auto_archive_duration: AutoArchiveDuration = AutoArchiveDuration.ONE_DAY,
reason: Absent[str] = None,
reason: Absent[str] | None = None,
) -> "TYPE_THREAD_CHANNEL":
"""
Creates a new thread in this channel. If a message is provided, it will be used as the initial message.
Expand Down Expand Up @@ -601,7 +601,7 @@ async def create_thread(
return self._client.cache.place_channel_data(thread_data)

async def fetch_public_archived_threads(
self, limit: int = None, before: Optional["models.Timestamp"] = None
self, limit: int | None = None, before: Optional["models.Timestamp"] = None
) -> "models.ThreadList":
"""
Get a `ThreadList` of archived **public** threads available in this channel.
Expand All @@ -621,7 +621,7 @@ async def fetch_public_archived_threads(
return models.ThreadList.from_dict(threads_data, self._client)

async def fetch_private_archived_threads(
self, limit: int = None, before: Optional["models.Timestamp"] = None
self, limit: int | None = None, before: Optional["models.Timestamp"] = None
) -> "models.ThreadList":
"""
Get a `ThreadList` of archived **private** threads available in this channel.
Expand All @@ -641,7 +641,7 @@ async def fetch_private_archived_threads(
return models.ThreadList.from_dict(threads_data, self._client)

async def fetch_archived_threads(
self, limit: int = None, before: Optional["models.Timestamp"] = None
self, limit: int | None = None, before: Optional["models.Timestamp"] = None
) -> "models.ThreadList":
"""
Get a `ThreadList` of archived threads available in this channel.
Expand All @@ -664,7 +664,7 @@ async def fetch_archived_threads(
return models.ThreadList.from_dict(threads_data, self._client)

async def fetch_joined_private_archived_threads(
self, limit: int = None, before: Optional["models.Timestamp"] = None
self, limit: int | None = None, before: Optional["models.Timestamp"] = None
) -> "models.ThreadList":
"""
Get a `ThreadList` of threads the bot is a participant of in this channel.
Expand Down Expand Up @@ -1220,7 +1220,7 @@ async def set_permission(
view_audit_log: bool | None = None,
view_channel: bool | None = None,
view_guild_insights: bool | None = None,
reason: str = None,
reason: str | None = None,
) -> None:
"""
Set the Permission Overwrites for a given target.
Expand Down Expand Up @@ -1664,7 +1664,7 @@ async def create_thread_from_message(
name: str,
message: Snowflake_Type,
auto_archive_duration: AutoArchiveDuration = AutoArchiveDuration.ONE_DAY,
reason: Absent[str] = None,
reason: Absent[str] | None = None,
) -> "GuildNewsThread":
"""
Creates a new news thread in this channel.
Expand Down Expand Up @@ -1749,7 +1749,7 @@ async def create_public_thread(
name: str,
auto_archive_duration: AutoArchiveDuration = AutoArchiveDuration.ONE_DAY,
rate_limit_per_user: Absent[int] = MISSING,
reason: Absent[str] = None,
reason: Absent[str] | None = None,
) -> "GuildPublicThread":
"""
Creates a new public thread in this channel.
Expand Down Expand Up @@ -1778,7 +1778,7 @@ async def create_private_thread(
invitable: Absent[bool] = MISSING,
auto_archive_duration: AutoArchiveDuration = AutoArchiveDuration.ONE_DAY,
rate_limit_per_user: Absent[int] = MISSING,
reason: Absent[str] = None,
reason: Absent[str] | None = None,
) -> "GuildPrivateThread":
"""
Creates a new private thread in this channel.
Expand Down Expand Up @@ -1808,7 +1808,7 @@ async def create_thread_from_message(
name: str,
message: Snowflake_Type,
auto_archive_duration: AutoArchiveDuration = AutoArchiveDuration.ONE_DAY,
reason: Absent[str] = None,
reason: Absent[str] | None = None,
) -> "GuildPublicThread":
"""
Creates a new public thread in this channel.
Expand Down
2 changes: 1 addition & 1 deletion interactions/models/discord/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def __init__(
style: ButtonStyle | int,
label: str | None = None,
emoji: "PartialEmoji | None | str" = None,
custom_id: str = None,
custom_id: str | None = None,
url: str | None = None,
disabled: bool = False,
) -> None:
Expand Down
22 changes: 11 additions & 11 deletions interactions/models/discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ async def create_channel(
permission_overwrites: Absent[
Union[dict, "models.PermissionOverwrite", List[Union[dict, "models.PermissionOverwrite"]]]
] = MISSING,
category: Union[Snowflake_Type, "models.GuildCategory"] = None,
category: Union[Snowflake_Type, "models.GuildCategory"] | None = None,
nsfw: bool = False,
bitrate: int = 64000,
user_limit: int = 0,
Expand Down Expand Up @@ -975,7 +975,7 @@ async def create_text_channel(
permission_overwrites: Absent[
Union[dict, "models.PermissionOverwrite", List[Union[dict, "models.PermissionOverwrite"]]]
] = MISSING,
category: Union[Snowflake_Type, "models.GuildCategory"] = None,
category: Union[Snowflake_Type, "models.GuildCategory"] | None = None,
nsfw: bool = False,
rate_limit_per_user: int = 0,
reason: Absent[Optional[str]] = MISSING,
Expand Down Expand Up @@ -1017,7 +1017,7 @@ async def create_forum_channel(
permission_overwrites: Absent[
Union[dict, "models.PermissionOverwrite", List[Union[dict, "models.PermissionOverwrite"]]]
] = MISSING,
category: Union[Snowflake_Type, "models.GuildCategory"] = None,
category: Union[Snowflake_Type, "models.GuildCategory"] | None = None,
nsfw: bool = False,
rate_limit_per_user: int = 0,
default_reaction_emoji: Absent[Union[dict, "models.PartialEmoji", "models.DefaultReaction", str]] = MISSING,
Expand Down Expand Up @@ -1068,7 +1068,7 @@ async def create_news_channel(
permission_overwrites: Absent[
Union[dict, "models.PermissionOverwrite", List[Union[dict, "models.PermissionOverwrite"]]]
] = MISSING,
category: Union[Snowflake_Type, "models.GuildCategory"] = None,
category: Union[Snowflake_Type, "models.GuildCategory"] | None = None,
nsfw: bool = False,
reason: Absent[Optional[str]] = MISSING,
) -> "models.GuildNews":
Expand Down Expand Up @@ -1107,7 +1107,7 @@ async def create_voice_channel(
permission_overwrites: Absent[
Union[dict, "models.PermissionOverwrite", List[Union[dict, "models.PermissionOverwrite"]]]
] = MISSING,
category: Union[Snowflake_Type, "models.GuildCategory"] = None,
category: Union[Snowflake_Type, "models.GuildCategory"] | None = None,
nsfw: bool = False,
bitrate: int = 64000,
user_limit: int = 0,
Expand Down Expand Up @@ -1217,7 +1217,7 @@ async def create_category(
)

async def delete_channel(
self, channel: Union["models.TYPE_GUILD_CHANNEL", Snowflake_Type], reason: str = None
self, channel: Union["models.TYPE_GUILD_CHANNEL", Snowflake_Type], reason: str | None = None
) -> None:
"""
Delete the given channel, can handle either a snowflake or channel object.
Expand Down Expand Up @@ -1871,7 +1871,7 @@ async def unban(
"""
await self._client.http.remove_guild_ban(self.id, to_snowflake(user), reason=reason)

async def fetch_widget_image(self, style: str = None) -> str:
async def fetch_widget_image(self, style: str | None = None) -> str:
"""
Fetch a guilds widget image.
Expand Down Expand Up @@ -2352,10 +2352,10 @@ class AuditLogHistory(AsyncIterator):
def __init__(
self,
guild: "Guild",
user_id: Snowflake_Type = None,
action_type: "AuditLogEventType" = None,
before: Snowflake_Type = None,
after: Snowflake_Type = None,
user_id: Snowflake_Type | None = None,
action_type: "AuditLogEventType | None" = None,
before: Snowflake_Type | None = None,
after: Snowflake_Type | None = None,
limit: int = 50,
) -> None:
self.guild: "Guild" = guild
Expand Down
2 changes: 1 addition & 1 deletion interactions/models/discord/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Reaction(ClientObject):
_channel_id: "Snowflake_Type" = attrs.field(repr=False, converter=to_snowflake)
_message_id: "Snowflake_Type" = attrs.field(repr=False, converter=to_snowflake)

def users(self, limit: int = 0, after: "Snowflake_Type" = None) -> ReactionUsers:
def users(self, limit: int = 0, after: "Snowflake_Type | None" = None) -> ReactionUsers:
"""Users who reacted using this emoji."""
return ReactionUsers(self, limit, after)

Expand Down
6 changes: 3 additions & 3 deletions interactions/models/discord/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ async def send(
tts: bool = False,
suppress_embeds: bool = False,
flags: Optional[Union[int, "MessageFlags"]] = None,
username: str = None,
avatar_url: str = None,
username: str | None = None,
avatar_url: str | None = None,
wait: bool = False,
thread: "Snowflake_Type" = None,
thread: "Snowflake_Type | None" = None,
**kwargs,
) -> Optional["Message"]:
"""
Expand Down
Loading

0 comments on commit 32e8086

Please sign in to comment.