You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/commands/admin/fakejoin.js

43 lines
966 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.channel.send('There is no join channel setup');
}
this.client.emit('guildMemberAdd', member);
}
}
module.exports = fakejoinCommand;