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 Jul 18, 2023
1 parent 18ac232 commit a964de1
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 44 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
8 changes: 5 additions & 3 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 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
2 changes: 1 addition & 1 deletion interactions/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions interactions/ext/hybrid_commands/hybrid_slash.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ async def __call__(self, context: SlashContext, *args, **kwargs) -> None:

def group(
self,
name: str = None,
name: str | None = None,
description: str = "No Description Set",
inherit_checks: bool = True,
aliases: list[str] | None = None,
Expand All @@ -263,7 +263,7 @@ def subcommand(
group_name: LocalisedName | str = None,
sub_cmd_description: Absent[LocalisedDesc | str] = MISSING,
group_description: Absent[LocalisedDesc | str] = MISSING,
options: List[Union[SlashCommandOption, dict]] = None,
options: List[Union[SlashCommandOption, dict]] | None = None,
nsfw: bool = False,
inherit_checks: bool = True,
aliases: list[str] | None = None,
Expand Down Expand Up @@ -541,8 +541,8 @@ def hybrid_slash_subcommand(
base_dm_permission: bool = True,
subcommand_group_description: Optional[str | LocalisedDesc] = None,
sub_group_desc: Optional[str | LocalisedDesc] = None,
scopes: List["Snowflake_Type"] = None,
options: List[dict] = None,
scopes: List["Snowflake_Type"] | None = None,
options: List[dict] | None = None,
nsfw: bool = False,
silence_autocomplete_errors: bool = False,
) -> Callable[[AsyncCallable], HybridSlashCommand]:
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 @@ -92,7 +92,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
22 changes: 11 additions & 11 deletions interactions/models/discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,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 @@ -565,7 +565,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 @@ -605,7 +605,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 @@ -625,7 +625,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 @@ -645,7 +645,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 @@ -668,7 +668,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 @@ -1224,7 +1224,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 @@ -1668,7 +1668,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 @@ -1751,7 +1751,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 @@ -1780,7 +1780,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 @@ -1810,7 +1810,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
4 changes: 2 additions & 2 deletions interactions/models/discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,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 @@ -1875,7 +1875,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
4 changes: 2 additions & 2 deletions interactions/models/discord/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ 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,
**kwargs,
Expand Down
12 changes: 6 additions & 6 deletions interactions/models/internal/annotations/slash.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def slash_str_option(
description: str,
required: bool = False,
autocomplete: bool = False,
choices: List[Union["SlashCommandChoice", dict]] = None,
choices: List[Union["SlashCommandChoice", dict]] | None = None,
min_length: Optional[int] = None,
max_length: Optional[int] = None,
) -> Type[str]:
Expand Down Expand Up @@ -64,7 +64,7 @@ def slash_float_option(
description: str,
required: bool = False,
autocomplete: bool = False,
choices: List[Union["SlashCommandChoice", dict]] = None,
choices: List[Union["SlashCommandChoice", dict]] | None = None,
min_value: Optional[float] = None,
max_value: Optional[float] = None,
) -> Type[float]:
Expand Down Expand Up @@ -96,7 +96,7 @@ def slash_int_option(
description: str,
required: bool = False,
autocomplete: bool = False,
choices: List[Union["SlashCommandChoice", dict]] = None,
choices: List[Union["SlashCommandChoice", dict]] | None = None,
min_value: Optional[float] = None,
max_value: Optional[float] = None,
) -> Type[int]:
Expand Down Expand Up @@ -171,7 +171,7 @@ def slash_channel_option(
description: str,
required: bool = False,
autocomplete: bool = False,
choices: List[Union["SlashCommandChoice", dict]] = None,
choices: List[Union["SlashCommandChoice", dict]] | None = None,
channel_types: Optional[list[Union["ChannelType", int]]] = None,
) -> Type["BaseChannel"]:
"""
Expand Down Expand Up @@ -200,7 +200,7 @@ def slash_role_option(
description: str,
required: bool = False,
autocomplete: bool = False,
choices: List[Union["SlashCommandChoice", dict]] = None,
choices: List[Union["SlashCommandChoice", dict]] | None = None,
) -> Type["Role"]:
"""
Annotates an argument as a role type slash command option.
Expand All @@ -226,7 +226,7 @@ def slash_mentionable_option(
description: str,
required: bool = False,
autocomplete: bool = False,
choices: List[Union["SlashCommandChoice", dict]] = None,
choices: List[Union["SlashCommandChoice", dict]] | None = None,
) -> Type[Union["Role", "BaseChannel", "User", "Member"]]:
"""
Annotates an argument as a mentionable type slash command option.
Expand Down
10 changes: 5 additions & 5 deletions interactions/models/internal/application_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ def wrapper(call: Callable[..., Coroutine]) -> Callable[..., Coroutine]:
return wrapper

def group(
self, name: str = None, description: str = "No Description Set", inherit_checks: bool = True
self, name: str | None = None, description: str = "No Description Set", inherit_checks: bool = True
) -> "SlashCommand":
return SlashCommand(
name=self.name,
Expand All @@ -736,7 +736,7 @@ def subcommand(
group_name: LocalisedName | str = None,
sub_cmd_description: Absent[LocalisedDesc | str] = MISSING,
group_description: Absent[LocalisedDesc | str] = MISSING,
options: List[Union[SlashCommandOption, Dict]] = None,
options: List[Union[SlashCommandOption, Dict]] | None = None,
nsfw: bool = False,
inherit_checks: bool = True,
) -> Callable[..., "SlashCommand"]:
Expand Down Expand Up @@ -961,8 +961,8 @@ def subcommand(
base_dm_permission: bool = True,
subcommand_group_description: Optional[str | LocalisedDesc] = None,
sub_group_desc: Optional[str | LocalisedDesc] = None,
scopes: List["Snowflake_Type"] = None,
options: List[dict] = None,
scopes: List["Snowflake_Type"] | None = None,
options: List[dict] | None = None,
nsfw: bool = False,
) -> Callable[[AsyncCallable], SlashCommand]:
"""
Expand Down Expand Up @@ -1190,7 +1190,7 @@ def slash_option(
opt_type: Union[OptionType, int],
required: bool = False,
autocomplete: bool = False,
choices: List[Union[SlashCommandChoice, dict]] = None,
choices: List[Union[SlashCommandChoice, dict]] | None = None,
channel_types: Optional[list[Union[ChannelType, int]]] = None,
min_value: Optional[float] = None,
max_value: Optional[float] = None,
Expand Down

0 comments on commit a964de1

Please sign in to comment.