Skip to content

Commit

Permalink
type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Larsundso committed Dec 31, 2024
1 parent 2c656f5 commit a8b0d5a
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions src/Commands/SlashCommands/settings/custom-client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { API } from '@discordjs/core';
import { API, type RESTPostAPIChatInputApplicationCommandsJSONBody } from '@discordjs/core';
import * as Discord from 'discord.js';
import client from '../../../BaseClient/Bot/Client.js';
import Lang from '../../../BaseClient/Other/language.js';
Expand Down Expand Up @@ -245,28 +245,14 @@ const sendWebhookRequest = (guild: Discord.Guild, meId: string) =>
components: [
{
type: Discord.ComponentType.ActionRow,
components: [
{
components: ['1155145303167602838', '1155145225459744780', '1155150048393441411'].map(
(id, i) => ({
type: Discord.ComponentType.Button,
style: Discord.ButtonStyle.Link,
label: 'Invite 1',
url: `https://discord.com/api/oauth2/authorize?client_id=${meId}&scope=bot&guild=1155150048393441411`,
},

{
type: Discord.ComponentType.Button,
style: Discord.ButtonStyle.Link,
label: 'Invite 2',
url: `https://discord.com/api/oauth2/authorize?client_id=${meId}&scope=bot&guild=1155145303167602838`,
},

{
type: Discord.ComponentType.Button,
style: Discord.ButtonStyle.Link,
label: 'Invite 3',
url: `https://discord.com/api/oauth2/authorize?client_id=${meId}&scope=bot&guild=1155145225459744780`,
},
],
label: `Invite ${i + 1}`,
url: `https://discord.com/api/oauth2/authorize?client_id=${meId}&scope=bot&guild_id=${id}`,
}),
),
},
],
},
Expand All @@ -286,7 +272,7 @@ export const doCommands = async (guild: Discord.Guild, me: Discord.APIApplicatio
.map((e) => guild.commands.cache.find((c) => c.name === e))
.filter((c): c is Discord.ApplicationCommand => !!c)
.map((c) => registerCmd(c.name as Parameters<typeof registerCmd>[0], guild))
.filter((c): c is Discord.RESTPostAPIChatInputApplicationCommandsJSONBody => !!c);
.filter((c): c is RESTPostAPIChatInputApplicationCommandsJSONBody => !!c);

await client.util.request.commands.bulkOverwriteGuildCommands(guild, [...existingCommands]);

Expand Down

0 comments on commit a8b0d5a

Please sign in to comment.