GuildShorter

Signature

export declare class GuildShorter extends BaseShorter

Properties

channels: {    list: (guildId: string, force?: boolean) => Promise<AllChannels[]>;    fetch: (_guildId: string, channelId: string, force?: boolean) => Promise<AllChannels>;    create: <T extends GuildChannelTypes = GuildChannelTypes>(guildId: string, body: RESTPostAPIGuildChannelJSONBody & {        type: T;    }) => Promise<SeyfertChannelMap[T]>;    delete: (guildId: string, channelId: string, reason?: string) => Promise<AllChannels>;    edit: (guildId: string, channelId: string, body: RESTPatchAPIChannelJSONBody, reason?: string) => Promise<AllChannels>;    editPositions: (guildId: string, body: RESTPatchAPIGuildChannelPositionsJSONBody) => Promise<undefined>;    addFollower: (channelId: string, webhook_channel_id: string, reason?: string) => Promise<RESTPostAPIChannelFollowersResult>;};

Provides access to channel-related functionality in a guild.

moderation: {    list: (guildId: string) => Promise<AutoModerationRuleStructure[]>;    create: (guildId: string, body: RESTPostAPIAutoModerationRuleJSONBody) => Promise<AutoModerationRuleStructure>;    delete: (guildId: string, ruleId: string, reason?: string) => Promise<undefined>;    fetch: (guildId: string, ruleId: string) => Promise<AutoModerationRuleStructure>;    edit: (guildId: string, ruleId: string, body: RESTPatchAPIAutoModerationRuleJSONBody, reason?: string) => Promise<AutoModerationRuleStructure>;};

Provides access to auto-moderation rule-related functionality in a guild.

stickers: {    list: (guildId: string) => Promise<StickerStructure[]>;    create: (guildId: string, { file, ...json }: CreateStickerBodyRequest, reason?: string) => Promise<StickerStructure>;    edit: (guildId: string, stickerId: string, body: RESTPatchAPIGuildStickerJSONBody, reason?: string) => Promise<StickerStructure>;    fetch: (guildId: string, stickerId: string, force?: boolean) => Promise<StickerStructure>;    delete: (guildId: string, stickerId: string, reason?: string) => Promise<void>;};

Provides access to sticker-related functionality in a guild.

Methods

fetch(id: string, options?: GuildFetchOptions | boolean): Promise<Guild<"api">>;

Fetches a guild by its ID.

Parameters
id
The ID of the guild to fetch.
options
The options for fetching the guild.
options.query
The query parameters for fetching the guild.
options.force
Whether to force fetching the guild from the API even if it exists in the cache.
Returns

A Promise that resolves to the fetched guild.

raw(id: string, options?: GuildFetchOptions | boolean): Promise<APIGuild>;

Fetches a guild by its ID.

Parameters
id
The ID of the guild to fetch.
options
The options for fetching the guild.
options.query
The query parameters for fetching the guild.
options.force
Whether to force fetching the guild from the API even if it exists in the cache.
Returns

A Promise that resolves to the fetched guild.

leave(id: string): Promise<void | undefined>;
searchMessages(guildId: string, query?: RESTGetAPIGuildMessagesSearchQuery, wait?: boolean): Promise<GuildSearchMessagesResult>;

Searches for messages within a guild using a variety of filters. Requires `READ_MESSAGE_HISTORY` permission.

Parameters
guildId
The ID of the guild to search in.
query
The search query parameters.
wait
Whether to automatically wait and retry when the guild index is not yet available (HTTP 202).
Returns

A Promise that resolves to the search results with flattened messages.