radiobot/modules/autoreact.js
2022-03-22 20:25:39 -04:00

30 lines
473 B
JavaScript

const discord = require("discord.js");
class AutoReactModule
{
constructor(config, client, bot)
{
this.config = config;
/** @type {discord.Client} */
this.client = client;
this.bot = bot;
}
/**
* @param {discord.Message} msg
* @param {Boolean} edited
*/
onMessage(msg, edited)
{
if (edited) {
return;
}
if (msg.content.match(new RegExp(this.config.match, "i"))) {
msg.react(this.config.emoji);
}
}
}
module.exports = AutoReactModule;