我一直在尝试使用带有子命令的斜杠命令将消息发送到指定的通道。当我尝试部署它时,我得到:
DiscordAPIError[50035]: Invalid Form Body
options[1][APPLICATION_COMMAND_OPTIONS_TYPE_INVALID]: Sub-command and sub-command group option types are mutually exclusive to all other types
at SequentialHandler.runRequest (D:\projs\cpp\tbot\node_modules\@di
在编写discord.js机器人代码时,我遇到了这个错误。
TypeError: message.guild.createRole is not a function
at Object.module.exports.run (/app/commands/myakish.js:7:36)
at Client.bot.on (/app/bot.js:70:7)
at Client.emit (events.js:189:13)
at MessageCreateAction.handle (/rbd/pnpm-volume/9ebd7b80-3cef-449a-8d
因此,基本上,我试图使用message.mentions.channels向特定频道发送通知。
ex !announce #announcements Today is a great day!
错误:
(node:5516) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channels' of undefined
at Object.module.exports.execute (C:\Users\Zarko\Desktop\Stackoverflow\commands\Answ
我正在学习制造一个不和谐的机器人,我遇到了一个我无法解决的错误.我试图用数组中的对象创建多个命令。在不使用数组的情况下,我只执行一个对象时,它就处于阻塞状态,但一旦创建了数组并插入了2个命令,它就会抛出以下错误:
I:\botDiscord\secondo-bot\node_modules\discord.js\src\rest\RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Invalid Form Body
na
你好,我正在尝试制作一个不和谐的机器人来解除某人的禁令,但它给了我这个错误: Unhandled promise rejection: Error [BAN_RESOLVE_ID]: Couldn't resolve the user ID to unban.
at GuildMemberManager.unban (C:\Users\Jakub Sokol\Documents\Coding\Discord Bots\Smiley\node_modules\discord.js\src\managers\GuildMemberManager.js:210:36)
at
我尝试创建一个-clear (数量)的命令,并且coomand执行得很好,但是权限不正确这就是我得到的错误
TypeError: Cannot read property 'roles' of null
at Client.<anonymous> (C:\Users\elyas\OneDrive\שולחן העבודה\discordbot\main.js:448:23)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\elyas\OneDr
我正在编写一个机器人在不一致,称为LowerBot,它是用javascript,并使用npm和discord.js。如果有人能准确指出我的机器人出了什么问题,那就太好了。 下面是我的代码: function getAfterSpace(str) {
return str.split(' ')[1]; // get after space
}
client.on("message", msg => {
if (msg.content.toLowerCase().includes === ";say ") {
由于某些原因,我使用Node.js和Discord.js编写的机器人在成员加入时不会为他们分配角色。有人能帮帮忙吗? bot.on("guildMemberAdd", function (member) {
member.guild.channels
.find("name", "general")
.send(
member.toString() +
" Welcome to the server. All your base are be
我试图用新的discord.js版本编写一个机器人,但是当我尝试登录时,它会提示我这个错误
/home/max/Schreibtisch/Discord Bots/Perplex/node_modules/discord.js/src/util/Util.js:279
if (!Object.hasOwn(given, key) || given[key] === undefined) {
^
TypeError: Object.hasOwn is not a function
at mergeDefault (/home/max/Schrei
我在编写我的不和谐机器人代码时遇到了问题。每当我运行这段代码时: const Constants = require('discord.js/src/util/Constants.js')
Constants.DefaultOptions.ws.properties.$browser = `Discord iOS` 我一直收到这个错误。 Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './src/util/Constants.js' is not defined by \"export