2019-06-16 15:27:30 -04:00
|
|
|
module.exports = (bot, knex, config, commands) => {
|
|
|
|
commands.addInboxThreadCommand('alert', '[opt:string]', async (msg, args, thread) => {
|
|
|
|
if (args.opt && args.opt.startsWith('c')) {
|
2018-04-21 09:39:38 -04:00
|
|
|
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`);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|