refactor!: move dirs outside of src/ (#2032)

This commit is contained in:
Skillz4Killz
2022-02-11 04:49:53 -05:00
committed by GitHub
parent 471ef5cb6c
commit 8aaea9f339
594 changed files with 84 additions and 66 deletions
+25
View File
@@ -0,0 +1,25 @@
import type { DiscoveryMetadata } from "../../types/discovery/discoveryMetadata.ts";
import type { Bot } from "../../bot.ts";
/** Returns the discovery metadata object for the guild. Requires the `MANAGE_GUILD` permission. */
export async function getDiscovery(bot: Bot, guildId: bigint) {
const result = await bot.rest.runMethod<DiscoveryMetadata>(
bot.rest,
"get",
bot.constants.endpoints.DISCOVERY_METADATA(guildId),
);
return {
guildId,
primaryCategoryId: result.primary_category_id,
keywords: result.keywords ?? undefined,
emojiDiscoverabilityEnabled: result.emoji_discoverability_enabled,
partnerActionedTimestamp: result.partner_actioned_timestamp
? Date.parse(result.partner_actioned_timestamp)
: undefined,
partnerApplicationTimestamp: result.partner_application_timestamp
? Date.parse(result.partner_application_timestamp)
: undefined,
categoryIds: result.category_ids,
};
}