Skip to content

Commit

Permalink
Discord UpdateInteractions, ignore modals
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryCraft committed May 31, 2024
1 parent c03c227 commit 95e9cd3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/discord/hooks/other/updateInteractions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default async function updateInteractions(client: ExtendedClient, params:
if (!guild) {
const arr: ApplicationCommandDataResolvable[] = [];
for await (const [, interaction] of client.interactions.entries()) {
if (interaction.type == "modal") continue;
if (interaction.registerTo == "app") arr.push(fromInteraction(interaction));
}
client.application?.commands.set(arr).catch((e) => {
Expand All @@ -44,6 +45,7 @@ export default async function updateInteractions(client: ExtendedClient, params:
}
const arr: ApplicationCommandDataResolvable[] = [];
for await (const [, interaction] of client.interactions.entries()) {
if (interaction.type == "modal") continue;
if (interaction.registerTo == "guild") arr.push(fromInteraction(interaction));
}
await guild.commands.set(arr).catch((e) => {
Expand Down

0 comments on commit 95e9cd3

Please sign in to comment.