I am getting an error when I am trying to run: (node:9164) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'applications' of undefined
Here is my code:
const discord = require('discord.js'); const client = new discord.Client(); const guildId = '820368493017825333'; client.on('ready', async () => { console.log('ready'); const commands = await client.api. applications(client.user.id) .guilds(guildId) .commands.get(); console.log(commands); }); client.login(require(`./config.json`).Token);
https://stackoverflow.com/questions/66620065/slash-commands-discord-js March 14, 2021 at 08:55AM
没有评论:
发表评论