在哪里放置},因为这没有意义[关闭]

问题描述 投票:-2回答:1
我必须在最后加上}和;我猜?我知道它很蠢,但是您能帮我吗。我尝试自己做,但只想要更多}或)。

client.on('ready', () => { console.log('Ready!'); }) client.on("guildMemberAdd", async member => { try { await member.send(`Hello ${member}, welcome to the PotatoHost Server! I want to help you and so my question is: Do you want to buy a server or do you need more informations first? \n A: I want to buy a server B: I need more informations first \n Please react to this message with A or B.`) .then(function (message) { message.react("🇦") message.react("🇧") }); message.awaitReactions((reaction, user) => user.id == message.author.id && (reaction.emoji.name == '🇦' || reaction.emoji.name == '🇧'), { max: 1, time: 30000 }).then(collected => { if (collected.first().emoji.name == '🇦') { message.reply('Shutting down...'); client.destroy(); } else message.reply('Operation canceled.'); }).catch(() => { message.reply('No reaction after 30 seconds, operation canceled'); }) } }

javascript bots discord
1个回答
0
投票
您忘记将catch放在try中。和“)”也都在这里

client.on('ready', () => { console.log('Ready!'); }) client.on("guildMemberAdd", async member => { try { await member.send(`Hello ${member}, welcome to the PotatoHost Server! I want to help you and so my question is: Do you want to buy a server or do you need more informations first? \n A: I want to buy a server B: I need more informations first \n Please react to this message with A or B.`) .then(function (message) { message.react("🇦") message.react("🇧") }); message.awaitReactions((reaction, user) => user.id == message.author.id && (reaction.emoji.name == '🇦' || reaction.emoji.name == '🇧'), { max: 1, time: 30000 }).then(collected => { if (collected.first().emoji.name == '🇦') { message.reply('Shutting down...'); client.destroy(); } else message.reply('Operation canceled.'); }).catch(() => { message.reply('No reaction after 30 seconds, operation canceled'); }) } catch (err) { console.log(err) } })

© www.soinside.com 2019 - 2024. All rights reserved.