const message = reactionReaction.message;
const verifyChannel = message.guild.channels.cache.get("684306214750126265");
const member = message.author.id;
const guild = message.guild;
const memberos = message.member.displayName;
if (user.bot) return;
if (
reactionReaction.emoji.name === "✔️" &&
message.channel.id === verifyChannel.id
) {
guild.channels.create(`TICKET + ${memberos}`, {
type: "text",
permissionOverwrites: [
{
id: message.author.id,
allow: ["VIEW_CHANNEL", "SEND_MESSAGES"],
},
],
});
await reactionReaction.users.remove(member).catch(console.error);
message.reply({ embed: elo1 })
.then(msg => {
message.react('❌')
})
}
});
});
我创建了票务机器人,实际上创建了频道工作但在这个频道上发送消息没有;/ 实际上消息是在 verifyChannel 上发送的,但我会在频道“TICKET + ${memberos}”
上发送答案 0 :(得分:0)
guild.channels.create()
返回一个带有新公会频道的 Promise,解决这个向新创建的频道发送消息的承诺。
const newChannel = await guild.channels.create(`TICKET + ${memberos}`, {
type: "text",
permissionOverwrites: [
{
id: message.author.id,
allow: ["VIEW_CHANNEL", "SEND_MESSAGES"],
},
],
});
newChannel.send('Hello World!');