微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我如何获得rob命令以停止忽略某些代码行?

如何解决我如何获得rob命令以停止忽略某些代码行?

我一直在尝试让!rob命令在我的discord机器人上工作一段时间,但是它总是忽略let authorBal = db.fetch(`money_${message.guild.id}_${message.author.id}`);之后和''const embed = new discord.MessageEmbed() .setTitle(${author.username} just robbed ${user.username} for ${random} coins!) .setDescription(Unlucky ${user.username});

db.add(money_${message.guild.id}_${user.id}随机); db.subtract(money_${message.guild.id}_${user.id}随机

message.channel.send(embed)```这是完整的代码请帮助

const db = require('quick.db')
const discord = require('discord.js');

module.exports = {

name:"rob",description:"rob someone!",async run(client,message,args) {

let user = message.mentions.users.first();
let fine = Math.floor(Math.random() * 100) + 1;
let random = Math.floor(Math.random() * 100) + 1; 

if(!user)return message.channel.send('Please metion who you want to rob')


let author = message.author;

if(author === user) return message.channel.send('you can\'t rob yourself')


let authorBal = db.fetch(`money_${message.guild.id}_${message.author.id}`);


if(author < 100) return message.channel.send(':x: You need at least 100 coins to rob someone')


let userBal = db.fetch(`money_${message.guild.id}_${user.id}`);


if(userBal = 0 ) {
    message.channel.send('You just tried to rob a poor person! :angry:')
    db.subtract(`money_${message.guild.id}_${user.id}`,fine);
    return;
}





const embed = new discord.MessageEmbed()
.setTitle(`${author.username} just robbed ${user.username} for ${random} coins!`)
.setDescription(`Unlucky ${user.username}`);

db.add(`money_${message.guild.id}_${user.id}`,random); 
db.subtract(`money_${message.guild.id}_${user.id}`,random)

message.channel.send(embed)
}}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。