#Shark2538 does command handlers cause
1 messages · Page 1 of 1 (latest)
give me a sec
ok
I also just tried to change const embed = new MessageEmbed() to const embed = new Discord.MessageEmbed() and it still didn't work
const challonge = require("challonge");
const {
MessageEmbed,
Permissions
} = require('discord.js')
module.exports = {
name: "create",
description: "Creates a tournament in challonge",
execute(Discord, client, message, args) {
if(!message.member.permissions.has(Permissions.FLAGS.ADMINSTRATOR)) return;
const embed = new MessageEmbed()
if(!args[0]) {
embed.setDescription(`\`\`\` $create \n name: <Tournament Name>\`\`\``);
message.channel.send({embeds: [embed]});
return;
}
let tournament_name = args.join(" ");
if(!tournament_name) {
embed.setDescription(`\`\`\` $create \n name<Tournament Name>\`\`\``);
message.channel.send(`Created ${tournament_name}ll`);
return;
}
const challongeClient = challonge.createClient({
apiKey: `${process.env.KEY}`
});
challongeClient.tournaments.create({
tournament: {
name: `${tournament_name}`,
tournamentType: `single elimination`
},
callback: (err, res) => {
console.log(err, res);
}
});
embed.setDescription(`Created a tournament with the name ${tournament_name}`);
message.channel.send({embeds: [embed]});
return;
}
}```
try that
no worries
@vale pecan also how do u type the code colored