Initial commit

This commit is contained in:
March 7th
2022-03-19 17:37:45 +07:00
commit ac49705f3e
282 changed files with 39756 additions and 0 deletions

198
typings/enums.d.ts vendored Normal file
View File

@@ -0,0 +1,198 @@
// These are enums that are used in the typings file but do not exist as actual exported values. To prevent them from
// showing up in an editor, they are imported from here instead of exporting them there directly.
export const enum ActivityTypes {
PLAYING = 0,
STREAMING = 1,
LISTENING = 2,
WATCHING = 3,
CUSTOM = 4,
COMPETING = 5,
}
export const enum ApplicationCommandTypes {
CHAT_INPUT = 1,
USER = 2,
MESSAGE = 3,
}
export const enum ApplicationCommandOptionTypes {
SUB_COMMAND = 1,
SUB_COMMAND_GROUP = 2,
STRING = 3,
INTEGER = 4,
BOOLEAN = 5,
USER = 6,
CHANNEL = 7,
ROLE = 8,
MENTIONABLE = 9,
NUMBER = 10,
}
export const enum ApplicationCommandPermissionTypes {
ROLE = 1,
USER = 2,
}
export const enum ChannelTypes {
GUILD_TEXT = 0,
DM = 1,
GUILD_VOICE = 2,
GROUP_DM = 3,
GUILD_CATEGORY = 4,
GUILD_NEWS = 5,
GUILD_STORE = 6,
UNKNOWN = 7,
GUILD_NEWS_THREAD = 10,
GUILD_PUBLIC_THREAD = 11,
GUILD_PRIVATE_THREAD = 12,
GUILD_STAGE_VOICE = 13,
}
export const enum MessageTypes {
DEFAULT,
RECIPIENT_ADD,
RECIPIENT_REMOVE,
CALL,
CHANNEL_NAME_CHANGE,
CHANNEL_ICON_CHANGE,
CHANNEL_PINNED_MESSAGE,
GUILD_MEMBER_JOIN,
USER_PREMIUM_GUILD_SUBSCRIPTION,
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1,
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2,
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3,
CHANNEL_FOLLOW_ADD,
GUILD_DISCOVERY_DISQUALIFIED = 14,
GUILD_DISCOVERY_REQUALIFIED,
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
THREAD_CREATED,
REPLY,
APPLICATION_COMMAND,
THREAD_STARTER_MESSAGE,
GUILD_INVITE_REMINDER,
CONTEXT_MENU_COMMAND,
}
export const enum DefaultMessageNotificationLevels {
ALL_MESSAGES = 0,
ONLY_MENTIONS = 1,
}
export const enum ExplicitContentFilterLevels {
DISABLED = 0,
MEMBERS_WITHOUT_ROLES = 1,
ALL_MEMBERS = 2,
}
export const enum GuildScheduledEventEntityTypes {
STAGE_INSTANCE = 1,
VOICE = 2,
EXTERNAL = 3,
}
export const enum GuildScheduledEventPrivacyLevels {
GUILD_ONLY = 2,
}
export const enum GuildScheduledEventStatuses {
SCHEDULED = 1,
ACTIVE = 2,
COMPLETED = 3,
CANCELED = 4,
}
export const enum InteractionResponseTypes {
PONG = 1,
CHANNEL_MESSAGE_WITH_SOURCE = 4,
DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE = 5,
DEFERRED_MESSAGE_UPDATE = 6,
UPDATE_MESSAGE = 7,
APPLICATION_COMMAND_AUTOCOMPLETE_RESULT = 8,
}
export const enum InteractionTypes {
PING = 1,
APPLICATION_COMMAND = 2,
MESSAGE_COMPONENT = 3,
APPLICATION_COMMAND_AUTOCOMPLETE = 4,
}
export const enum InviteTargetType {
STREAM = 1,
EMBEDDED_APPLICATION = 2,
}
export const enum MembershipStates {
INVITED = 1,
ACCEPTED = 2,
}
export const enum MessageButtonStyles {
PRIMARY = 1,
SECONDARY = 2,
SUCCESS = 3,
DANGER = 4,
LINK = 5,
}
export const enum MessageComponentTypes {
ACTION_ROW = 1,
BUTTON = 2,
SELECT_MENU = 3,
}
export const enum MFALevels {
NONE = 0,
ELEVATED = 1,
}
export const enum NSFWLevels {
DEFAULT = 0,
EXPLICIT = 1,
SAFE = 2,
AGE_RESTRICTED = 3,
}
export const enum OverwriteTypes {
role = 0,
member = 1,
}
export const enum PremiumTiers {
NONE = 0,
TIER_1 = 1,
TIER_2 = 2,
TIER_3 = 3,
}
export const enum PrivacyLevels {
PUBLIC = 1,
GUILD_ONLY = 2,
}
export const enum StickerFormatTypes {
PNG = 1,
APNG = 2,
LOTTIE = 3,
}
export const enum StickerTypes {
STANDARD = 1,
GUILD = 2,
}
export const enum VerificationLevels {
NONE = 0,
LOW = 1,
MEDIUM = 2,
HIGH = 3,
VERY_HIGH = 4,
}
export const enum WebhookTypes {
Incoming = 1,
'Channel Follower' = 2,
Application = 3,
}

