Skip to content

Commit

Permalink
refactor: change const enums to regular enums (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
suneettipirneni committed Jan 26, 2022
1 parent 663c4e9 commit 70bab5d
Show file tree
Hide file tree
Showing 41 changed files with 109 additions and 116 deletions.
8 changes: 4 additions & 4 deletions gateway/v8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const GatewayVersion = '8';
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
*/
export const enum GatewayOpcodes {
export enum GatewayOpcodes {
/**
* An event was dispatched
*/
Expand Down Expand Up @@ -85,7 +85,7 @@ export const enum GatewayOpcodes {
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
*/
export const enum GatewayCloseCodes {
export enum GatewayCloseCodes {
/**
* We're not sure what went wrong. Try reconnecting?
*/
Expand Down Expand Up @@ -168,7 +168,7 @@ export const enum GatewayCloseCodes {
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
*/
export const enum GatewayIntentBits {
export enum GatewayIntentBits {
Guilds = 1 << 0,
GuildMembers = 1 << 1,
GuildBans = 1 << 2,
Expand All @@ -190,7 +190,7 @@ export const enum GatewayIntentBits {
/**
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
*/
export const enum GatewayDispatchEvents {
export enum GatewayDispatchEvents {
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
Expand Down
8 changes: 4 additions & 4 deletions gateway/v9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const GatewayVersion = '9';
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
*/
export const enum GatewayOpcodes {
export enum GatewayOpcodes {
/**
* An event was dispatched
*/
Expand Down Expand Up @@ -88,7 +88,7 @@ export const enum GatewayOpcodes {
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
*/
export const enum GatewayCloseCodes {
export enum GatewayCloseCodes {
/**
* We're not sure what went wrong. Try reconnecting?
*/
Expand Down Expand Up @@ -171,7 +171,7 @@ export const enum GatewayCloseCodes {
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
*/
export const enum GatewayIntentBits {
export enum GatewayIntentBits {
Guilds = 1 << 0,
GuildMembers = 1 << 1,
GuildBans = 1 << 2,
Expand All @@ -193,7 +193,7 @@ export const enum GatewayIntentBits {
/**
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
*/
export const enum GatewayDispatchEvents {
export enum GatewayDispatchEvents {
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
*/
export const enum ApplicationCommandOptionType {
export enum ApplicationCommandOptionType {
Subcommand = 1,
SubcommandGroup,
String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface APIApplicationCommandPermission {
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type
*/
export const enum ApplicationCommandPermissionType {
export enum ApplicationCommandPermissionType {
Role = 1,
User,
}
2 changes: 1 addition & 1 deletion payloads/v8/_interactions/applicationCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface APIApplicationCommand {
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types
*/
export const enum ApplicationCommandType {
export enum ApplicationCommandType {
ChatInput = 1,
User,
Message,
Expand Down
4 changes: 2 additions & 2 deletions payloads/v8/_interactions/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { APIApplicationCommandOptionChoice } from './applicationCommands';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
*/
export const enum InteractionType {
export enum InteractionType {
Ping = 1,
ApplicationCommand,
MessageComponent,
Expand Down Expand Up @@ -54,7 +54,7 @@ export interface APIInteractionResponseUpdateMessage {
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
*/
export const enum InteractionResponseType {
export enum InteractionResponseType {
/**
* ACK a `Ping`
*/
Expand Down
2 changes: 1 addition & 1 deletion payloads/v8/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export interface APIApplication {
/**
* https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
export const enum ApplicationFlags {
export enum ApplicationFlags {
EmbeddedReleased = 1 << 1,
ManagedEmoji = 1 << 2,
GroupDMCreate = 1 << 4,
Expand Down
4 changes: 2 additions & 2 deletions payloads/v8/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export interface APIAuditLogEntry {
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
*/
export const enum AuditLogEvent {
export enum AuditLogEvent {
GuildUpdate = 1,

ChannelCreate = 10,
Expand Down Expand Up @@ -249,7 +249,7 @@ export interface APIAuditLogOptions {
role_name?: string;
}

export const enum AuditLogOptionsType {
export enum AuditLogOptionsType {
Role = '0',
Member = '1',
}
Expand Down
20 changes: 10 additions & 10 deletions payloads/v8/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export type APIChannel =
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*/
export const enum ChannelType {
export enum ChannelType {
/**
* A text channel within a guild
*/
Expand Down Expand Up @@ -223,7 +223,7 @@ export const enum ChannelType {
GuildStageVoice = 13,
}

export const enum VideoQualityMode {
export enum VideoQualityMode {
/**
* Discord chooses the quality for optimal performance
*/
Expand Down Expand Up @@ -425,7 +425,7 @@ export interface APIMessage {
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-types
*/
export const enum MessageType {
export enum MessageType {
Default,
RecipientAdd,
RecipientRemove,
Expand Down Expand Up @@ -488,7 +488,7 @@ export interface APIMessageReference {
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
*/
export const enum MessageActivityType {
export enum MessageActivityType {
Join = 1,
Spectate,
Listen,
Expand All @@ -498,7 +498,7 @@ export const enum MessageActivityType {
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
export const enum MessageFlags {
export enum MessageFlags {
/**
* This message has been published to subscribed channels (via Channel Following)
*/
Expand Down Expand Up @@ -595,7 +595,7 @@ export interface APIOverwrite {
deny: Permissions;
}

export const enum OverwriteType {
export enum OverwriteType {
Role,
Member,
}
Expand Down Expand Up @@ -688,7 +688,7 @@ export interface APIEmbed {
* https://discord.com/developers/docs/resources/channel#embed-object-embed-types
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
*/
export const enum EmbedType {
export enum EmbedType {
/**
* Generic embed rendered from embed attributes
*/
Expand Down Expand Up @@ -932,7 +932,7 @@ export interface APIChannelMention {
/**
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
*/
export const enum AllowedMentionsTypes {
export enum AllowedMentionsTypes {
/**
* Controls @everyone and @here mentions
*/
Expand Down Expand Up @@ -986,7 +986,7 @@ export interface APIBaseMessageComponent<T extends ComponentType> {
/**
* https://discord.com/developers/docs/interactions/message-components#component-types
*/
export const enum ComponentType {
export enum ComponentType {
/**
* Action Row component
*/
Expand Down Expand Up @@ -1070,7 +1070,7 @@ export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonCompo
/**
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
*/
export const enum ButtonStyle {
export enum ButtonStyle {
Primary = 1,
Secondary,
Success,
Expand Down
6 changes: 3 additions & 3 deletions payloads/v8/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export interface GatewayPresenceUpdate {
client_status?: GatewayPresenceClientStatus;
}

export const enum PresenceUpdateStatus {
export enum PresenceUpdateStatus {
Online = 'online',
DoNotDisturb = 'dnd',
Idle = 'idle',
Expand Down Expand Up @@ -216,7 +216,7 @@ export enum ActivityPlatform {
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
*/
export const enum ActivityType {
export enum ActivityType {
/**
* Playing {game}
*/
Expand Down Expand Up @@ -291,7 +291,7 @@ export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
*/
export const enum ActivityFlags {
export enum ActivityFlags {
Instance = 1 << 0,
Join = 1 << 1,
Spectate = 1 << 2,
Expand Down
22 changes: 11 additions & 11 deletions payloads/v8/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,15 @@ export interface APIGuild extends APIPartialGuild {
/**
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
export const enum GuildDefaultMessageNotifications {
export enum GuildDefaultMessageNotifications {
AllMessages,
OnlyMentions,
}

/**
* https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
*/
export const enum GuildExplicitContentFilter {
export enum GuildExplicitContentFilter {
Disabled,
MembersWithoutRoles,
AllMembers,
Expand All @@ -360,15 +360,15 @@ export const enum GuildExplicitContentFilter {
/**
* https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
*/
export const enum GuildMFALevel {
export enum GuildMFALevel {
None,
Elevated,
}

/**
* https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level
*/
export const enum GuildNSFWLevel {
export enum GuildNSFWLevel {
Default,
Explicit,
Safe,
Expand All @@ -378,7 +378,7 @@ export const enum GuildNSFWLevel {
/**
* https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*/
export const enum GuildVerificationLevel {
export enum GuildVerificationLevel {
/**
* Unrestricted
*/
Expand All @@ -404,7 +404,7 @@ export const enum GuildVerificationLevel {
/**
* https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
*/
export const enum GuildPremiumTier {
export enum GuildPremiumTier {
None,
Tier1,
Tier2,
Expand All @@ -414,7 +414,7 @@ export const enum GuildPremiumTier {
/**
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
export const enum GuildSystemChannelFlags {
export enum GuildSystemChannelFlags {
/**
* Suppress member join notifications
*/
Expand All @@ -436,7 +436,7 @@ export const enum GuildSystemChannelFlags {
/**
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*/
export const enum GuildFeature {
export enum GuildFeature {
/**
* Guild has access to set an animated guild icon
*/
Expand Down Expand Up @@ -757,7 +757,7 @@ export type APIGuildInteractionType = 'twitch' | 'youtube' | 'discord';
/**
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
*/
export const enum IntegrationExpireBehavior {
export enum IntegrationExpireBehavior {
RemoveRole,
Kick,
}
Expand Down Expand Up @@ -861,7 +861,7 @@ export interface APIGuildWidgetMember {
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options
*/
export const enum GuildWidgetStyle {
export enum GuildWidgetStyle {
/**
* Shield style widget with Discord icon and guild members online count
*/
Expand Down Expand Up @@ -951,7 +951,7 @@ export interface APIGuildMembershipScreeningField {
required: boolean;
}

export const enum MembershipScreeningFieldType {
export enum MembershipScreeningFieldType {
/**
* Server Rules
*/
Expand Down
6 changes: 3 additions & 3 deletions payloads/v8/guildScheduledEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export interface APIGuildScheduledEventEntityMetadata {
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types
*/
export const enum GuildScheduledEventEntityType {
export enum GuildScheduledEventEntityType {
StageInstance = 1,
Voice,
External,
Expand All @@ -116,7 +116,7 @@ export const enum GuildScheduledEventEntityType {
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status
*/
export const enum GuildScheduledEventStatus {
export enum GuildScheduledEventStatus {
Scheduled = 1,
Active,
Completed,
Expand All @@ -126,7 +126,7 @@ export const enum GuildScheduledEventStatus {
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level
*/
export const enum GuildScheduledEventPrivacyLevel {
export enum GuildScheduledEventPrivacyLevel {
/**
* The scheduled event is only accessible to guild members
*/
Expand Down
2 changes: 1 addition & 1 deletion payloads/v8/invite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export interface APIInvite {
/**
* https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
*/
export const enum InviteTargetType {
export enum InviteTargetType {
Stream = 1,
EmbeddedApplication,
}
Expand Down

0 comments on commit 70bab5d

Please sign in to comment.