我正在制作一个不和谐的机器人,它将改变频道的特定名称
代码
if(command === `${prefix}openslot`) {
let embed = new Discord.RichEmbed()
.setColor("#1bc643")
.setTitle("Sucessfully opened slot for PREMIUM RANK!")
.addField("Created At", message.author.createdAt)
.setDescription("SYSTEM");
message.channel.sendMessage(embed);
channel.setName('Reserved_Slot')
Run Code Online (Sandbox Code Playgroud)
.then(newChannel => console.log( Channel's new name is ${newChannel.name})) .catch(console.error);
return;
}
Run Code Online (Sandbox Code Playgroud)
而且我还是 discord.js 的新手(一个月前开始)
我正在尝试为我朋友的 Discord 服务器制作一个恶作剧 Discord 机器人,但该机器人不会响应任何内容;甚至 elseif 函数都没有通过。如果有人知道为什么我的代码不起作用,请指定它。
注意:如果您需要参考,客户端变量是 Discord.Client。
client.on("message", message => {
if (message.channel.id != 425328056777834506) return;
if (Math.floor(Math.random() * Math.floor(4))== 3 && message.embeds.length > 0) {
message.channel.send("https://cdn.discordapp.com/attachments/330441704073330688/453693702687162369/yeet.png");
} else if (message.embeds.length < 0) {
message.channel.send("send me photos of your win >.>");
}
})
Run Code Online (Sandbox Code Playgroud) 我正在尝试从./resources/scripts/views/auth/LoginForm导入LoginForm.vue \n但 TypeScript 无法\xe2\x80\x99t 识别该路径。
\n我注意到 TypeScript 无法识别不在\'@\'或\'./resources/scripts\'根目录中的 Vue文件 \n这意味着我无法将 Vue 文件放入子文件夹中,而 TypeScript 无法识别它。
\n我试过
\n身份验证路由器.ts
\nAuthenticationRouter.ts 是导入到主路由器文件中的模块。
\n该模块位于\'./resources/scripts/plugins/router/modules/AuthenticationRouter.ts\'
\n另外,它还没有完成,因为我无法在 TypeScript 不发出嘶嘶声的情况下导入视图文件。
\n// AuthenticationRouter.ts\n// ./resources/scripts/plugins/router/modules/AuthenticationRouter.ts\nimport LoginForm from \'@/views/auth/LoginForm\'\n\n// IGNORE EVERYTHING BELOW THIS LINE\nexport default [\n {\n path: \'/auth/login\',\n component: LoginForm,\n children: …Run Code Online (Sandbox Code Playgroud)