Skip to content

Commit e07d0d9

Browse files
chore(pre-commit): pre-commit autoupdate (#2336)
* chore(pre-commit): pre-commit autoupdate updates: - [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1) * style(pre-commit): auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8a7ea47 commit e07d0d9

Some content is hidden

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

57 files changed

+163
-187
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
hooks:
2929
- id: isort
3030
- repo: https://github.com/psf/black
31-
rev: 23.12.1
31+
rev: 24.1.1
3232
hooks:
3333
- id: black
3434
args: [--safe, --quiet]

discord/_typed_dict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2222
DEALINGS IN THE SOFTWARE.
2323
"""
24+
2425
import sys
2526

2627
# PEP 655 Required and NotRequired were added in python 3.11. This file is simply a

discord/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2323
DEALINGS IN THE SOFTWARE.
2424
"""
25+
2526
from __future__ import annotations
2627

2728
import datetime

discord/abc.py

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ class GuildChannel:
341341

342342
def __init__(
343343
self, *, state: ConnectionState, guild: Guild, data: dict[str, Any]
344-
):
345-
...
344+
): ...
346345

347346
def __str__(self) -> str:
348347
return self.name
@@ -526,9 +525,9 @@ async def _edit(
526525
"default_reaction_emoji must be of type: Emoji | int | str"
527526
)
528527

529-
options[
530-
"default_reaction_emoji"
531-
] = default_reaction_emoji._to_forum_reaction_payload()
528+
options["default_reaction_emoji"] = (
529+
default_reaction_emoji._to_forum_reaction_payload()
530+
)
532531

533532
if options:
534533
return await self._state.http.edit_channel(
@@ -853,8 +852,7 @@ async def set_permissions(
853852
*,
854853
overwrite: PermissionOverwrite | None = ...,
855854
reason: str | None = ...,
856-
) -> None:
857-
...
855+
) -> None: ...
858856

859857
@overload
860858
async def set_permissions(
@@ -863,8 +861,7 @@ async def set_permissions(
863861
*,
864862
reason: str | None = ...,
865863
**permissions: bool,
866-
) -> None:
867-
...
864+
) -> None: ...
868865

869866
async def set_permissions(
870867
self, target, *, overwrite=MISSING, reason=None, **permissions
@@ -1033,8 +1030,7 @@ async def move(
10331030
category: Snowflake | None = MISSING,
10341031
sync_permissions: bool = MISSING,
10351032
reason: str | None = MISSING,
1036-
) -> None:
1037-
...
1033+
) -> None: ...
10381034

10391035
@overload
10401036
async def move(
@@ -1045,8 +1041,7 @@ async def move(
10451041
category: Snowflake | None = MISSING,
10461042
sync_permissions: bool = MISSING,
10471043
reason: str = MISSING,
1048-
) -> None:
1049-
...
1044+
) -> None: ...
10501045

10511046
@overload
10521047
async def move(
@@ -1057,8 +1052,7 @@ async def move(
10571052
category: Snowflake | None = MISSING,
10581053
sync_permissions: bool = MISSING,
10591054
reason: str = MISSING,
1060-
) -> None:
1061-
...
1055+
) -> None: ...
10621056

10631057
@overload
10641058
async def move(
@@ -1069,8 +1063,7 @@ async def move(
10691063
category: Snowflake | None = MISSING,
10701064
sync_permissions: bool = MISSING,
10711065
reason: str = MISSING,
1072-
) -> None:
1073-
...
1066+
) -> None: ...
10741067

10751068
async def move(self, **kwargs) -> None:
10761069
"""|coro|
@@ -1359,8 +1352,7 @@ async def send(
13591352
view: View = ...,
13601353
suppress: bool = ...,
13611354
silent: bool = ...,
1362-
) -> Message:
1363-
...
1355+
) -> Message: ...
13641356

13651357
@overload
13661358
async def send(
@@ -1379,8 +1371,7 @@ async def send(
13791371
view: View = ...,
13801372
suppress: bool = ...,
13811373
silent: bool = ...,
1382-
) -> Message:
1383-
...
1374+
) -> Message: ...
13841375

13851376
@overload
13861377
async def send(
@@ -1399,8 +1390,7 @@ async def send(
13991390
view: View = ...,
14001391
suppress: bool = ...,
14011392
silent: bool = ...,
1402-
) -> Message:
1403-
...
1393+
) -> Message: ...
14041394

14051395
@overload
14061396
async def send(
@@ -1419,8 +1409,7 @@ async def send(
14191409
view: View = ...,
14201410
suppress: bool = ...,
14211411
silent: bool = ...,
1422-
) -> Message:
1423-
...
1412+
) -> Message: ...
14241413

14251414
async def send(
14261415
self,

discord/activity.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -843,13 +843,11 @@ def __repr__(self) -> str:
843843

844844

845845
@overload
846-
def create_activity(data: ActivityPayload) -> ActivityTypes:
847-
...
846+
def create_activity(data: ActivityPayload) -> ActivityTypes: ...
848847

849848

850849
@overload
851-
def create_activity(data: None) -> None:
852-
...
850+
def create_activity(data: None) -> None: ...
853851

854852

855853
def create_activity(data: ActivityPayload | None) -> ActivityTypes | None:

discord/audit_logs.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,9 @@ def __repr__(self) -> str:
222222

223223
if TYPE_CHECKING:
224224

225-
def __getattr__(self, item: str) -> Any:
226-
...
225+
def __getattr__(self, item: str) -> Any: ...
227226

228-
def __setattr__(self, key: str, value: Any) -> Any:
229-
...
227+
def __setattr__(self, key: str, value: Any) -> Any: ...
230228

231229

232230
Transformer = Callable[["AuditLogEntry", Any], Any]

discord/backoff.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,13 @@ def __init__(self, base: int = 1, *, integral: T = False):
7171
self._randfunc: Callable[..., int | float] = rand.randrange if integral else rand.uniform # type: ignore
7272

7373
@overload
74-
def delay(self: ExponentialBackoff[Literal[False]]) -> float:
75-
...
74+
def delay(self: ExponentialBackoff[Literal[False]]) -> float: ...
7675

7776
@overload
78-
def delay(self: ExponentialBackoff[Literal[True]]) -> int:
79-
...
77+
def delay(self: ExponentialBackoff[Literal[True]]) -> int: ...
8078

8179
@overload
82-
def delay(self: ExponentialBackoff[bool]) -> int | float:
83-
...
80+
def delay(self: ExponentialBackoff[bool]) -> int | float: ...
8481

8582
def delay(self) -> int | float:
8683
"""Compute the next delay

