python-twitch-chatbot icon indicating copy to clipboard operation
python-twitch-chatbot copied to clipboard

Need automod functions

Open MitchellHarrison opened this issue 4 years ago • 5 comments

"WaNnA bEcOmE fAmOuS?!!?"

MitchellHarrison avatar May 14 '21 21:05 MitchellHarrison

user should get a warning/ban if trying to shoutout themselves once/more than once.

MitchellHarrison avatar May 17 '21 18:05 MitchellHarrison

user should get a warning/ban if trying to shoutout themselves once/more than once.

i dont see it as automod, and i honesthly thik it should be part of the !so stuff, that way its configured in the same place as the !so message

VinylVault avatar May 17 '21 18:05 VinylVault

some channels allow self shoutout, but only every {{ definable }} period of time, this is useful for small streamers who have very few mods and sometimes only one is active in a channel, and the mods are streamers. might be worth having a switch for allowing self shoutout and a variable for time period in minutes.

VinylVault avatar Jun 22 '21 13:06 VinylVault

I'm not sure I understand your use case example, but I think a GUI to control the bot setting is a great idea and very possible. But that's a different issue. Could you elaborate? If the mods are streamers, why should they be allowed to self-shoutout? Making it configurable makes it easier of course.

MitchellHarrison avatar Jun 23 '21 03:06 MitchellHarrison

To start on this you'd want to do a few things. First, elevate privileges for your bot.

Next in your regex add the following: id=(?P<message_id>.*);

    def delete_message(self, user, channel, message_body, message_id):
        self.irc_command('@login={user};target-msg-id={message_id} :tmi.twitch.tv CLEARMSG #{channel} :{message_body}')
                message_id = message_data['message_id']
                text = message_data["text"]
                user = message_data["username"]
                display_name = message_data["display_name"]
                chatter_id = message_data["user_id"]
                user_color = message_data["color"].lstrip("#")

                if 'so you wanna be famous'  in text.lower():
                    self.delete_message(user, self.channel, text, message_id)
                    return 

This would remove the chat message (i think) and also remove it from ending up in your local chat stream.

flyboy1565 avatar Jul 16 '21 21:07 flyboy1565