javascript - discord.js var 令牌意外
问题描述
所以我得到了这段代码,我已经想弄清楚几个小时了,无论我尝试什么,我都无法弄清楚我的 var 有什么问题,什么也没有
async run (message, user)
var = mentionlycan = message.mentions.users.first()
var lycanroll = Math.floor(Math.random() * 100) + 1;
if (lycanroll < 50)
guildMember.addRole(role, mentionlycan);
message.reply(` ${mention} was attacked and converted into a Lycan`)
guildMember.addRole(role);
if (lycanroll > 50)
message.reply(`was attacked and they survived. ${mention}.`)
解决方案
问题在第二行。
var = mentionlycan = message.mentions.users.first()
你定义了一个错误的变量。将其更改为:
var mentionlycan = message.mentions.users.first();
推荐阅读
- javascript - 使用 ++ 增加 React 状态的前或后会引发只读错误
- python - Python 上的卷积
- mysql - 需要一个聚合的 MySQL 选择,它几乎可以跨日期范围迭代并返回账单
- python - 每天在特定时间自动运行的脚本问题
- phpstorm - 在已经配置 PHP 的 PhpStorm 中创建 Vanila HTML / JS 项目
- python - venv vs Anaconda 用于创建虚拟环境
- reactjs - 禁用js时在reactjs中设置动态元标记
- c# - 通过复制玩家位置跟随玩家的幽灵敌人 AI
- java - RecyclerView 只调用构造函数
- reactjs - Material-UI 在条件“覆盖”中使用默认值