2022-05-05 23:29:28 +03:00
|
|
|
const { Client: FrameworkClient }= require('@eartharoid/dbf');
|
|
|
|
const { Intents } = require('discord.js');
|
2022-05-06 02:27:27 +03:00
|
|
|
const { PrismaClient } = require('@prisma/client');
|
2022-05-05 23:29:28 +03:00
|
|
|
|
|
|
|
module.exports = class Client extends FrameworkClient {
|
|
|
|
constructor() {
|
|
|
|
super({
|
|
|
|
intents: [
|
|
|
|
Intents.FLAGS.GUILDS,
|
|
|
|
Intents.FLAGS.GUILD_MEMBERS,
|
|
|
|
Intents.FLAGS.GUILD_MESSAGES,
|
|
|
|
],
|
|
|
|
});
|
|
|
|
}
|
2022-05-06 02:27:27 +03:00
|
|
|
|
2022-05-05 23:29:28 +03:00
|
|
|
async login(token) {
|
2022-05-06 02:27:27 +03:00
|
|
|
this.prisma = new PrismaClient();
|
|
|
|
// this.prisma.$use((params, next) => {})
|
2022-05-05 23:29:28 +03:00
|
|
|
return super.login(token);
|
|
|
|
}
|
|
|
|
|
|
|
|
async destroy() {
|
|
|
|
await this.prisma.$disconnect();
|
|
|
|
return super.destroy();
|
|
|
|
}
|
|
|
|
};
|