How can I save my Discord member data using a register command? Please provide assistance!
bot.js
client.on("message", msg => {
if (msg.content === "!register, ign:<input from member>, level:<input from member>"){
const newProfileSchema = new ProfileSchema({
discordid: "Discord Member Username",
ign: "<input from member>",
level: "<input from member>",
})
}
})
Here is the schema structure: Schema.js
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ProfileSchema = new Schema({
discordid: {
type: String,
required: true
},
ign: {
type: String
},
level: {
type: Number
}
});
module.exports = User = mongoose.model('profile', ProfileSchema);