Skip to content

Commit 3a05630

Browse files
committed
Ruff formatting
1 parent 2a09512 commit 3a05630

39 files changed

+506
-506
lines changed

twitchio/assets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Asset:
7474
+-------------+-------------------------------------------+-----------------------------------------------+
7575
"""
7676

77-
__slots__ = ("_http", "_ext", "_dimensions", "_original_url", "_url", "_name")
77+
__slots__ = ("_dimensions", "_ext", "_http", "_name", "_original_url", "_url")
7878

7979
def __init__(
8080
self,

twitchio/authentication/payloads.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333

3434

3535
__all__ = (
36-
"RefreshTokenPayload",
37-
"ValidateTokenPayload",
36+
"AuthorizationURLPayload",
3837
"ClientCredentialsPayload",
38+
"RefreshTokenPayload",
3939
"UserTokenPayload",
40-
"AuthorizationURLPayload",
40+
"ValidateTokenPayload",
4141
)
4242

4343

@@ -58,7 +58,7 @@ def __len__(self) -> int:
5858

5959

6060
class RefreshTokenPayload(BasePayload):
61-
__slots__ = ("access_token", "refresh_token", "expires_in", "scope", "token_type")
61+
__slots__ = ("access_token", "expires_in", "refresh_token", "scope", "token_type")
6262

6363
def __init__(self, raw: RefreshTokenResponse, /) -> None:
6464
super().__init__(raw)
@@ -71,7 +71,7 @@ def __init__(self, raw: RefreshTokenResponse, /) -> None:
7171

7272

7373
class ValidateTokenPayload(BasePayload):
74-
__slots__ = ("client_id", "login", "scopes", "user_id", "expires_in")
74+
__slots__ = ("client_id", "expires_in", "login", "scopes", "user_id")
7575

7676
def __init__(self, raw: ValidateTokenResponse, /) -> None:
7777
super().__init__(raw)
@@ -84,7 +84,7 @@ def __init__(self, raw: ValidateTokenResponse, /) -> None:
8484

8585

8686
class UserTokenPayload(BasePayload):
87-
__slots__ = ("access_token", "refresh_token", "expires_in", "scope", "token_type")
87+
__slots__ = ("access_token", "expires_in", "refresh_token", "scope", "token_type")
8888

8989
def __init__(self, raw: UserTokenResponse, /) -> None:
9090
super().__init__(raw)
@@ -108,7 +108,7 @@ def __init__(self, raw: ClientCredentialsResponse, /) -> None:
108108

109109

110110
class AuthorizationURLPayload(BasePayload):
111-
__slots__ = ("url", "client_id", "redirect_uri", "response_type", "scopes", "force_verify", "state")
111+
__slots__ = ("client_id", "force_verify", "redirect_uri", "response_type", "scopes", "state", "url")
112112

113113
def __init__(self, raw: AuthorizationURLResponse, /) -> None:
114114
super().__init__(raw)

twitchio/eventsub/enums.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626

2727

2828
__all__ = (
29-
"TransportMethod",
30-
"ShardStatus",
3129
"CloseCode",
3230
"MessageType",
33-
"SubscriptionType",
3431
"RevocationReason",
32+
"ShardStatus",
33+
"SubscriptionType",
34+
"TransportMethod",
3535
)
3636

3737

twitchio/eventsub/subscriptions.py

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -35,78 +35,78 @@
3535

3636

3737
__all__ = (
38-
"SubscriptionPayload",
38+
"AdBreakBeginSubscription",
3939
"AutomodMessageHoldSubscription",
4040
"AutomodMessageUpdateSubscription",
4141
"AutomodSettingsUpdateSubscription",
4242
"AutomodTermsUpdateSubscription",
43-
"ChannelUpdateSubscription",
44-
"ChannelFollowSubscription",
45-
"AdBreakBeginSubscription",
46-
"ChatClearSubscription",
47-
"ChatClearUserMessagesSubscription",
48-
"ChatMessageSubscription",
49-
"ChatNotificationSubscription",
50-
"ChatMessageDeleteSubscription",
51-
"ChatSettingsUpdateSubscription",
52-
"ChatUserMessageHoldSubscription",
53-
"ChatUserMessageUpdateSubscription",
54-
"ChannelSubscribeSubscription",
55-
"ChannelSubscriptionEndSubscription",
56-
"ChannelSubscriptionGiftSubscription",
57-
"ChannelSubscribeMessageSubscription",
58-
"ChannelCheerSubscription",
59-
"ChannelRaidSubscription",
6043
"ChannelBanSubscription",
61-
"ChannelUnbanSubscription",
62-
"ChannelUnbanRequestSubscription",
63-
"ChannelUnbanRequestResolveSubscription",
44+
"ChannelCheerSubscription",
45+
"ChannelFollowSubscription",
6446
"ChannelModerateSubscription",
6547
"ChannelModerateV2Subscription",
6648
"ChannelModeratorAddSubscription",
6749
"ChannelModeratorRemoveSubscription",
6850
"ChannelPointsAutoRedeemSubscription",
69-
"ChannelVIPAddSubscription",
70-
"ChannelVIPRemoveSubscription",
71-
"ChannelWarningAcknowledgementSubscription",
72-
"ChannelWarningSendSubscription",
73-
"ChannelPointsRewardAddSubscription",
74-
"ChannelPointsRewardUpdateSubscription",
75-
"ChannelPointsRewardRemoveSubscription",
7651
"ChannelPointsRedeemAddSubscription",
7752
"ChannelPointsRedeemUpdateSubscription",
53+
"ChannelPointsRewardAddSubscription",
54+
"ChannelPointsRewardRemoveSubscription",
55+
"ChannelPointsRewardUpdateSubscription",
7856
"ChannelPollBeginSubscription",
79-
"ChannelPollProgressSubscription",
8057
"ChannelPollEndSubscription",
81-
"SuspiciousUserUpdateSubscription",
82-
"SuspiciousUserMessageSubscription",
58+
"ChannelPollProgressSubscription",
59+
"ChannelPredictionBeginSubscription",
60+
"ChannelPredictionEndSubscription",
61+
"ChannelPredictionLockSubscription",
62+
"ChannelPredictionProgressSubscription",
63+
"ChannelRaidSubscription",
64+
"ChannelSubscribeMessageSubscription",
65+
"ChannelSubscribeSubscription",
66+
"ChannelSubscriptionEndSubscription",
67+
"ChannelSubscriptionGiftSubscription",
68+
"ChannelUnbanRequestResolveSubscription",
69+
"ChannelUnbanRequestSubscription",
70+
"ChannelUnbanSubscription",
71+
"ChannelUpdateSubscription",
72+
"ChannelVIPAddSubscription",
73+
"ChannelVIPRemoveSubscription",
74+
"ChannelWarningAcknowledgementSubscription",
75+
"ChannelWarningSendSubscription",
76+
"CharityCampaignProgressSubscription",
77+
"CharityCampaignStartSubscription",
78+
"CharityCampaignStopSubscription",
79+
"CharityDonationSubscription",
80+
"ChatClearSubscription",
81+
"ChatClearUserMessagesSubscription",
82+
"ChatMessageDeleteSubscription",
83+
"ChatMessageSubscription",
84+
"ChatNotificationSubscription",
85+
"ChatSettingsUpdateSubscription",
86+
"ChatUserMessageHoldSubscription",
87+
"ChatUserMessageUpdateSubscription",
8388
"GoalBeginSubscription",
84-
"GoalProgressSubscription",
8589
"GoalEndSubscription",
90+
"GoalProgressSubscription",
8691
"HypeTrainBeginSubscription",
87-
"HypeTrainProgressSubscription",
8892
"HypeTrainEndSubscription",
93+
"HypeTrainProgressSubscription",
94+
"SharedChatSessionBeginSubscription",
95+
"SharedChatSessionEndSubscription",
96+
"SharedChatSessionUpdateSubscription",
8997
"ShieldModeBeginSubscription",
9098
"ShieldModeEndSubscription",
9199
"ShoutoutCreateSubscription",
92100
"ShoutoutReceiveSubscription",
93-
"StreamOnlineSubscription",
94101
"StreamOfflineSubscription",
102+
"StreamOnlineSubscription",
103+
"SubscriptionPayload",
104+
"SuspiciousUserMessageSubscription",
105+
"SuspiciousUserUpdateSubscription",
95106
"UserAuthorizationGrantSubscription",
96107
"UserAuthorizationRevokeSubscription",
97108
"UserUpdateSubscription",
98109
"WhisperReceivedSubscription",
99-
"CharityDonationSubscription",
100-
"CharityCampaignStartSubscription",
101-
"CharityCampaignProgressSubscription",
102-
"CharityCampaignStopSubscription",
103-
"ChannelPredictionBeginSubscription",
104-
"ChannelPredictionLockSubscription",
105-
"ChannelPredictionProgressSubscription",
106-
"ChannelPredictionEndSubscription",
107-
"SharedChatSessionBeginSubscription",
108-
"SharedChatSessionEndSubscription",
109-
"SharedChatSessionUpdateSubscription",
110110
)
111111

112112

@@ -136,18 +136,18 @@ class SubscriptionPayload(abc.ABC):
136136
version: ClassVar[Any]
137137

138138
__slots__ = (
139+
"broadcaster_id",
139140
"broadcaster_user_id",
140-
"moderator_user_id",
141-
"user_id",
142141
"campaign_id",
143142
"category_id",
144-
"organization_id",
145143
"client_id",
146144
"conduit_id",
147-
"reward_id",
148145
"from_broadcaster_user_id",
146+
"moderator_user_id",
147+
"organization_id",
148+
"reward_id",
149149
"to_broadcaster_user_id",
150-
"broadcaster_id",
150+
"user_id",
151151
)
152152

153153
def __init__(self, **condition: Unpack[Condition]) -> None:

twitchio/eventsub/websockets.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,25 @@
6666

6767
class Websocket:
6868
__slots__ = (
69-
"_keep_alive_timeout",
69+
"__subscription_cost",
70+
"_backoff",
71+
"_client",
72+
"_closed",
73+
"_connecting",
74+
"_connection_tasks",
7075
"_heartbeat",
71-
"_last_keepalive",
76+
"_http",
7277
"_keep_alive_task",
73-
"_session_id",
74-
"_socket",
78+
"_keep_alive_timeout",
79+
"_last_keepalive",
7580
"_listen_task",
81+
"_original_attempts",
7682
"_ready",
7783
"_reconnect_attempts",
78-
"_backoff",
79-
"__subscription_cost",
80-
"_client",
81-
"_token_for",
82-
"_http",
84+
"_session_id",
85+
"_socket",
8386
"_subscriptions",
84-
"_closed",
85-
"_connecting",
86-
"_original_attempts",
87-
"_connection_tasks",
87+
"_token_for",
8888
)
8989

9090
def __init__(

twitchio/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from typing import TYPE_CHECKING, Any
2828

2929

30-
__all__ = ("TwitchioException", "HTTPException", "WebsocketConnectionException", "MessageRejectedError")
30+
__all__ = ("HTTPException", "MessageRejectedError", "TwitchioException", "WebsocketConnectionException")
3131

3232

3333
if TYPE_CHECKING:

twitchio/ext/commands/cooldowns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
from .context import Context
3939

4040

41-
__all__ = ("BaseCooldown", "Cooldown", "GCRACooldown", "BucketType", "Bucket")
41+
__all__ = ("BaseCooldown", "Bucket", "BucketType", "Cooldown", "GCRACooldown")
4242

4343

4444
PT = TypeVar("PT")

twitchio/ext/commands/core.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@
4141

4242

4343
__all__ = (
44-
"CommandErrorPayload",
4544
"Command",
46-
"Mixin",
45+
"CommandErrorPayload",
4746
"Group",
47+
"Mixin",
4848
"command",
49+
"cooldown",
4950
"group",
5051
"guard",
51-
"is_owner",
52-
"is_staff",
5352
"is_broadcaster",
53+
"is_elevated",
5454
"is_moderator",
55+
"is_owner",
56+
"is_staff",
5557
"is_vip",
56-
"is_elevated",
57-
"cooldown",
5858
)
5959

6060

@@ -775,7 +775,7 @@ async def _invoke(self, context: Context) -> None:
775775
context._invoked_with = f"{context._invoked_with} {trigger}"
776776
context._subcommand_trigger = trigger or None
777777

778-
if not trigger or not next_ and self._invoke_fallback:
778+
if not trigger or (not next_ and self._invoke_fallback):
779779
view.undo()
780780
await super()._invoke(context=context)
781781

twitchio/ext/commands/exceptions.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@
3131

3232

3333
__all__ = (
34+
"ArgumentError",
35+
"BadArgument",
3436
"CommandError",
35-
"ComponentLoadError",
36-
"CommandInvokeError",
37+
"CommandExistsError",
3738
"CommandHookError",
39+
"CommandInvokeError",
3840
"CommandNotFound",
39-
"CommandExistsError",
40-
"PrefixError",
41-
"InputError",
42-
"ArgumentError",
43-
"GuardFailure",
41+
"CommandOnCooldown",
42+
"ComponentLoadError",
4443
"ConversionError",
45-
"BadArgument",
44+
"GuardFailure",
45+
"InputError",
4646
"MissingRequiredArgument",
4747
"ModuleAlreadyLoadedError",
4848
"ModuleLoadFailure",
4949
"ModuleNotLoadedError",
5050
"NoEntryPointError",
51-
"CommandOnCooldown",
51+
"PrefixError",
5252
)
5353

5454

0 commit comments

Comments
 (0)