-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a decent topic.
Add your topic. The topic name will be the same as the command used to trigger it. Example:
!addtopic piracy
This can now be triggered by typing !piracy
.
Setting the topic response/answer. This 'answer' will be given when the topic is triggered. Example:
!setanswer piracy Piracy is not very nice.
This will accept newlines (you can enter them in discord with Shift+Enter
)
Adding a pattern. This pattern is written in Regex. The bot will check incoming messages with this pattern, and if they are matched it shall give a response. I recommend using https://regexr.com/ to test your pattern. Example:
!addpattern piracy (how\s|where\s|can\s)(can\s)?(i\s|you\s)(download\s|install\s|get|\s)(the\s|a\s)?(iso|game|rom)
Now when somebody types "where can you download the rom", the piracy message will be triggered!
This is incredibly useful when your regex pattern is too broad for an entire server and might have false-positives. For instance having a topic on 'where to download the game' misfiring in a general gaming channel. Example:
!addChannel piracy 521711544925552642
Aliases are good when topics cover multiple points, or need a shorter and quicker name.
Example for topic settings
:
!setaliases settings s options
You can also make it embed an image in your topic. Be sure to scale the image appropriately. Example:
!setImage piracy https://en.wikipedia.org/wiki/Piracy#/media/File:British_sailors_boarding_an_Algerine_pirate_ship.jpg