Skip to content

Commit cc3ad33

Browse files
authored
Update master with current
Update master with V2.10.0
2 parents 69d5743 + b91434b commit cc3ad33

File tree

19 files changed

+981
-50
lines changed

19 files changed

+981
-50
lines changed

docs/changelog.rst

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
:orphan:
22

3+
4+
2.10.0
5+
=======
6+
- TwitchIO
7+
- Bug fixes
8+
- fix: :func:`~twitchio.PartialUser.fetch_markers` was passing list of one element from payload, now just passes element
9+
10+
- ext.commands
11+
- Changes
12+
- Added which alias failed to load in the error raised by :func:`~twitchio.ext.commands.Bot.add_command`
13+
14+
- Bug fixes
15+
- fix string parser not properly parsing specific quoted strings
16+
17+
- ext.eventsub
18+
- Additions
19+
- Added :meth:`EventSubClient.subscribe_channel_unban_request_create <twitchio.ext.eventsub.EventSubClient.subscribe_channel_unban_request_create>` /
20+
:meth:`EventSubWSClient.subscribe_channel_unban_request_create <twitchio.ext.eventsub.EventSubWSClient.subscribe_channel_unban_request_create>`
21+
- Added :meth:`EventSubClient.subscribe_channel_unban_request_resolve <twitchio.ext.eventsub.EventSubClient.subscribe_channel_unban_request_resolve>` /
22+
:meth:`EventSubWSClient.subscribe_channel_unban_request_resolve <twitchio.ext.eventsub.EventSubWSClient.subscribe_channel_unban_request_resolve>`
23+
- Added :meth:`EventSubClient.subscribe_automod_terms_update <twitchio.ext.eventsub.EventSubClient.subscribe_automod_terms_update>` /
24+
:meth:`EventSubWSClient.subscribe_automod_terms_update <twitchio.ext.eventsub.EventSubWSClient.subscribe_automod_terms_update>`
25+
- Added :meth:`EventSubClient.subscribe_automod_settings_update <twitchio.ext.eventsub.EventSubClient.subscribe_automod_settings_update>` /
26+
:meth:`EventSubWSClient.subscribe_automod_settings_update <twitchio.ext.eventsub.EventSubWSClient.subscribe_automod_settings_update>`
27+
- Added :meth:`EventSubClient.subscribe_automod_message_update <twitchio.ext.eventsub.EventSubClient.subscribe_automod_message_update>` /
28+
:meth:`EventSubWSClient.subscribe_automod_message_update <twitchio.ext.eventsub.EventSubWSClient.subscribe_automod_message_update>`
29+
- Added :meth:`EventSubClient.subscribe_automod_message_hold <twitchio.ext.eventsub.EventSubClient.subscribe_automod_message_hold>` /
30+
:meth:`EventSubWSClient.subscribe_automod_message_hold <twitchio.ext.eventsub.EventSubWSClient.subscribe_automod_message_hold>`
31+
- Added :meth:`EventSubClient.subscribe_channel_moderate <twitchio.ext.eventsub.EventSubClient.subscribe_channel_moderate>` /
32+
:meth:`EventSubWSClient.subscribe_channel_moderate <twitchio.ext.eventsub.EventSubWSClient.subscribe_channel_moderate>`
33+
- Added :meth:`EventSubClient.subscribe_suspicious_user_update <twitchio.ext.eventsub.EventSubClient.subscribe_suspicious_user_update>` /
34+
:meth:`EventSubWSClient.subscribe_suspicious_user_update <twitchio.ext.eventsub.EventSubWSClient.subscribe_suspicious_user_update>`
35+
- Added :meth:`EventSubClient.subscribe_channel_vip_add <twitchio.ext.eventsub.EventSubClient.subscribe_channel_vip_add>` /
36+
:meth:`EventSubWSClient.subscribe_channel_vip_add <twitchio.ext.eventsub.EventSubWSClient.subscribe_channel_vip_add>`
37+
- Added :meth:`EventSubClient.subscribe_channel_vip_remove <twitchio.ext.eventsub.EventSubClient.subscribe_channel_vip_remove>` /
38+
:meth:`EventSubWSClient.subscribe_channel_vip_remove <twitchio.ext.eventsub.EventSubWSClient.subscribe_channel_vip_remove>`
39+
- Added all accompanying models for those endpoints.
40+
- ext.sounds
41+
- Additions
42+
- Added TinyTag as a dependency to support retrieving audio metadata.
43+
- added :meth:`twitchio.ext.sounds.Sound.rate` setter.
44+
- added :meth:`twitchio.ext.sounds.Sound.channels` setter.
45+
46+
347
2.9.2
448
=======
549
- TwitchIO
@@ -66,7 +110,7 @@
66110
- New models for the new methods have been added:
67111
- :class:`~twitchio.ChannelFollowerEvent`
68112
- :class:`~twitchio.ChannelFollowingEvent`
69-
- New optional ``is_featured`` query parameter for :func:`~twitchio.PartialUser.fetch_clips`
113+
- New optional ``is_featured`` query parameter for :func:`~twitchio.PartialUser.fetch_clips`
70114
- New attribute :attr:`~twitchio.Clip.is_featured` for :class:`~twitchio.Clip`
71115

