我已经遇到这个问题好几个小时了,我无法确保人们在与宠物进行活动之前已经购买了宠物。
它没有显示错误,但它不能正常工作,我不知道如何引用玩家库存中的某个项目,因为我正在尝试实现一个宠物功能,你可以在其中与其他人打宠物,也将能够喂养你的宠物,并且会有宠物比赛和统计等活动。
const db = require('quick.db');
const Discord = require('discord.js');
module.exports = {
name: "fight",
description: "fight someone",
async run(client, message, args) {
let target = message.mentions.users.first();
if (!target) return message.channel.send('please provide a person to fight');
let user = message.author;
let theitemsofuser = await db.fetch(message.author.id, {
items: []
});
if (target === user) return message.channel.send('You can\'t fight yourself!')
if (db.has(user.id + !'.items.hamster')) return message.channel.send('you need a pet to fight');
if (db.has(user.id + !'.items.dog')) return message.channel.send('you need a pet to fight');
if (db.has(user.id + !'.items.cat')) return message.channel.send('you need a pet to fight');
if (db.has(target.id + !'.items.hamster')) return message.channel.send('your opponent needs a pet to fight');
if (db.has(target.id + !'.items.dog')) return message.channel.send('your opponent needs a pet to fight');
if (db.has(target.id + !'.items.cat')) return message.channel.send('your opponent needs a pet to fight');
message.channel.send('your all good!')
}
}
明月笑刀无情
ITMISS
摇曳的蔷薇
相关分类