File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import {Logger} from "../../main/logger.js";
77import { LoggingAction } from "../../enums/loggingTypes.js" ;
88import { database } from "../../main/database.js" ;
99import { Config } from "../../main/config.js" ;
10+ import { initUsersToDatabase } from "../../helper/databaseHelper.js" ;
1011
1112export async function vote ( client : ExtendedClient ) {
1213 const app = express ( ) ;
@@ -85,7 +86,11 @@ export async function vote(client: ExtendedClient) {
8586 return ;
8687 }
8788 const vote = req . body
88- const data = await database . users . findFirst ( {
89+ const user = await client . users . fetch ( vote . id ) ;
90+
91+ await initUsersToDatabase ( client , user )
92+
93+ let data = await database . users . findFirst ( {
8994 where : {
9095 UserId : vote . id
9196 }
@@ -125,7 +130,7 @@ export async function vote(client: ExtendedClient) {
125130 const webhook = new WebhookClient ( {
126131 url : "https://discord.com/api/webhooks/1231322811964854292/fLN_e9cNkywg3Hdoi25AKEUL_KDbeKFYTtgNhiwGmHmVa14CWNuF9iSbNAYNFmISD8r3" ,
127132 } ) ;
128- const user = await client . users . fetch ( vote . id ) ;
133+
129134
130135 await webhook . send ( {
131136 embeds : [
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import {LoggingAction} from "../enums/loggingTypes.js";
77import colors from "colors"
88import { User } from "discord.js" ;
99import { Config } from "../main/config.js" ;
10- import * as process from "node:process" ;
1110
1211colors . enable ( ) ;
1312
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import {PrismaClient} from "../prisma/index.js";
33import { LoggingAction } from "../enums/loggingTypes.js" ;
44import { Logger } from "./logger.js" ;
55import colors from "colors"
6- import { initGuildsToDatabase , initUsersToDatabase , setupDisBotConfig } from "../helper/databaseHelper.js" ;
6+ import { initGuildsToDatabase , setupDisBotConfig } from "../helper/databaseHelper.js" ;
77import { Config } from "./config.js" ;
88
99colors . enable ( ) ;
You can’t perform that action at this time.
0 commit comments