72116
- Bug fixes
@@ -104,14 +148,14 @@
104148
- Added :func:`~twitchio.Client.fetch_content_classification_labels` along with :class:`~twitchio.ContentClassificationLabel`
105149
- Added :attr:`~twitchio.ChannelInfo.content_classification_labels` and :attr:`~twitchio.ChannelInfo.is_branded_content` to :class:`~twitchio.ChannelInfo`
106150
- Added new parameters to :func:`~twitchio.PartialUser.modify_stream` for ``is_branded_content`` and ``content_classification_labels``
107-
151+
108152
- Bug fixes
109153
- Fix :func:`~twitchio.Client.search_categories` due to :attr:`~twitchio.Game.igdb_id` being added to :class:`~twitchio.Game`
110154
- Made Chatter :attr:`~twitchio.Chatter.id` property public
111155
- :func:`~twitchio.Client.event_token_expired` will now be called correctly when response is ``401 Invalid OAuth token``
112156
- Fix reconnect loop when Twitch sends a RECONNECT via IRC websocket
113157
- Fix :func:`~twitchio.CustomReward.edit` so it now can enable the reward
114-
158+
115159
- Other Changes
116160
- Updated the HTTPException to provide useful information when an error is raised.
117161

docs/exts/eventsub.rst

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,3 +495,62 @@ API Reference
495495
:members:
496496
:inherited-members:
497497

498+
.. attributetable::: ChannelUnbanRequestCreateData
499+
500+
.. autoclass:: ChannelUnbanRequestCreateData
501+
:members:
502+
:inherited-members:
503+
504+
.. attributetable::: ChannelUnbanRequestResolveData
505+
506+
.. autoclass:: ChannelUnbanRequestResolveData
507+
:members:
508+
:inherited-members:
509+
510+
.. attributetable::: AutomodMessageHoldData
511+
512+
.. autoclass:: AutomodMessageHoldData
513+
:members:
514+
:inherited-members:
515+
516+
.. attributetable::: AutomodMessageUpdateData
517+
518+
.. autoclass:: AutomodMessageUpdateData
519+
:members:
520+
:inherited-members:
521+
522+
.. attributetable::: AutomodSettingsUpdateData
523+
524+
.. autoclass:: AutomodSettingsUpdateData
525+
:members:
526+
:inherited-members:
527+
528+
.. attributetable::: AutomodTermsUpdateData
529+
530+
.. autoclass:: AutomodTermsUpdateData
531+
:members:
532+
:inherited-members:
533+
534+
.. attributetable::: SuspiciousUserUpdateData
535+
536+
.. autoclass:: SuspiciousUserUpdateData
537+
:members:
538+
:inherited-members:
539+
540+
.. attributetable::: ChannelModerateData
541+
542+
.. autoclass:: ChannelModerateData
543+
:members:
544+
:inherited-members:
545+
546+
.. autoclass:: ChannelVIPAddRemove
547+
:members:
548+
:inherited-members:
549+
550+
.. autoclass:: AutoCustomReward
551+
:members:
552+
:inherited-members:
553+
554+
.. autoclass:: AutoRewardRedeem
555+
:members:
556+
:inherited-members:

docs/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ sphinxext-opengraph
77
Pygments
88
furo
99
pyaudio==0.2.11
10-
yt-dlp>=2022.2.4
10+
yt-dlp>=2022.2.4
11+
tinytag>=1.9.0

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
sounds = [
5252
"yt-dlp>=2022.2.4",
5353
'pyaudio==0.2.11; platform_system!="Windows"',
54+
'tinytag>=1.9.0',
5455
]
5556
speed = [
5657
"ujson>=5.2,<6",

twitchio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
__author__ = "TwitchIO, PythonistaGuild"
2929
__license__ = "MIT"
3030
__copyright__ = "Copyright 2017-present (c) TwitchIO"
31-
__version__ = "2.9.2"
31+
__version__ = "2.10.0"
3232

3333
from .client import Client
3434
from .user import *

twitchio/errors.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
from typing import Any, Optional
2526

2627

twitchio/ext/commands/bot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def add_command(self, command: Command):
209209
if alias in self.commands:
210210
del self.commands[command.name]
211211
raise TwitchCommandError(
212-
f"Failed to load command <{command.name}>, a command with that name/alias already exists."
212+
f"Failed to load alias <{alias}> for command <{command.name}>, a command with that name/alias already exists.",
213213
)
214214
self._command_aliases[alias] = command.name
215215

@@ -347,7 +347,7 @@ async def invoke(self, context):
347347
await context.command(context)
348348

349349
def load_module(self, name: str) -> None:
350-
"""Method which loads a module and it's cogs.
350+
"""Method which loads a module and its cogs.
351351
352352
Parameters
353353
------------
@@ -367,7 +367,7 @@ def load_module(self, name: str) -> None:
367367
self._modules[name] = module
368368

369369
def unload_module(self, name: str) -> None:
370-
"""Method which unloads a module and it's cogs.
370+
"""Method which unloads a module and its cogs.
371371
372372
Parameters
373373
----------
@@ -402,7 +402,7 @@ def unload_module(self, name: str) -> None:
402402
del sys.modules[m]
403403

404404
def reload_module(self, name: str):
405-
"""Method which reloads a module and it's cogs.
405+
"""Method which reloads a module and its cogs.
406406
407407
Parameters
408408
----------

twitchio/ext/commands/errors.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
from __future__ import annotations
2526

2627
from typing import Optional, TYPE_CHECKING

twitchio/ext/commands/stringparser.py

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,31 @@ def __init__(self):
3737
self.ignore = False
3838

3939
def process_string(self, msg: str) -> Dict[int, str]:
40-
while True:
41-
try:
42-
loc = msg[self.count]
43-
except IndexError:
44-
self.eof = self.count
45-
word = msg[self.start : self.eof]
46-
if not word:
47-
break
48-
self.words[self.index] = msg[self.start : self.eof]
49-
break
50-
51-
if loc.isspace() and not self.ignore:
52-
self.words[self.index] = msg[self.start : self.count].replace(" ", "", 1)
40+
while self.count < len(msg):
41+
loc = msg[self.count]
42+
43+
if loc == '"' and not self.ignore:
44+
self.ignore = True
45+
self.start = self.count + 1
46+
47+
elif loc == '"' and self.ignore:
48+
self.words[self.index] = msg[self.start : self.count]
5349
self.index += 1
50+
self.ignore = False
5451
self.start = self.count + 1
5552

56-
elif loc == '"':
57-
if not self.ignore:
58-
if self.start == self.count: # only tokenize if they're a new word
59-
self.start = self.count + 1
60-
self.ignore = True
61-
else:
53+
elif loc.isspace() and not self.ignore:
54+
if self.start != self.count:
6255
self.words[self.index] = msg[self.start : self.count]
6356
self.index += 1
64-
self.count += 1
65-
self.start = self.count
66-
self.ignore = False
57+
58+
self.start = self.count + 1
6759

6860
self.count += 1
61+
62+
if self.start < len(msg) and not self.ignore:
63+
self.words[self.index] = msg[self.start : len(msg)].strip()
64+
6965
return self.words
7066

7167
def copy(self) -> StringParser:

0 commit comments

Comments
 (0)