discord-slim
Advanced tools
Comparing version 2.0.5 to 2.1.0
/// <reference types="node" /> | ||
import { RequestOptions, TokenTypes } from './request'; | ||
import { RequestOptions } from './request'; | ||
import type * as helpers from './helpers'; | ||
@@ -31,9 +31,11 @@ import type * as types from './types'; | ||
parent_id?: string | null; | ||
rtc_region?: string | null; | ||
video_quality_mode?: helpers.VideoQualityModes; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
Delete: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
GetMessages: (channel_id: string, params?: { | ||
around: string; | ||
before: string; | ||
after: string; | ||
limit: number; | ||
around?: string | undefined; | ||
before?: string | undefined; | ||
after?: string | undefined; | ||
limit?: number | undefined; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<types.Message[]>; | ||
@@ -104,6 +106,8 @@ BulkDeleteMessages: (channel_id: string, params: { | ||
allowed_mentions?: types.AllowedMentions; | ||
attachments?: types.Attachment[]; | ||
components?: types.Component[]; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Message>; | ||
Pin: (channel_id: string, message_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
Unpin: (channel_id: string, message_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
GetReactions: (channel_id: string, message_id: string, emoji: string, params?: { | ||
before?: string | undefined; | ||
after?: string | undefined; | ||
@@ -120,6 +124,2 @@ limit?: number | undefined; | ||
}; | ||
export declare const PinnedMessage: { | ||
Add: (channel_id: string, message_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
Delete: (channel_id: string, message_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
}; | ||
export declare const GroupDM: { | ||
@@ -156,2 +156,3 @@ AddRecipient: (channel_id: string, user_id: string, params: { | ||
system_channel_id?: string; | ||
system_channel_flags?: helpers.SystemChannelFlags; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Guild>; | ||
@@ -173,9 +174,14 @@ Get: (guild_id: string, params?: { | ||
splash?: string | null; | ||
discovery_splash?: string | null; | ||
banner?: string | null; | ||
system_channel_id?: string | null; | ||
system_channel_flags?: helpers.SystemChannelFlags; | ||
rules_channel_id?: string | null; | ||
public_updates_channel_id?: string | null; | ||
preferred_locale?: string | null; | ||
features?: helpers.GuildFeatures[]; | ||
description?: string | null; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Guild>; | ||
Delete: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
GetChannels: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Channel[]>; | ||
ModifyChannelPositions: (guild_id: string, params: ({ | ||
@@ -185,3 +191,10 @@ id: string; | ||
})[], requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
ListMembers: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Member[]>; | ||
ListMembers: (guild_id: string, params?: { | ||
limit?: number | undefined; | ||
after?: string | undefined; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<types.Member[]>; | ||
SearchMembers: (guild_id: string, params: { | ||
query: number; | ||
limit?: number; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Member[]>; | ||
GetBans: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Ban[]>; | ||
@@ -203,7 +216,10 @@ GetRoles: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Role[]>; | ||
include_roles?: string | undefined; | ||
reason?: string | undefined; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<{ | ||
pruned: number | null; | ||
}>; | ||
GetVoiceRegions: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.VoiceRegion[]>; | ||
GetInvites: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<(types.Invite & types.InviteMetadata)[]>; | ||
GetIntegrations: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Integration[]>; | ||
DeleteIntegration: (guild_id: string, integration_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
GetVanityURL: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<{ | ||
@@ -228,4 +244,4 @@ code: string; | ||
Modify: (guild_id: string, emoji_id: string, params: { | ||
name: string; | ||
roles?: string[]; | ||
name?: string; | ||
roles?: string[] | null; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Emoji>; | ||
@@ -238,6 +254,6 @@ Delete: (guild_id: string, emoji_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
access_token: string; | ||
nick?: string | null; | ||
roles?: string[] | null; | ||
mute?: boolean | null; | ||
deaf?: boolean | null; | ||
nick?: string; | ||
roles?: string[]; | ||
mute?: boolean; | ||
deaf?: boolean; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Member | null>; | ||
@@ -250,4 +266,4 @@ Modify: (guild_id: string, user_id: string, params: { | ||
channel_id?: string | null; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Member | null>; | ||
ModifyOwnNick: (guild_id: string, params: { | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Member>; | ||
ModifyCurrentNick: (guild_id: string, params: { | ||
nick?: string | null; | ||
@@ -276,23 +292,10 @@ }, requestOptions?: RequestOptions | undefined) => Promise<string | null>; | ||
Modify: (guild_id: string, role_id: string, params?: { | ||
name?: string | undefined; | ||
permissions?: string | undefined; | ||
color?: number | undefined; | ||
hoist?: boolean | undefined; | ||
mentionable?: boolean | undefined; | ||
name?: string | null | undefined; | ||
permissions?: string | null | undefined; | ||
color?: number | null | undefined; | ||
hoist?: boolean | null | undefined; | ||
mentionable?: boolean | null | undefined; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<types.Role>; | ||
Delete: (guild_id: string, role_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
}; | ||
export declare const Integration: { | ||
Create: (guild_id: string, params: { | ||
type: string; | ||
id: string; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
Modify: (guild_id: string, integration_id: string, params: { | ||
expire_behavior?: helpers.IntegrationExpireBehaviors | null; | ||
expire_grace_period?: number | null; | ||
enable_emoticons?: boolean | null; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
Delete: (guild_id: string, integration_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
Sync: (guild_id: string, integration_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
}; | ||
export declare const Widget: { | ||
@@ -320,7 +323,9 @@ GetSettings: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.GuildWidget>; | ||
unique?: boolean; | ||
target_user?: string; | ||
target_user_type?: helpers.TargetUserTypes; | ||
target_type?: helpers.InviteTargetTypes; | ||
target_user_id?: string; | ||
target_application_id?: string; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Invite>; | ||
Get: (invite_code: string, params?: { | ||
with_counts?: boolean | undefined; | ||
with_expiration?: boolean | undefined; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<types.Invite>; | ||
@@ -361,5 +366,4 @@ Delete: (invite_code: string, requestOptions?: RequestOptions | undefined) => Promise<types.Invite>; | ||
export declare const Voice: { | ||
GetRegions: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.VoiceRegion[]>; | ||
ListRegions: (requestOptions?: RequestOptions | undefined) => Promise<types.VoiceRegion[]>; | ||
UpdateSelfState: (guild_id: string, params: { | ||
UpdateCurrentState: (guild_id: string, params: { | ||
channel_id: string; | ||
@@ -369,3 +373,3 @@ suppress?: boolean; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
UpdateOthersState: (guild_id: string, user_id: string, params: { | ||
UpdateUserState: (guild_id: string, user_id: string, params: { | ||
channel_id: string; | ||
@@ -378,3 +382,3 @@ suppress?: boolean; | ||
name: string; | ||
avatar: string | null; | ||
avatar?: string | null; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Webhook>; | ||
@@ -412,2 +416,3 @@ Get: (webhook_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Webhook>; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
GetMessage: (webhook_id: string, webhook_token: string, message_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Message>; | ||
EditMessage: (webhook_id: string, webhook_token: string, message_id: string, params: { | ||
@@ -417,2 +422,3 @@ content?: string; | ||
allowed_mentions?: types.AllowedMentions; | ||
attachments?: types.Attachment[]; | ||
components?: types.Component[]; | ||
@@ -428,2 +434,3 @@ }, requestOptions?: RequestOptions | undefined) => Promise<types.Message>; | ||
options?: types.ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
@@ -435,2 +442,3 @@ GetGlobalCommand: (application_id: string, command_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
options?: types.ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
@@ -443,2 +451,3 @@ DeleteGlobalCommand: (application_id: string, command_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
options?: types.ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
@@ -450,5 +459,7 @@ GetGuildCommand: (application_id: string, guild_id: string, command_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
options?: types.ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
DeleteGuildCommand: (application_id: string, guild_id: string, command_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
CreateInteractionResponse: (interaction_id: string, interaction_token: string, params: types.InteractionResponse, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
GetOriginalInteractionResponse: (application_id: string, interaction_token: string, requestOptions?: RequestOptions | undefined) => Promise<types.Message>; | ||
EditOriginalInteractionResponse: (application_id: string, interaction_token: string, params: { | ||
@@ -502,3 +513,3 @@ content?: string; | ||
access_token: string; | ||
token_type: TokenTypes.BEARER; | ||
token_type: helpers.TokenTypes.BEARER; | ||
expires_in: number; | ||
@@ -517,3 +528,3 @@ refresh_token: string; | ||
export declare const Thread: { | ||
Modify: (id: string, params: { | ||
Modify: (channel_id: string, params: { | ||
name?: string; | ||
@@ -525,2 +536,3 @@ archived?: boolean; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
Delete: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
StartWithMessage: (channel_id: string, message_id: string, params: { | ||
@@ -527,0 +539,0 @@ name: string; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StageInstance = exports.Thread = exports.OAuth2 = exports.Application = exports.Webhook = exports.Voice = exports.User = exports.Template = exports.Invite = exports.WelcomeScreen = exports.Widget = exports.Integration = exports.Role = exports.Ban = exports.Member = exports.Emoji = exports.Guild = exports.GroupDM = exports.PinnedMessage = exports.Reaction = exports.Message = exports.Channel = exports.setDefaultRequestOptions = void 0; | ||
exports.StageInstance = exports.Thread = exports.OAuth2 = exports.Application = exports.Webhook = exports.Voice = exports.User = exports.Template = exports.Invite = exports.WelcomeScreen = exports.Widget = exports.Role = exports.Ban = exports.Member = exports.Emoji = exports.Guild = exports.GroupDM = exports.Reaction = exports.Message = exports.Channel = exports.setDefaultRequestOptions = void 0; | ||
const request_1 = require("./request"); | ||
@@ -19,3 +19,3 @@ const querystring_1 = __importDefault(require("querystring")); | ||
GetMessages: (channel_id, params, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/messages", requestOptions ?? defaultRequestOptions, params), | ||
BulkDeleteMessages: (channel_id, params, requestOptions) => request_1.Request("POST", "/channels/" + channel_id + "/messages", requestOptions ?? defaultRequestOptions, params), | ||
BulkDeleteMessages: (channel_id, params, requestOptions) => request_1.Request("POST", "/channels/" + channel_id + "/messages" + "/bulk-delete", requestOptions ?? defaultRequestOptions, params), | ||
EditPermissions: (channel_id, overwrite_id, params, requestOptions) => request_1.Request("PUT", "/channels/" + channel_id + "/permissions/" + overwrite_id, requestOptions ?? defaultRequestOptions, params), | ||
@@ -39,2 +39,4 @@ GetInvites: (channel_id, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/invites", requestOptions ?? defaultRequestOptions), | ||
Edit: (channel_id, message_id, params, requestOptions) => request_1.Request("PATCH", "/channels/" + channel_id + "/messages/" + message_id, requestOptions ?? defaultRequestOptions, params), | ||
Pin: (channel_id, message_id, requestOptions) => request_1.Request("PUT", "/channels/" + channel_id + "/pins/" + message_id, requestOptions ?? defaultRequestOptions), | ||
Unpin: (channel_id, message_id, requestOptions) => request_1.Request("DELETE", "/channels/" + channel_id + "/pins/" + message_id, requestOptions ?? defaultRequestOptions), | ||
GetReactions: (channel_id, message_id, emoji, params, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/messages/" + message_id + "/reactions/" + encodeURIComponent(emoji) + '?' + querystring_1.default.stringify(params), requestOptions ?? defaultRequestOptions), | ||
@@ -49,6 +51,2 @@ DeleteAllReactions: (channel_id, message_id, requestOptions) => request_1.Request("DELETE", "/channels/" + channel_id + "/messages/" + message_id + "/reactions", requestOptions ?? defaultRequestOptions), | ||
}; | ||
exports.PinnedMessage = { | ||
Add: (channel_id, message_id, requestOptions) => request_1.Request("PUT", "/channels/" + channel_id + "/pins/" + message_id, requestOptions ?? defaultRequestOptions), | ||
Delete: (channel_id, message_id, requestOptions) => request_1.Request("DELETE", "/channels/" + channel_id + "/pins/" + message_id, requestOptions ?? defaultRequestOptions), | ||
}; | ||
exports.GroupDM = { | ||
@@ -67,4 +65,6 @@ AddRecipient: (channel_id, user_id, params, requestOptions) => request_1.Request("PUT", "/channels/" + channel_id + "/recipients/" + user_id, requestOptions ?? defaultRequestOptions, params), | ||
Delete: (guild_id, requestOptions) => request_1.Request("DELETE", "/guilds/" + guild_id, requestOptions ?? defaultRequestOptions), | ||
GetChannels: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/channels", requestOptions ?? defaultRequestOptions), | ||
ModifyChannelPositions: (guild_id, params, requestOptions) => request_1.Request("PATCH", "/guilds/" + guild_id + "/channels", requestOptions ?? defaultRequestOptions, params), | ||
ListMembers: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/members", requestOptions ?? defaultRequestOptions), | ||
ListMembers: (guild_id, params, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/members?" + querystring_1.default.stringify(params), requestOptions ?? defaultRequestOptions), | ||
SearchMembers: (guild_id, params, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/members" + "/search?" + querystring_1.default.stringify(params), requestOptions ?? defaultRequestOptions), | ||
GetBans: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/bans", requestOptions ?? defaultRequestOptions), | ||
@@ -75,4 +75,6 @@ GetRoles: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/roles", requestOptions ?? defaultRequestOptions), | ||
Prune: (guild_id, params, requestOptions) => request_1.Request("POST", "/guilds/" + guild_id + "/prune", requestOptions ?? defaultRequestOptions, params), | ||
GetVoiceRegions: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/regions", requestOptions ?? defaultRequestOptions), | ||
GetInvites: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/invites", requestOptions ?? defaultRequestOptions), | ||
GetIntegrations: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/integrations", requestOptions ?? defaultRequestOptions), | ||
DeleteIntegration: (guild_id, integration_id, requestOptions) => request_1.Request("DELETE", "/guilds/" + guild_id + "/integrations/" + integration_id, requestOptions ?? defaultRequestOptions), | ||
GetVanityURL: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/vanity-url", requestOptions ?? defaultRequestOptions), | ||
@@ -93,3 +95,3 @@ CreateFromTemplate: (template_code, params, requestOptions) => request_1.Request("POST", "/guilds" + "/templates/" + template_code, requestOptions ?? defaultRequestOptions, params), | ||
Modify: (guild_id, user_id, params, requestOptions) => request_1.Request("PATCH", "/guilds/" + guild_id + "/members/" + user_id, requestOptions ?? defaultRequestOptions, params), | ||
ModifyOwnNick: (guild_id, params, requestOptions) => request_1.Request("PATCH", "/guilds/" + guild_id + "/members" + "/@me" + "/nick", requestOptions ?? defaultRequestOptions, params), | ||
ModifyCurrentNick: (guild_id, params, requestOptions) => request_1.Request("PATCH", "/guilds/" + guild_id + "/members" + "/@me" + "/nick", requestOptions ?? defaultRequestOptions, params), | ||
AddRole: (guild_id, user_id, role_id, requestOptions) => request_1.Request("PUT", "/guilds/" + guild_id + "/members/" + user_id + "/roles/" + role_id, requestOptions ?? defaultRequestOptions), | ||
@@ -109,8 +111,2 @@ RemoveRole: (guild_id, user_id, role_id, requestOptions) => request_1.Request("DELETE", "/guilds/" + guild_id + "/members/" + user_id + "/roles/" + role_id, requestOptions ?? defaultRequestOptions), | ||
}; | ||
exports.Integration = { | ||
Create: (guild_id, params, requestOptions) => request_1.Request("POST", "/guilds/" + guild_id + "/integrations", requestOptions ?? defaultRequestOptions, params), | ||
Modify: (guild_id, integration_id, params, requestOptions) => request_1.Request("PATCH", "/guilds/" + guild_id + "/integrations/" + integration_id, requestOptions ?? defaultRequestOptions, params), | ||
Delete: (guild_id, integration_id, requestOptions) => request_1.Request("DELETE", "/guilds/" + guild_id + "/integrations/" + integration_id, requestOptions ?? defaultRequestOptions), | ||
Sync: (guild_id, integration_id, requestOptions) => request_1.Request("POST", "/guilds/" + guild_id + "/integrations/" + integration_id + "/sync", requestOptions ?? defaultRequestOptions), | ||
}; | ||
exports.Widget = { | ||
@@ -148,6 +144,5 @@ GetSettings: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/widget", requestOptions ?? defaultRequestOptions), | ||
exports.Voice = { | ||
GetRegions: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/regions", requestOptions ?? defaultRequestOptions), | ||
ListRegions: (requestOptions) => request_1.Request("GET", "/voice" + "/regions", requestOptions ?? defaultRequestOptions), | ||
UpdateSelfState: (guild_id, params, requestOptions) => request_1.Request("PATCH", "/guilds/" + guild_id + "/voice-states" + "/@me", requestOptions ?? defaultRequestOptions, params), | ||
UpdateOthersState: (guild_id, user_id, params, requestOptions) => request_1.Request("PATCH", "/guilds/" + guild_id + "/voice-states/" + user_id, requestOptions ?? defaultRequestOptions, params), | ||
UpdateCurrentState: (guild_id, params, requestOptions) => request_1.Request("PATCH", "/guilds/" + guild_id + "/voice-states" + "/@me", requestOptions ?? defaultRequestOptions, params), | ||
UpdateUserState: (guild_id, user_id, params, requestOptions) => request_1.Request("PATCH", "/guilds/" + guild_id + "/voice-states/" + user_id, requestOptions ?? defaultRequestOptions, params), | ||
}; | ||
@@ -165,2 +160,3 @@ exports.Webhook = { | ||
ExecuteGitHub: (webhook_id, webhook_token, params, requestOptions) => request_1.Request("POST", "/webhooks/" + webhook_id + '/' + webhook_token + "/github?" + querystring_1.default.stringify(params), requestOptions ?? defaultRequestOptions), | ||
GetMessage: (webhook_id, webhook_token, message_id, requestOptions) => request_1.Request("GET", "/webhooks/" + webhook_id + '/' + webhook_token + "/messages/" + message_id, requestOptions ?? defaultRequestOptions), | ||
EditMessage: (webhook_id, webhook_token, message_id, params, requestOptions) => request_1.Request("PATCH", "/webhooks/" + webhook_id + '/' + webhook_token + "/messages/" + message_id, requestOptions ?? defaultRequestOptions, params), | ||
@@ -181,2 +177,3 @@ DeleteMessage: (webhook_id, webhook_token, message_id, requestOptions) => request_1.Request("DELETE", "/webhooks/" + webhook_id + '/' + webhook_token + "/messages/" + message_id, requestOptions ?? defaultRequestOptions), | ||
CreateInteractionResponse: (interaction_id, interaction_token, params, requestOptions) => request_1.Request("POST", "/interactions/" + interaction_id + '/' + interaction_token + "/callback", requestOptions ?? defaultRequestOptions, params), | ||
GetOriginalInteractionResponse: (application_id, interaction_token, requestOptions) => request_1.Request("GET", "/webhooks/" + application_id + '/' + interaction_token + "/messages" + "/@original", requestOptions ?? defaultRequestOptions), | ||
EditOriginalInteractionResponse: (application_id, interaction_token, params, requestOptions) => request_1.Request("PATCH", "/webhooks/" + application_id + '/' + interaction_token + "/messages" + "/@original", requestOptions ?? defaultRequestOptions, params), | ||
@@ -198,3 +195,4 @@ DeleteOriginalInteractionResponse: (application_id, interaction_token, requestOptions) => request_1.Request("DELETE", "/webhooks/" + application_id + '/' + interaction_token + "/messages" + "/@original", requestOptions ?? defaultRequestOptions), | ||
exports.Thread = { | ||
Modify: (id, params, requestOptions) => request_1.Request("PATCH", "/channels/" + id, requestOptions ?? defaultRequestOptions, params), | ||
Modify: (channel_id, params, requestOptions) => request_1.Request("PATCH", "/channels/" + channel_id, requestOptions ?? defaultRequestOptions, params), | ||
Delete: (channel_id, requestOptions) => request_1.Request("DELETE", "/channels/" + channel_id, requestOptions ?? defaultRequestOptions), | ||
StartWithMessage: (channel_id, message_id, params, requestOptions) => request_1.Request("POST", "/channels/" + channel_id + "/messages/" + message_id + "/threads", requestOptions ?? defaultRequestOptions, params), | ||
@@ -201,0 +199,0 @@ Start: (channel_id, params, requestOptions) => request_1.Request("POST", "/channels/" + channel_id + "/threads", requestOptions ?? defaultRequestOptions, params), |
@@ -50,3 +50,3 @@ /// <reference types="node" /> | ||
}) => void; | ||
UpdateStatus: (params: { | ||
UpdatePresence: (params: { | ||
since: number | null; | ||
@@ -57,3 +57,3 @@ activities: { | ||
url?: string; | ||
}[] | null; | ||
}[]; | ||
status: StatusTypes; | ||
@@ -60,0 +60,0 @@ afk: boolean; |
@@ -27,3 +27,3 @@ "use strict"; | ||
} | ||
const response = await request_1.Request('GET', this._auth?.authorization.type == request_1.TokenTypes.BOT ? | ||
const response = await request_1.Request('GET', this._auth?.authorization.type == helpers_1.TokenTypes.BOT ? | ||
'/gateway/bot' : | ||
@@ -151,3 +151,3 @@ '/gateway', this._auth).catch(() => { }); | ||
}; | ||
this.UpdateStatus = (params) => { | ||
this.UpdatePresence = (params) => { | ||
if (!this._ws) | ||
@@ -154,0 +154,0 @@ throw 'No connection.'; |
/// <reference types="node" /> | ||
import { EventEmitter } from 'events'; | ||
import type { EventEmitter } from 'events'; | ||
import type * as types from './types'; | ||
import { TargetUserTypes } from './helpers'; | ||
import type * as helpers from './helpers'; | ||
export declare enum Events { | ||
@@ -60,3 +60,2 @@ READY = "READY", | ||
user: types.User; | ||
private_channels: []; | ||
guilds: types.UnavailableGuild[]; | ||
@@ -135,4 +134,6 @@ session_id: string; | ||
nick?: string | null; | ||
joined_at: string; | ||
joined_at: string | null; | ||
premium_since?: string | null; | ||
deaf?: boolean; | ||
mute?: boolean; | ||
pending?: boolean; | ||
@@ -170,4 +171,5 @@ }; | ||
max_uses: number; | ||
target_type?: helpers.InviteTargetTypes; | ||
target_user?: types.User; | ||
target_user_type?: TargetUserTypes; | ||
target_application?: types.Application; | ||
temporary: boolean; | ||
@@ -174,0 +176,0 @@ uses: number; |
export declare const HOST: "https://discord.com", API: "https://discord.com/api", API_VERSION = 9, API_PATH: "https://discord.com/api/v9", CDN = "https://cdn.discordapp.com"; | ||
export declare enum TokenTypes { | ||
BOT = "Bot", | ||
BEARER = "Bearer", | ||
NONE = "" | ||
} | ||
export declare const Permissions: { | ||
@@ -35,2 +40,3 @@ readonly NO_PERMISSIONS: 0n; | ||
readonly MANAGE_EMOJIS: 1073741824n; | ||
readonly USE_SLASH_COMMANDS: 2147483648n; | ||
readonly REQUEST_TO_SPEAK: 4294967296n; | ||
@@ -185,18 +191,22 @@ readonly MANAGE_THREADS: 17179869184n; | ||
export declare enum SystemChannelFlags { | ||
NO_FLAGS = 0, | ||
SUPPRESS_JOIN_NOTIFICATIONS = 1, | ||
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 2 | ||
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 2, | ||
SUPPRESS_GUILD_REMINDER_NOTIFICATIONS = 4 | ||
} | ||
export declare enum GuildFeatures { | ||
ANIMATED_ICON = "ANIMATED_ICON", | ||
BANNER = "BANNER", | ||
COMMERCE = "COMMERCE", | ||
COMMUNITY = "COMMUNITY", | ||
DISCOVERABLE = "DISCOVERABLE", | ||
FEATURABLE = "FEATURABLE", | ||
INVITE_SPLASH = "INVITE_SPLASH", | ||
VIP_REGIONS = "VIP_REGIONS", | ||
MEMBER_VERIFICATION_GATE_ENABLED = "MEMBER_VERIFICATION_GATE_ENABLED", | ||
NEWS = "NEWS", | ||
PARTNERED = "PARTNERED", | ||
PREVIEW_ENABLED = "PREVIEW_ENABLED", | ||
VANITY_URL = "VANITY_URL", | ||
VERIFIED = "VERIFIED", | ||
PARTNERED = "PARTNERED", | ||
COMMUNITY = "COMMUNITY", | ||
COMMERCE = "COMMERCE", | ||
NEWS = "NEWS", | ||
DISCOVERABLE = "DISCOVERABLE", | ||
FEATURABLE = "FEATURABLE", | ||
ANIMATED_ICON = "ANIMATED_ICON", | ||
BANNER = "BANNER", | ||
VIP_REGIONS = "VIP_REGIONS", | ||
WELCOME_SCREEN_ENABLED = "WELCOME_SCREEN_ENABLED" | ||
@@ -214,5 +224,2 @@ } | ||
} | ||
export declare enum TargetUserTypes { | ||
STREAM = 1 | ||
} | ||
export declare enum ActivityTypes { | ||
@@ -241,3 +248,3 @@ PLAYING = 0, | ||
export declare enum UserFlags { | ||
NONE = 0, | ||
NO_FLAGS = 0, | ||
DISCORD_EMPLOYEE = 1, | ||
@@ -252,6 +259,6 @@ PARTNERED_SERVER_OWNER = 2, | ||
TEAM_USER = 1024, | ||
SYSTEM = 4096, | ||
BUG_HUNTER_LEVEL_2 = 16384, | ||
VERIFIED_BOT = 65536, | ||
EARLY_VERIFIED_BOT_DEVELOPER = 131072 | ||
EARLY_VERIFIED_BOT_DEVELOPER = 131072, | ||
DISCORD_CERTIFIED_MODERATOR = 262144 | ||
} | ||
@@ -273,2 +280,3 @@ export declare enum PremiumTypes { | ||
export declare enum ActivityFlags { | ||
NO_FLAGS = 0, | ||
INSTANCE = 1, | ||
@@ -312,23 +320,25 @@ JOIN = 2, | ||
export declare enum OAuth2Scopes { | ||
ACTIVITIES_READ = "activities.read", | ||
ACTIVITIES_WRITE = "activities.write", | ||
APPLICATIONS_BUILDS_READ = "applications.builds.read", | ||
APPLICATIONS_BUILDS_UPLOAD = "applications.builds.upload", | ||
APPLICATIONS_COMMANDS = "applications.commands", | ||
APPLICATIONS_COMMANDS_UPDATE = "applications.commands.update", | ||
APPLICATIONS_STORE_UPDATE = "applications.store.update", | ||
APPLICATIONS_ENTITLEMENTS = "applications.entitlements", | ||
BOT = "bot", | ||
CONNECTIONS = "connections", | ||
EMAIL = "email", | ||
IDENTIFY = "identify", | ||
GDM_JOIN = "gdm.join", | ||
GUILDS = "guilds", | ||
GUILDS_JOIN = "guilds.join", | ||
GDM_JOIN = "gdm.join", | ||
IDENTIFY = "identify", | ||
MESSAGES_READ = "messages.read", | ||
RELATIONSHIPS_READ = "relationships.read", | ||
RPC = "rpc", | ||
RPC_API = "rpc.api", | ||
RPC_ACTIVITIES_WRITE = "rpc.activities.write", | ||
RPC_NOTIFICATIONS_READ = "rpc.notifications.read", | ||
WEBHOOK_INCOMING = "webhook.incoming", | ||
APPLICATIONS_BUILDS_UPLOAD = "applications.builds.upload", | ||
APPLICATIONS_BUILDS_READ = "applications.builds.read", | ||
APPLICATIONS_STORE_UPDATE = "applications.store.update", | ||
APPLICATIONS_ENTITLEMENTS = "applications.entitlements", | ||
RELATIONSHIPS_READ = "relationships.read", | ||
ACTIVITIES_READ = "activities.read", | ||
ACTIVITIES_WRITE = "activities.write", | ||
APPLICATIONS_COMMANDS = "applications.commands", | ||
APPLICATIONS_COMMANDS_UPDATE = "applications.commands.update" | ||
RPC_VOICE_READ = "rpc.voice.read", | ||
RPC_VOICE_WRITE = "rpc.voice.write", | ||
WEBHOOK_INCOMING = "webhook.incoming" | ||
} | ||
@@ -349,3 +359,3 @@ export declare enum OAuth2GrantTypes { | ||
export declare enum SpeakingStates { | ||
NONE = 0, | ||
NO_FLAGS = 0, | ||
MICROPHONE = 1, | ||
@@ -374,1 +384,20 @@ SOUNDSHARE = 2, | ||
} | ||
export declare enum GuildNSFWLevel { | ||
DEFAULT = 0, | ||
EXPLICIT = 1, | ||
SAFE = 2, | ||
AGE_RESTRICTED = 3 | ||
} | ||
export declare enum InviteTargetTypes { | ||
STREAM = 1, | ||
EMBEDDED_APPLICATION = 2 | ||
} | ||
export declare enum ApplicationFlags { | ||
NO_FLAGS = 0, | ||
GATEWAY_PRESENCE = 4096, | ||
GATEWAY_PRESENCE_LIMITED = 8192, | ||
GATEWAY_GUILD_MEMBERS = 16384, | ||
GATEWAY_GUILD_MEMBERS_LIMITED = 32768, | ||
VERIFICATION_PENDING_GUILD_LIMIT = 65536, | ||
EMBEDDED = 131072 | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PrivacyLevel = exports.ButtonStyles = exports.ComponentTypes = exports.VideoQualityModes = exports.SpeakingStates = exports.VoiceEncryptionModes = exports.MembershipStates = exports.OAuth2GrantTypes = exports.OAuth2Scopes = exports.InteractionResponseFlags = exports.InteractionResponseTypes = exports.InteractionTypes = exports.ApplicationCommandPermissionType = exports.ApplicationCommandOptionTypes = exports.ActivityFlags = exports.WebhookTypes = exports.VisibilityTypes = exports.PremiumTypes = exports.UserFlags = exports.WidgetStyleOptions = exports.StatusTypes = exports.ActivityTypes = exports.TargetUserTypes = exports.PremiumTier = exports.IntegrationExpireBehaviors = exports.GuildFeatures = exports.SystemChannelFlags = exports.VerificationLevel = exports.MFA_Level = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.AllowedMentionTypes = exports.PermissionsOverwriteTypes = exports.MessageStickerFormatTypes = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.ChannelTypes = exports.AuditLogEvents = exports.Intents = exports.Permissions = exports.CDN = exports.API_PATH = exports.API_VERSION = exports.API = exports.HOST = void 0; | ||
exports.ApplicationFlags = exports.InviteTargetTypes = exports.GuildNSFWLevel = exports.PrivacyLevel = exports.ButtonStyles = exports.ComponentTypes = exports.VideoQualityModes = exports.SpeakingStates = exports.VoiceEncryptionModes = exports.MembershipStates = exports.OAuth2GrantTypes = exports.OAuth2Scopes = exports.InteractionResponseFlags = exports.InteractionResponseTypes = exports.InteractionTypes = exports.ApplicationCommandPermissionType = exports.ApplicationCommandOptionTypes = exports.ActivityFlags = exports.WebhookTypes = exports.VisibilityTypes = exports.PremiumTypes = exports.UserFlags = exports.WidgetStyleOptions = exports.StatusTypes = exports.ActivityTypes = exports.PremiumTier = exports.IntegrationExpireBehaviors = exports.GuildFeatures = exports.SystemChannelFlags = exports.VerificationLevel = exports.MFA_Level = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.AllowedMentionTypes = exports.PermissionsOverwriteTypes = exports.MessageStickerFormatTypes = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.ChannelTypes = exports.AuditLogEvents = exports.Intents = exports.Permissions = exports.TokenTypes = exports.CDN = exports.API_PATH = exports.API_VERSION = exports.API = exports.HOST = void 0; | ||
exports.HOST = 'https://discord.com', exports.API = `${exports.HOST}/api`, exports.API_VERSION = 9, exports.API_PATH = `${exports.API}/v${exports.API_VERSION}`, exports.CDN = 'https://cdn.discordapp.com'; | ||
var TokenTypes; | ||
(function (TokenTypes) { | ||
TokenTypes["BOT"] = "Bot"; | ||
TokenTypes["BEARER"] = "Bearer"; | ||
TokenTypes["NONE"] = ""; | ||
})(TokenTypes = exports.TokenTypes || (exports.TokenTypes = {})); | ||
exports.Permissions = { | ||
NO_PERMISSIONS: 0x000000000n, | ||
CREATE_INSTANT_INVITE: 0x000000001n, | ||
KICK_MEMBERS: 0x000000002n, | ||
BAN_MEMBERS: 0x000000004n, | ||
ADMINISTRATOR: 0x000000008n, | ||
MANAGE_CHANNELS: 0x000000010n, | ||
MANAGE_GUILD: 0x000000020n, | ||
ADD_REACTIONS: 0x000000040n, | ||
VIEW_AUDIT_LOG: 0x000000080n, | ||
PRIORITY_SPEAKER: 0x000000100n, | ||
STREAM: 0x000000200n, | ||
VIEW_CHANNEL: 0x000000400n, | ||
SEND_MESSAGES: 0x000000800n, | ||
SEND_TTS_MESSAGES: 0x000001000n, | ||
MANAGE_MESSAGES: 0x000002000n, | ||
EMBED_LINKS: 0x000004000n, | ||
ATTACH_FILES: 0x000008000n, | ||
READ_MESSAGE_HISTORY: 0x000010000n, | ||
MENTION_EVERYONE: 0x000020000n, | ||
USE_EXTERNAL_EMOJIS: 0x000040000n, | ||
VIEW_GUILD_INSIGHTS: 0x000080000n, | ||
CONNECT: 0x000100000n, | ||
SPEAK: 0x000200000n, | ||
MUTE_MEMBERS: 0x000400000n, | ||
DEAFEN_MEMBERS: 0x000800000n, | ||
MOVE_MEMBERS: 0x001000000n, | ||
USE_VAD: 0x002000000n, | ||
CHANGE_NICKNAME: 0x004000000n, | ||
MANAGE_NICKNAMES: 0x008000000n, | ||
MANAGE_ROLES: 0x010000000n, | ||
MANAGE_WEBHOOKS: 0x020000000n, | ||
MANAGE_EMOJIS: 0x040000000n, | ||
REQUEST_TO_SPEAK: 0x100000000n, | ||
NO_PERMISSIONS: 0n, | ||
CREATE_INSTANT_INVITE: 0x0000000001n, | ||
KICK_MEMBERS: 0x0000000002n, | ||
BAN_MEMBERS: 0x0000000004n, | ||
ADMINISTRATOR: 0x0000000008n, | ||
MANAGE_CHANNELS: 0x0000000010n, | ||
MANAGE_GUILD: 0x0000000020n, | ||
ADD_REACTIONS: 0x0000000040n, | ||
VIEW_AUDIT_LOG: 0x0000000080n, | ||
PRIORITY_SPEAKER: 0x0000000100n, | ||
STREAM: 0x0000000200n, | ||
VIEW_CHANNEL: 0x0000000400n, | ||
SEND_MESSAGES: 0x0000000800n, | ||
SEND_TTS_MESSAGES: 0x0000001000n, | ||
MANAGE_MESSAGES: 0x0000002000n, | ||
EMBED_LINKS: 0x0000004000n, | ||
ATTACH_FILES: 0x0000008000n, | ||
READ_MESSAGE_HISTORY: 0x0000010000n, | ||
MENTION_EVERYONE: 0x0000020000n, | ||
USE_EXTERNAL_EMOJIS: 0x0000040000n, | ||
VIEW_GUILD_INSIGHTS: 0x0000080000n, | ||
CONNECT: 0x0000100000n, | ||
SPEAK: 0x0000200000n, | ||
MUTE_MEMBERS: 0x0000400000n, | ||
DEAFEN_MEMBERS: 0x0000800000n, | ||
MOVE_MEMBERS: 0x0001000000n, | ||
USE_VAD: 0x0002000000n, | ||
CHANGE_NICKNAME: 0x0004000000n, | ||
MANAGE_NICKNAMES: 0x0008000000n, | ||
MANAGE_ROLES: 0x0010000000n, | ||
MANAGE_WEBHOOKS: 0x0020000000n, | ||
MANAGE_EMOJIS: 0x0040000000n, | ||
USE_SLASH_COMMANDS: 0x0080000000n, | ||
REQUEST_TO_SPEAK: 0x0100000000n, | ||
MANAGE_THREADS: 0x0400000000n, | ||
@@ -201,19 +208,23 @@ USE_PUBLIC_THREADS: 0x0800000000n, | ||
(function (SystemChannelFlags) { | ||
SystemChannelFlags[SystemChannelFlags["NO_FLAGS"] = 0] = "NO_FLAGS"; | ||
SystemChannelFlags[SystemChannelFlags["SUPPRESS_JOIN_NOTIFICATIONS"] = 1] = "SUPPRESS_JOIN_NOTIFICATIONS"; | ||
SystemChannelFlags[SystemChannelFlags["SUPPRESS_PREMIUM_SUBSCRIPTIONS"] = 2] = "SUPPRESS_PREMIUM_SUBSCRIPTIONS"; | ||
SystemChannelFlags[SystemChannelFlags["SUPPRESS_GUILD_REMINDER_NOTIFICATIONS"] = 4] = "SUPPRESS_GUILD_REMINDER_NOTIFICATIONS"; | ||
})(SystemChannelFlags = exports.SystemChannelFlags || (exports.SystemChannelFlags = {})); | ||
var GuildFeatures; | ||
(function (GuildFeatures) { | ||
GuildFeatures["ANIMATED_ICON"] = "ANIMATED_ICON"; | ||
GuildFeatures["BANNER"] = "BANNER"; | ||
GuildFeatures["COMMERCE"] = "COMMERCE"; | ||
GuildFeatures["COMMUNITY"] = "COMMUNITY"; | ||
GuildFeatures["DISCOVERABLE"] = "DISCOVERABLE"; | ||
GuildFeatures["FEATURABLE"] = "FEATURABLE"; | ||
GuildFeatures["INVITE_SPLASH"] = "INVITE_SPLASH"; | ||
GuildFeatures["VIP_REGIONS"] = "VIP_REGIONS"; | ||
GuildFeatures["MEMBER_VERIFICATION_GATE_ENABLED"] = "MEMBER_VERIFICATION_GATE_ENABLED"; | ||
GuildFeatures["NEWS"] = "NEWS"; | ||
GuildFeatures["PARTNERED"] = "PARTNERED"; | ||
GuildFeatures["PREVIEW_ENABLED"] = "PREVIEW_ENABLED"; | ||
GuildFeatures["VANITY_URL"] = "VANITY_URL"; | ||
GuildFeatures["VERIFIED"] = "VERIFIED"; | ||
GuildFeatures["PARTNERED"] = "PARTNERED"; | ||
GuildFeatures["COMMUNITY"] = "COMMUNITY"; | ||
GuildFeatures["COMMERCE"] = "COMMERCE"; | ||
GuildFeatures["NEWS"] = "NEWS"; | ||
GuildFeatures["DISCOVERABLE"] = "DISCOVERABLE"; | ||
GuildFeatures["FEATURABLE"] = "FEATURABLE"; | ||
GuildFeatures["ANIMATED_ICON"] = "ANIMATED_ICON"; | ||
GuildFeatures["BANNER"] = "BANNER"; | ||
GuildFeatures["VIP_REGIONS"] = "VIP_REGIONS"; | ||
GuildFeatures["WELCOME_SCREEN_ENABLED"] = "WELCOME_SCREEN_ENABLED"; | ||
@@ -233,6 +244,2 @@ })(GuildFeatures = exports.GuildFeatures || (exports.GuildFeatures = {})); | ||
})(PremiumTier = exports.PremiumTier || (exports.PremiumTier = {})); | ||
var TargetUserTypes; | ||
(function (TargetUserTypes) { | ||
TargetUserTypes[TargetUserTypes["STREAM"] = 1] = "STREAM"; | ||
})(TargetUserTypes = exports.TargetUserTypes || (exports.TargetUserTypes = {})); | ||
var ActivityTypes; | ||
@@ -265,3 +272,3 @@ (function (ActivityTypes) { | ||
(function (UserFlags) { | ||
UserFlags[UserFlags["NONE"] = 0] = "NONE"; | ||
UserFlags[UserFlags["NO_FLAGS"] = 0] = "NO_FLAGS"; | ||
UserFlags[UserFlags["DISCORD_EMPLOYEE"] = 1] = "DISCORD_EMPLOYEE"; | ||
@@ -276,6 +283,6 @@ UserFlags[UserFlags["PARTNERED_SERVER_OWNER"] = 2] = "PARTNERED_SERVER_OWNER"; | ||
UserFlags[UserFlags["TEAM_USER"] = 1024] = "TEAM_USER"; | ||
UserFlags[UserFlags["SYSTEM"] = 4096] = "SYSTEM"; | ||
UserFlags[UserFlags["BUG_HUNTER_LEVEL_2"] = 16384] = "BUG_HUNTER_LEVEL_2"; | ||
UserFlags[UserFlags["VERIFIED_BOT"] = 65536] = "VERIFIED_BOT"; | ||
UserFlags[UserFlags["EARLY_VERIFIED_BOT_DEVELOPER"] = 131072] = "EARLY_VERIFIED_BOT_DEVELOPER"; | ||
UserFlags[UserFlags["DISCORD_CERTIFIED_MODERATOR"] = 262144] = "DISCORD_CERTIFIED_MODERATOR"; | ||
})(UserFlags = exports.UserFlags || (exports.UserFlags = {})); | ||
@@ -301,2 +308,3 @@ var PremiumTypes; | ||
(function (ActivityFlags) { | ||
ActivityFlags[ActivityFlags["NO_FLAGS"] = 0] = "NO_FLAGS"; | ||
ActivityFlags[ActivityFlags["INSTANCE"] = 1] = "INSTANCE"; | ||
@@ -346,23 +354,25 @@ ActivityFlags[ActivityFlags["JOIN"] = 2] = "JOIN"; | ||
(function (OAuth2Scopes) { | ||
OAuth2Scopes["ACTIVITIES_READ"] = "activities.read"; | ||
OAuth2Scopes["ACTIVITIES_WRITE"] = "activities.write"; | ||
OAuth2Scopes["APPLICATIONS_BUILDS_READ"] = "applications.builds.read"; | ||
OAuth2Scopes["APPLICATIONS_BUILDS_UPLOAD"] = "applications.builds.upload"; | ||
OAuth2Scopes["APPLICATIONS_COMMANDS"] = "applications.commands"; | ||
OAuth2Scopes["APPLICATIONS_COMMANDS_UPDATE"] = "applications.commands.update"; | ||
OAuth2Scopes["APPLICATIONS_STORE_UPDATE"] = "applications.store.update"; | ||
OAuth2Scopes["APPLICATIONS_ENTITLEMENTS"] = "applications.entitlements"; | ||
OAuth2Scopes["BOT"] = "bot"; | ||
OAuth2Scopes["CONNECTIONS"] = "connections"; | ||
OAuth2Scopes["EMAIL"] = "email"; | ||
OAuth2Scopes["IDENTIFY"] = "identify"; | ||
OAuth2Scopes["GDM_JOIN"] = "gdm.join"; | ||
OAuth2Scopes["GUILDS"] = "guilds"; | ||
OAuth2Scopes["GUILDS_JOIN"] = "guilds.join"; | ||
OAuth2Scopes["GDM_JOIN"] = "gdm.join"; | ||
OAuth2Scopes["IDENTIFY"] = "identify"; | ||
OAuth2Scopes["MESSAGES_READ"] = "messages.read"; | ||
OAuth2Scopes["RELATIONSHIPS_READ"] = "relationships.read"; | ||
OAuth2Scopes["RPC"] = "rpc"; | ||
OAuth2Scopes["RPC_API"] = "rpc.api"; | ||
OAuth2Scopes["RPC_ACTIVITIES_WRITE"] = "rpc.activities.write"; | ||
OAuth2Scopes["RPC_NOTIFICATIONS_READ"] = "rpc.notifications.read"; | ||
OAuth2Scopes["RPC_VOICE_READ"] = "rpc.voice.read"; | ||
OAuth2Scopes["RPC_VOICE_WRITE"] = "rpc.voice.write"; | ||
OAuth2Scopes["WEBHOOK_INCOMING"] = "webhook.incoming"; | ||
OAuth2Scopes["APPLICATIONS_BUILDS_UPLOAD"] = "applications.builds.upload"; | ||
OAuth2Scopes["APPLICATIONS_BUILDS_READ"] = "applications.builds.read"; | ||
OAuth2Scopes["APPLICATIONS_STORE_UPDATE"] = "applications.store.update"; | ||
OAuth2Scopes["APPLICATIONS_ENTITLEMENTS"] = "applications.entitlements"; | ||
OAuth2Scopes["RELATIONSHIPS_READ"] = "relationships.read"; | ||
OAuth2Scopes["ACTIVITIES_READ"] = "activities.read"; | ||
OAuth2Scopes["ACTIVITIES_WRITE"] = "activities.write"; | ||
OAuth2Scopes["APPLICATIONS_COMMANDS"] = "applications.commands"; | ||
OAuth2Scopes["APPLICATIONS_COMMANDS_UPDATE"] = "applications.commands.update"; | ||
})(OAuth2Scopes = exports.OAuth2Scopes || (exports.OAuth2Scopes = {})); | ||
@@ -387,3 +397,3 @@ var OAuth2GrantTypes; | ||
(function (SpeakingStates) { | ||
SpeakingStates[SpeakingStates["NONE"] = 0] = "NONE"; | ||
SpeakingStates[SpeakingStates["NO_FLAGS"] = 0] = "NO_FLAGS"; | ||
SpeakingStates[SpeakingStates["MICROPHONE"] = 1] = "MICROPHONE"; | ||
@@ -416,1 +426,23 @@ SpeakingStates[SpeakingStates["SOUNDSHARE"] = 2] = "SOUNDSHARE"; | ||
})(PrivacyLevel = exports.PrivacyLevel || (exports.PrivacyLevel = {})); | ||
var GuildNSFWLevel; | ||
(function (GuildNSFWLevel) { | ||
GuildNSFWLevel[GuildNSFWLevel["DEFAULT"] = 0] = "DEFAULT"; | ||
GuildNSFWLevel[GuildNSFWLevel["EXPLICIT"] = 1] = "EXPLICIT"; | ||
GuildNSFWLevel[GuildNSFWLevel["SAFE"] = 2] = "SAFE"; | ||
GuildNSFWLevel[GuildNSFWLevel["AGE_RESTRICTED"] = 3] = "AGE_RESTRICTED"; | ||
})(GuildNSFWLevel = exports.GuildNSFWLevel || (exports.GuildNSFWLevel = {})); | ||
var InviteTargetTypes; | ||
(function (InviteTargetTypes) { | ||
InviteTargetTypes[InviteTargetTypes["STREAM"] = 1] = "STREAM"; | ||
InviteTargetTypes[InviteTargetTypes["EMBEDDED_APPLICATION"] = 2] = "EMBEDDED_APPLICATION"; | ||
})(InviteTargetTypes = exports.InviteTargetTypes || (exports.InviteTargetTypes = {})); | ||
var ApplicationFlags; | ||
(function (ApplicationFlags) { | ||
ApplicationFlags[ApplicationFlags["NO_FLAGS"] = 0] = "NO_FLAGS"; | ||
ApplicationFlags[ApplicationFlags["GATEWAY_PRESENCE"] = 4096] = "GATEWAY_PRESENCE"; | ||
ApplicationFlags[ApplicationFlags["GATEWAY_PRESENCE_LIMITED"] = 8192] = "GATEWAY_PRESENCE_LIMITED"; | ||
ApplicationFlags[ApplicationFlags["GATEWAY_GUILD_MEMBERS"] = 16384] = "GATEWAY_GUILD_MEMBERS"; | ||
ApplicationFlags[ApplicationFlags["GATEWAY_GUILD_MEMBERS_LIMITED"] = 32768] = "GATEWAY_GUILD_MEMBERS_LIMITED"; | ||
ApplicationFlags[ApplicationFlags["VERIFICATION_PENDING_GUILD_LIMIT"] = 65536] = "VERIFICATION_PENDING_GUILD_LIMIT"; | ||
ApplicationFlags[ApplicationFlags["EMBEDDED"] = 131072] = "EMBEDDED"; | ||
})(ApplicationFlags = exports.ApplicationFlags || (exports.ApplicationFlags = {})); |
export { Client, ClientEvents } from './client'; | ||
export { Authorization, TokenTypes } from './request'; | ||
export { Authorization } from './request'; | ||
export { Events } from './events'; | ||
@@ -4,0 +4,0 @@ export * as Actions from './actions'; |
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VoiceEvents = exports.Voice = exports.Tools = exports.Helpers = exports.Actions = exports.Events = exports.TokenTypes = exports.Authorization = exports.ClientEvents = exports.Client = void 0; | ||
exports.VoiceEvents = exports.Voice = exports.Tools = exports.Helpers = exports.Actions = exports.Events = exports.Authorization = exports.ClientEvents = exports.Client = void 0; | ||
var client_1 = require("./client"); | ||
@@ -29,3 +29,2 @@ Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_1.Client; } }); | ||
Object.defineProperty(exports, "Authorization", { enumerable: true, get: function () { return request_1.Authorization; } }); | ||
Object.defineProperty(exports, "TokenTypes", { enumerable: true, get: function () { return request_1.TokenTypes; } }); | ||
var events_1 = require("./events"); | ||
@@ -32,0 +31,0 @@ Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return events_1.Events; } }); |
@@ -1,6 +0,2 @@ | ||
export declare enum TokenTypes { | ||
BOT = "Bot", | ||
BEARER = "Bearer", | ||
NONE = "" | ||
} | ||
import { TokenTypes } from './helpers'; | ||
export declare class Authorization { | ||
@@ -7,0 +3,0 @@ private _type; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Request = exports.Authorization = exports.TokenTypes = void 0; | ||
exports.Request = exports.Authorization = void 0; | ||
const https_1 = __importDefault(require("https")); | ||
@@ -12,10 +12,4 @@ const util_1 = require("./util"); | ||
const DEFAULT_CONNECTION_TIMEOUT = 5000, DEFAULT_RETRY_COUNT = 5; | ||
var TokenTypes; | ||
(function (TokenTypes) { | ||
TokenTypes["BOT"] = "Bot"; | ||
TokenTypes["BEARER"] = "Bearer"; | ||
TokenTypes["NONE"] = ""; | ||
})(TokenTypes = exports.TokenTypes || (exports.TokenTypes = {})); | ||
class Authorization { | ||
constructor(token, type = TokenTypes.BOT) { | ||
constructor(token, type = helpers_1.TokenTypes.BOT) { | ||
this._update = () => this._cache = this._type ? | ||
@@ -22,0 +16,0 @@ `${this._type} ${this._token}` : |
@@ -20,2 +20,3 @@ import { Permissions as Flags } from './helpers'; | ||
Emoji: (emoji: Emoji) => string; | ||
Reaction: (emoji: Emoji) => string; | ||
}; | ||
@@ -26,8 +27,8 @@ export declare const Link: { | ||
export declare const CdnImages: { | ||
CustomEmoji: (emoji_id: string, size?: number | undefined, ext?: "png" | "gif" | undefined) => string; | ||
GuildIcon: (guild: Guild, size?: number | undefined, ext?: "png" | "gif" | "jpg" | "webp" | undefined) => string | null; | ||
CustomEmoji: (emoji_id: string, size?: number | undefined, ext?: "png" | "jpg" | "webp" | "gif" | undefined) => string; | ||
GuildIcon: (guild: Guild, size?: number | undefined, ext?: "png" | "jpg" | "webp" | "gif" | undefined) => string | null; | ||
GuildSplash: (guild: Guild, size?: number | undefined, ext?: "png" | "jpg" | "webp" | undefined) => string | null; | ||
GuildDiscoverySplash: (guild: Guild, size?: number | undefined, ext?: "png" | "jpg" | "webp" | undefined) => string | null; | ||
GuildBanner: (guild: Guild, size?: number | undefined, ext?: "png" | "jpg" | "webp" | undefined) => string | null; | ||
UserAvatar: (user: User, size?: number | undefined, ext?: "png" | "gif" | "jpg" | "webp" | undefined) => string; | ||
UserAvatar: (user: User, size?: number | undefined, ext?: "png" | "jpg" | "webp" | "gif" | undefined) => string; | ||
ApplicationIcon: (application: Application, size?: number | undefined, ext?: "png" | "jpg" | "webp" | undefined) => string | null; | ||
@@ -34,0 +35,0 @@ ApplicationAsset: (application: Application, asset_id: string, size?: number | undefined, ext?: "png" | "jpg" | "webp" | undefined) => string; |
@@ -25,2 +25,3 @@ "use strict"; | ||
Emoji: (emoji) => `<${emoji.animated ? 'a' : ''}:${emoji.name}:${emoji.id}>`, | ||
Reaction: (emoji) => `${emoji.name}:${emoji.id}`, | ||
}; | ||
@@ -27,0 +28,0 @@ exports.Link = { |
@@ -11,3 +11,3 @@ import type * as helpers from './helpers'; | ||
changes?: AuditLogChange[]; | ||
user_id: string; | ||
user_id: string | null; | ||
id: string; | ||
@@ -156,5 +156,6 @@ action_type: helpers.AuditLogEvents; | ||
activity?: MessageActivity; | ||
application?: MessageApplication; | ||
application?: Application; | ||
application_id?: string; | ||
message_reference?: MessageReference; | ||
flags?: number; | ||
flags?: helpers.MessageFlags; | ||
stickers?: MessageSticker[]; | ||
@@ -170,9 +171,2 @@ referenced_message?: Message | null; | ||
}; | ||
export declare type MessageApplication = { | ||
id: string; | ||
cover_image?: string; | ||
description: string; | ||
icon: string | null; | ||
name: string; | ||
}; | ||
export declare type MessageReference = { | ||
@@ -191,3 +185,2 @@ message_id?: string; | ||
asset: string; | ||
preview_asset: string | null; | ||
format_type: helpers.MessageStickerFormatTypes; | ||
@@ -247,2 +240,3 @@ }; | ||
url?: string; | ||
proxy_url?: string; | ||
height?: number; | ||
@@ -280,7 +274,8 @@ width?: number; | ||
filename: string; | ||
content_type?: string; | ||
size: number; | ||
url: string; | ||
proxy_url: string; | ||
height: number | null; | ||
width: number | null; | ||
height?: number | null; | ||
width?: number | null; | ||
}; | ||
@@ -356,2 +351,5 @@ export declare type ChannelMention = { | ||
approximate_presence_count?: number; | ||
welcome_screen?: WelcomeScreen; | ||
nsfw_level: helpers.GuildNSFWLevel; | ||
stage_instances?: StageInstance[]; | ||
}; | ||
@@ -380,3 +378,3 @@ export declare type UnavailableGuild = { | ||
user?: User; | ||
nick: string | null; | ||
nick?: string | null; | ||
roles: string[]; | ||
@@ -388,2 +386,3 @@ joined_at: string; | ||
pending?: boolean; | ||
permissions?: string; | ||
}; | ||
@@ -425,3 +424,3 @@ export declare type Integration = { | ||
description: string | null; | ||
welcome_channels: []; | ||
welcome_channels: WelcomeScreenChannel[]; | ||
}; | ||
@@ -439,6 +438,8 @@ export declare type WelcomeScreenChannel = { | ||
inviter?: User; | ||
target_type?: helpers.InviteTargetTypes; | ||
target_user?: User; | ||
target_user_type?: helpers.TargetUserTypes; | ||
target_application?: Application; | ||
approximate_presence_count?: number; | ||
approximate_member_count?: number; | ||
expires_at?: string | null; | ||
}; | ||
@@ -540,2 +541,5 @@ export declare type InviteMetadata = { | ||
application_id: string | null; | ||
source_guild?: Guild; | ||
source_channel?: Channel; | ||
url?: string; | ||
}; | ||
@@ -694,6 +698,8 @@ export declare type ApplicationCommand = { | ||
bot_require_code_grant: boolean; | ||
terms_of_service_url?: string; | ||
privacy_policy_url?: string; | ||
owner: User; | ||
summary?: string; | ||
summary: string; | ||
verify_key: string; | ||
team?: Team; | ||
team: Team | null; | ||
guild_id?: string; | ||
@@ -703,3 +709,3 @@ primary_sku_id?: string; | ||
cover_image?: string; | ||
flags?: number; | ||
flags: helpers.ApplicationFlags; | ||
}; | ||
@@ -706,0 +712,0 @@ export declare type Team = { |
{ | ||
"name": "discord-slim", | ||
"version": "2.0.5", | ||
"description": "Lightweight Discord bot API for Node.js.", | ||
"version": "2.1.0", | ||
"description": "Lightweight Discord API library for Node.js.", | ||
"author": "Hanabishi", | ||
@@ -6,0 +6,0 @@ "repository": { |
# Discord Slim | ||
[![npm](https://img.shields.io/npm/v/discord-slim?style=for-the-badge)](https://www.npmjs.com/package/discord-slim) | ||
Lightweight **Discord** bot API for **Node.js**. | ||
Lightweight **Discord API** library for **Node.js**. | ||
Provides pure API interaction via type definitions and some helper tools, without excessive abstractions. | ||
@@ -11,2 +12,15 @@ ## Before you start | ||
## Docs | ||
### Main exports | ||
**Client** - client for connecting to the Discord API gateway. | ||
**ClientEvents** - set of possible client events. | ||
**Authorization** - authorization class for client and actions. | ||
**Events** - set of possible gateway API events. | ||
**Actions** - access to API requests. | ||
**Helpers** - objects and constants for API. | ||
**Tools** - additional tools for convinience. | ||
**Voice** - client for connecting to voice channels. | ||
**VoiceEvents** - set of possible voice client events. | ||
**Types** - type definitions export for TypeScript. | ||
**TODO.** | ||
@@ -13,0 +27,0 @@ For now use e.g. VS Code for types completion. |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
163099
3329
140