【发布时间】:2021-11-23 19:42:42
【问题描述】:
我注意到斜杠命令仅适用于一台 Discord 服务器:bot.guilds.cache.get(<GUILD_ID>).commands.set(command.name, command)。
真的没有办法让命令在机器人已经存在的服务器上立即运行吗?我必须单独添加 ID 吗?我试过bot.guilds.cache.map(guild => guild.id).commands.set(command.name, command),但它给出了一个错误TypeError: Cannot read properties of undefined (reading 'set')。
【问题讨论】:
标签: discord.js