RemyK888/discord-together

Error

Closed this issue · 0 comments

1ALN1 commented

Doesn't make an invite URL and leaves an error in the console

heres my code:

const Discord = require('discord.js')
require("discord-reply")
const bot = new Discord.Client();

module.exports = {
    name: "youtube",
    cooldown: 3,
    description: "Check the version of the bot",
    aliases: ["yt", "youtube_together", "youtubetogether"],
    execute(msg){
        const Discord = require('discord.js');
        const { colour } = require('../config.json')
        const { DiscordTogether } = require('discord-together');
        
        bot.discordTogether = new DiscordTogether(bot);

        if(!msg.member.voice.channel) return msg.lineReply("You need to be in a `Voice Channel` for this command")

        if(msg.member.voice.channel) {
            bot.discordTogether.createTogetherCode(msg.member.voice.channelID, 'poker').then(async invite => {
                const ytEmbed = new Discord.MessageEmbed()
                    .setColor(colour)
                    .setTitle('__Youtube__')
                    .setDescription(`${invite.code}`)
                    .setTimestamp()
                return msg.lineReply(`${ytEmbed}`);
            })
        } else {
            msg.lineReply("Sorry I could not start that activity")
        }
    }
}

image