Add keyword notification feature #11

Merged
myrkvi merged 3 commits from feature/keyword-notify into main 2023-04-17 20:08:35 +02:00
Owner

This PR implements #5.

Allows a user to be notified when a keyword is said in the server.


Makes the following commands available:

  • /keyword-notify add <keyword>: Add a keyword to be notified about.
  • /keyword-notify list: List current keywords.
  • /keyword-notify remove <keyword>: Remove a keyword. Uses autocomplete

Implementation details

Currently, this checks for any keywords on any message sent, which could potentially be slow on larger servers. There likely isn't a way around this, as you cannot filter message events based on their contents.

The bot stores a list of keywords for each guild in-memory, stored as a dictionary with guild IDs as keys and a set of keywords as its value. If a user adds a keyword, it is added to the set. If a user removes a keyword, and it was the only user listening for the keyword in the guild, the keyword is removed from the set.

This PR implements #5. Allows a user to be notified when a keyword is said in the server. --- ### Makes the following commands available: - `/keyword-notify add <keyword>`: Add a keyword to be notified about. - `/keyword-notify list`: List current keywords. - `/keyword-notify remove <keyword>`: Remove a keyword. Uses autocomplete --- ### Implementation details Currently, this checks for any keywords on any message sent, which could potentially be slow on larger servers. There likely isn't a way around this, as you cannot filter message events based on their contents. The bot stores a list of keywords for each guild in-memory, stored as a dictionary with guild IDs as keys and a set of keywords as its value. If a user adds a keyword, it is added to the set. If a user removes a keyword, and it was the only user listening for the keyword in the guild, the keyword is removed from the set.
myrkvi added 1 commit 2023-04-01 00:57:52 +02:00
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
1968d5db65
Add keyword notification feature
myrkvi self-assigned this 2023-04-01 00:58:06 +02:00
myrkvi requested review from konradomen 2023-04-01 00:58:11 +02:00
myrkvi added 1 commit 2023-04-01 01:03:18 +02:00
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
a8472c1629
Disable arm64 arch for CI
Author
Owner

Side note: I also changed the Drone CI runner to be a x64 Azure VM instead of the RPi w/ arm64. Should result in better performance as it's no longer running on a RPi :dogehehe:.

Side note: I also changed the Drone CI runner to be a x64 Azure VM instead of the RPi w/ arm64. Should result in better performance as it's no longer running on a RPi :dogehehe:.
konradomen requested changes 2023-04-17 20:04:04 +02:00
@ -291,6 +291,7 @@ def main():
bot.load_extension("heimdallr.commands.polls")
bot.load_extension("heimdallr.commands.bot_messages")
bot.load_extension("heimdallr.commands.modmail")
bot.load_extension("heimdallr.commands.keyword_notify")V
Owner

V like Vandetta

V like Vandetta
myrkvi marked this conversation as resolved
myrkvi added 1 commit 2023-04-17 20:04:28 +02:00
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2fcd69c881
Fixed stray "V" at the end of a line
myrkvi requested review from konradomen 2023-04-17 20:06:30 +02:00
konradomen approved these changes 2023-04-17 20:08:13 +02:00
myrkvi merged commit eb37f41b45 into main 2023-04-17 20:08:35 +02:00
myrkvi deleted branch feature/keyword-notify 2023-05-31 20:32:04 +02:00
Sign in to join this conversation.
No description provided.