我对JavaScripting和discord.js还是很陌生
我似乎无法发现机器人的问题。
console.log("Ban Key is " + banKey);
console.log("Punishment Log Key is " + punishmentLogs);
toBan.push({key: banKey, method: method, channelID: message.channel.id, memberID: memberID, timeForBan: args[3], reasonForBan: args[4], username: JSON.parse(data).Username,value: args[2], cid: message.channel.id});
client.channels.cache.get(punishmentLogs).send("**Player banned through Discord.**" + "\r" + "**Player:** " + args[2] + "\r" + "*Moderator:**" + "<@" + message.member.id + ">" + "\r" + "**Length:**" + args[3] + "**Hours.**" + "\r" + "**Reason:**" + args[4]);
记录banKey和惩罚日志键会返回此
// Key so my other script knows where the ban is coming from
Ban Key is PSG
// Channel ID of the punishment-logs channel
Punishment Log Key is 741047551221825700
这意味着它知道它们有一个值,但是当涉及到使用渠道时,它说它是未定义的。