more buggybois

master
Kit Kasune 3 years ago
parent 21954ce73d
commit 2819c2b4ae
  1. 3
      models/user.js
  2. 10
      util/oncommand.js

@ -17,7 +17,8 @@ const UserSchema = new mongoose.Schema({
blacklisted: {type: Boolean, default: false},
donator: {type: Boolean, default: false},
bio: {type: String, default: ''},
color: {type: String, default: ''}
color: {type: String, default: ''},
msg: {type: Boolean}
});
module.exports = mongoose.model("user", UserSchema);

@ -5,13 +5,11 @@ module.exports = async (message, msg, args, cmd, prefix, mention, client) => {
let botData = await require('../models/bot').findOne({finder: 'lel'});
botData.commands = botData.commands + 1;
botData.save();
let tu = await UserData.findOne({uid: message.author.id})
? await UserData.findOne({uid: message.author.id})
: new UserData({uid: message.author.id});
tu.commands = tu.commands + 1;
let tu = await UserData.findOne({uid: message.author.id}) || new UserData({uid: message.author.id});
tu.commands++;
if (tu.commands > 50 && !tu.msg) {
message.author.send({embeds: [new Discord.MessageEmbed()
await message.author.send({embeds: [new Discord.MessageEmbed()
.setThumbnail(client.user.avatarURL({size: 2048}))
.setDescription(`Hey there **${message.author.username}**! Looks like you've used my commands over **50 times**${tu.commands > 51 ? ` (${tu.commands} to be exact)` : ''}!\nI hope you're enjoying the wonderful things I have to offer, because I've enjoyed offering them to you.`)
.addField("What next?", "If you're enjoying what I do, you can [join my support server](https://discord.gg/u9c2uD24wB) to leave feedback and say hi to my developers. You can also consider [giving the repository a star](https://github.com/NatsukiDev/Natsuki) to show your support! I look forward to my time with you in the future <:hearty:812130944319750144>")
@ -22,5 +20,5 @@ module.exports = async (message, msg, args, cmd, prefix, mention, client) => {
tu.msg = true;
}
tu.save();
await tu.save();
};
Loading…
Cancel
Save