#Shark2538 does command handlers cause

1 messages · Page 1 of 1 (latest)

vale pecan
#

hey

#

send the code to your file here

#

@rocky mountain

rocky mountain
#

give me a sec

vale pecan
#

ok

rocky mountain
#

I also just tried to change const embed = new MessageEmbed() to const embed = new Discord.MessageEmbed() and it still didn't work

vale pecan
#
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

rocky mountain
#

alr

#

thank u dude
it worked

vale pecan
#

np!

#

you hadn't defined Discord or MessageEmbed

#

that was the issue btw

rocky mountain
#

ohhh

#

Alr

#

Thank u

#

Appreciate it!

vale pecan
#

no worries

rocky mountain
#

@vale pecan also how do u type the code colored