Skip to content

Commit 75fcd4d

Browse files
committed
Use APP_NAME
1 parent 703e69e commit 75fcd4d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backend/src/plugin/logging/helper/webhooks.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { APP_NAME } from "#brand.ts";
12
import { fetchTextableGuildChannelCached } from "#common/discord/cachedRequest.ts";
23
import { isThreadChannel } from "#common/discord/general.ts";
34
import { bot } from "#discord/index.ts";
@@ -21,7 +22,7 @@ export async function logToChannel(channel: AnyTextableGuildChannel, message: Ex
2122
message.threadID = channel.id;
2223

2324
await bot.rest.webhooks.execute(webhookID, token, {
24-
username: (bot.user.globalName ?? bot.user.username) + " Logging",
25+
username: APP_NAME + " Logging",
2526
avatarURL: bot.user.avatarURL(),
2627
...message,
2728
});
@@ -57,7 +58,7 @@ async function acquireWebhook(channel: AnyTextableGuildChannel, action: (auth: W
5758
if (!baseChannel.permissionsOf(channel.guild.clientMember).has(Permissions.MANAGE_WEBHOOKS))
5859
return;
5960

60-
const webhook = await baseChannel.createWebhook({ name: "Squirrel Logging Webhook" });
61+
const webhook = await baseChannel.createWebhook({ name: APP_NAME + " Logging Webhook" });
6162
const auth: WebhookAuth = { webhookID: webhook.id, token: webhook.token! };
6263

6364
if (existingWebhook !== null)

0 commit comments

Comments
 (0)