Answer the question
In order to leave comments, you need to log in
I'm writing a Discord bot in JS. I'm using mongodb and I get an error when saving, how can I fix it?
const Discord = require("discord.js");
const embed = new Discord.MessageEmbed();
const User = require('../data/user');
const guild = require('../data/guild');
module.exports.run = async(bot, message, args) => {
let coinemoji = bot.emojis.cache.find(e => e.name === "M_cash")
if (!message.member.roles.cache.get("796669760665419786")) {
return message.channel.send(embed
.setColor(message.member.displayHexColor)
.setDescription(`У вас нет прав на данную команду.`))
}
else
guild.moneyOfPick = (args[0])
message.channel.send(embed.setColor("BLUE")
.setDescription(`Бот скинул бонус в размере ${guild.moneyOfPick} ${coinemoji}, напиши .pick что бы получить!`)).then(msg => {
global.MessageByBot = msg.id;
})
guild.pickMsgs += 1;
guild.save();
}
module.exports.help = {
name: "cpick",
}
Answer the question
In order to leave comments, you need to log in
What is GUILD.save? They write to you that GUILD.SAVE is not a function for you, see the code, and in particular SAVE and edit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question