From 98557cd4f2654248c3bed513a8f890ddb8b234d2 Mon Sep 17 00:00:00 2001 From: isaac Date: Fri, 23 Feb 2024 18:10:29 -0500 Subject: [PATCH] Rename MemberEvent to JoinEvent --- TikTokLive/events/proto_events.py | 25 ++++++++++++------------- scripts/events/__build__.py | 4 ++-- scripts/events/transcribe.py | 3 ++- scripts/publish.py | 2 ++ setup.py | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/TikTokLive/events/proto_events.py b/TikTokLive/events/proto_events.py index 001f29b..55f6f19 100644 --- a/TikTokLive/events/proto_events.py +++ b/TikTokLive/events/proto_events.py @@ -10,6 +10,15 @@ from typing import Union +class JoinEvent(BaseEvent, WebcastMemberMessage): + """ + JoinEvent + """ + + operator: ExtendedUser + user: ExtendedUser + + class BarrageEvent(BaseEvent, WebcastBarrageMessage): """ BarrageEvent @@ -174,16 +183,6 @@ class LiveIntroEvent(BaseEvent, WebcastLiveIntroMessage): host: ExtendedUser -class MemberEvent(BaseEvent, WebcastMemberMessage): - """ - MemberEvent - - """ - - operator: ExtendedUser - user: ExtendedUser - - class MessageDetectEvent(BaseEvent, WebcastMsgDetectMessage): """ MessageDetectEvent @@ -295,7 +294,7 @@ class UnauthorizedMemberEvent(BaseEvent, WebcastUnauthorizedMemberMessage): "WebcastSocialMessage": SocialEvent, "WebcastSubNotifyMessage": SubscribeEvent, "WebcastRankUpdateMessage": RankUpdateEvent, - "WebcastMemberMessage": MemberEvent, + "WebcastMemberMessage": JoinEvent, "WebcastPollMessage": PollEvent, "WebcastQuestionNewMessage": QuestionNewEvent, "WebcastRankTextMessage": RankTextEvent, @@ -330,7 +329,7 @@ class UnauthorizedMemberEvent(BaseEvent, WebcastUnauthorizedMemberMessage): SocialEvent, SubscribeEvent, RankUpdateEvent, - MemberEvent, + JoinEvent, PollEvent, QuestionNewEvent, RankTextEvent, @@ -365,7 +364,7 @@ class UnauthorizedMemberEvent(BaseEvent, WebcastUnauthorizedMemberMessage): "SocialEvent", "SubscribeEvent", "RankUpdateEvent", - "MemberEvent", + "JoinEvent", "PollEvent", "QuestionNewEvent", "RankTextEvent", diff --git a/scripts/events/__build__.py b/scripts/events/__build__.py index a1462a5..1da4dd5 100644 --- a/scripts/events/__build__.py +++ b/scripts/events/__build__.py @@ -4,8 +4,8 @@ from TikTokLive.client.logger import TikTokLiveLogHandler, LogLevel from TikTokLive.proto import User, ExtendedUser -from events.overrides import InsertOverrides -from events.transcribe import EventsTranscriber +from overrides import InsertOverrides +from transcribe import EventsTranscriber if __name__ == '__main__': diff --git a/scripts/events/transcribe.py b/scripts/events/transcribe.py index 6ed73a0..b9beda1 100644 --- a/scripts/events/transcribe.py +++ b/scripts/events/transcribe.py @@ -12,7 +12,8 @@ MESSAGE_OVERRIDES: Dict[str, str] = { "WebcastMsgDetectMessage": "MessageDetectEvent", "WebcastChatMessage": "CommentEvent", - "WebcastSubNotifyMessage": "SubscribeEvent" + "WebcastSubNotifyMessage": "SubscribeEvent", + "WebcastMemberMessage": "JoinEvent" } BASE_IMPORTS: List[str] = [ diff --git a/scripts/publish.py b/scripts/publish.py index 71d7863..1ca88a2 100644 --- a/scripts/publish.py +++ b/scripts/publish.py @@ -7,6 +7,8 @@ API_KEY: str = os.environ["PYPI_TOKEN"] +input("Press any key to upload...") + subprocess.Popen( f'python -m twine upload --username __token__ --password "{API_KEY}" --repository pypi ../dist/*', shell=True diff --git a/setup.py b/setup.py index 4ed6b56..2fc60c5 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ # PyPi upload Command # rm -r dist ; python setup.py sdist ; python -m twine upload dist/* -version: str = "6.0.0-pre1" +version: str = "6.0.0-post1" setuptools.setup( name="TikTokLive",