Skip to content

Commit

Permalink
Initial beta release
Browse files Browse the repository at this point in the history
- Fixed ExclusiveChatCommand having no target
- Updated message getting for Cocorum v1.0.0-beta
- Added use of Cocorum reporting deleted messages
  • Loading branch information
thelabcat committed May 4, 2024
1 parent 4356568 commit 16a3ff9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "rumchat_actor"
version = "0.1.0"
version = "1.0.0"
keywords = ["rumble", "chat", "livestream", "bot"]
authors = [
{ name="Wilbur Jaywright", email="zargulthewizard@outlook.com" },
Expand All @@ -13,14 +13,14 @@ description = "Automatically interact with your Rumble livestream chats."
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"cocorum",
"cocorum>=1.0.0",
"selenium",
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
]

[project.urls]
Expand Down
8 changes: 4 additions & 4 deletions src/rumchat_actor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(self, name, actor, cooldown = BROWSER_ACTION_DELAY, amount_cents =
allowed_badges: Badges which must be borne to use the command at all
whitelist_badges: Badges which if borne give the user free-of-charge command access
target: The function(message, actor) to call on successful command usage. Defaults to self.run"""
super().__init__(name, actor, cooldown = BROWSER_ACTION_DELAY, amount_cents = 0, whitelist_badges = ["moderator"], target = None)
super().__init__(name, actor, cooldown = BROWSER_ACTION_DELAY, amount_cents = 0, whitelist_badges = ["moderator"], target = target)
#Admin can always call any command
self.allowed_badges = ["admin"] + allowed_badges

Expand Down Expand Up @@ -197,7 +197,7 @@ def __init__(self, stream_id = None, init_message = "Hello, Rumble world!", prof
self.send_message(init_message)

#Wait until we get that message
while (m := self.ssechat.next_chat_message()).user.username != self.username:
while (m := self.ssechat.get_message()).user.username != self.username:
pass

assert "moderator" in m.user.badges or "admin" in m.user.badges, "Actor cannot function without being a moderator"
Expand Down Expand Up @@ -357,15 +357,15 @@ def __process_message(self, message):
return

for action in self.message_actions:
if not action(message, self): #The message got deleted by an action
if message.message_id in self.ssechat.deleted_message_ids or not action(message, self): #The message got deleted, possibly by this action
return

self.__run_if_command(message)

def mainloop(self):
"""Run the actor forever"""
while self.keep_running:
m = self.ssechat.next_chat_message()
m = self.ssechat.get_message()
if not m: #Chat has closed
self.keep_running = False
return
Expand Down

0 comments on commit 16a3ff9

Please sign in to comment.