mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
refactor!: move dirs outside of src/ (#2032)
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user