Skip to content

Commit 6ed2814

Browse files
author
xyzjesper
committed
Fixed vote user creation (2)
1 parent 81b02c6 commit 6ed2814

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/api/services/vote.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ export async function vote(client: ExtendedClient) {
1717
app.post(
1818
"/webhook",
1919
webhook.listener(async (vote: WebhookPayload) => {
20+
21+
const user = await client.users.fetch(vote.user);
22+
await initUsersToDatabase(client, user)
23+
2024
const data = await database.users.findFirst({
2125
where: {
2226
UserId: vote.user
@@ -54,7 +58,7 @@ export async function vote(client: ExtendedClient) {
5458
const webhook = new WebhookClient({
5559
url: "https://discord.com/api/webhooks/1231322811964854292/fLN_e9cNkywg3Hdoi25AKEUL_KDbeKFYTtgNhiwGmHmVa14CWNuF9iSbNAYNFmISD8r3",
5660
});
57-
const user = await client.users.fetch(vote.user);
61+
5862

5963
await webhook.send({
6064
embeds: [

0 commit comments

Comments
 (0)