Last active
July 26, 2024 03:04
-
-
Save thelabcat/84b77a999e80c8b31fa7f6c20da1f1c4 to your computer and use it in GitHub Desktop.
Rumble Chat Actor implementation imitating Misses Ma'am's current setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Misses Ma'am Rumble Chat Actor setup v0.0-alpha | |
| Imitation of Misses Ma'am's Rumble Bot setup | |
| as it was acting up. | |
| S.D.G. | |
| """ | |
| import os | |
| import rumchat_actor | |
| #The Firefox profile to use for the chat actor browser instance. TODO | |
| # You could use your default profile, but then you can't open Firefox to it while streaming. | |
| PROFILE_DIR = os.sep.join(( | |
| os.environ["APPDATA"], | |
| "Mozilla", "Firefox", | |
| "Profiles", | |
| "CREATE A PROFILE IN FIREFOX AND PUT IT'S FOLDER NAME HERE", | |
| )) | |
| #Use RumBot's API passthrough | |
| API_URL = "http://localhost:9843/api/ls" | |
| #Throne message, as it is used more than once | |
| THRONE_MESSAGE = "Throne (gift MissesMa'am!) <3 - https://throne.com/missesmaam" | |
| #Timed messages to send | |
| TIMED_MESSAGES = [ | |
| THRONE_MESSAGE, | |
| "Please don't forget to spread that Rumble Love, drop a Like + Follow !💚✨", | |
| "Checkout Chat Commands ; !blurk !clip !discord !x !throne ✨ ̶A̶I̶ TTS (Subs Only!!) Try !tts", | |
| ] | |
| print("Initializing actor...") | |
| actor = rumchat_actor.RumbleChatActor(api_url = API_URL, profile_dir = PROFILE_DIR) | |
| print("Registering message actions...") | |
| #Send timed messages | |
| tmm = rumchat_actor.actions.TimedMessagesManager(actor, messages = TIMED_MESSAGES, delay = 300, in_between = 5) | |
| actor.register_message_action(tmm.action) | |
| print("Registering commands...") | |
| #Blurk command | |
| actor.register_command("blurk", | |
| lambda message, actor: | |
| actor.send_message(f"@{message.user.username} is now blurking puietly in the tarkness. :-)") | |
| ) | |
| #Clip command | |
| clip_command = rumchat_actor.commands.ClipRecordingCommand( | |
| actor = actor, | |
| recording_load_path = os.sep.join((os.environ["HOME"], "Videos")), | |
| clip_save_path = os.sep.join((os.environ["HOME"], "Videos", "stream_clips")), | |
| ) | |
| actor.register_command(clip_command) | |
| #Discord command TODO | |
| actor.register_command("discord", | |
| lambda message, actor: | |
| actor.send_message(f"@{message.user.username} Sorry, I don't know the Discord link yet.") | |
| ) | |
| #X command | |
| actor.register_command("x", | |
| lambda message, actor: | |
| actor.send_message("Follow Misses Ma'am on X! https://x.com/MissesMaam999") | |
| ) | |
| #Throne command | |
| actor.register_command("throne", | |
| lambda message, actor: | |
| actor.send_message(THRONE_MESSAGE) | |
| ) | |
| #TTS command | |
| actor.register_command( | |
| rumchat_actor.commands.TTSCommand( | |
| actor = actor, | |
| allowed_badges = ["recurring_subscription", "locals_supporter"] | |
| ) | |
| ) | |
| print("Starting mainloop...") | |
| actor.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment