discord-slim
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -55,6 +55,31 @@ /// <reference types="node" /> | ||
GetWebhooks: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Webhook[]>; | ||
GetActiveThreads: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Channel[]>; | ||
GetSelfArchivedPrivateThreads: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Channel[]>; | ||
GetArchivedPublicThreads: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Channel[]>; | ||
GetArchivedPrivateThreads: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Channel[]>; | ||
ListActiveThreads: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<{ | ||
threads: types.Channel[]; | ||
members: types.ThreadMember[]; | ||
has_more: boolean; | ||
}>; | ||
ListPublicArchivedThreads: (channel_id: string, params?: { | ||
before?: string | undefined; | ||
limit?: number | undefined; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<{ | ||
threads: types.Channel[]; | ||
members: types.ThreadMember[]; | ||
has_more: boolean; | ||
}>; | ||
ListPrivateArchivedThreads: (channel_id: string, params?: { | ||
before?: string | undefined; | ||
limit?: number | undefined; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<{ | ||
threads: types.Channel[]; | ||
members: types.ThreadMember[]; | ||
has_more: boolean; | ||
}>; | ||
ListJoinedPrivateArchivedThreads: (channel_id: string, params?: { | ||
before?: string | undefined; | ||
limit?: number | undefined; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<{ | ||
threads: types.Channel[]; | ||
members: types.ThreadMember[]; | ||
has_more: boolean; | ||
}>; | ||
}; | ||
@@ -102,2 +127,6 @@ export declare const Message: { | ||
RemoveRecipient: (channel_id: string, user_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
Modify: (id: string, params: { | ||
name?: string; | ||
icon?: string; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
}; | ||
@@ -266,2 +295,10 @@ export declare const Guild: { | ||
}; | ||
export declare const WelcomeScreen: { | ||
Get: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.WelcomeScreen>; | ||
Modify: (guild_id: string, params: { | ||
enabled?: boolean | null; | ||
welcome_channels?: types.WelcomeScreenChannel[] | null; | ||
description?: string | null; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.WelcomeScreen>; | ||
}; | ||
export declare const Invite: { | ||
@@ -453,3 +490,22 @@ Create: (channel_id: string, params: { | ||
export declare const Thread: { | ||
GetMembers: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.ThreadMember[]>; | ||
Modify: (id: string, params: { | ||
name?: string; | ||
archived?: boolean; | ||
auto_archive_duration?: types.ThreadArchiveDuration; | ||
locked?: boolean; | ||
rate_limit_per_user?: number | null; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
StartWithMessage: (channel_id: string, message_id: string, params: { | ||
name: string; | ||
auto_archive_duration: types.ThreadArchiveDuration; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
Start: (channel_id: string, params: { | ||
name: string; | ||
auto_archive_duration: types.ThreadArchiveDuration; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
Join: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
AddMember: (channel_id: string, user_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
Leave: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
RemoveMember: (channel_id: string, user_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
ListMembers: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.ThreadMember[]>; | ||
}; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Thread = exports.OAuth2 = exports.Application = exports.Webhook = exports.Voice = exports.User = exports.Template = exports.Invite = 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.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; | ||
const request_1 = require("./request"); | ||
@@ -27,6 +27,6 @@ const querystring_1 = __importDefault(require("querystring")); | ||
GetWebhooks: (channel_id, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/webhooks", requestOptions ?? defaultRequestOptions), | ||
GetActiveThreads: (channel_id, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/threads" + "/active", requestOptions ?? defaultRequestOptions), | ||
GetSelfArchivedPrivateThreads: (channel_id, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/users" + "/@me" + "/threads" + "/archived" + "/private", requestOptions ?? defaultRequestOptions), | ||
GetArchivedPublicThreads: (channel_id, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/threads" + "/archived" + "/public", requestOptions ?? defaultRequestOptions), | ||
GetArchivedPrivateThreads: (channel_id, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/threads" + "/archived" + "/private", requestOptions ?? defaultRequestOptions), | ||
ListActiveThreads: (channel_id, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/threads" + "/active", requestOptions ?? defaultRequestOptions), | ||
ListPublicArchivedThreads: (channel_id, params, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/threads" + "/archived" + "/public?" + querystring_1.default.stringify(params), requestOptions ?? defaultRequestOptions), | ||
ListPrivateArchivedThreads: (channel_id, params, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/threads" + "/archived" + "/private?" + querystring_1.default.stringify(params), requestOptions ?? defaultRequestOptions), | ||
ListJoinedPrivateArchivedThreads: (channel_id, params, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/users" + "/@me" + "/threads" + "/archived" + "/private?" + querystring_1.default.stringify(params), requestOptions ?? defaultRequestOptions), | ||
}; | ||
@@ -55,2 +55,3 @@ exports.Message = { | ||
RemoveRecipient: (channel_id, user_id, requestOptions) => request_1.Request("DELETE", "/channels/" + channel_id + "/recipients/" + user_id, requestOptions ?? defaultRequestOptions), | ||
Modify: (id, params, requestOptions) => request_1.Request("PATCH", "/channels/" + id, requestOptions ?? defaultRequestOptions, params), | ||
}; | ||
@@ -116,2 +117,6 @@ exports.Guild = { | ||
}; | ||
exports.WelcomeScreen = { | ||
Get: (guild_id, requestOptions) => request_1.Request("GET", "/guilds/" + guild_id + "/welcome-screen", requestOptions ?? defaultRequestOptions), | ||
Modify: (guild_id, params, requestOptions) => request_1.Request("PATCH", "/guilds/" + guild_id + "/welcome-screen", requestOptions ?? defaultRequestOptions, params), | ||
}; | ||
exports.Invite = { | ||
@@ -186,3 +191,10 @@ Create: (channel_id, params, requestOptions) => request_1.Request("POST", "/channels/" + channel_id + "/invites", requestOptions ?? defaultRequestOptions, params), | ||
exports.Thread = { | ||
GetMembers: (channel_id, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/thread-members", requestOptions ?? defaultRequestOptions), | ||
Modify: (id, params, requestOptions) => request_1.Request("PATCH", "/channels/" + id, requestOptions ?? defaultRequestOptions, params), | ||
StartWithMessage: (channel_id, message_id, params, requestOptions) => request_1.Request("POST", "/channels/" + channel_id + "/messages/" + message_id + "/threads", requestOptions ?? defaultRequestOptions, params), | ||
Start: (channel_id, params, requestOptions) => request_1.Request("POST", "/channels/" + channel_id + "/threads", requestOptions ?? defaultRequestOptions, params), | ||
Join: (channel_id, requestOptions) => request_1.Request("PUT", "/channels/" + channel_id + "/thread-members" + "/@me", requestOptions ?? defaultRequestOptions), | ||
AddMember: (channel_id, user_id, requestOptions) => request_1.Request("PUT", "/channels/" + channel_id + "/thread-members/" + user_id, requestOptions ?? defaultRequestOptions), | ||
Leave: (channel_id, requestOptions) => request_1.Request("DELETE", "/channels/" + channel_id + "/thread-members" + "/@me", requestOptions ?? defaultRequestOptions), | ||
RemoveMember: (channel_id, user_id, requestOptions) => request_1.Request("DELETE", "/channels/" + channel_id + "/thread-members/" + user_id, requestOptions ?? defaultRequestOptions), | ||
ListMembers: (channel_id, requestOptions) => request_1.Request("GET", "/channels/" + channel_id + "/thread-members", requestOptions ?? defaultRequestOptions), | ||
}; |
@@ -291,3 +291,4 @@ 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"; | ||
PING = 1, | ||
APPLICATION_COMMAND = 2 | ||
APPLICATION_COMMAND = 2, | ||
MESSAGE_COMPONENT = 3 | ||
} | ||
@@ -297,3 +298,5 @@ export declare enum InteractionResponseTypes { | ||
CHANNEL_MESSAGE_WITH_SOURCE = 4, | ||
DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE = 5 | ||
DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE = 5, | ||
DEFERRED_UPDATE_MESSAGE = 6, | ||
UPDATE_MESSAGE = 7 | ||
} | ||
@@ -349,1 +352,12 @@ export declare enum InteractionResponseFlags { | ||
} | ||
export declare enum ComponentTypes { | ||
ACTION_ROW = 1, | ||
BUTTON = 2 | ||
} | ||
export declare enum ButtonStyles { | ||
PRIMARY = 1, | ||
SECONDARY = 2, | ||
SUCCESS = 3, | ||
DANGER = 4, | ||
LINK = 5 | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
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.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.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'; | ||
@@ -324,2 +324,3 @@ exports.Permissions = { | ||
InteractionTypes[InteractionTypes["APPLICATION_COMMAND"] = 2] = "APPLICATION_COMMAND"; | ||
InteractionTypes[InteractionTypes["MESSAGE_COMPONENT"] = 3] = "MESSAGE_COMPONENT"; | ||
})(InteractionTypes = exports.InteractionTypes || (exports.InteractionTypes = {})); | ||
@@ -331,2 +332,4 @@ var InteractionResponseTypes; | ||
InteractionResponseTypes[InteractionResponseTypes["DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE"] = 5] = "DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE"; | ||
InteractionResponseTypes[InteractionResponseTypes["DEFERRED_UPDATE_MESSAGE"] = 6] = "DEFERRED_UPDATE_MESSAGE"; | ||
InteractionResponseTypes[InteractionResponseTypes["UPDATE_MESSAGE"] = 7] = "UPDATE_MESSAGE"; | ||
})(InteractionResponseTypes = exports.InteractionResponseTypes || (exports.InteractionResponseTypes = {})); | ||
@@ -389,1 +392,14 @@ var InteractionResponseFlags; | ||
})(VideoQualityModes = exports.VideoQualityModes || (exports.VideoQualityModes = {})); | ||
var ComponentTypes; | ||
(function (ComponentTypes) { | ||
ComponentTypes[ComponentTypes["ACTION_ROW"] = 1] = "ACTION_ROW"; | ||
ComponentTypes[ComponentTypes["BUTTON"] = 2] = "BUTTON"; | ||
})(ComponentTypes = exports.ComponentTypes || (exports.ComponentTypes = {})); | ||
var ButtonStyles; | ||
(function (ButtonStyles) { | ||
ButtonStyles[ButtonStyles["PRIMARY"] = 1] = "PRIMARY"; | ||
ButtonStyles[ButtonStyles["SECONDARY"] = 2] = "SECONDARY"; | ||
ButtonStyles[ButtonStyles["SUCCESS"] = 3] = "SUCCESS"; | ||
ButtonStyles[ButtonStyles["DANGER"] = 4] = "DANGER"; | ||
ButtonStyles[ButtonStyles["LINK"] = 5] = "LINK"; | ||
})(ButtonStyles = exports.ButtonStyles || (exports.ButtonStyles = {})); |
import { Permissions as Flags } from './helpers'; | ||
import { Guild, User, Application, Team } from './types'; | ||
import { Guild, User, Application, Team, Emoji, Message } from './types'; | ||
declare type Permission = typeof Flags[keyof typeof Flags]; | ||
@@ -18,2 +18,8 @@ declare type PermissionSet = string | number | bigint; | ||
}; | ||
export declare const Format: { | ||
Emoji: (emoji: Emoji) => string; | ||
}; | ||
export declare const Link: { | ||
Message: (message: Message) => string; | ||
}; | ||
export declare const CdnImages: { | ||
@@ -20,0 +26,0 @@ CustomEmoji: (emoji_id: string, size?: number | undefined, ext?: "png" | "gif" | undefined) => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CdnImages = exports.Mentions = exports.Permissions = void 0; | ||
exports.CdnImages = exports.Link = exports.Format = exports.Mentions = exports.Permissions = void 0; | ||
const helpers_1 = require("./helpers"); | ||
@@ -23,2 +23,8 @@ exports.Permissions = { | ||
}; | ||
exports.Format = { | ||
Emoji: (emoji) => `<${emoji.animated ? 'a' : ''}:${emoji.name}:${emoji.id}>`, | ||
}; | ||
exports.Link = { | ||
Message: (message) => `${helpers_1.HOST}/channels/${message.guild_id ?? '@me'}/${message.channel_id}/${message.id}`, | ||
}; | ||
const SizeExtOpt = (size, ext) => (ext ? `.${ext}` : '') + (size ? `?size=${size}` : ''); | ||
@@ -25,0 +31,0 @@ exports.CdnImages = { |
@@ -161,2 +161,4 @@ import type * as helpers from './helpers'; | ||
interaction?: MessageInteraction; | ||
thread?: Channel; | ||
components?: Component[]; | ||
}; | ||
@@ -204,6 +206,7 @@ export declare type MessageActivity = { | ||
}; | ||
export declare type ThreadArchiveDuration = 60 | 1440 | 4320 | 10080; | ||
export declare type ThreadMetadata = { | ||
archived: boolean; | ||
archiver_id?: string; | ||
auto_archive_duration: 60 | 1440 | 4320 | 10080; | ||
auto_archive_duration: ThreadArchiveDuration; | ||
archive_timestamp: string; | ||
@@ -412,2 +415,12 @@ locked?: boolean; | ||
}; | ||
export declare type WelcomeScreen = { | ||
description: string | null; | ||
welcome_channels: []; | ||
}; | ||
export declare type WelcomeScreenChannel = { | ||
channel_id: string; | ||
description: string; | ||
emoji_id: string | null; | ||
emoji_name: string | null; | ||
}; | ||
export declare type Invite = { | ||
@@ -561,2 +574,3 @@ code: string; | ||
version: number; | ||
message?: Message; | ||
}; | ||
@@ -566,6 +580,24 @@ export declare type ApplicationCommandInteractionData = { | ||
name: string; | ||
resolved?: ApplicationCommandInteractionDataResolved; | ||
options?: ApplicationCommandInteractionDataOption[]; | ||
custom_id?: string; | ||
component_type?: helpers.ComponentTypes; | ||
}; | ||
export declare type ApplicationCommandInteractionDataResolved = { | ||
users?: { | ||
[id: string]: User; | ||
}; | ||
members?: { | ||
[id: string]: Member; | ||
}; | ||
roles?: { | ||
[id: string]: Role; | ||
}; | ||
channels?: { | ||
[id: string]: Channel; | ||
}; | ||
}; | ||
export declare type ApplicationCommandInteractionDataOption = { | ||
name: string; | ||
type: helpers.ApplicationCommandOptionTypes; | ||
value?: string | number | boolean; | ||
@@ -675,1 +707,11 @@ options?: ApplicationCommandInteractionDataOption[]; | ||
}; | ||
export declare type Component = { | ||
type: helpers.ComponentTypes; | ||
style?: helpers.ButtonStyles; | ||
label?: string; | ||
emoji?: Emoji; | ||
custom_id?: string; | ||
url?: string; | ||
disabled?: boolean; | ||
components?: Component[]; | ||
}; |
{ | ||
"name": "discord-slim", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Lightweight Discord bot API for Node.js.", | ||
@@ -10,3 +10,2 @@ "author": "Hanabishi", | ||
}, | ||
"homepage": "https://discord.gg/drsXkP8R4h", | ||
"keywords": [ | ||
@@ -13,0 +12,0 @@ "discord", |
@@ -6,5 +6,2 @@ # Discord Slim | ||
### Support & suggestions | ||
[![discord](https://user-images.githubusercontent.com/13597663/113933123-a1b62e00-980d-11eb-8bdb-8ff439358010.png)](https://discord.gg/drsXkP8R4h) | ||
## Before you start | ||
@@ -16,3 +13,3 @@ ### **Node.js** 14+ is required! | ||
**TODO.** | ||
For now use e.g. VS Code for types completion. If you have any questions join our discord server. | ||
For now use e.g. VS Code for types completion. | ||
@@ -19,0 +16,0 @@ ## Installation |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155074
3202
1
126