twitch.py 3.2.4__tar.gz → 3.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. {twitch_py-3.2.4/twitch.py.egg-info → twitch_py-3.2.6}/PKG-INFO +3 -2
  2. {twitch_py-3.2.4 → twitch_py-3.2.6}/pyproject.toml +1 -0
  3. twitch_py-3.2.6/requirements.txt +1 -0
  4. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/__init__.py +1 -1
  5. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/client.py +0 -1
  6. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/http.py +2 -2
  7. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/channels.py +4 -2
  8. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/eventsub/interaction.py +7 -0
  9. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/eventsub/moderation.py +106 -44
  10. {twitch_py-3.2.4 → twitch_py-3.2.6/twitch.py.egg-info}/PKG-INFO +3 -2
  11. twitch_py-3.2.6/twitch.py.egg-info/requires.txt +1 -0
  12. twitch_py-3.2.4/requirements.txt +0 -1
  13. twitch_py-3.2.4/twitch.py.egg-info/requires.txt +0 -1
  14. {twitch_py-3.2.4 → twitch_py-3.2.6}/LICENSE +0 -0
  15. {twitch_py-3.2.4 → twitch_py-3.2.6}/MANIFEST.in +0 -0
  16. {twitch_py-3.2.4 → twitch_py-3.2.6}/README.md +0 -0
  17. {twitch_py-3.2.4 → twitch_py-3.2.6}/setup.cfg +0 -0
  18. {twitch_py-3.2.4 → twitch_py-3.2.6}/setup.py +0 -0
  19. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/channel.py +0 -0
  20. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/chat.py +0 -0
  21. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/errors.py +0 -0
  22. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/bot/__init__.py +0 -0
  23. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/bot/bot.py +0 -0
  24. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/oauth/__init__.py +0 -0
  25. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/oauth/enums.py +0 -0
  26. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/oauth/http.py +0 -0
  27. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/oauth/oauth.py +0 -0
  28. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/overlay/__init__.py +0 -0
  29. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/overlay/attachment.py +0 -0
  30. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/overlay/geteway.py +0 -0
  31. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/overlay/overlay.py +0 -0
  32. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/overlay/route.py +0 -0
  33. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/ext/overlay/template.py +0 -0
  34. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/gateway.py +0 -0
  35. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/py.typed +0 -0
  36. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/state.py +0 -0
  37. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/stream.py +0 -0
  38. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/__init__.py +0 -0
  39. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/activity.py +0 -0
  40. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/analytics.py +0 -0
  41. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/bits.py +0 -0
  42. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/chat.py +0 -0
  43. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/eventsub/__init__.py +0 -0
  44. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/eventsub/activity.py +0 -0
  45. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/eventsub/bits.py +0 -0
  46. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/eventsub/channels.py +0 -0
  47. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/eventsub/chat.py +0 -0
  48. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/eventsub/streams.py +0 -0
  49. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/eventsub/users.py +0 -0
  50. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/interaction.py +0 -0
  51. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/moderation.py +0 -0
  52. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/search.py +0 -0
  53. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/streams.py +0 -0
  54. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/types/users.py +0 -0
  55. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/user.py +0 -0
  56. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch/utils.py +0 -0
  57. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch.py.egg-info/SOURCES.txt +0 -0
  58. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch.py.egg-info/dependency_links.txt +0 -0
  59. {twitch_py-3.2.4 → twitch_py-3.2.6}/twitch.py.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: twitch.py
3
- Version: 3.2.4
3
+ Version: 3.2.6
4
4
  Summary: Real-time Twitch Event Handling and Helix API Integration in Python
5
5
  Author-email: Snifo <Snifo@mail.com>
6
6
  License: MIT
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
20
21
  Classifier: Topic :: Software Development :: Libraries
21
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
23
  Classifier: Topic :: Utilities
@@ -24,7 +25,7 @@ Classifier: Typing :: Typed
24
25
  Requires-Python: >=3.8.0
25
26
  Description-Content-Type: text/markdown
26
27
  License-File: LICENSE
27
- Requires-Dist: aiohttp>=3.8.0
28
+ Requires-Dist: aiohttp<4,>=3.7.4
28
29
 
29
30
  # twitch.py
30
31
 
