【发布时间】:2018-11-10 17:06:13
【问题描述】:
if (message.content.toLowerCase().startsWith(prefix + `shout`)) {
if (!message.member.roles.some(r => ["shout perms"].includes(r.name)))
return message.reply("Sorry, you don't have permissions to use this!");
if (!args) {
return;
message.reply('Please specify a message to shout.')
}
const shoutMSG = args.join(" ");
roblox.shout(groupId, shoutMSG)
.then(function() {
console.log(`Shouted ${shoutMSG}`);
})
message.channel.sendMessage(`Shouted ${shoutMSG}`)
.catch(function(error) {
console.log(`Shout error: ${error}`)
});
}
上面是代码,当使用命令时,会向 Roblox 发送一个喊叫,但是,它也会喊出前缀和命令,如下所示。我该如何解决这个问题,让它只喊消息而不是前缀和命令?
【问题讨论】:
-
const shoutMSG = args.slice(1).join(" ");大概。 -
这是 discord.js 还是 roblox?
-
@ElectroxMortem Discord.js 与 Roblox-js 包。
-
好吧。我看到您遵循了我的潜意识信息并将我标记为正确? ;) @ScottElsy
标签: javascript node.js discord.js