|
110 | 110 | ) |
111 | 111 |
|
112 | 112 |
|
| 113 | +# Short names: Only map names that require shortening... |
| 114 | +_SUB_MAPPING: dict[str, str] = { |
| 115 | + "channel.ad_break.begin": "ad_break", |
| 116 | + "channel.chat.clear_user_messages": "chat_clear_user", |
| 117 | + "channel.chat.message": "message", # Sub events? |
| 118 | + "channel.chat.message_delete": "message_delete", |
| 119 | + "channel.unban_request.create": "unban_request", |
| 120 | + "channel.channel_points_automatic_reward_redemption.add": "automatic_redemption_add", |
| 121 | + "channel.channel_points_custom_reward.add": "custom_reward_add", |
| 122 | + "channel.channel_points_custom_reward.update": "custom_reward_update", |
| 123 | + "channel.channel_points_custom_reward.remove": "custom_reward_remove", |
| 124 | + "channel.channel_points_custom_reward_redemption.add": "custom_redemption_add", |
| 125 | + "channel.channel_points_custom_reward_redemption.update": "custom_redemption_update", |
| 126 | + "user.whisper.message": "message_whisper", |
| 127 | + "channel.subscribe": "subscription", |
| 128 | + "channel.moderate": "mod_action", # Sub events? |
| 129 | + "channel.hype_train.begin": "hype_train", |
| 130 | +} |
| 131 | + |
| 132 | + |
113 | 133 | class SubscriptionPayload(abc.ABC): |
114 | 134 | type: ClassVar[Any] |
115 | 135 | version: ClassVar[Any] |
@@ -1240,7 +1260,8 @@ def condition(self) -> Condition: |
1240 | 1260 |
|
1241 | 1261 |
|
1242 | 1262 | class ChannelModerateSubscription(SubscriptionPayload): |
1243 | | - """The ``channel.moderate subscription`` type sends a notification when a moderator performs a moderation action in a channel. Some of these actions affect chatters in other channels during Shared Chat. |
| 1263 | + """The ``channel.moderate`` subscription type sends a notification when a moderator performs a moderation action in a channel. |
| 1264 | + Some of these actions affect chatters in other channels during Shared Chat. |
1244 | 1265 |
|
1245 | 1266 | This is Version 1 of the subscription. |
1246 | 1267 |
|
@@ -1290,7 +1311,8 @@ def condition(self) -> Condition: |
1290 | 1311 |
|
1291 | 1312 |
|
1292 | 1313 | class ChannelModerateV2Subscription(SubscriptionPayload): |
1293 | | - """The ``channel.moderate subscription`` type sends a notification when a moderator performs a moderation action in a channel. Some of these actions affect chatters in other channels during Shared Chat. |
| 1314 | + """The ``channel.moderate`` subscription type sends a notification when a moderator performs a moderation action in a channel. |
| 1315 | + Some of these actions affect chatters in other channels during Shared Chat. |
1294 | 1316 |
|
1295 | 1317 | This is Version 2 of the subscription that includes warnings. |
1296 | 1318 |
|
@@ -2076,7 +2098,8 @@ def condition(self) -> Condition: |
2076 | 2098 |
|
2077 | 2099 |
|
2078 | 2100 | class ChannelWarningAcknowledgementSubscription(SubscriptionPayload): |
2079 | | - """The ``channel.warning.acknowledge`` subscription type sends a notification when a warning is acknowledged by a user. Broadcasters and moderators can see the warning's details. |
| 2101 | + """The ``channel.warning.acknowledge`` subscription type sends a notification when a warning is acknowledged by a user. |
| 2102 | + Broadcasters and moderators can see the warning's details. |
2080 | 2103 |
|
2081 | 2104 | .. important:: |
2082 | 2105 | Must have the ``moderator:read:warnings`` or ``moderator:manage:warnings`` scope. |
@@ -2116,7 +2139,8 @@ def condition(self) -> Condition: |
2116 | 2139 |
|
2117 | 2140 |
|
2118 | 2141 | class ChannelWarningSendSubscription(SubscriptionPayload): |
2119 | | - """The ``channel.warning.send`` subscription type sends a notification when a warning is sent to a user. Broadcasters and moderators can see the warning's details. |
| 2142 | + """The ``channel.warning.send`` subscription type sends a notification when a warning is sent to a user. |
| 2143 | + Broadcasters and moderators can see the warning's details. |
2120 | 2144 |
|
2121 | 2145 | .. important:: |
2122 | 2146 | Must have the ``moderator:read:warnings`` or ``moderator:manage:warnings`` scope. |
@@ -2352,7 +2376,8 @@ def condition(self) -> Condition: |
2352 | 2376 |
|
2353 | 2377 |
|
2354 | 2378 | class GoalProgressSubscription(SubscriptionPayload): |
2355 | | - """The ``channel.goal.progress`` subscription type sends a notification when progress is made towards the specified broadcaster's goal. Progress could be positive (added followers) or negative (lost followers). |
| 2379 | + """The ``channel.goal.progress`` subscription type sends a notification when progress is made towards the specified broadcaster's goal. |
| 2380 | + Progress could be positive (added followers) or negative (lost followers). |
2356 | 2381 |
|
2357 | 2382 | .. note:: |
2358 | 2383 | It's possible to receive the Progress events before receiving the Begin event. |
|
0 commit comments