【发布时间】:2019-12-05 08:18:34
【问题描述】:
我相信在此之前我有一条工作线会检查名为 Motion Design 的用户角色,然后如果他们继续,但如果他们没有,则向频道发送消息。即使他们有角色,它似乎总是将消息发送到频道。 ****** 是应该检查角色的行。
我尝试重命名角色并更改代码,但没有任何效果。
if (messageReaction.emoji.name === reactions.success) {
let client1 = messageReaction.users
const notbot = messageReaction.users.filter(clientuser => clientuser !== client.user).first();
await messageReaction.remove(notbot);
//check if they have role id
******** if(!message.member.roles.find(r => r.name === "Motion Design")) return client.channels.get(`${ticketchat}`).send(`${notbot} You do not have the requested role for that ticket`);
const defbot = messageReaction.users.filter(clientuser => clientuser == client.user).first();
await messageReaction.remove(defbot);
let web1 = new Discord.RichEmbed()
.setDescription(`This commission has been claimed by ${notbot} .`)
.setColor("#15f153")
.addField("Client", `${message.author} with ID: ${message.author.id}`)
.addField("Budget", `${budget}`)
.addField("Time", message.createdAt)
.addField("Budget", `${budget}`)
.addField("Requested Freelancer",`<@&${motionDesign}>`)
let tickets = message.guild.channels.find('name', "tickets")
if(!tickets) return message.channel.send(`${message.author} Can't find tickets channel.`)
message.delete().catch(O_o=>{});
message.author.send(`Freelancer ${notbot} has taken your ticket. ${message.author}`);
【问题讨论】:
标签: javascript node.js discord discord.js