discord/bot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,8 +1137,7 @@ async def invoke_application_command(self, ctx: ApplicationContext) -> None:
11371137

11381138
@property
11391139
@abstractmethod
1140-
def _bot(self) -> Bot | AutoShardedBot:
1141-
...
1140+
def _bot(self) -> Bot | AutoShardedBot: ...
11421141

11431142

11441143
class BotBase(ApplicationCommandMixin, CogMixin, ABC):

discord/channel.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -780,12 +780,10 @@ async def edit(
780780
default_thread_slowmode_delay: int = ...,
781781
type: ChannelType = ...,
782782
overwrites: Mapping[Role | Member | Snowflake, PermissionOverwrite] = ...,
783-
) -> TextChannel | None:
784-
...
783+
) -> TextChannel | None: ...
785784

786785
@overload
787-
async def edit(self) -> TextChannel | None:
788-
...
786+
async def edit(self) -> TextChannel | None: ...
789787

790788
async def edit(self, *, reason=None, **options):
791789
"""|coro|
@@ -1090,12 +1088,10 @@ async def edit(
10901088
available_tags: list[ForumTag] = ...,
10911089
require_tag: bool = ...,
10921090
overwrites: Mapping[Role | Member | Snowflake, PermissionOverwrite] = ...,
1093-
) -> ForumChannel | None:
1094-
...
1091+
) -> ForumChannel | None: ...
10951092

10961093
@overload
1097-
async def edit(self) -> ForumChannel | None:
1098-
...
1094+
async def edit(self) -> ForumChannel | None: ...
10991095

11001096
async def edit(self, *, reason=None, **options):
11011097
"""|coro|
@@ -1834,12 +1830,10 @@ async def edit(
18341830
video_quality_mode: VideoQualityMode = ...,
18351831
slowmode_delay: int = ...,
18361832
reason: str | None = ...,
1837-
) -> VoiceChannel | None:
1838-
...
1833+
) -> VoiceChannel | None: ...
18391834

18401835
@overload
1841-
async def edit(self) -> VoiceChannel | None:
1842-
...
1836+
async def edit(self) -> VoiceChannel | None: ...
18431837

18441838
async def edit(self, *, reason=None, **options):
18451839
"""|coro|
@@ -2459,12 +2453,10 @@ async def edit(
24592453
rtc_region: VoiceRegion | None = ...,
24602454
video_quality_mode: VideoQualityMode = ...,
24612455
reason: str | None = ...,
2462-
) -> StageChannel | None:
2463-
...
2456+
) -> StageChannel | None: ...
24642457

24652458
@overload
2466-
async def edit(self) -> StageChannel | None:
2467-
...
2459+
async def edit(self) -> StageChannel | None: ...
24682460

24692461
async def edit(self, *, reason=None, **options):
24702462
"""|coro|
@@ -2638,12 +2630,10 @@ async def edit(
26382630
nsfw: bool = ...,
26392631
overwrites: Mapping[Role | Member, PermissionOverwrite] = ...,
26402632
reason: str | None = ...,
2641-
) -> CategoryChannel | None:
2642-
...
2633+
) -> CategoryChannel | None: ...
26432634

26442635
@overload
2645-
async def edit(self) -> CategoryChannel | None:
2646-
...
2636+
async def edit(self) -> CategoryChannel | None: ...
26472637

26482638
async def edit(self, *, reason=None, **options):
26492639
"""|coro|

discord/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ def __init__(
218218
self.loop: asyncio.AbstractEventLoop = (
219219
asyncio.get_event_loop() if loop is None else loop
220220
)
221-
self._listeners: dict[
222-
str, list[tuple[asyncio.Future, Callable[..., bool]]]
223-
] = {}
221+
self._listeners: dict[str, list[tuple[asyncio.Future, Callable[..., bool]]]] = (
222+
{}
223+
)
224224
self.shard_id: int | None = options.get("shard_id")
225225
self.shard_count: int | None = options.get("shard_count")
226226

0 commit comments

Comments
 (0)