Skip to content

Autoreply features

Casper1123 edited this page Oct 2, 2024 · 4 revisions

Under certain conditions, Patrick can automatically reply to your messages.
The code for these features is found here.

Letter only

If Patrick sees a message consisting of only a single letter that he recognises, he will reply to it with the next letter in the alphabet.

Number

If Patrick sees a message that starts with a number, he'll reply to it with that number + 1.
Conversion isn't perfect and is prone to errors.

A random saying

Patrick has a small chance to reply to your message with something random he has in store.

Message content replier

If Patrick sees that your message has some piece of text in it, he might reply with something.

This works as follows:
Triggers and Replies are bundled together under a name (an 'alias').
Patrick looks through his stored aliases to see if the message contains one of said alias' triggers.
If so, he takes a random reply for that alias and stores it.
Once he's done with every alias, he picks a random reply he has stored and sends it.
Replies have Weight to them, which partially determines the likelyhood that the reply is selected for an Alias.
To see how this works, please refer to ListenerCog.py and ReplyManager.py.

Clone this wiki locally