Closed SleepingCiaran closed 5 years ago
Hello, I am creating a Discord Bot and I am trying to make an Mute Command, but I always get the same error.
Can you guys help me?
Some information:
Code:
const { Command } = require('klasa'); const { MessageEmbed } = require('discord.js'); module.exports = class extends Command { constructor(...args) { super(...args, { description: 'Mute an user.' }) } async run(msg, args) { if(!msg.member.hasPermission("MANAGE_MEMBERS")) return msg.channel.send("You can't use this command."); let MuteUser = msg.guild.member(msg.mentions.users.first() || msg.guild.members.get(args[0])) if(!MuteUser) return msg.channel.send("Can't find user!"); let MuteReason = msg.content.split(" ").slice(2).join(" "); let MuteRole = msg.guild.roles.find(r => r.name === "Spammer"); if(!MuteRole) return msg.channel.send("Can't find the Spammer role!"); let MuteChannel = msg.guild.channels.find(guild => guild.name === 'bot-logs'); if(!MuteChannel) return msg.channel.send("Can't find the #bot-logs channel."); if(MuteUser.roles.has(MuteRole)) return msg.channel.send("That user is already muted!."); MuteUser.addRole(MuteRole.id); return MuteChannel.send(new MessageEmbed() .setAuthor("Mute"|| 'Unknown', "http://wolfdevelopment.cf/BotSymbols/info.png") .setColor("#ff0000") .addField("Muted User", `${MuteUser}`) .addField("Muted By", `<@${msg.author.id}>`) .addField("Muted In", `${msg.channel}`) .addField("Time", `${msg.createdAt}`) .addField("Reason", `${MuteReason}`)); } }
This is more a klasa question than a discord.js, this issue does not belong here but in Dirigeants Headquarter's support. There's an invite button in the official page, top right, see you there!
Hello, I am creating a Discord Bot and I am trying to make an Mute Command, but I always get the same error.
Can you guys help me?
Some information:
Code: