aboutsummaryrefslogtreecommitdiff
path: root/src/modules/alert.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/alert.js')
-rw-r--r--src/modules/alert.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/alert.js b/src/modules/alert.js
new file mode 100644
index 0000000..a844230
--- /dev/null
+++ b/src/modules/alert.js
@@ -0,0 +1,11 @@
+module.exports = ({ bot, knex, config, commands }) => {
+ commands.addInboxThreadCommand('alert', '[opt:string]', async (msg, args, thread) => {
+ if (args.opt && args.opt.startsWith('c')) {
+ await thread.setAlert(null);
+ await thread.postSystemMessage(`Cancelled new message alert`);
+ } else {
+ await thread.setAlert(msg.author.id);
+ await thread.postSystemMessage(`Pinging ${msg.author.username}#${msg.author.discriminator} when this thread gets a new reply`);
+ }
+ });
+};