@@ -20,6 +20,7 @@ classifiers = [
20
20
  "Programming Language :: Python :: 3.10",
21
21
  "Programming Language :: Python :: 3.11",
22
22
  "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
23
24
  "Topic :: Software Development :: Libraries",
24
25
  "Topic :: Software Development :: Libraries :: Python Modules",
25
26
  "Topic :: Utilities",
@@ -0,0 +1 @@
1
+ aiohttp>=3.7.4,<4
@@ -8,7 +8,7 @@ Real-time Twitch Event Handling and Helix API Integration in Python
8
8
  """
9
9
 
10
10
  __title__ = 'twitch.py'
11
- __version__ = '3.2.4'
11
+ __version__ = '3.2.6'
12
12
  __license__ = 'MIT License'
13
13
  __author__ = 'Snifo'
14
14
  __email__ = 'Snifo@mail.com'
@@ -478,7 +478,6 @@ class Client:
478
478
  Indicates whether to attempt reconnection if the WebSocket connection is lost.
479
479
  """
480
480
  kwargs: Dict[str, Any] = {'resume': False, 'initial': True}
481
-
482
481
  backoff = ExponentialBackoff()
483
482
 
484
483
  while not self.is_closed():
@@ -355,12 +355,12 @@ class HTTPClient:
355
355
  subscriptions: Dict[str, Dict[str, Any]] = {
356
356
  'automod_message_hold': {
357
357
  'name': 'automod.message.hold',
358
- 'version': '1',
358
+ 'version': '2',
359
359
  'condition': {'broadcaster': 'moderator_user_id', 'user': 'broadcaster_user_id'}
360
360
  },
361
361
  'automod_message_update': {
362
362
  'name': 'automod.message.update',
363
- 'version': '1',
363
+ 'version': '2',
364
364
  'condition': {'broadcaster': 'moderator_user_id', 'user': 'broadcaster_user_id'}
365
365
  },
366
366
  'automod_settings_update': {
@@ -38,12 +38,14 @@ class CCL(TypedDict):
38
38
 
39
39
  Attributes
40
40
  ----------
41
- id: Literal['DrugsIntoxication', 'SexualThemes', 'ViolentGraphic', 'Gambling', 'ProfanityVulgarity']
41
+ id: Literal['DebatedSocialIssuesAndPolitics', 'DrugsIntoxication', 'SexualThemes', 'ViolentGraphic', 'Gambling',
42
+ 'ProfanityVulgarity']
42
43
  The type of content classification.
43
44
  is_enabled: bool
44
45
  Indicates if the classification is enabled.
45
46
  """
46
- id: Literal['DrugsIntoxication', 'SexualThemes', 'ViolentGraphic', 'Gambling', 'ProfanityVulgarity']
47
+ id: Literal['DebatedSocialIssuesAndPolitics', 'DrugsIntoxication', 'SexualThemes', 'ViolentGraphic', 'Gambling',
48
+ 'ProfanityVulgarity']
47
49
  is_enabled: bool
48
50
 
49
51
 
@@ -499,6 +499,8 @@ class HypeTrainEvent(SpecificBroadcaster):
499
499
  A list of top contributions to the Hype Train.
500
500
  last_contribution: Contribution
501
501
  The most recent contribution to the Hype Train.
502
+ is_golden_kappa_train: bool
503
+ Indicates if the Hype Train is a Golden Kappa Train.
502
504
  started_at: str
503
505
  The timestamp when the Hype Train started, in ISO 8601 format.
504
506
  expires_at: str
@@ -510,10 +512,12 @@ class HypeTrainEvent(SpecificBroadcaster):
510
512
  goal: int
511
513
  top_contributions: List[Contribution]
512
514
  last_contribution: Contribution
515
+ is_golden_kappa_train: bool
513
516
  started_at: str
514
517
  expires_at: str
515
518
 
516
519
 
520
+
517
521
  class HypeTrainEndEvent(SpecificBroadcaster):
518
522
  """
519
523
  Represents an event where a Hype Train ends.
@@ -528,6 +532,8 @@ class HypeTrainEndEvent(SpecificBroadcaster):
528
532
  The total amount of contributions to the Hype Train.
529
533
  top_contributions: List[Contribution]
530
534
  A list of top contributions to the Hype Train.
535
+ is_golden_kappa_train: bool
536
+ Indicates if the Hype Train is a Golden Kappa Train.
531
537
  started_at: str
532
538
  The timestamp when the Hype Train started, in ISO 8601 format.
533
539
  ended_at: str
@@ -539,6 +545,7 @@ class HypeTrainEndEvent(SpecificBroadcaster):
539
545
  level: int
540
546
  total: int
541
547
  top_contributions: List[Contribution]
548
+ is_golden_kappa_train: bool
542
549
  started_at: str
543
550
  ended_at: str
544
551
  cooldown_ends_at: str
@@ -33,30 +33,27 @@ if TYPE_CHECKING:
33
33
 
34
34
  # AutoMod
35
35
  class Emote(TypedDict):
36
- """
37
- Represents an emote.
36
+ """Represents metadata pertaining to an emote.
38
37
 
39
38
  Attributes
40
39
  ----------
41
40
  id: str
42
- The ID of the emote.
41
+ An ID that uniquely identifies this emote.
43
42
  emote_set_id: str
44
- The ID of the emote set to which the emote belongs.
43
+ An ID that identifies the emote set that the emote belongs to.
45
44
  """
46
45
  id: str
47
46
  emote_set_id: str
48
47
 
49
-
50
48
  class Cheermote(TypedDict):
51
- """
52
- Represents a cheermote.
49
+ """Represents metadata pertaining to a cheermote.
53
50
 
54
51
  Attributes
55
52
  ----------
56
53
  prefix: str
57
- The prefix of the cheermote.
54
+ The name portion of the Cheermote string.
58
55
  bits: int
59
- The number of bits required to use the cheermote.
56
+ The amount of bits cheered.
60
57
  tier: int
61
58
  The tier level of the cheermote.
62
59
  """
@@ -64,89 +61,155 @@ class Cheermote(TypedDict):
64
61
  bits: int
65
62
  tier: int
66
63
 
67
-
68
64
  class Fragment(TypedDict):
69
- """
70
- Represents a fragment of a message that can be an emote or cheermote.
65
+ """Represents a fragment of a message, which can include text, emotes, or cheermotes.
71
66
 
72
67
  Attributes
73
68
  ----------
69
+ type: str
70
+ The type of the fragment: "text", "emote", or "cheermote".
74
71
  text: str
75
72
  The text content of the fragment.
76
73
  emote: Optional[Emote]
77
- The emote in the fragment, if any.
74
+ Metadata pertaining to the emote, if applicable.
78
75
  cheermote: Optional[Cheermote]
79
- The cheermote in the fragment, if any.
76
+ Metadata pertaining to the cheermote, if applicable.
80
77
  """
78
+ type: str
81
79
  text: str
82
80
  emote: Optional[Emote]
83
81
  cheermote: Optional[Cheermote]
84
82
 
85
-
86
83
  class Message(TypedDict):
87
- """
88
- Represents a message with its content and fragments.
84
+ """Represents a user message with its content and parsed fragments.
89
85
 
90
86
  Attributes
91
87
  ----------
92
88
  text: str
93
- The text content of the message.
89
+ The full text of the message.
94
90
  fragments: List[Fragment]
95
- A list of fragments in the message.
91
+ A list of fragments representing parts of the message.
96
92
  """
97
93
  text: str
98
94
  fragments: List[Fragment]
99
95
 
96
+ class Boundary(TypedDict):
97
+ """Defines boundaries for flagged portions of a message.
100
98
 
101
- class AutomodMessageHoldEvent(SpecificBroadcaster, SpecificUser):
99
+ Attributes
100
+ ----------
101
+ start_pos: int
102
+ The starting position of the boundary in the message text.
103
+ end_pos: int
104
+ The ending position of the boundary in the message text.
102
105
  """
103
- Represents an event where a message is held by AutoMod.
106
+ start_pos: int
107
+ end_pos: int
108
+
109
+ class Automod(TypedDict):
110
+ """Represents details about the AutoMod moderation decision.
111
+
112
+ Attributes
113
+ ----------
114
+ category: str
115
+ The category of the moderation, e.g., "aggressive".
116
+ level: int
117
+ The severity level of the moderation (1-4).
118
+ boundaries: List[Boundary]
119
+ A list of boundaries indicating flagged portions of the message.
120
+ """
121
+ category: str
122
+ level: int
123
+ boundaries: List[Boundary]
124
+
125
+ class TermBoundary(TypedDict):
126
+ """Defines the boundary of a blocked term.
127
+
128
+ Attributes
129
+ ----------
130
+ start_pos: int
131
+ Index in the message for the start of the problem (0 indexed, inclusive).
132
+ end_pos: int
133
+ Index in the message for the end of the problem (0 indexed, inclusive).
134
+ """
135
+ start_pos: int
136
+ end_pos: int
137
+
138
+ class BlockedTerm(TypedDict):
139
+ """Represents a blocked term found in a message.
140
+
141
+ Attributes
142
+ ----------
143
+ term_id: str
144
+ The ID of the blocked term found.
145
+ boundary: TermBoundary
146
+ The bounds of the text that caused the message to be flagged.
147
+ owner_broadcaster_user_id: str
148
+ The ID of the broadcaster that owns the blocked term.
149
+ owner_broadcaster_user_login: str
150
+ The login of the broadcaster that owns the blocked term.
151
+ owner_broadcaster_user_name: str
152
+ The username of the broadcaster that owns the blocked term.
153
+ """
154
+ term_id: str
155
+ boundary: TermBoundary
156
+ owner_broadcaster_user_id: str
157
+ owner_broadcaster_user_login: str
158
+ owner_broadcaster_user_name: str
159
+
160
+ class AutomodMessageHoldEvent(SpecificBroadcaster, SpecificUser):
161
+ """Represents an AutoMod event where a message is held for moderation.
104
162
 
105
163
  Attributes
106
164
  ----------
107
165
  message_id: str
108
166
  The ID of the held message.
109
167
  message: Message
110
- The details of the held message.
111
- category: str
112
- The category of the AutoMod action.
113
- level: int
114
- The moderation level of the AutoMod action.
168
+ The body of the held message.
115
169
  held_at: str
116
- The timestamp when the message was held, in ISO 8601 format.
170
+ The timestamp of when AutoMod saved the message.
171
+ reason: str
172
+ The reason the message was flagged (e.g., "automod", "blocked_term").
173
+ automod: Optional[Automod]
174
+ Details about the AutoMod moderation decision, if applicable.
175
+ blocked_term: Optional[List[BlockedTerm]]
176
+ Details about blocked terms found in the message, if applicable.
117
177
  """
118
178
  message_id: str
119
179
  message: Message
120
- category: str
121
- level: int
122
180
  held_at: str
181
+ reason: str
182
+ automod: Optional[Automod]
183
+ blocked_term: Optional[List[BlockedTerm]]
123
184
 
124
185
 
125
186
  class AutomodMessageUpdateEvent(SpecificBroadcaster, SpecificModerator, SpecificUser):
126
- """
127
- Represents an event where a held message is updated by AutoMod.
187
+ """Represents an event when AutoMod settings are updated.
128
188
 
129
189
  Attributes
130
190
  ----------
131
191
  message_id: str
132
- The ID of the updated message.
192
+ The ID of the message that was flagged by automod.
133
193
  message: Message
134
- The updated message details.
135
- category: str
136
- The category of the AutoMod action.
137
- level: int
138
- The moderation level of the AutoMod action.
139
- status: Literal['Approved', 'Denied', 'Expired']
140
- The current status of the message.
194
+ The body of the message.
195
+ status: str
196
+ The message’s status. Possible values are: "Approved", "Denied", "Expired".
141
197
  held_at: str
142
- The timestamp when the message was held, in ISO 8601 format.
198
+ The timestamp of when automod saved the message.
199
+ reason: str
200
+ The reason why the message was caught. Possible values are: "automod", "blocked_term".
201
+ automod: Optional[Automod]
202
+ If the message was caught by automod, this will be populated.
203
+ blocked_term: Optional[List[BlockedTerm]]
204
+ If the message was caught due to a blocked term, this will be populated.
143
205
  """
144
206
  message_id: str
145
207
  message: Message
146
- category: str
147
- level: int
148
- status: Literal['Approved', 'Denied', 'Expired']
208
+ status: str
149
209
  held_at: str
210
+ reason: str
211
+ automod: Optional[Automod]
212
+ blocked_term: Optional[List[BlockedTerm]]
150
213
 
151
214
 
152
215
  class AutomodSettingsUpdateEvent(SpecificBroadcaster, SpecificModerator):
@@ -184,7 +247,6 @@ class AutomodSettingsUpdateEvent(SpecificBroadcaster, SpecificModerator):
184
247
  sex_based_terms: int
185
248
  swearing: int
186
249
 
187
-
188
250
  class AutomodTermsUpdateEvent(SpecificBroadcaster, SpecificModerator):
189
251
  """
190
252
  Represents an event where AutoMod terms are updated.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: twitch.py
3
- Version: 3.2.4
3
+ Version: 3.2.6
4
4
  Summary: Real-time Twitch Event Handling and Helix API Integration in Python
5
5
  Author-email: Snifo <Snifo@mail.com>
6
6
  License: MIT
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
20
21
  Classifier: Topic :: Software Development :: Libraries
21
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
23
  Classifier: Topic :: Utilities
@@ -24,7 +25,7 @@ Classifier: Typing :: Typed
24
25
  Requires-Python: >=3.8.0
25
26
  Description-Content-Type: text/markdown
26
27
  License-File: LICENSE
27
- Requires-Dist: aiohttp>=3.8.0
28
+ Requires-Dist: aiohttp<4,>=3.7.4
28
29
 
29
30
  # twitch.py
30
31
 
@@ -0,0 +1 @@
1
+ aiohttp<4,>=3.7.4
@@ -1 +0,0 @@
1
- aiohttp>=3.8.0
@@ -1 +0,0 @@
1
- aiohttp>=3.8.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes