Javascript 当';大喊大叫;?
上面是代码,当使用命令时,它将向Roblox发送一个呼喊,但是,它也会呼喊前缀和命令,如下所示。如何修复此问题并使其仅显示消息而不是前缀和命令Javascript 当';大喊大叫;?,javascript,node.js,discord.js,Javascript,Node.js,Discord.js,上面是代码,当使用命令时,它将向Roblox发送一个呼喊,但是,它也会呼喊前缀和命令,如下所示。如何修复此问题并使其仅显示消息而不是前缀和命令 您只需删除前7个字符。前缀为1。5个用于喊叫,1个用于空间 var shoutMSG='!请将此标记为正确' console.log(shoutMSG) shoutMSG=shoutMSG.substr(7) console.log(shoutMSG)const shoutMSG=args.slice(1).join(“”)推测。这是discord.j
您只需删除前7个字符。前缀为1。5个用于喊叫,1个用于空间
var shoutMSG='!请将此标记为正确'
console.log(shoutMSG)
shoutMSG=shoutMSG.substr(7)
console.log(shoutMSG)
const shoutMSG=args.slice(1).join(“”)代码>推测。这是discord.js还是roblox?@ElectroxMortem discord.js和roblox js包。我看到你遵循了我的潜意识信息,并将我标记为正确的?;)@斯科特尔西
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}`)
});
}