2019-08-13 13:34:46 -04:00
|
|
|
module.exports = ({ bot, knex, config, commands }) => {
|
2020-08-12 17:08:37 -04:00
|
|
|
commands.addInboxThreadCommand("alert", "[opt:string]", async (msg, args, thread) => {
|
|
|
|
if (args.opt && args.opt.startsWith("c")) {
|
2020-02-17 14:04:43 -05:00
|
|
|
await thread.removeAlert(msg.author.id)
|
2020-08-12 17:08:37 -04:00
|
|
|
await thread.postSystemMessage("Cancelled new message alert");
|
2018-04-21 09:39:38 -04:00
|
|
|
} else {
|
2020-02-17 14:04:43 -05:00
|
|
|
await thread.addAlert(msg.author.id);
|
2018-04-21 09:39:38 -04:00
|
|
|
await thread.postSystemMessage(`Pinging ${msg.author.username}#${msg.author.discriminator} when this thread gets a new reply`);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|