generated from nhcarrigan/template
feat: define type, prep for company announcements
This commit is contained in:
@@ -5,14 +5,23 @@
|
||||
*/
|
||||
/* eslint-disable @typescript-eslint/naming-convention -- we are making raw API calls. */
|
||||
|
||||
const channelIds = {
|
||||
import type { AnnouncementType } from "../interfaces/announcementType.js";
|
||||
|
||||
const channelIds: Record<AnnouncementType, string> = {
|
||||
community: "1386105484313886820",
|
||||
company: "1422472775695728661",
|
||||
products: "1386105452881776661",
|
||||
} as const;
|
||||
const roleIds = {
|
||||
};
|
||||
const roleIds: Record<AnnouncementType, string> = {
|
||||
community: "1386107941224054895",
|
||||
products: "1386107909699666121",
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Note that this is not a role ID, but the server ID.
|
||||
* Company announcements ping everyone.
|
||||
*/
|
||||
company: "1354624415861833870",
|
||||
products: "1386107909699666121",
|
||||
};
|
||||
|
||||
/**
|
||||
* Forwards an announcement to our Discord server.
|
||||
@@ -24,7 +33,7 @@ const roleIds = {
|
||||
export const announceOnDiscord = async(
|
||||
title: string,
|
||||
content: string,
|
||||
type: "products" | "community",
|
||||
type: AnnouncementType,
|
||||
): Promise<string> => {
|
||||
const messageRequest = await fetch(
|
||||
`https://discord.com/api/v10/channels/${channelIds[type]}/messages`,
|
||||
|
||||
Reference in New Issue
Block a user