Haha-Yes/commands/admin/fakejoin.js
supositware dfd25c8bf2 Bunch of update
mostly replacing message.channel.send with message.reply
( i hope it work this time... )
2021-07-23 04:19:47 +02:00

43 lines
No EOL
959 B
JavaScript

const { Command } = require('discord-akairo');
const joinChannel = require('../../models').joinChannel;
class fakejoinCommand extends Command {
constructor() {
super('fakejoin', {
aliases: ['fakejoin'],
category: 'admin',
channel: 'guild',
clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'],
args: [
{
id: 'user',
type: 'user',
match: 'rest'
}
],
description: {
content: 'Fake join message',
usage: '[text]',
examples: ['Supositware']
}
});
}
async exec(message, args) {
let member;
const join = await joinChannel.findOne({where: {guildID: message.guild.id}});
if (join) {
if (args.user)
member = message.guild.members.resolve(args.user.id);
else
member = message.guild.members.resolve(message.author.id);
} else {
return message.reply('There is no join channel setup');
}
this.client.emit('guildMemberAdd', member);
}
}
module.exports = fakejoinCommand;