Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: VoiceChannel.activityInvite is not a function #21

Closed
ghost opened this issue Dec 14, 2021 · 3 comments
Closed

TypeError: VoiceChannel.activityInvite is not a function #21

ghost opened this issue Dec 14, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 14, 2021

hello i was trying to add commands to the bot (i use my command handler). But I get the error:
TypeError: VoiceChannel.activityInvite is not a function
Here is my code (I have Discord.js v13):

require("discordjs-activity");

const Command = require("../Structures/Command");

module.exports = new Command({
    name: "activities",
    description: "Voice minigames command",
    cooldown: 10,
    permissions: ["SEND_MESSAGES"],
    async run(message, args, client){
        
        const voice = args[0];
        const game = args[1];

        try {
            if(game === 'youtube'){
                let VoiceChannel = client.channels.cache.get(voice)
                let Invite = await VoiceChannel.activityInvite("youtube_together")
                if(Invite) {
                    message.reply("https://discord.com/invite/"+Invite.code)
                }
            }
        } catch (error) {
            console.log(error)
        }
    }
});

How can i fix this?

@JotaroKujo0525
Copy link

hello i was trying to add commands to the bot (i use my command handler). But I get the error: TypeError: VoiceChannel.activityInvite is not a function Here is my code (I have Discord.js v13):

require("discordjs-activity");

const Command = require("../Structures/Command");

module.exports = new Command({
    name: "activities",
    description: "Voice minigames command",
    cooldown: 10,
    permissions: ["SEND_MESSAGES"],
    async run(message, args, client){
        
        const voice = args[0];
        const game = args[1];

        try {
            if(game === 'youtube'){
                let VoiceChannel = client.channels.cache.get(voice)
                let Invite = await VoiceChannel.activityInvite("youtube_together")
                if(Invite) {
                    message.reply("https://discord.com/invite/"+Invite.code)
                }
            }
        } catch (error) {
            console.log(error)
        }
    }
});

How can i fix this?

We don't support djs 13

@ghost
Copy link
Author

ghost commented Dec 15, 2021

I hope there will be an update

Repository owner deleted a comment from DarrenOfficial Dec 15, 2021
@SudhanPlayz
Copy link
Owner

You are supposed to require the module before defining client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants