feat: more automated announcements #8

Merged
naomi merged 11 commits from feat/announcements into main 2026-01-08 18:07:28 -08:00
Showing only changes of commit 2692948202 - Show all commits
+8 -8
View File
@@ -12,15 +12,15 @@ const channelIds: Record<AnnouncementType, string> = {
company: "1422472775695728661",
products: "1386105452881776661",
};
const roleIds: Record<AnnouncementType, string> = {
const roleIds: Record<Exclude<AnnouncementType, "company">, string> = {
community: "1386107941224054895",
products: "1386107909699666121",
};
/**
* Note that this is not a role ID, but the server ID.
* Company announcements ping everyone.
*/
company: "1354624415861833870",
products: "1386107909699666121",
const getAnnouncementPing = (type: AnnouncementType): string => {
return type === "company"
? "@everyone"
: `<@&${roleIds[type]}>`;
};
/**
@@ -40,7 +40,7 @@ export const announceOnDiscord = async(
{
body: JSON.stringify({
allowed_mentions: { parse: [ "users", "roles" ] },
content: `# ${title}\n\n${content}\n-# <@&${roleIds[type]}>`,
content: `# ${title}\n\n${content}\n-# ${getAnnouncementPing(type)}`,
}),
headers: {
"Authorization": `Bot ${process.env.DISCORD_TOKEN ?? ""}`,