Class
REST
HTTP client for the Fluxer API.
Extends EventEmitter
Constructor
new REST
(options: RESTOptions)| Param | Type | Description |
|---|---|---|
| options | RESTOptions |
Properties
requestManager
: RequestManager (readonly)Routes
: { readonly channel: (id: ) => `/channels/${string}`; readonly channelMessages: (id: ) => `/channels/${string}/messages`; readonly channelMessage: (channelId: , messageId: ) => `/channels/${string}/messages/${string}`; readonly channelMessageReactions: (channelId: , messageId: ) => `/channels/${string}/messages/${string}/reactions`; readonly channelMessageReaction: (channelId: , messageId: , emoji: string) => `/channels/${string}/messages/${string}/reactions/${string}`; readonly channelMessageReactionMe: (channelId: , messageId: , emoji: string) => `/channels/${string}/messages/${string}/reactions/${string}/@me`; readonly channelMessageReactionUsers: (channelId: , messageId: , emoji: string) => `/channels/${string}/messages/${string}/reactions/${string}/users`; readonly channelMessageReactionUser: (channelId: , messageId: , emoji: string, userId: ) => `/channels/${string}/messages/${string}/reactions/${string}/${string}`; readonly channelPins: (id: ) => `/channels/${string}/messages/pins`; readonly channelPinMessage: (channelId: , messageId: ) => `/channels/${string}/pins/${string}`; readonly channelBulkDelete: (id: ) => `/channels/${string}/messages/bulk-delete`; readonly channelBulkDeleteMine: (id: ) => `/channels/${string}/messages/bulk-delete-mine`; readonly channelMessagesAck: (id: ) => `/channels/${string}/messages/ack`; readonly channelMessagesPurge: (id: ) => `/channels/${string}/messages/purge`; readonly channelPinsAck: (id: ) => `/channels/${string}/pins/ack`; readonly channelAttachments: (id: ) => `/channels/${string}/attachments`; readonly channelAttachmentsComplete: (id: ) => `/channels/${string}/attachments/complete`; readonly channelsMessagesBulk: () => "/channels/messages/bulk"; readonly channelWebhooks: (id: ) => `/channels/${string}/webhooks`; readonly channelTyping: (id: ) => `/channels/${string}/typing`; readonly channelRtcRegions: (id: ) => `/channels/${string}/rtc-regions`; readonly channelSlowmode: (id: ) => `/channels/${string}/slowmode`; readonly channelInvites: (id: ) => `/channels/${string}/invites`; readonly channelPermission: (channelId: , overwriteId: ) => `/channels/${string}/permissions/${string}`; readonly channelRecipient: (channelId: , userId: ) => `/channels/${string}/recipients/${string}`; readonly channelMessageAttachment: (channelId: , messageId: , attachmentId: ) => `/channels/${string}/messages/${string}/attachments/${string}`; readonly guilds: () => "/guilds"; readonly guild: (id: ) => `/guilds/${string}`; readonly guildDelete: (guildId: ) => `/guilds/${string}/delete`; readonly guildVanityUrl: (guildId: ) => `/guilds/${string}/vanity-url`; readonly guildTransferOwnership: (guildId: ) => `/guilds/${string}/transfer-ownership`; readonly guildRolesHoistPositions: (guildId: ) => `/guilds/${string}/roles/hoist-positions`; readonly guildEmojisBulk: (guildId: ) => `/guilds/${string}/emojis/bulk`; readonly guildEmojisClone: (guildId: ) => `/guilds/${string}/emojis/clone`; readonly guildStickersBulk: (guildId: ) => `/guilds/${string}/stickers/bulk`; readonly guildStickersClone: (guildId: ) => `/guilds/${string}/stickers/clone`; readonly guildDiscovery: (guildId: ) => `/guilds/${string}/discovery`; readonly guildChannels: (id: ) => `/guilds/${string}/channels`; readonly guildMembers: (id: ) => `/guilds/${string}/members`; readonly guildMembersSearch: (id: ) => `/guilds/${string}/members-search`; readonly guildMember: (guildId: , userId: ) => `/guilds/${string}/members/${string}`; readonly guildMemberMe: (guildId: ) => `/guilds/${string}/members/@me`; readonly guildMemberRole: (guildId: , userId: , roleId: ) => `/guilds/${string}/members/${string}/roles/${string}`; readonly guildRoles: (id: ) => `/guilds/${string}/roles`; readonly guildRole: (guildId: , roleId: ) => `/guilds/${string}/roles/${string}`; readonly guildBans: (id: ) => `/guilds/${string}/bans`; readonly guildBan: (guildId: , userId: ) => `/guilds/${string}/bans/${string}`; readonly guildInvites: (id: ) => `/guilds/${string}/invites`; readonly invite: (code: string) => `/invites/${string}`; readonly guildAuditLogs: (id: ) => `/guilds/${string}/audit-logs`; readonly guildEmojis: (id: ) => `/guilds/${string}/emojis`; readonly guildEmoji: (guildId: , emojiId: ) => `/guilds/${string}/emojis/${string}`; readonly guildStickers: (id: ) => `/guilds/${string}/stickers`; readonly guildSticker: (guildId: , stickerId: ) => `/guilds/${string}/stickers/${string}`; readonly guildWebhooks: (id: ) => `/guilds/${string}/webhooks`; readonly webhook: (id: ) => `/webhooks/${string}`; readonly webhookExecute: (id: , token: string) => `/webhooks/${string}/${string}`; readonly webhookMessage: (id: , token: string, messageId: ) => `/webhooks/${string}/${string}/messages/${string}`; readonly user: (id: ) => `/users/${string}`; readonly currentUser: () => "/users/@me"; readonly currentUserGuilds: () => "/users/@me/guilds"; readonly leaveGuild: (guildId: ) => `/users/@me/guilds/${string}`; readonly guildBulkDeleteMine: (guildId: ) => `/users/@me/guilds/${string}/messages/bulk-delete-mine`; readonly userMeChannels: () => "/users/@me/channels"; readonly userMeChannelPin: (channelId: ) => `/users/@me/channels/${string}/pin`; readonly userProfile: (id: , guildId?: ) => string; readonly instanceDiscovery: () => "/.well-known/fluxer"; readonly gatewayBot: () => "/gateway/bot"; readonly applicationsMe: () => "/applications/@me"; readonly oauth2ApplicationsMe: () => "/oauth2/applications/@me"; readonly emojiMetadata: (emojiId: ) => `/emojis/${string}/metadata`; readonly stickerMetadata: (stickerId: ) => `/stickers/${string}/metadata`; readonly checkUsernameTag: () => "/users/check-tag"; readonly preloadMessages: () => "/users/@me/preload-messages"; readonly preloadMessagesAlt: () => "/users/@me/channels/messages/preload"; readonly streamPreview: (streamKey: string) => `/streams/${string}/preview`; readonly packs: () => "/packs"; readonly packsByType: (packType: string) => `/packs/${string}`; readonly pack: (packId: ) => `/packs/${string}`; readonly packInstall: (packId: ) => `/packs/${string}/install`; readonly packInvites: (packId: ) => `/packs/${string}/invites`; readonly packEmojis: (packId: ) => `/packs/emojis/${string}`; readonly packEmojisBulk: (packId: ) => `/packs/emojis/${string}/bulk`; readonly packEmoji: (packId: , emojiId: ) => `/packs/emojis/${string}/${string}`; readonly packStickers: (packId: ) => `/packs/stickers/${string}`; readonly packStickersBulk: (packId: ) => `/packs/stickers/${string}/bulk`; readonly packSticker: (packId: , stickerId: ) => `/packs/stickers/${string}/${string}`; readonly oauth2ApplicationBot: (id: ) => `/oauth2/applications/${string}/bot`; readonly oauth2ApplicationBotResetToken: (id: ) => `/oauth2/applications/${string}/bot/reset-token`; } (readonly)token
: string | null (readonly)Methods
delete
(route: string, options?: RequestOptions): Promise<>| Param | Type | Description |
|---|---|---|
| route | string | |
| options? | RequestOptions |
get
(route: string, options?: Pick<RequestOptions, 'auth' | 'signal' | 'headers'>): Promise<>| Param | Type | Description |
|---|---|---|
| route | string | |
| options? | Pick<RequestOptions, 'auth' | 'signal' | 'headers'> |
patch
(route: string, options?: RequestOptions): Promise<>| Param | Type | Description |
|---|---|---|
| route | string | |
| options? | RequestOptions |
post
(route: string, options?: RequestOptions): Promise<>| Param | Type | Description |
|---|---|---|
| route | string | |
| options? | RequestOptions |
put
(route: string, options?: RequestOptions): Promise<>| Param | Type | Description |
|---|---|---|
| route | string | |
| options? | RequestOptions |
setToken
(token: string | null): this| Param | Type | Description |
|---|---|---|
| token | string | null |