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

30 lines
532 B
JavaScript

const discord = require("discord.js");
class JoinReactModule
{
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 (msg.system && msg.type == "GUILD_MEMBER_JOIN") {
setTimeout(() => {
try {
msg.react(this.config.emoji || "👋");
} catch (err) { console.error(err); }
}, 2000);
}
}
}
module.exports = JoinReactModule;