Intégration MongoDB + Fix export et amp
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { Guild } from 'discord.js'
|
||||
import { Types } from 'mongoose'
|
||||
import dbGuild from '../schemas/guild'
|
||||
|
||||
export default async (guild: Guild) => {
|
||||
let guildProfile = new dbGuild({
|
||||
_id: new Types.ObjectId(),
|
||||
guildId: guild.id,
|
||||
guildName: guild.name,
|
||||
guildIcon: guild.iconURL() ?? 'None',
|
||||
guildPlayer: {
|
||||
replay: { enabled: false },
|
||||
disco: { enabled: false }
|
||||
},
|
||||
guildRss: { enabled: false, feeds: [] },
|
||||
guildAmp: { enabled: false }
|
||||
})
|
||||
await guildProfile.save().catch(console.error)
|
||||
return guildProfile
|
||||
}
|
||||
Reference in New Issue
Block a user