Skip to content

Commit

Permalink
find webhooks using application id
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 authored and Meta Construct committed Apr 5, 2024
1 parent 39b0d72 commit cd06edd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/services/Starboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ export class Starboard extends Service {

// we need a webhook created by the application so we can attach components
const webhooks = await channel.fetchWebhooks();
let webhook = webhooks.find(h => h.isApplicationCreated());
if (!webhook)
webhook = await channel.createWebhook({ name: "metaconcord starboard", });
let webhook = webhooks.find(
h => h.applicationId === discordConfig.bot.applicationId && h.token
);
if (!webhook) webhook = await channel.createWebhook({ name: "metaconcord starboard" });

if (webhook) {
const starred = await webhook.send({
Expand Down

0 comments on commit cd06edd

Please sign in to comment.