Merge pull request #879 from discordeno/remove-discord-prefixed-types

Remove discord prefixed types
This commit is contained in:
Skillz4Killz
2021-04-30 19:39:15 -04:00
committed by GitHub
201 changed files with 310 additions and 716 deletions
+3 -8
View File
@@ -2,16 +2,11 @@ import { eventHandlers } from "../../bot.ts";
import { cacheHandlers } from "../../cache.ts";
import { structures } from "../../structures/mod.ts";
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
import {
DiscordVoiceState,
VoiceState,
} from "../../types/voice/voice_state.ts";
import { snakeKeysToCamelCase } from "../../util/utils.ts";
import { VoiceState } from "../../types/voice/voice_state.ts";
export async function handleVoiceStateUpdate(data: DiscordGatewayPayload) {
const payload = snakeKeysToCamelCase<VoiceState>(
data.d as DiscordVoiceState,
);
const payload = data.d as VoiceState;
if (!payload.guildId) return;
const guild = await cacheHandlers.get("guilds", payload.guildId);
@@ -1,9 +1,9 @@
import { rest } from "../../rest/rest.ts";
import { DiscordValidateDiscoverySearchTerm } from "../../types/discovery/validate_discovery_search_term.ts";
import { ValidateDiscoverySearchTerm } from "../../types/discovery/validate_discovery_search_term.ts";
import { endpoints } from "../../util/constants.ts";
export async function validDiscoveryTerm(term: string) {
const result = await rest.runMethod<DiscordValidateDiscoverySearchTerm>(
const result = await rest.runMethod<ValidateDiscoverySearchTerm>(
"get",
endpoints.DISCOVERY_VALID_TERM,
{ term },
+2 -2
View File
@@ -4,7 +4,7 @@ import { structures } from "../../structures/mod.ts";
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
import { DiscordAllowedMentionsTypes } from "../../types/messages/allowed_mentions_types.ts";
import { CreateMessage } from "../../types/messages/create_message.ts";
import { DiscordMessage, Message } from "../../types/messages/message.ts";
import { Message } from "../../types/messages/message.ts";
import { Errors } from "../../types/misc/errors.ts";
import { PermissionStrings } from "../../types/permissions/permission_strings.ts";
import { endpoints } from "../../util/constants.ts";
@@ -96,7 +96,7 @@ export async function sendMessage(
const result = await rest.runMethod<Message>(
"post",
endpoints.CHANNEL_MESSAGES(channelId),
camelKeysToSnakeCase<DiscordMessage>({
camelKeysToSnakeCase({
...content,
...(content.messageReference?.messageId
? {
+1 -4
View File
@@ -1,9 +1,9 @@
import { Integration } from "../integration/integration.ts";
import { User } from "../users/user.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { Webhook } from "../webhooks/webhook.ts";
import { AuditLogEntry } from "./audit_log_entry.ts";
/** https://discord.com/developers/docs/resources/audit-log#audit-log-object */
export interface AuditLog {
/** List of webhooks found in the audit log */
webhooks: Webhook[];
@@ -14,6 +14,3 @@ export interface AuditLog {
/** List of partial integration objects */
integrations: Partial<Integration>[];
}
/** https://discord.com/developers/docs/resources/audit-log#audit-log-object */
export type DiscordAuditLog = SnakeCasedPropertiesDeep<AuditLog>;
+1 -4
View File
@@ -1,6 +1,6 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { AuditLogChangeValue } from "./audit_log_change_value.ts";
/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */
export interface AuditLogChange {
/** New value of the key */
newValue?: AuditLogChangeValue;
@@ -9,6 +9,3 @@ export interface AuditLogChange {
/** Name of audit log change key */
key: string;
}
/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */
export type DiscordAuditLogChange = SnakeCasedPropertiesDeep<AuditLogChange>;
@@ -1,7 +1,7 @@
import { Overwrite } from "../channels/overwrite.ts";
import { Role } from "../permissions/role.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */
export type AuditLogChangeValue =
| {
newValue: string;
@@ -83,8 +83,3 @@ export type AuditLogChangeValue =
oldValue: string | number;
key: "type";
};
/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */
export type DiscordAuditLogChangeValue = SnakeCasedPropertiesDeep<
AuditLogChangeValue
>;
+1 -4
View File
@@ -1,8 +1,8 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { AuditLogChange } from "./audit_log_change.ts";
import { DiscordAuditLogEvents } from "./audit_log_events.ts";
import { OptionalAuditEntryInfo } from "./optional_audit_entry_info.ts";
/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure */
export interface AuditLogEntry {
/** id of the affected entity (webhook, user, role, etc.) */
targetId: string | null;
@@ -19,6 +19,3 @@ export interface AuditLogEntry {
/** The reason for the change (0-512 characters) */
reason?: string;
}
/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure */
export type DiscordAuditLogEntry = SnakeCasedPropertiesDeep<AuditLogEntry>;
+3
View File
@@ -36,3 +36,6 @@ export enum DiscordAuditLogEvents {
INTEGRATION_UPDATE,
INTEGRATION_DELETE,
}
export type AuditLogEvents = DiscordAuditLogEvents;
export const AuditLogEvents = DiscordAuditLogEvents;
+1 -6
View File
@@ -1,6 +1,6 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { DiscordAuditLogEvents } from "./audit_log_events.ts";
/** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log-query-string-parameters */
export interface GetGuildAuditLog {
/** Filter the log for actions made by a user */
userId: string;
@@ -11,8 +11,3 @@ export interface GetGuildAuditLog {
/** How many entries are returned (default 50, minimum 1, maximum 100) */
limit: number;
}
/** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log-query-string-parameters */
export type DiscordGetGuildAuditLog = SnakeCasedPropertiesDeep<
GetGuildAuditLog
>;
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info */
export interface OptionalAuditEntryInfo {
/** Number of days after which inactive members were kicked */
deleteMemberDays: string;
@@ -18,8 +17,3 @@ export interface OptionalAuditEntryInfo {
/** Name of the role if type is "0" (not present if type is "1") */
roleName: string;
}
/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info */
export type DiscordOptionalAuditEntryInfo = SnakeCasedPropertiesDeep<
OptionalAuditEntryInfo
>;
+2 -8
View File
@@ -1,9 +1,9 @@
import { User } from "../users/user.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { DiscordChannelTypes } from "./channel_types.ts";
import { DiscordOverwrite, Overwrite } from "./overwrite.ts";
import { Overwrite } from "./overwrite.ts";
import { DiscordVideoQualityModes } from "./video_quality_modes.ts";
/** https://discord.com/developers/docs/resources/channel#channel-object */
export interface Channel {
/** The id of the channel */
id: string;
@@ -46,9 +46,3 @@ export interface Channel {
/** The camera video quality mode of the voice channel, 1 when not present */
videoQualityMode?: DiscordVideoQualityModes;
}
/** https://discord.com/developers/docs/resources/channel#channel-object */
export interface DiscordChannel
extends SnakeCasedPropertiesDeep<Omit<Channel, "permissionOverwrites">> {
permission_overwrites?: DiscordOverwrite[];
}
+1 -5
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/channel#channel-mention-object */
export interface ChannelMention {
/** id of the channel */
id: string;
@@ -10,6 +9,3 @@ export interface ChannelMention {
/** The name of the channel */
name: string;
}
/** https://discord.com/developers/docs/resources/channel#channel-mention-object */
export type DiscordChannelMention = SnakeCasedPropertiesDeep<ChannelMention>;
+1 -7
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#channel-pins-update */
export interface ChannelPinsUpdate {
/** The id of the guild */
guildId?: string;
@@ -8,8 +7,3 @@ export interface ChannelPinsUpdate {
/** The time at which the most recent pinned message was pinned */
lastPinTimestamp?: string | null;
}
/** https://discord.com/developers/docs/topics/gateway#channel-pins-update */
export type DiscordChannelPinsUpdate = SnakeCasedPropertiesDeep<
ChannelPinsUpdate
>;
+3
View File
@@ -17,3 +17,6 @@ export enum DiscordChannelTypes {
/** A voice channel for hosting events with an audience */
GUILD_STAGE_VOICE = 13,
}
export type ChannelTypes = DiscordChannelTypes;
export const ChannelTypes = DiscordChannelTypes;
+1 -5
View File
@@ -1,11 +1,7 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/channel#followed-channel-object */
export interface FollowedChannel {
/** Source message id */
channelId: string;
/** Created target webhook id */
webhookId: string;
}
/** https://discord.com/developers/docs/resources/channel#followed-channel-object */
export type DiscordFollowedChannel = SnakeCasedPropertiesDeep<FollowedChannel>;
+2
View File
@@ -37,3 +37,5 @@ export interface DiscordModifyChannel extends
> {
permission_overwrites?: DiscordOverwrite[];
}
//TODO: check this
+2
View File
@@ -17,3 +17,5 @@ export interface DiscordOverwrite extends Omit<Overwrite, "allow" | "deny"> {
allow: string;
deny: string;
}
// TODO: check this
+3
View File
@@ -2,3 +2,6 @@ export enum DiscordOverwriteTypes {
ROLE,
MEMBER,
}
export type OverwriteTypes = DiscordOverwriteTypes;
export const OverwriteTypes = DiscordOverwriteTypes;
@@ -4,3 +4,6 @@ export enum DiscordVideoQualityModes {
/** 720p */
Full,
}
export type VideoQualityModes = DiscordVideoQualityModes;
export const VideoQualityModes = DiscordVideoQualityModes;
@@ -15,3 +15,6 @@ export enum DiscordGatewayCloseEventCodes {
InvalidIntents,
DisallowedIntents,
}
export type GatewayCloseEventCodes = DiscordGatewayCloseEventCodes;
export const GatewayCloseEventCodes = DiscordGatewayCloseEventCodes;
+3
View File
@@ -12,3 +12,6 @@ export enum DiscordGatewayOpcodes {
Hello,
HeartbeatACK,
}
export type GatewayOpcodes = DiscordGatewayOpcodes;
export const GatewayOpcodes = DiscordGatewayOpcodes;
+3
View File
@@ -12,3 +12,6 @@ export enum DiscordHTTPResponseCodes {
TooManyRequests = 429,
GatewayUnavailable = 502,
}
export type HTTPPResponseCodes = DiscordHTTPResponseCodes;
export const HTTPPResponseCodes = DiscordHTTPResponseCodes;
+3
View File
@@ -81,3 +81,6 @@ export enum DiscordJsonErrorCodes {
ReqctionWasBlocked = 90001,
ApiResourceIsCurrentlyOverloadedTryAgainALittleLater = 130000,
}
export type JsonErrrorCodes = DiscordJsonErrorCodes;
export const JsonErrrorCodes = DiscordJsonErrorCodes;
+3
View File
@@ -7,3 +7,6 @@ export enum DiscordRpcCloseEventCodes {
InvalidVersion,
InvalidEncoding,
}
export type RpcCloseEventCodes = DiscordRpcCloseEventCodes;
export const RpcCloseEventCodes = DiscordRpcCloseEventCodes;
+3
View File
@@ -17,3 +17,6 @@ export enum DiscordRpcErrorCodes {
SelectVoiceForceRequired,
CaptureShortcutAlreadyListening,
}
export type RpcErrorCodes = DiscordRpcErrorCodes;
export const RpcErrorCodes = DiscordRpcErrorCodes;
@@ -13,3 +13,6 @@ export enum DiscordVoiceCloseEventCodes {
VoiceServerCrashed,
UnknownEncryptionMode,
}
export type VoiceCloseEventCodes = DiscordVoiceCloseEventCodes;
export const VoiceCloseEventCodes = DiscordVoiceCloseEventCodes;
+3
View File
@@ -12,3 +12,6 @@ export enum DiscordVoiceOpcodes {
Resumed,
ClientDisconnect = 13,
}
export type VoiceOpcodes = DiscordVoiceOpcodes;
export const VoiceOpcodes = DiscordVoiceOpcodes;
@@ -1,12 +1,6 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
export interface AddGuildDiscoverySubcategory {
/** The guild Id of the subcategory was added to */
guildId: string;
/** The Id of the subcategory added */
categoryId: number;
}
export type DiscordAddGuildDiscoverySubcategory = SnakeCasedPropertiesDeep<
AddGuildDiscoverySubcategory
>;
+1 -6
View File
@@ -1,6 +1,6 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { DiscoveryName } from "./discovery_name.ts";
//TODO: add docs link
export interface DiscoveryCategory {
/** Numeric id of the category */
id: number;
@@ -9,8 +9,3 @@ export interface DiscoveryCategory {
/** Whether this category can be set as a guild's primary category */
isPrimary: boolean;
}
//TODO: add docs link
export type DiscordDiscoveryCategory = SnakeCasedPropertiesDeep<
DiscoveryCategory
>;
+1 -7
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
// TODO: add docs link
export interface DiscoveryMetadata {
/** The guild Id */
guildId: string;
@@ -16,8 +15,3 @@ export interface DiscoveryMetadata {
/** Ids of up to 5 discovery subcategories set for this guild */
categoryIds: number[];
}
// TODO: add docs link
export type DiscordDiscoveryMetadata = SnakeCasedPropertiesDeep<
DiscoveryMetadata
>;
+1 -2
View File
@@ -1,8 +1,7 @@
//TODO: add docs link
export interface DiscoveryName {
/** The name in English */
default: string;
/** The name in other languages */
localizations?: Record<string, string>;
}
export type DiscordDiscoveryName = DiscoveryName;
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
// TODO: add docs link
export interface ModifyGuildDiscoveryMetadata {
/** The id of the primary discovery category. Default: 0 */
primaryCategoryId?: number | null;
@@ -8,7 +7,3 @@ export interface ModifyGuildDiscoveryMetadata {
/** Whether guild info is shown when custom emojis are clicked. Default: true */
emojiDiscoverabilityEnabled?: boolean | null;
}
export type DiscordModifyGuildDiscoveryMetadata = SnakeCasedPropertiesDeep<
ModifyGuildDiscoveryMetadata
>;
@@ -1,6 +1,5 @@
// TODO: add docs link
export interface ValidateDiscoverySearchTerm {
/** Whether the provided term is valid */
valid: boolean;
}
export type DiscordValidateDiscoverySearchTerm = ValidateDiscoverySearchTerm;
@@ -1,8 +1,5 @@
// TODO: add docs link
export interface ValidateDiscoverySearchTermParams {
/** The search term to check */
term: string;
}
// TODO: add docs link
export type DiscordValidateDiscoverySearchTermParams =
ValidateDiscoverySearchTermParams;
+1 -3
View File
@@ -7,6 +7,7 @@ import { EmbedThumbnail } from "./embed_thumbnail.ts";
import { DiscordEmbedTypes } from "./embed_types.ts";
import { EmbedVideo } from "./embed_video.ts";
/** https://discord.com/developers/docs/resources/channel#embed-object */
export interface Embed {
/** Title of embed */
title?: string;
@@ -35,6 +36,3 @@ export interface Embed {
/** Fields information */
fields?: EmbedField[];
}
/** https://discord.com/developers/docs/resources/channel#embed-object */
export type DiscordEmbed = Embed;
+1 -5
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure */
export interface EmbedAuthor {
/** Name of author */
name?: string;
@@ -10,6 +9,3 @@ export interface EmbedAuthor {
/** A proxied url of author icon */
proxyIconUrl?: string;
}
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure */
export type DiscordEmbedAuthor = SnakeCasedPropertiesDeep<EmbedAuthor>;
+1 -3
View File
@@ -1,3 +1,4 @@
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure */
export interface EmbedField {
/** Name of the field */
name: string;
@@ -6,6 +7,3 @@ export interface EmbedField {
/** Whether or not this field should display inline */
inline?: boolean;
}
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure */
export type DiscordEmbedField = EmbedField;
+1 -5
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure */
export interface EmbedFooter {
/** Footer text */
text: string;
@@ -8,6 +7,3 @@ export interface EmbedFooter {
/** A proxied url of footer icon */
proxyIconUrl?: string;
}
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure */
export type DiscordEmbedFooter = SnakeCasedPropertiesDeep<EmbedFooter>;
+1 -5
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure */
export interface EmbedImage {
/** Source url of image (only supports http(s) and attachments) */
url?: string;
@@ -10,6 +9,3 @@ export interface EmbedImage {
/** Width of image */
width?: number;
}
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure */
export type DiscordEmbedImage = SnakeCasedPropertiesDeep<EmbedImage>;
+1 -3
View File
@@ -1,9 +1,7 @@
export type DiscordEmbedProvider = EmbedProvider;
export interface EmbedProvider {
/** Name of provider */
name?: string;
/** Url of provider */
url?: string;
}
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure */
export type DiscordEmbedProvider = EmbedProvider;
+1 -5
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure */
export interface EmbedThumbnail {
/** Source url of thumbnail (only supports http(s) and attachments) */
url?: string;
@@ -10,6 +9,3 @@ export interface EmbedThumbnail {
/** Width of thumbnail */
width?: number;
}
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure */
export type DiscordEmbedThumbnail = SnakeCasedPropertiesDeep<EmbedThumbnail>;
+1 -5
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure */
export interface EmbedVideo {
/** Source url of video */
url?: string;
@@ -10,6 +9,3 @@ export interface EmbedVideo {
/** Width of video */
width?: number;
}
/** https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure */
export type DiscordEmbedVideo = SnakeCasedPropertiesDeep<EmbedVideo>;
+1 -3
View File
@@ -1,3 +1,4 @@
/** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
export interface CreateGuildEmoji {
/** Name of the emoji */
name: string;
@@ -6,6 +7,3 @@ export interface CreateGuildEmoji {
/** Roles allowed to use this emoji */
roles: string[];
}
/** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
export type DiscordCreateGuildEmojis = CreateGuildEmoji;
+1 -4
View File
@@ -1,6 +1,6 @@
import { User } from "../users/user.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure */
export interface Emoji {
/** Emoji id */
id: string | null;
@@ -19,6 +19,3 @@ export interface Emoji {
/** Whether this emoji can be used, may be false due to loss of Server Boosts */
available?: boolean;
}
/** https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure */
export type DiscordEmoji = SnakeCasedPropertiesDeep<Emoji>;
+1 -6
View File
@@ -1,14 +1,9 @@
import { Emoji } from "../emojis/emoji.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#guild-emojis-update */
export interface GuildEmojisUpdate {
/** id of the guild */
guildId: string;
/** Array of emojis */
emojis: Emoji[];
}
/** https://discord.com/developers/docs/topics/gateway#guild-emojis-update */
export type DiscordGuildEmojisUpdate = SnakeCasedPropertiesDeep<
GuildEmojisUpdate
>;
+1 -3
View File
@@ -1,9 +1,7 @@
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
export interface ModifyGuildEmoji {
/** Name of the emoji */
name?: string;
/** Roles allowed to use this emoji */
roles?: string[] | null;
}
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
export type DiscordModifyGuildEmoji = ModifyGuildEmoji;
+3
View File
@@ -88,3 +88,6 @@ export enum DiscordGatewayIntents {
*/
DIRECT_MESSAGE_TYPING = 1 << 14,
}
export type Intents = DiscordGatewayIntents;
export const Intents = DiscordGatewayIntents;
+1 -3
View File
@@ -1,3 +1,4 @@
/** https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params */
export interface GatewayURLParams {
/** Gateway version to use */
v: string;
@@ -6,6 +7,3 @@ export interface GatewayURLParams {
/** The (optional) compression of gateway packets */
compress?: string;
}
/** https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params */
export type DiscordGatewayURLParams = GatewayURLParams;
+1 -4
View File
@@ -1,6 +1,6 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { SessionStartLimit } from "./session_start_limit.ts";
/** https://discord.com/developers/docs/topics/gateway#get-gateway-bot */
export interface GetGatewayBot {
/** The WSS URL that can be used for connecting to the gateway */
url: string;
@@ -9,6 +9,3 @@ export interface GetGatewayBot {
/** Information on the current session start limit */
sessionStartLimit: SessionStartLimit;
}
/** https://discord.com/developers/docs/topics/gateway#get-gateway-bot */
export type DiscordGetGatewayBot = SnakeCasedPropertiesDeep<GetGatewayBot>;
+1 -4
View File
@@ -1,7 +1,7 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { IdentifyConnectionProperties } from "./identify_connection_properties.ts";
import { StatusUpdate } from "./status_update.ts";
/** https://discord.com/developers/docs/topics/gateway#identify */
export interface Identify {
/** Authentication token */
token: string;
@@ -18,6 +18,3 @@ export interface Identify {
/** The Gateway Intents you wish to receive */
intents: number;
}
/** https://discord.com/developers/docs/topics/gateway#identify */
export type DiscordIdentify = SnakeCasedPropertiesDeep<Identify>;
+1 -1
View File
@@ -3,6 +3,7 @@ import { Application } from "../oauth2/application.ts";
import { User } from "../users/user.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#ready */
export interface Ready {
/** Gateway version */
v: number;
@@ -20,5 +21,4 @@ export interface Ready {
application: Partial<Application> & Pick<Application, "id" | "flags">;
}
/** https://discord.com/developers/docs/topics/gateway#ready */
export type DiscordReady = SnakeCasedPropertiesDeep<Ready>;
+1 -3
View File
@@ -1,3 +1,4 @@
/** https://discord.com/developers/docs/topics/gateway#resume */
export interface Resume {
/** Session token */
token: string;
@@ -6,6 +7,3 @@ export interface Resume {
/** Last sequence number received */
seq: number;
}
/** https://discord.com/developers/docs/topics/gateway#resume */
export type DiscordResume = Resume;
+1 -7
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#session-start-limit-object */
export interface SessionStartLimit {
/** The total number of session starts the current user is allowed */
total: number;
@@ -10,8 +9,3 @@ export interface SessionStartLimit {
/** The number of identify requests allowed per 5 seconds */
maxConcurrency: number;
}
/** https://discord.com/developers/docs/topics/gateway#session-start-limit-object */
export type DiscordSessionStartLimit = SnakeCasedPropertiesDeep<
SessionStartLimit
>;
+1 -4
View File
@@ -1,7 +1,7 @@
import { Activity } from "../misc/activity.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { DiscordStatusTypes } from "./status_types.ts";
/** https://discord.com/developers/docs/topics/gateway#update-status */
export interface StatusUpdate {
/** Unix time (in milliseconds) of when the client went idle, or null if the client is not idle */
since: number | null;
@@ -12,6 +12,3 @@ export interface StatusUpdate {
/** Whether or not the client is afk */
afk: boolean;
}
/** https://discord.com/developers/docs/topics/gateway#update-status */
export type DiscordStatusUpdate = SnakeCasedPropertiesDeep<StatusUpdate>;
+1 -4
View File
@@ -1,12 +1,9 @@
import { User } from "../users/user.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#ban-object */
export interface Ban {
/** The reason for the ban */
reason: string | null;
/** The banned user */
user: User;
}
/** https://discord.com/developers/docs/resources/guild#ban-object */
export type DiscordBan = SnakeCasedPropertiesDeep<Ban>;
+1 -5
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
export interface BeginGuildPrune {
/** Number of days to prune (1 or more), default: 7 */
days?: number;
@@ -8,6 +7,3 @@ export interface BeginGuildPrune {
/** Role(s) ro include, default: none */
includeRoles?: string[];
}
/** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
export type DiscordBeginGuildPrune = SnakeCasedPropertiesDeep<BeginGuildPrune>;
+1 -4
View File
@@ -1,11 +1,11 @@
import { Channel } from "../channels/channel.ts";
import { Role } from "../permissions/role.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { DiscordDefaultMessageNotificationLevels } from "./default_message_notification_levels.ts";
import { DiscordExplicitContentFilterLevels } from "./explicit_content_filter_levels.ts";
import { DiscordSystemChannelFlags } from "./system_channel_flags.ts";
import { DiscordVerificationLevels } from "./verification_levels.ts";
/** https://discord.com/developers/docs/resources/guild#create-guild */
export interface CreateGuild {
/** Name of the guild (2-100 characters) */
name: string;
@@ -32,6 +32,3 @@ export interface CreateGuild {
/** System channel flags */
systemChannelFlags?: DiscordSystemChannelFlags;
}
/** https://discord.com/developers/docs/resources/guild#create-guild */
export type DiscordCreateGuild = SnakeCasedPropertiesDeep<CreateGuild>;
+1 -5
View File
@@ -1,11 +1,7 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#create-guild-ban */
export interface CreateGuildBan {
/** Number of days to delete messages for (0-7) */
deleteMessageDays?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
/** Reason for the ban */
reason?: string;
}
/** https://discord.com/developers/docs/resources/guild#create-guild-ban */
export type DiscordCreateGuildBan = SnakeCasedPropertiesDeep<CreateGuildBan>;
+1
View File
@@ -32,3 +32,4 @@ export interface DiscordCreateGuildChannel extends
> {
permission_overwrites: DiscordOverwrite[];
}
// TODO: check this
+1
View File
@@ -18,3 +18,4 @@ export interface DiscordCreateGuildRole
extends Omit<CreateGuildRole, "permissions"> {
permissions?: string;
}
// TODO: check this
@@ -5,3 +5,8 @@ export enum DiscordDefaultMessageNotificationLevels {
/** Members will receive notifications only for messages that @mention them by default */
ONLY_MENTIONS,
}
export type DefaultMessageNotificationLevels =
DiscordDefaultMessageNotificationLevels;
export const DefaultMessageNotificationLevels =
DiscordDefaultMessageNotificationLevels;
@@ -7,3 +7,6 @@ export enum DiscordExplicitContentFilterLevels {
/** Media content sent by all members will be scanned */
ALL_MEMBERS,
}
export type ExplicitContentFilterLevels = DiscordExplicitContentFilterLevels;
export const ExplicitContentFilterLevels = DiscordExplicitContentFilterLevels;
+1 -5
View File
@@ -1,9 +1,5 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#get-guild */
export interface GetGuildQuery {
/** When true, will return approximate member and presence counts for the guild */
withCounts?: boolean;
}
/** https://discord.com/developers/docs/resources/guild#get-guild */
export type DiscordGetGuildQuery = SnakeCasedPropertiesDeep<GetGuildQuery>;
+1 -7
View File
@@ -1,13 +1,7 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
export interface GetGuildPruneCountQuery {
/** Number of days to count prune for (1 or more), default: 7 */
days?: number;
/** Role(s) to include, default: none */
includeRoles: string | string[];
}
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
export type DiscordGetGuildPruneCountQuery = SnakeCasedPropertiesDeep<
GetGuildPruneCountQuery
>;
+1 -3
View File
@@ -1,9 +1,7 @@
import { DiscordGetGuildWidgetImageStyleOptions } from "./get_guild_widget_image_style_options.ts";
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image-query-string-params */
export interface GetGuildWidgetImageQuery {
/** Style of the widget returned, default: shield */
style?: DiscordGetGuildWidgetImageStyleOptions;
}
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image-query-string-params */
export type DiscordGetGuildWidgetImage = GetGuildWidgetImageQuery;
@@ -11,3 +11,8 @@ export enum DiscordGetGuildWidgetImageStyleOptions {
/** Large Discord logo at the top of the widget. Guild icon, name and online count in the middle portion of the widget and a "JOIN MY SERVER" button at the bottom */
BANNER_4 = "banner4",
}
export type GetGuildWidgetImageStyleOptions =
DiscordGetGuildWidgetImageStyleOptions;
export const GetGuildWidgetImageStyleOptions =
DiscordGetGuildWidgetImageStyleOptions;
+1 -4
View File
@@ -2,7 +2,6 @@ import { Channel } from "../channels/channel.ts";
import { Emoji } from "../emojis/emoji.ts";
import { PresenceUpdate } from "../misc/presence_update.ts";
import { Role } from "../permissions/role.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { VoiceState } from "../voice/voice_state.ts";
import { DiscordDefaultMessageNotificationLevels } from "./default_message_notification_levels.ts";
import { DiscordExplicitContentFilterLevels } from "./explicit_content_filter_levels.ts";
@@ -14,6 +13,7 @@ import { DiscordSystemChannelFlags } from "./system_channel_flags.ts";
import { DiscordVerificationLevels } from "./verification_levels.ts";
import { WelcomeScreen } from "./welcome_screen.ts";
/** https://discord.com/developers/docs/resources/guild#guild-object */
export interface Guild {
/** Guild id */
id: string;
@@ -108,6 +108,3 @@ export interface Guild {
/** The welcome screen of a Community guild, shown to new members, returned when in the invite object */
welcomeScreen?: WelcomeScreen;
}
/** https://discord.com/developers/docs/resources/guild#guild-object */
export type DiscordGuild = SnakeCasedPropertiesDeep<Guild>;
+1 -6
View File
@@ -1,14 +1,9 @@
import { User } from "../users/user.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#guild-ban-add */
export interface GuildBanAddRemove {
/** id of the guild */
guildId: string;
/** The banned user */
user: User;
}
/** https://discord.com/developers/docs/topics/gateway#guild-ban-add */
export type DiscordGuildBanAddRemove = SnakeCasedPropertiesDeep<
GuildBanAddRemove
>;
+1 -4
View File
@@ -1,12 +1,9 @@
import { User } from "../users/user.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#guild-ban-remove */
export interface GuildBanRemove {
/** id of the guild */
guildId: string;
/** The unbanned user */
user: User;
}
/** https://discord.com/developers/docs/topics/gateway#guild-ban-remove */
export type DiscordGuildBanRemove = SnakeCasedPropertiesDeep<GuildBanRemove>;
+5 -1
View File
@@ -17,7 +17,8 @@ export enum DiscordGuildFeatures {
/** Guild has access to create news channels */
NEWS = "NEWS",
/** Guild is able to be discovered in the directory */
DISCOVERABLE = "DISCOVERABLE", /** guild cannot be discoverable */
DISCOVERABLE = "DISCOVERABLE",
/** guild cannot be discoverable */
DISCOVERABLE_DISABLED = "DISCOVERABLE_DISABLED",
/** Guild is able to be featured in the directory */
FEATURABLE = "FEATURABLE",
@@ -32,3 +33,6 @@ export enum DiscordGuildFeatures {
/** Guild can be previewed before joining via Membership Screening or the directory */
PREVIEW_ENABLED = "PREVIEW_ENABLED",
}
export type GuildFeatures = DiscordGuildFeatures;
export const GuildFeatures = DiscordGuildFeatures;
+2 -8
View File
@@ -1,6 +1,6 @@
import { User } from "../users/user.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#guild-member-object */
export interface GuildMember {
/** The user this guild member represents */
user?: User;
@@ -20,13 +20,7 @@ export interface GuildMember {
pending?: boolean;
}
/** https://discord.com/developers/docs/resources/guild#guild-member-object */
export type DiscordGuildMember = SnakeCasedPropertiesDeep<GuildMember>;
// We use these types much since user always exists unless its a `CREATE_MESSAGE` or `MESSAGE_UPDATE` event
export type GuildMemberWithUser = Omit<GuildMember, "user"> & { user: User };
/** https://discord.com/developers/docs/resources/guild#guild-member-object */
export type DiscordGuildMemberWithUser = SnakeCasedPropertiesDeep<
GuildMemberWithUser
>;
export type GuildMemberWithUser = Omit<GuildMember, "user"> & { user: User };
+1 -4
View File
@@ -1,7 +1,7 @@
import { Emoji } from "../emojis/emoji.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { DiscordGuildFeatures } from "./guild_features.ts";
/** https://discord.com/developers/docs/resources/guild#guild-preview-object */
export interface GuildPreview {
/** Guild id */
id: string;
@@ -24,6 +24,3 @@ export interface GuildPreview {
/** The description for the guild, if the guild is discoverable */
description: string | null;
}
/** https://discord.com/developers/docs/resources/guild#guild-preview-object */
export type DiscordGuildPreview = SnakeCasedPropertiesDeep<GuildPreview>;
+1 -4
View File
@@ -1,12 +1,9 @@
import { Role } from "../permissions/role.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#guild-role-create */
export interface GuildRoleCreate {
/** The id of the guild */
guildId: string;
/** The role created */
role: Role;
}
/** https://discord.com/developers/docs/topics/gateway#guild-role-create */
export type DiscordGuildRoleCreate = SnakeCasedPropertiesDeep<GuildRoleCreate>;
+1 -5
View File
@@ -1,11 +1,7 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#guild-role-delete */
export interface GuildRoleDelete {
/** id of the guild */
guildId: string;
/** id of the role */
roleId: string;
}
/** https://discord.com/developers/docs/topics/gateway#guild-role-delete */
export type DiscordGuildRoleDelete = SnakeCasedPropertiesDeep<GuildRoleDelete>;
+1 -4
View File
@@ -1,12 +1,9 @@
import { Role } from "../permissions/role.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#guild-role-update */
export interface GuildRoleUpdate {
/** The id of the guild */
guildId: string;
/** The role updated */
role: Role;
}
/** https://discord.com/developers/docs/topics/gateway#guild-role-update */
export type DiscordGuildRoleUpdate = SnakeCasedPropertiesDeep<GuildRoleUpdate>;
+1 -5
View File
@@ -1,11 +1,7 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#guild-widget-object-guild-widget-structure */
export interface GuildWidget {
/** Whether the widget is enabled */
enabled: boolean;
/** The widget channel id */
channelId: string | null;
}
/** https://discord.com/developers/docs/resources/guild#guild-widget-object-guild-widget-structure */
export type DiscordGuildWidget = SnakeCasedPropertiesDeep<GuildWidget>;
+1 -3
View File
@@ -1,9 +1,7 @@
/** https://discord.com/developers/docs/resources/guild#list-guild-members */
export interface ListGuildMembers {
/** Max number of members to return (1-1000). Default: 1 */
limit?: number;
/** The highest user id in the previous page. Default: 0 */
after?: string;
}
/** https://discord.com/developers/docs/resources/guild#list-guild-members */
export type DiscordListGuildMembers = ListGuildMembers;
+3
View File
@@ -5,3 +5,6 @@ export enum DiscordMfaLevels {
/** Guild has a 2FA requirement for moderation actions */
ELEVATED,
}
export type MfaLevels = DiscordMfaLevels;
export const MfaLevels = DiscordMfaLevels;
+1 -3
View File
@@ -1,7 +1,5 @@
/** https://discord.com/developers/docs/resources/guild#modify-current-user-nick */
export interface ModifyCurrentUserNick {
/** Value to set users nickname to. Requires the CHANGENICKNAME permission */
nick?: string | null;
}
/** https://discord.com/developers/docs/resources/guild#modify-current-user-nick */
export type DiscordModifyCurrentUserNick = ModifyCurrentUserNick;
+1 -4
View File
@@ -1,10 +1,10 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { DiscordDefaultMessageNotificationLevels } from "./default_message_notification_levels.ts";
import { DiscordExplicitContentFilterLevels } from "./explicit_content_filter_levels.ts";
import { DiscordGuildFeatures } from "./guild_features.ts";
import { DiscordSystemChannelFlags } from "./system_channel_flags.ts";
import { DiscordVerificationLevels } from "./verification_levels.ts";
/** https://discord.com/developers/docs/resources/guild#modify-guild */
export interface ModifyGuild {
/** Guild name */
name?: string;
@@ -43,6 +43,3 @@ export interface ModifyGuild {
/** Enabled guild features */
features?: DiscordGuildFeatures[];
}
/** https://discord.com/developers/docs/resources/guild#modify-guild */
export type DiscordModifyGuild = SnakeCasedPropertiesDeep<ModifyGuild>;
@@ -1,4 +1,5 @@
// TODO: most likely it is but check if lockPositions and parentId really are optional
/** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */
export interface ModifyGuildChannelPositions {
/** Channel id */
id: string;
@@ -9,6 +10,3 @@ export interface ModifyGuildChannelPositions {
/** The new parent ID for the channel that is moved */
parentId?: string | null;
}
/** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */
export type DiscordModifyGuildChannelPositions = ModifyGuildChannelPositions;
+1 -7
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#modify-guild-member */
export interface ModifyGuildMember {
/** Value to set users nickname to. Requires the `MANAGE_NICKNAMES` permission */
nick?: string | null;
@@ -12,8 +11,3 @@ export interface ModifyGuildMember {
/** Id of channel to move user to (if they are connected to voice). Requires the `MOVE_MEMBERS` permission */
channelId: string | null;
}
/** https://discord.com/developers/docs/resources/guild#modify-guild-member */
export type DiscordModifyGuildMember = SnakeCasedPropertiesDeep<
ModifyGuildMember
>;
+2
View File
@@ -18,3 +18,5 @@ export interface DiscordModifyGuildRole
extends Omit<ModifyGuildRole, "permissions"> {
permissions?: string | null;
}
// TODO: check this
@@ -1,9 +1,7 @@
/** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions */
export interface ModifyGuildRolePositions {
/** Role id */
id: string;
/** Sorting position of the role */
position?: number | null;
}
/** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions */
export type DiscordModifyGuildRolePositions = ModifyGuildRolePositions;
@@ -1,6 +1,6 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { WelcomeScreenChannel } from "./welcome_screen_channel.ts";
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
export interface ModifyGuildWelcomeScreen {
/** Whether the welcome screen is enabled */
enabled?: boolean | null;
@@ -9,8 +9,3 @@ export interface ModifyGuildWelcomeScreen {
/** The server description to show in the welcome screen */
description?: string | null;
}
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
export type DiscordModifyGuildWelcomeScreen = SnakeCasedPropertiesDeep<
ModifyGuildWelcomeScreen
>;
+3
View File
@@ -9,3 +9,6 @@ export enum DiscordPremiumTiers {
/** Guild has unlocked Server Boost level 3 perks */
TIER_3,
}
export type PremiumTiers = DiscordPremiumTiers;
export const PremiumTiers = DiscordPremiumTiers;
+1 -7
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#request-guild-members */
export interface RequestGuildMembers {
/** id of the guild to get members for */
guildId: string;
@@ -14,8 +13,3 @@ export interface RequestGuildMembers {
/** Nonce to identify the Guild Members Chunk response */
nonce?: string;
}
/** https://discord.com/developers/docs/topics/gateway#request-guild-members */
export type DiscordRequestGuildMembers = SnakeCasedPropertiesDeep<
RequestGuildMembers
>;
+3
View File
@@ -7,3 +7,6 @@ export enum DiscordSystemChannelFlags {
/** Suppress server setup tips */
SUPPRESS_GUILD_REMINDER_NOTIFICATIONS = 1 << 2,
}
export type SystemChannelFlags = DiscordSystemChannelFlags;
export const SystemChannelFlags = DiscordSystemChannelFlags;
+1 -6
View File
@@ -1,9 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { Guild } from "./guild.ts";
export type UnavailableGuild = Pick<Guild, "id" | "unavailable">;
/** https://discord.com/developers/docs/resources/guild#unavailable-guild-object */
export type DiscordUnavailableGuild = SnakeCasedPropertiesDeep<
UnavailableGuild
>;
export type UnavailableGuild = Pick<Guild, "id" | "unavailable">;
@@ -1,13 +1,7 @@
import { SnakeCasedProperties } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#update-user-voice-state */
export interface UpdateOthersVoiceState {
/** The id of the channel the user is currently in */
channelId: string;
/** Toggles the user's suppress state */
suppress?: boolean;
}
/** https://discord.com/developers/docs/resources/guild#update-user-voice-state */
export type DiscordUpdateOthersVoiceState = SnakeCasedProperties<
UpdateOthersVoiceState
>;
+1 -7
View File
@@ -1,5 +1,4 @@
import { SnakeCasedProperties } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#update-current-user-voice-state */
export interface UpdateSelfVoiceState {
/** The id of the channel the user is currently in */
channelId: string;
@@ -8,8 +7,3 @@ export interface UpdateSelfVoiceState {
/** Sets the user's request to speak */
requestToSpeakTimestamp?: string | null;
}
/** https://discord.com/developers/docs/resources/guild#update-current-user-voice-state */
export type DiscordUpdateSelfVoiceState = SnakeCasedProperties<
UpdateSelfVoiceState
>;
+3
View File
@@ -11,3 +11,6 @@ export enum DiscordVerificationLevels {
/** Must have a verified phone number */
VERY_HIGH,
}
export type VerificationLevels = DiscordVerificationLevels;
export const VerificationLevels = DiscordVerificationLevels;
+1 -4
View File
@@ -1,12 +1,9 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { WelcomeScreenChannel } from "./welcome_screen_channel.ts";
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-structure */
export interface WelcomeScreen {
/** The server description shown in the welcome screen */
description: string | null;
/** The channels shown in the welcome screen, up to 5 */
welcomeChannels: WelcomeScreenChannel[];
}
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-structure */
export type DiscordWelcomeScreen = SnakeCasedPropertiesDeep<WelcomeScreen>;
+1 -7
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-channel-structure */
export interface WelcomeScreenChannel {
/** The channel's id */
channelId: string;
@@ -10,8 +9,3 @@ export interface WelcomeScreenChannel {
/** The emoji name if custom, the unicode character if standard, or `null` if no emoji is set */
emojiName: string | null;
}
/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-channel-structure */
export type DiscordWelcomeScreenChannel = SnakeCasedPropertiesDeep<
WelcomeScreenChannel
>;
@@ -1,11 +1,5 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/topics/gateway#guild-integrations-update */
export interface GuildIntegrationsUpdate {
/** id of the guild whose integrations were updated */
guildId: string;
}
/** https://discord.com/developers/docs/topics/gateway#guild-integrations-update */
export type DiscordGuildIntegrationsUpdate = SnakeCasedPropertiesDeep<
GuildIntegrationsUpdate
>;
+1 -4
View File
@@ -1,9 +1,9 @@
import { User } from "../users/user.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { IntegrationAccount } from "./integration_account.ts";
import { IntegrationApplication } from "./integration_application.ts";
import { DiscordIntegrationExpireBehaviors } from "./integration_expire_behaviors.ts";
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */
export interface Integration {
/** Integration Id */
id: string;
@@ -36,6 +36,3 @@ export interface Integration {
/** The bot/OAuth2 application for discord integrations */
application?: IntegrationApplication;
}
/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */
export type DiscordIntegration = SnakeCasedPropertiesDeep<Integration>;
+1 -3
View File
@@ -1,9 +1,7 @@
/** https://discord.com/developers/docs/resources/guild#integration-account-object-integration-account-structure */
export interface IntegrationAccount {
/** Id of the account */
id: string;
/** Name of the account */
name: string;
}
/** https://discord.com/developers/docs/resources/guild#integration-account-object-integration-account-structure */
export type DiscordIntegrationAccount = IntegrationAccount;
@@ -1,6 +1,6 @@
import { User } from "../users/user.ts";
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://discord.com/developers/docs/resources/guild#integration-application-object-integration-application-structure */
export interface IntegrationApplication {
/** The id of the app */
id: string;
@@ -15,8 +15,3 @@ export interface IntegrationApplication {
/** The bot associated with this application */
bot?: User;
}
/** https://discord.com/developers/docs/resources/guild#integration-application-object-integration-application-structure */
export type DiscordIntegrationApplication = SnakeCasedPropertiesDeep<
IntegrationApplication
>;
@@ -1,12 +1,7 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
import { Integration } from "./integration.ts";
/** https://github.com/discord/discord-api-docs/blob/master/docs/topics/Gateway.md#integration-create-event-additional-fields */
export interface IntegrationCreateUpdate extends Integration {
/** Id of the guild */
guildId: string;
}
/** https://github.com/discord/discord-api-docs/blob/master/docs/topics/Gateway.md#integration-create-event-additional-fields */
export type DiscordIntegrationCreateUpdate = SnakeCasedPropertiesDeep<
IntegrationCreateUpdate
>;
+1 -7
View File
@@ -1,5 +1,4 @@
import { SnakeCasedPropertiesDeep } from "../util.ts";
/** https://github.com/discord/discord-api-docs/blob/master/docs/topics/Gateway.md#integration-delete-event-fields */
export interface IntegrationDelete {
/** Integration id */
id: string;
@@ -8,8 +7,3 @@ export interface IntegrationDelete {
/** Id of the bot/OAuth2 application for this discord integration */
applicationId?: string;
}
/** https://github.com/discord/discord-api-docs/blob/master/docs/topics/Gateway.md#integration-delete-event-fields */
export type DiscordIntegrationDelete = SnakeCasedPropertiesDeep<
IntegrationDelete
>;

Some files were not shown because too many files have changed in this diff Show More