UNPKG

seyfert

Version:

The most advanced framework for discord bots

568 lines (567 loc) 31.2 kB
import type { GuildMemberStructure, GuildStructure, ThreadChannelStructure } from '../client'; import type { UsingClient } from '../commands'; import type { CreateInviteFromChannel, GuildSearchMessagesResult } from '../common'; import type { ObjectToLower, StructPropState, StructStates, ToClass } from '../common/types/util'; import type { APIGuild, APIPartialGuild, GatewayGuildCreateDispatchData, RESTGetAPIGuildMessagesSearchQuery, RESTPatchAPIGuildJSONBody } from '../types'; import { BaseGuild } from './extra/BaseGuild'; import type { DiscordBase } from './extra/DiscordBase'; export interface Guild extends ObjectToLower<Omit<APIGuild, 'stickers' | 'emojis' | 'roles'>>, DiscordBase { } declare const Guild_base: ToClass<Omit<BaseGuild, keyof ObjectToLower<APIPartialGuild>>, Guild>; export declare class Guild<State extends StructStates = 'api'> extends Guild_base { joinedAt: StructPropState<number, State, 'create'>; memberCount: StructPropState<number, State, 'create'>; large: StructPropState<boolean, State, 'create'>; unavailable?: StructPropState<boolean, State, 'create'>; constructor(client: UsingClient, data: APIGuild | GatewayGuildCreateDispatchData); webhooks: { list: () => Promise<import("../client").WebhookStructure[]>; }; get maxStickers(): MaxStickers; get maxEmojis(): MaxEmojis; fetchOwner(force?: boolean): Promise<GuildMemberStructure | null>; listActiveThreads(force?: boolean): Promise<ThreadChannelStructure[]>; templates: { fetch: (code: string) => Promise<import("../client").GuildTemplateStructure>; list: () => Promise<import("../client").GuildTemplateStructure[]>; create: (body: import("../types").RESTPostAPIGuildTemplatesJSONBody) => Promise<import("../client").GuildTemplateStructure>; sync: (code: string) => Promise<import("../client").GuildTemplateStructure>; edit: (code: string, body: import("../types").RESTPatchAPIGuildTemplateJSONBody) => Promise<import("../client").GuildTemplateStructure>; delete: (code: string) => Promise<import("../client").GuildTemplateStructure>; }; stickers: { list: () => Promise<import("../client").StickerStructure[]>; create: (payload: import("./Sticker").CreateStickerBodyRequest, reason?: string) => Promise<import("../client").StickerStructure>; edit: (stickerId: string, body: import("../types").RESTPatchAPIGuildStickerJSONBody, reason?: string) => Promise<import("../client").StickerStructure>; fetch: (stickerId: string, force?: boolean) => Promise<import("../client").StickerStructure>; delete: (stickerId: string, reason?: string) => Promise<void>; }; members: { resolve: (resolve: import("../common").GuildMemberResolvable) => Promise<GuildMemberStructure | undefined>; search: (query?: import("../types").RESTGetAPIGuildMembersSearchQuery) => Promise<GuildMemberStructure[]>; unban: (id: string, reason?: string) => Promise<undefined>; ban: (id: string, body?: import("../types").RESTPutAPIGuildBanJSONBody, reason?: string) => Promise<void>; kick: (id: string, reason?: string) => Promise<void>; edit: (id: string, body: import("../types").RESTPatchAPIGuildMemberJSONBody, reason?: string) => Promise<GuildMemberStructure>; add: (id: string, body: import("../types").RESTPutAPIGuildMemberJSONBody) => Promise<GuildMemberStructure | undefined>; addRole: (memberId: string, id: string) => Promise<undefined>; removeRole: (memberId: string, id: string) => Promise<undefined>; fetch: (memberId: string, force?: boolean) => Promise<GuildMemberStructure>; list: (query?: import("../types").RESTGetAPIGuildMembersQuery, force?: boolean) => Promise<GuildMemberStructure[]>; }; moderationRules: { list: () => Promise<import("../client").AutoModerationRuleStructure[]>; create: (body: import("../types").RESTPostAPIAutoModerationRuleJSONBody) => Promise<import("../client").AutoModerationRuleStructure>; delete: (ruleId: string, reason?: string) => Promise<undefined>; fetch: (ruleId: string) => Promise<import("../client").AutoModerationRuleStructure>; edit: (ruleId: string, body: import("../types").RESTPatchAPIAutoModerationRuleJSONBody, reason?: string) => Promise<import("../client").AutoModerationRuleStructure>; }; roles: { create: (body: import("../types").RESTPostAPIGuildRoleJSONBody) => Promise<import("../client").GuildRoleStructure>; list: (force?: boolean) => Promise<import("../client").GuildRoleStructure[]>; edit: (roleId: string, body: import("../types").RESTPatchAPIGuildRoleJSONBody, reason?: string) => Promise<import("../client").GuildRoleStructure>; delete: (roleId: string, reason?: string) => Promise<void>; editPositions: (body: import("../types").RESTPatchAPIGuildRolePositionsJSONBody) => Promise<import("../client").GuildRoleStructure[]>; }; channels: { list: (force?: boolean) => Promise<import("./channels").AllChannels[]>; fetch: (id: string, force?: boolean) => Promise<import("./channels").AllChannels>; create: <T extends import("./channels").GuildChannelTypes = import("./channels").GuildChannelTypes>(body: import("../types").RESTPostAPIGuildChannelJSONBody & { type: T; }) => Promise<import("../commands").SeyfertChannelMap[T]>; delete: (id: string, reason?: string) => Promise<import("./channels").AllChannels>; edit: (id: string, body: import("../types").RESTPatchAPIChannelJSONBody, reason?: string) => Promise<import("./channels").AllChannels>; editPositions: (body: import("../types").RESTPatchAPIGuildChannelPositionsJSONBody) => Promise<undefined>; }; emojis: { edit: (emojiId: string, body: import("../types").RESTPatchAPIGuildEmojiJSONBody, reason?: string) => Promise<import("../client").GuildEmojiStructure>; create: (body: Parameters<import("../common").EmojiShorter["create"]>[1]) => Promise<import("../client").GuildEmojiStructure>; fetch: (emojiId: string, force?: boolean) => Promise<import("../client").GuildEmojiStructure>; list: (force?: boolean) => Promise<import("../client").GuildEmojiStructure[]>; }; bans: { fetch: (userId: string, force?: boolean) => Promise<import("../client").GuildBanStructure>; list: (query?: import("../types").RESTGetAPIGuildBansQuery, force?: boolean) => Promise<import("../client").GuildBanStructure[]>; create: (memberId: string, body?: Parameters<import("../common/shorters/bans").BanShorter["create"]>[2], reason?: string) => Promise<void>; remove: (memberId: string, reason?: string) => Promise<undefined>; bulkCreate: (body: Parameters<import("../common/shorters/bans").BanShorter["bulkCreate"]>[1], reason?: string) => Promise<import("../types").RESTPostAPIGuildBulkBanResult>; }; edit(body: RESTPatchAPIGuildJSONBody, reason?: string): Promise<GuildStructure<'api'>>; searchMessages(query?: RESTGetAPIGuildMessagesSearchQuery, wait?: boolean): Promise<GuildSearchMessagesResult>; invites: { list: () => Promise<{ uses: number; maxUses: number; maxAge: number; temporary: boolean; createdAt: string; code: string; guild?: { id: string; name: string; description: string | null; icon: string | null; splash: string | null; banner: string | null; features: import("../types").GuildFeature[]; verificationLevel: import("../types").GuildVerificationLevel; vanityUrlCode: string | null; premiumSubscriptionCount?: number | undefined; nsfwLevel: import("../types").GuildNSFWLevel; } | undefined; channel: { id: string; type: import("../types").ChannelType; name: string | null; } | null; inviter?: { id: string; username: string; discriminator: string; globalName: string | null; avatar: string | null; bot?: boolean | undefined; system?: boolean | undefined; mfaEnabled?: boolean | undefined; banner?: string | null | undefined; accentColor?: number | null | undefined; locale?: string | undefined; verified?: boolean | undefined; email?: string | null | undefined; flags?: import("../types").UserFlags | undefined; premiumType?: import("../types").UserPremiumType | undefined; publicFlags?: import("../types").UserFlags | undefined; avatarDecorationData?: import("../types").APIAvatarDecorationData | null | undefined; primaryGuild?: import("../types").PrimaryGuild | undefined; } | undefined; targetType?: import("../types").InviteTargetType | undefined; targetUser?: { id: string; username: string; discriminator: string; globalName: string | null; avatar: string | null; bot?: boolean | undefined; system?: boolean | undefined; mfaEnabled?: boolean | undefined; banner?: string | null | undefined; accentColor?: number | null | undefined; locale?: string | undefined; verified?: boolean | undefined; email?: string | null | undefined; flags?: import("../types").UserFlags | undefined; premiumType?: import("../types").UserPremiumType | undefined; publicFlags?: import("../types").UserFlags | undefined; avatarDecorationData?: import("../types").APIAvatarDecorationData | null | undefined; primaryGuild?: import("../types").PrimaryGuild | undefined; } | undefined; targetApplication?: { id?: string | undefined; name?: string | undefined; icon?: string | null | undefined; description?: string | undefined; rpcOrigins?: string[] | undefined; botPublic?: boolean | undefined; botRequireCodeGrant?: boolean | undefined; bot?: import("../types").APIUser | undefined; termsOfServiceUrl?: string | undefined; privacyPolicyUrl?: string | undefined; owner?: import("../types").APIUser | undefined; verifyKey?: string | undefined; team?: import("../types").APITeam | null | undefined; guildId?: string | undefined; guild?: APIPartialGuild | undefined; primarySkuId?: string | undefined; slug?: string | undefined; coverImage?: string | undefined; flags?: import("../types").ApplicationFlags | undefined; approximateGuildCount?: number | undefined; approximateUserInstallCount?: number | undefined; redirectUris?: string[] | undefined; interactionsEndpointUrl?: string | null | undefined; roleConnectionsVerificationUrl?: string | null | undefined; tags?: [string, (string | undefined)?, (string | undefined)?, (string | undefined)?, (string | undefined)?] | undefined; installParams?: import("../types").APIApplicationInstallParams | undefined; integrationTypesConfig?: import("../types").APIApplicationIntegrationTypesConfigMap | undefined; customInstallUrl?: string | undefined; } | undefined; approximatePresenceCount?: number | undefined; approximateMemberCount?: number | undefined; expiresAt?: string | null | undefined; guildScheduledEvent?: { channelId: string; entityMetadata: null; id: string; guildId: string; creatorId?: string | null | undefined; name: string; description?: string | null | undefined; scheduledStartTime: string; scheduledEndTime: string | null; privacyLevel: import("../types").GuildScheduledEventPrivacyLevel; status: import("../types").GuildScheduledEventStatus; entityType: import("../types").GuildScheduledEventEntityType.StageInstance; entityId: string | null; creator?: import("../types").APIUser | undefined; userCount?: number | undefined; image?: string | null | undefined; recurrenceRule: import("../types").APIGuildScheduledEventRecurrenceRule | null; } | { channelId: string; entityMetadata: null; id: string; guildId: string; creatorId?: string | null | undefined; name: string; description?: string | null | undefined; scheduledStartTime: string; scheduledEndTime: string | null; privacyLevel: import("../types").GuildScheduledEventPrivacyLevel; status: import("../types").GuildScheduledEventStatus; entityType: import("../types").GuildScheduledEventEntityType.Voice; entityId: string | null; creator?: import("../types").APIUser | undefined; userCount?: number | undefined; image?: string | null | undefined; recurrenceRule: import("../types").APIGuildScheduledEventRecurrenceRule | null; } | { channelId: null; entityMetadata: { location: string; }; id: string; guildId: string; creatorId?: string | null | undefined; name: string; description?: string | null | undefined; scheduledStartTime: string; scheduledEndTime: string | null; privacyLevel: import("../types").GuildScheduledEventPrivacyLevel; status: import("../types").GuildScheduledEventStatus; entityType: import("../types").GuildScheduledEventEntityType.External; entityId: string | null; creator?: import("../types").APIUser | undefined; userCount?: number | undefined; image?: string | null | undefined; recurrenceRule: import("../types").APIGuildScheduledEventRecurrenceRule | null; } | undefined; type: import("../types").InviteType; }[]>; create: (data: CreateInviteFromChannel) => Promise<{ uses: number; maxUses: number; maxAge: number; temporary: boolean; createdAt: string; code: string; guild?: { id: string; name: string; description: string | null; icon: string | null; splash: string | null; banner: string | null; features: import("../types").GuildFeature[]; verificationLevel: import("../types").GuildVerificationLevel; vanityUrlCode: string | null; premiumSubscriptionCount?: number | undefined; nsfwLevel: import("../types").GuildNSFWLevel; } | undefined; channel: { id: string; type: import("../types").ChannelType; name: string | null; } | null; inviter?: { id: string; username: string; discriminator: string; globalName: string | null; avatar: string | null; bot?: boolean | undefined; system?: boolean | undefined; mfaEnabled?: boolean | undefined; banner?: string | null | undefined; accentColor?: number | null | undefined; locale?: string | undefined; verified?: boolean | undefined; email?: string | null | undefined; flags?: import("../types").UserFlags | undefined; premiumType?: import("../types").UserPremiumType | undefined; publicFlags?: import("../types").UserFlags | undefined; avatarDecorationData?: import("../types").APIAvatarDecorationData | null | undefined; primaryGuild?: import("../types").PrimaryGuild | undefined; } | undefined; targetType?: import("../types").InviteTargetType | undefined; targetUser?: { id: string; username: string; discriminator: string; globalName: string | null; avatar: string | null; bot?: boolean | undefined; system?: boolean | undefined; mfaEnabled?: boolean | undefined; banner?: string | null | undefined; accentColor?: number | null | undefined; locale?: string | undefined; verified?: boolean | undefined; email?: string | null | undefined; flags?: import("../types").UserFlags | undefined; premiumType?: import("../types").UserPremiumType | undefined; publicFlags?: import("../types").UserFlags | undefined; avatarDecorationData?: import("../types").APIAvatarDecorationData | null | undefined; primaryGuild?: import("../types").PrimaryGuild | undefined; } | undefined; targetApplication?: { id?: string | undefined; name?: string | undefined; icon?: string | null | undefined; description?: string | undefined; rpcOrigins?: string[] | undefined; botPublic?: boolean | undefined; botRequireCodeGrant?: boolean | undefined; bot?: import("../types").APIUser | undefined; termsOfServiceUrl?: string | undefined; privacyPolicyUrl?: string | undefined; owner?: import("../types").APIUser | undefined; verifyKey?: string | undefined; team?: import("../types").APITeam | null | undefined; guildId?: string | undefined; guild?: APIPartialGuild | undefined; primarySkuId?: string | undefined; slug?: string | undefined; coverImage?: string | undefined; flags?: import("../types").ApplicationFlags | undefined; approximateGuildCount?: number | undefined; approximateUserInstallCount?: number | undefined; redirectUris?: string[] | undefined; interactionsEndpointUrl?: string | null | undefined; roleConnectionsVerificationUrl?: string | null | undefined; tags?: [string, (string | undefined)?, (string | undefined)?, (string | undefined)?, (string | undefined)?] | undefined; installParams?: import("../types").APIApplicationInstallParams | undefined; integrationTypesConfig?: import("../types").APIApplicationIntegrationTypesConfigMap | undefined; customInstallUrl?: string | undefined; } | undefined; approximatePresenceCount?: number | undefined; approximateMemberCount?: number | undefined; expiresAt?: string | null | undefined; guildScheduledEvent?: { channelId: string; entityMetadata: null; id: string; guildId: string; creatorId?: string | null | undefined; name: string; description?: string | null | undefined; scheduledStartTime: string; scheduledEndTime: string | null; privacyLevel: import("../types").GuildScheduledEventPrivacyLevel; status: import("../types").GuildScheduledEventStatus; entityType: import("../types").GuildScheduledEventEntityType.StageInstance; entityId: string | null; creator?: import("../types").APIUser | undefined; userCount?: number | undefined; image?: string | null | undefined; recurrenceRule: import("../types").APIGuildScheduledEventRecurrenceRule | null; } | { channelId: string; entityMetadata: null; id: string; guildId: string; creatorId?: string | null | undefined; name: string; description?: string | null | undefined; scheduledStartTime: string; scheduledEndTime: string | null; privacyLevel: import("../types").GuildScheduledEventPrivacyLevel; status: import("../types").GuildScheduledEventStatus; entityType: import("../types").GuildScheduledEventEntityType.Voice; entityId: string | null; creator?: import("../types").APIUser | undefined; userCount?: number | undefined; image?: string | null | undefined; recurrenceRule: import("../types").APIGuildScheduledEventRecurrenceRule | null; } | { channelId: null; entityMetadata: { location: string; }; id: string; guildId: string; creatorId?: string | null | undefined; name: string; description?: string | null | undefined; scheduledStartTime: string; scheduledEndTime: string | null; privacyLevel: import("../types").GuildScheduledEventPrivacyLevel; status: import("../types").GuildScheduledEventStatus; entityType: import("../types").GuildScheduledEventEntityType.External; entityId: string | null; creator?: import("../types").APIUser | undefined; userCount?: number | undefined; image?: string | null | undefined; recurrenceRule: import("../types").APIGuildScheduledEventRecurrenceRule | null; } | undefined; type: import("../types").InviteType; }>; delete: (code: string, reason?: string) => Promise<{ code: string; guild?: { id: string; name: string; description: string | null; icon: string | null; splash: string | null; banner: string | null; features: import("../types").GuildFeature[]; verificationLevel: import("../types").GuildVerificationLevel; vanityUrlCode: string | null; premiumSubscriptionCount?: number | undefined; nsfwLevel: import("../types").GuildNSFWLevel; } | undefined; channel: { id: string; type: import("../types").ChannelType; name: string | null; } | null; inviter?: { id: string; username: string; discriminator: string; globalName: string | null; avatar: string | null; bot?: boolean | undefined; system?: boolean | undefined; mfaEnabled?: boolean | undefined; banner?: string | null | undefined; accentColor?: number | null | undefined; locale?: string | undefined; verified?: boolean | undefined; email?: string | null | undefined; flags?: import("../types").UserFlags | undefined; premiumType?: import("../types").UserPremiumType | undefined; publicFlags?: import("../types").UserFlags | undefined; avatarDecorationData?: import("../types").APIAvatarDecorationData | null | undefined; primaryGuild?: import("../types").PrimaryGuild | undefined; } | undefined; targetType?: import("../types").InviteTargetType | undefined; targetUser?: { id: string; username: string; discriminator: string; globalName: string | null; avatar: string | null; bot?: boolean | undefined; system?: boolean | undefined; mfaEnabled?: boolean | undefined; banner?: string | null | undefined; accentColor?: number | null | undefined; locale?: string | undefined; verified?: boolean | undefined; email?: string | null | undefined; flags?: import("../types").UserFlags | undefined; premiumType?: import("../types").UserPremiumType | undefined; publicFlags?: import("../types").UserFlags | undefined; avatarDecorationData?: import("../types").APIAvatarDecorationData | null | undefined; primaryGuild?: import("../types").PrimaryGuild | undefined; } | undefined; targetApplication?: { id?: string | undefined; name?: string | undefined; icon?: string | null | undefined; description?: string | undefined; rpcOrigins?: string[] | undefined; botPublic?: boolean | undefined; botRequireCodeGrant?: boolean | undefined; bot?: import("../types").APIUser | undefined; termsOfServiceUrl?: string | undefined; privacyPolicyUrl?: string | undefined; owner?: import("../types").APIUser | undefined; verifyKey?: string | undefined; team?: import("../types").APITeam | null | undefined; guildId?: string | undefined; guild?: APIPartialGuild | undefined; primarySkuId?: string | undefined; slug?: string | undefined; coverImage?: string | undefined; flags?: import("../types").ApplicationFlags | undefined; approximateGuildCount?: number | undefined; approximateUserInstallCount?: number | undefined; redirectUris?: string[] | undefined; interactionsEndpointUrl?: string | null | undefined; roleConnectionsVerificationUrl?: string | null | undefined; tags?: [string, (string | undefined)?, (string | undefined)?, (string | undefined)?, (string | undefined)?] | undefined; installParams?: import("../types").APIApplicationInstallParams | undefined; integrationTypesConfig?: import("../types").APIApplicationIntegrationTypesConfigMap | undefined; customInstallUrl?: string | undefined; } | undefined; approximatePresenceCount?: number | undefined; approximateMemberCount?: number | undefined; expiresAt?: string | null | undefined; guildScheduledEvent?: { channelId: string; entityMetadata: null; id: string; guildId: string; creatorId?: string | null | undefined; name: string; description?: string | null | undefined; scheduledStartTime: string; scheduledEndTime: string | null; privacyLevel: import("../types").GuildScheduledEventPrivacyLevel; status: import("../types").GuildScheduledEventStatus; entityType: import("../types").GuildScheduledEventEntityType.StageInstance; entityId: string | null; creator?: import("../types").APIUser | undefined; userCount?: number | undefined; image?: string | null | undefined; recurrenceRule: import("../types").APIGuildScheduledEventRecurrenceRule | null; } | { channelId: string; entityMetadata: null; id: string; guildId: string; creatorId?: string | null | undefined; name: string; description?: string | null | undefined; scheduledStartTime: string; scheduledEndTime: string | null; privacyLevel: import("../types").GuildScheduledEventPrivacyLevel; status: import("../types").GuildScheduledEventStatus; entityType: import("../types").GuildScheduledEventEntityType.Voice; entityId: string | null; creator?: import("../types").APIUser | undefined; userCount?: number | undefined; image?: string | null | undefined; recurrenceRule: import("../types").APIGuildScheduledEventRecurrenceRule | null; } | { channelId: null; entityMetadata: { location: string; }; id: string; guildId: string; creatorId?: string | null | undefined; name: string; description?: string | null | undefined; scheduledStartTime: string; scheduledEndTime: string | null; privacyLevel: import("../types").GuildScheduledEventPrivacyLevel; status: import("../types").GuildScheduledEventStatus; entityType: import("../types").GuildScheduledEventEntityType.External; entityId: string | null; creator?: import("../types").APIUser | undefined; userCount?: number | undefined; image?: string | null | undefined; recurrenceRule: import("../types").APIGuildScheduledEventRecurrenceRule | null; } | undefined; type: import("../types").InviteType; }>; }; } /** Maximun custom guild emojis per level */ export type MaxEmojis = 50 | 100 | 150 | 250; /** Maximun custom guild stickers per level */ export type MaxStickers = 5 | 15 | 30 | 60; export {};