text: const fetch = require("node-fetch");
  const { token } = require("../../../../Config")
  
  module.exports = {
  	name: "fishington",
  	description: "Start playing fishington.io.",
  	run: async(client, interaction, Discord) => {
          let user = await interaction.member.fetch();
          let channel = await user.voice.channel;
  
          const notInVoiceChannelEmbed = new Discord.MessageEmbed()
          .setDescription('You need to join a Voice Channel!')
          .setColor('RED')
          if(!channel) return interaction.reply({ embeds: [notInVoiceChannelEmbed], ephemeral: true });
          fetch(`https://discord.com/api/v8/channels/${channel.id}/invites`, {
            method: "POST",
            body: JSON.stringify({
                max_age: 86400,
                max_uses: 0,
                target_application_id: "814288819477020702",
                target_type: 2,
                temporary: false,
                validate: null
            }),
            headers: {
                "Authorization": `Bot ${token}`,
                "Content-Type": "application/json"
            }
        }).then(res => res.json())
        .then(invite =>{
          if(!invite.code) return interaction.reply({ content: ":x: Cannot start minigame", ephemeral: true});
          const embed = new Discord.MessageEmbed()
            .setAuthor(
              "Fishington.io",
              "https://cdn.discordapp.com/emojis/937110848441290842.gif?size=96&quality=lossless"
            )
            .setColor("#FF0000").setDescription(`
            An online fishing game where you can relax, chat and fish with up to 24 players!
                
            __**[Join Fishington.io](https://discord.com/invite/${invite.code})**__
      
            ⚠ **Note:** This only works in Desktop
      `);
            interaction.reply({ embeds: [embed]});
      
        })
  	}
  }