GuildShorter
Signature
export declare class GuildShorter extends BaseShorterProperties
8Methods
9Properties
audit: { fetch: (guildId: string, query?: RESTGetAPIAuditLogQuery) => Promise<APIAuditLog>;};Provides access to audit-log functionality in a guild. https://docs.discord.com/developers/resources/audit-log#get-guild-audit-log
onboarding: { fetch: (guildId: string) => Promise<GuildOnboardingStructure>; edit: (guildId: string, body: RESTPutAPIGuildOnboardingJSONBody, reason?: string) => Promise<GuildOnboardingStructure>;};Provides access to onboarding functionality in a guild. https://docs.discord.com/developers/resources/guild#get-guild-onboarding
welcome: { fetch: (guildId: string) => Promise<GuildWelcomeScreenStructure>; edit: (guildId: string, body: RESTPatchAPIGuildWelcomeScreenJSONBody, reason?: string) => Promise<GuildWelcomeScreenStructure>;};Provides access to welcome-screen functionality in a guild. https://docs.discord.com/developers/resources/guild#get-guild-welcome-screen
widget: { settings: (guildId: string) => Promise<APIGuildWidgetSettings>; edit: (guildId: string, body: RESTPatchAPIGuildWidgetSettingsJSONBody, reason?: string) => Promise<APIGuildWidgetSettings>; fetch: (guildId: string) => Promise<APIGuildWidget>; image: (guildId: string, query?: RESTGetAPIGuildWidgetImageQuery) => Promise<ArrayBuffer>;};Provides access to widget functionality in a guild. https://docs.discord.com/developers/resources/guild#get-guild-widget-settings
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.
events: { list: (guildId: string, query?: RESTGetAPIGuildScheduledEventsQuery) => Promise<GuildScheduledEventStructure[]>; create: (guildId: string, body: RESTPostAPIGuildScheduledEventJSONBody, reason?: string) => Promise<GuildScheduledEventStructure>; fetch: (guildId: string, eventId: string, query?: RESTGetAPIGuildScheduledEventQuery) => Promise<GuildScheduledEventStructure>; edit: (guildId: string, eventId: string, body: RESTPatchAPIGuildScheduledEventJSONBody, reason?: string) => Promise<GuildScheduledEventStructure>; delete: (guildId: string, eventId: string, reason?: string) => Promise<undefined>; subscribers: (guildId: string, eventId: string, query?: RESTGetAPIGuildScheduledEventUsersQuery) => Promise<GuildScheduledSubscriberStructure[]>;};Provides access to scheduled-event functionality in a guild. https://docs.discord.com/developers/resources/guild-scheduled-event
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.
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.
A Promise that resolves to the fetched guild.
raw(id: string, options?: GuildFetchOptions | boolean): Promise<APIGuild>;Fetches a guild by its ID.
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.
A Promise that resolves to the fetched guild.
widgetURL(id: string, style?: GuildWidgetStyle): Promise<ArrayBuffer>;Generates the widget URL for the guild.
id- The ID of the guild.
style- The style of the widget.
The generated widget URL.
incidents(guildId: string, body: RESTPutAPIGuildIncidentActionsJSONBody, reason?: string): Promise<RESTPutAPIGuildIncidentActionsResult>;Replaces the incident actions for a guild.
guildId- The ID of the guild.
body- When invites and DMs stay disabled until.
reason- The audit-log reason.
A Promise that resolves to the updated incidents payload.
edit(guildId: string, body: RESTPatchAPIGuildJSONBody, reason?: string): Promise<GuildStructure<'api'>>;list<T extends boolean = false>(query?: RESTGetAPICurrentUserGuildsQuery, force?: T): Promise<If<T, AnonymousGuildStructure[], GuildStructure<'cached'>[] | AnonymousGuildStructure[]>>;fetchSelf(id: string, force?: boolean): Promise<GuildMemberStructure>;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.
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).
A Promise that resolves to the search results with flattened messages.