Skip to content

Running the AI via Keywords from Chat

SoftDiamond edited this page Nov 4, 2023 · 1 revision

Running the AI using keywords are possible, this can be useful for users who do not want to set up a channel redeem or have not reached affiliate. In the following example provided from a user, you'd add a new function such as:

    def process_message(self, message):
        if message.startswith("!bubbles "):
            content = message[len("!bubbles "):]
            return content
        else:
            return message  

This function above looks for messages that start with !bubbles and strips the !bubbles from the script. Using the example above, here's how the command was ran able to run in event_message definition:

        if (message.tags.get('custom-reward-id') == REDEEM_ID) or (bitsAmount >= 100 and has_message) or (message.content.startswith("!bubbles ")):
            message.content = self.process_message(message.content)
Clone this wiki locally