Skip to content

Commit d3283ce

Browse files
ci: correct from checks.
1 parent cc5c0f4 commit d3283ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+376
-106
lines changed

interactions/api/events/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ async def some_func(self, event):
5959
```
6060
Returns:
6161
A listener object.
62+
6263
"""
6364
listener = models.Listener.create(cls().resolved_name)(coro)
6465
client.add_listener(listener)

interactions/api/events/internal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ async def an_event_handler(event: ChannelCreate):
1919
While all of these events are documented, not all of them are used, currently.
2020
2121
"""
22+
2223
import re
2324
import typing
2425
from typing import Any, Optional, TYPE_CHECKING, Type

interactions/api/gateway/gateway.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Outlines the interaction between interactions and Discord's Gateway API."""
2+
23
import asyncio
34
import logging
45
import sys

interactions/api/gateway/state.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def wrapped_logger(self, level: int, message: str, **kwargs) -> None:
138138
level: The logging level
139139
message: The message to log
140140
**kwargs: Any additional keyword arguments that Logger.log accepts
141+
141142
"""
142143
self.logger.log(level, f"Shard ID {self.shard_id} | {message}", **kwargs)
143144

interactions/api/gateway/websocket.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,10 @@ async def _start_bee_gees(self) -> None:
315315
return
316316

317317
@abstractmethod
318-
async def _identify(self) -> None:
319-
...
318+
async def _identify(self) -> None: ...
320319

321320
@abstractmethod
322-
async def _resume_connection(self) -> None:
323-
...
321+
async def _resume_connection(self) -> None: ...
324322

325323
@abstractmethod
326324
async def send_heartbeat(self) -> None:

interactions/api/http/http_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This file handles the interaction with discords http endpoints."""
2+
23
import asyncio
34
import inspect
45
import os
@@ -79,6 +80,7 @@ def set_reset_time(self, delta: float) -> None:
7980
8081
Args:
8182
delta: The time to wait before resetting the calls.
83+
8284
"""
8385
self._reset_time = time.perf_counter() + delta
8486
self._calls = 0
@@ -133,6 +135,7 @@ def ingest_ratelimit_header(self, header: CIMultiDictProxy) -> None:
133135
header: The header to ingest, containing rate limit information.
134136
135137
Updates the bucket_hash, limit, remaining, and delta attributes with the information from the header.
138+
136139
"""
137140
self.bucket_hash = header.get("x-ratelimit-bucket")
138141
self.limit = int(header.get("x-ratelimit-limit", self.DEFAULT_LIMIT))
@@ -178,6 +181,7 @@ async def lock_for_duration(self, duration: float, block: bool = False) -> None:
178181
179182
Raises:
180183
RuntimeError: If the bucket is already locked.
184+
181185
"""
182186
if self._lock.locked():
183187
raise RuntimeError("Attempted to lock a bucket that is already locked.")
@@ -253,6 +257,7 @@ def get_ratelimit(self, route: Route) -> BucketLock:
253257
254258
Returns:
255259
The BucketLock object for this route
260+
256261
"""
257262
if bucket_hash := self._endpoints.get(route.rl_bucket):
258263
if lock := self.ratelimit_locks.get(bucket_hash):
@@ -270,6 +275,7 @@ def ingest_ratelimit(self, route: Route, header: CIMultiDictProxy, bucket_lock:
270275
route: The route we're ingesting ratelimit for
271276
header: The rate limit header in question
272277
bucket_lock: The rate limit bucket for this route
278+
273279
"""
274280
bucket_lock.ingest_ratelimit_header(header)
275281

@@ -292,6 +298,7 @@ def _process_payload(
292298
293299
Returns:
294300
Either a dictionary or multipart data form
301+
295302
"""
296303
if isinstance(payload, FormData):
297304
return payload
@@ -481,6 +488,7 @@ def log_ratelimit(self, log_func: Callable, message: str) -> None:
481488
Args:
482489
log_func: The logging function to use
483490
message: The message to log
491+
484492
"""
485493
if self.show_ratelimit_traceback:
486494
if frame := next(

interactions/api/http/http_requests/channels.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ async def get_channel_messages(
4141
self,
4242
channel_id: "Snowflake_Type",
4343
limit: int = 50,
44-
) -> list[discord_typings.MessageData]:
45-
...
44+
) -> list[discord_typings.MessageData]: ...
4645

4746
@overload
4847
async def get_channel_messages(
@@ -51,8 +50,7 @@ async def get_channel_messages(
5150
limit: int = 50,
5251
*,
5352
around: "Snowflake_Type | None" = None,
54-
) -> list[discord_typings.MessageData]:
55-
...
53+
) -> list[discord_typings.MessageData]: ...
5654

5755
@overload
5856
async def get_channel_messages(
@@ -61,8 +59,7 @@ async def get_channel_messages(
6159
limit: int = 50,
6260
*,
6361
before: "Snowflake_Type | None" = None,
64-
) -> list[discord_typings.MessageData]:
65-
...
62+
) -> list[discord_typings.MessageData]: ...
6663

6764
@overload
6865
async def get_channel_messages(
@@ -71,8 +68,7 @@ async def get_channel_messages(
7168
limit: int = 50,
7269
*,
7370
after: "Snowflake_Type | None" = None,
74-
) -> list[discord_typings.MessageData]:
75-
...
71+
) -> list[discord_typings.MessageData]: ...
7672

7773
async def get_channel_messages(
7874
self,
@@ -263,8 +259,7 @@ async def create_channel_invite(
263259
unique: bool = False,
264260
*,
265261
reason: str | None = None,
266-
) -> discord_typings.InviteData:
267-
...
262+
) -> discord_typings.InviteData: ...
268263

269264
@overload
270265
async def create_channel_invite(
@@ -277,8 +272,7 @@ async def create_channel_invite(
277272
*,
278273
target_user_id: "Snowflake_Type | None" = None,
279274
reason: str | None = None,
280-
) -> discord_typings.InviteData:
281-
...
275+
) -> discord_typings.InviteData: ...
282276

283277
@overload
284278
async def create_channel_invite(
@@ -291,8 +285,7 @@ async def create_channel_invite(
291285
*,
292286
target_application_id: "Snowflake_Type | None" = None,
293287
reason: str | None = None,
294-
) -> discord_typings.InviteData:
295-
...
288+
) -> discord_typings.InviteData: ...
296289

297290
async def create_channel_invite(
298291
self,
@@ -598,6 +591,7 @@ async def create_tag(
598591
!!! note
599592
Can either have an `emoji_id` or an `emoji_name`, but not both.
600593
`emoji_id` is meant for custom emojis, `emoji_name` is meant for unicode emojis.
594+
601595
"""
602596
payload: PAYLOAD_TYPE = {
603597
"name": name,
@@ -632,6 +626,7 @@ async def edit_tag(
632626
!!! note
633627
Can either have an `emoji_id` or an `emoji_name`, but not both.
634628
emoji`_id is meant for custom emojis, `emoji_name` is meant for unicode emojis.
629+
635630
"""
636631
payload: PAYLOAD_TYPE = {
637632
"name": name,
@@ -652,6 +647,7 @@ async def delete_tag(self, channel_id: "Snowflake_Type", tag_id: "Snowflake_Type
652647
Args:
653648
channel_id: The ID of the forum channel to delete tag it.
654649
tag_id: The ID of the tag to delete
650+
655651
"""
656652
result = await self.request(
657653
Route("DELETE", "/channels/{channel_id}/tags/{tag_id}", channel_id=channel_id, tag_id=tag_id)

interactions/api/http/http_requests/guild.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ async def get_guild_channels(
637637
638638
Returns:
639639
A list of channels in this guild. Does not include threads.
640+
640641
"""
641642
result = await self.request(Route("GET", "/guilds/{guild_id}/channels", guild_id=guild_id))
642643
return cast(list[discord_typings.ChannelData], result)
@@ -927,6 +928,7 @@ async def get_auto_moderation_rules(
927928
928929
Returns:
929930
A list of auto moderation rules
931+
930932
"""
931933
result = await self.request(Route("GET", "/guilds/{guild_id}/auto-moderation/rules", guild_id=guild_id))
932934
return cast(list[dict], result)
@@ -943,6 +945,7 @@ async def get_auto_moderation_rule(
943945
944946
Returns:
945947
The auto moderation rule
948+
946949
"""
947950
result = await self.request(
948951
Route("GET", "/guilds/{guild_id}/auto-moderation/rules/{rule_id}", guild_id=guild_id, rule_id=rule_id)
@@ -961,6 +964,7 @@ async def create_auto_moderation_rule(
961964
962965
Returns:
963966
The created auto moderation rule
967+
964968
"""
965969
result = await self.request(
966970
Route("POST", "/guilds/{guild_id}/auto-moderation/rules", guild_id=guild_id), payload=payload
@@ -999,6 +1003,7 @@ async def modify_auto_moderation_rule(
9991003
10001004
Returns:
10011005
The updated rule object
1006+
10021007
"""
10031008
payload = {
10041009
"name": name,
@@ -1029,6 +1034,7 @@ async def delete_auto_moderation_rule(
10291034
guild_id: The ID of the guild to delete this rule from
10301035
rule_id: The ID of the role to delete
10311036
reason: The reason for deleting this rule
1037+
10321038
"""
10331039
result = await self.request(
10341040
Route("DELETE", "/guilds/{guild_id}/auto-moderation/rules/{rule_id}", guild_id=guild_id, rule_id=rule_id),

interactions/api/http/http_requests/interactions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ async def create_application_command(
117117
118118
Returns:
119119
An application command object
120+
120121
"""
121122
if guild_id == GLOBAL_SCOPE:
122123
result = await self.request(

interactions/api/http/http_requests/threads.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ async def create_forum_thread(
249249
250250
Returns:
251251
The created thread object
252+
252253
"""
253254
return await self.request(
254255
Route("POST", "/channels/{channel_id}/threads", channel_id=channel_id),

0 commit comments

Comments
 (0)