ramirez/src/modules/alert.js

12 lines
514 B
JavaScript
Raw Normal View History

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")) {
await thread.removeAlert(msg.author.id)
2020-08-12 17:08:37 -04:00
await thread.postSystemMessage("Cancelled new message alert");
} else {
await thread.addAlert(msg.author.id);
await thread.postSystemMessage(`Pinging ${msg.author.username}#${msg.author.discriminator} when this thread gets a new reply`);
}
});
};