5847
typings/index.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

1252
typings/index.test-d.ts Normal file

File diff suppressed because it is too large Load Diff

210
typings/rawDataTypes.d.ts vendored Normal file
View File

@@ -0,0 +1,210 @@
// These are aggregate types that are used in the typings file but do not exist as actual exported values.
// To prevent them from showing up in an editor, they are imported from here instead of exporting them there directly.
import {
APIApplication,
APIApplicationCommand,
APIApplicationCommandInteraction,
APIAttachment,
APIAuditLog,
APIAuditLogEntry,
APIBan,
APIChannel,
APIEmoji,
APIExtendedInvite,
APIGuild,
APIGuildIntegration,
APIGuildIntegrationApplication,
APIGuildMember,
APIGuildPreview,
APIGuildWelcomeScreen,
APIGuildWelcomeScreenChannel,
APIGuildWidget,
APIGuildWidgetMember,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
APIInteractionGuildMember,
APIInvite,
APIInviteStageInstance,
APIMessage,
APIMessageButtonInteractionData,
APIMessageComponentInteraction,
APIMessageSelectMenuInteractionData,
APIOverwrite,
APIPartialChannel,
APIPartialEmoji,
APIPartialGuild,
APIReaction,
APIRole,
APIStageInstance,
APISticker,
APIStickerItem,
APIStickerPack,
APITeam,
APITeamMember,
APITemplate,
APIThreadMember,
APIUnavailableGuild,
APIUser,
APIVoiceRegion,
APIWebhook,
GatewayActivity,
GatewayActivityAssets,
GatewayActivityEmoji,
GatewayGuildBanAddDispatchData,
GatewayGuildMemberAddDispatchData,
GatewayGuildMemberUpdateDispatchData,
GatewayInteractionCreateDispatchData,
GatewayInviteCreateDispatchData,
GatewayInviteDeleteDispatchData,
GatewayMessageReactionAddDispatchData,
GatewayMessageUpdateDispatchData,
GatewayPresenceUpdate,
GatewayReadyDispatchData,
GatewayTypingStartDispatchData,
GatewayVoiceState,
RESTAPIPartialCurrentUserGuild,
RESTGetAPIWebhookWithTokenResult,
RESTPatchAPIChannelMessageJSONBody,
RESTPatchAPICurrentGuildMemberNicknameJSONBody,
RESTPatchAPIInteractionFollowupJSONBody,
RESTPatchAPIInteractionOriginalResponseJSONBody,
RESTPatchAPIWebhookWithTokenJSONBody,
RESTPostAPIChannelMessageJSONBody,
RESTPostAPIInteractionCallbackFormDataBody,
RESTPostAPIInteractionFollowupJSONBody,
RESTPostAPIWebhookWithTokenJSONBody,
Snowflake,
APIGuildScheduledEvent
} from 'discord-api-types/v9';
import { GuildChannel, Guild, PermissionOverwrites } from '.';
export type RawActivityData = GatewayActivity;
export type RawApplicationData = RawClientApplicationData | RawIntegrationApplicationData;
export type RawClientApplicationData = GatewayReadyDispatchData['application'] | APIMessage['application'];
export type RawIntegrationApplicationData = APIGuildIntegrationApplication | Partial<APIApplication>;
export type RawApplicationCommandData = APIApplicationCommand;
export type RawChannelData =
| RawGuildChannelData
| RawThreadChannelData
| RawDMChannelData
| RawPartialGroupDMChannelData;
export type RawDMChannelData = APIChannel | APIInteractionDataResolvedChannel;
export type RawGuildChannelData = APIChannel | APIInteractionDataResolvedChannel | Required<APIPartialChannel>;
export type RawPartialGroupDMChannelData = APIChannel | Required<APIPartialChannel>;
export type RawThreadChannelData = APIChannel | APIInteractionDataResolvedChannel;
export type RawEmojiData =
| RawGuildEmojiData
| RawReactionEmojiData
| GatewayActivityEmoji
| Omit<Partial<APIPartialEmoji>, 'animated'>;
export type RawGuildEmojiData = APIEmoji;
export type RawReactionEmojiData = APIEmoji | APIPartialEmoji;
export type RawGuildAuditLogData = APIAuditLog;
export type RawGuildAuditLogEntryData = APIAuditLogEntry;
export type RawGuildBanData = GatewayGuildBanAddDispatchData | APIBan;
export type RawGuildData = APIGuild | APIUnavailableGuild;
export type RawAnonymousGuildData = RawGuildData | RawInviteGuildData;
export type RawBaseGuildData = RawAnonymousGuildData | RawOAuth2GuildData;
export type RawInviteGuildData = APIPartialGuild;
export type RawOAuth2GuildData = RESTAPIPartialCurrentUserGuild;
export type RawGuildMemberData =
| APIGuildMember
| APIInteractionGuildMember
| APIInteractionDataResolvedGuildMember
| GatewayGuildMemberAddDispatchData
| GatewayGuildMemberUpdateDispatchData
| Required<RESTPatchAPICurrentGuildMemberNicknameJSONBody>
| { user: { id: Snowflake } };
export type RawThreadMemberData = APIThreadMember;
export type RawGuildPreviewData = APIGuildPreview;
export type RawGuildScheduledEventData = APIGuildScheduledEvent;
export type RawGuildTemplateData = APITemplate;
export type RawIntegrationData = APIGuildIntegration;
export type RawInteractionData = GatewayInteractionCreateDispatchData;
export type RawCommandInteractionData = APIApplicationCommandInteraction;
export type RawMessageComponentInteractionData = APIMessageComponentInteraction;
export type RawMessageButtonInteractionData = APIMessageButtonInteractionData;
export type RawMessageSelectMenuInteractionData = APIMessageSelectMenuInteractionData;
export type RawInviteData =
| APIExtendedInvite
| APIInvite
| (GatewayInviteCreateDispatchData & { channel: GuildChannel; guild: Guild })
| (GatewayInviteDeleteDispatchData & { channel: GuildChannel; guild: Guild });
export type RawInviteStageInstance = APIInviteStageInstance;
export type RawMessageData = APIMessage;
export type RawPartialMessageData = GatewayMessageUpdateDispatchData;
export type RawMessageAttachmentData = APIAttachment;
export type RawMessagePayloadData =
| RESTPostAPIChannelMessageJSONBody
| RESTPatchAPIChannelMessageJSONBody
| RESTPostAPIWebhookWithTokenJSONBody
| RESTPatchAPIWebhookWithTokenJSONBody
| RESTPostAPIInteractionCallbackFormDataBody
| RESTPatchAPIInteractionOriginalResponseJSONBody
| RESTPostAPIInteractionFollowupJSONBody
| RESTPatchAPIInteractionFollowupJSONBody;
export type RawMessageReactionData = APIReaction | GatewayMessageReactionAddDispatchData;
export type RawPermissionOverwriteData = APIOverwrite | PermissionOverwrites;
export type RawPresenceData = GatewayPresenceUpdate;
export type RawRoleData = APIRole;
export type RawRichPresenceAssets = GatewayActivityAssets;
export type RawStageInstanceData =
| APIStageInstance
| (Partial<APIStageInstance> & Pick<APIStageInstance, 'id' | 'channel_id' | 'guild_id'>);
export type RawStickerData = APISticker | APIStickerItem;
export type RawStickerPackData = APIStickerPack;
export type RawTeamData = APITeam;
export type RawTeamMemberData = APITeamMember;
export type RawTypingData = GatewayTypingStartDispatchData;
export type RawUserData =
| (APIUser & { member?: Omit<APIGuildMember, 'user'> })
| (GatewayPresenceUpdate['user'] & Pick<APIUser, 'username'>);
export type RawVoiceRegionData = APIVoiceRegion;
export type RawVoiceStateData = GatewayVoiceState | Omit<GatewayVoiceState, 'guild_id'>;
export type RawWebhookData =
| APIWebhook
| RESTGetAPIWebhookWithTokenResult
| (Partial<APIWebhook> & Required<Pick<APIWebhook, 'id' | 'guild_id'>>);
export type RawWelcomeChannelData = APIGuildWelcomeScreenChannel;
export type RawWelcomeScreenData = APIGuildWelcomeScreen;
export type RawWidgetData = APIGuildWidget;
export type RawWidgetMemberData = APIGuildWidgetMember;