Skip to content

Commit

Permalink
chore: handle "Unknown interaction"
Browse files Browse the repository at this point in the history
  • Loading branch information
yuimarudev committed Feb 19, 2024
1 parent 7de53b0 commit cc4af96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/handlers/interactionCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ export default async ({
api,
data,
}: WithIntrinsicProps<GatewayInteractionCreateDispatchData>) => {
await api.interactions.defer(data.id, data.token);
const error = await api.interactions
.defer(data.id, data.token)
.catch((x) => x as Error);

if (error) return console.error(error);
if (!validate(data)) return false;

const command = commands.find((x) => x.defition().name === data.data.name);
Expand Down

0 comments on commit cc4af96

Please sign in to comment.