mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
@@ -12,5 +12,8 @@ export async function getWidget(guildId: string, options?: { force: boolean }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add return type
|
// TODO: add return type
|
||||||
return await rest.runMethod("get", `${endpoints.GUILD_WIDGET(guildId)}.json`);
|
return await rest.runMethod(
|
||||||
|
"get",
|
||||||
|
`${endpoints.GUILD_WIDGET(guildId)}.json`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export interface ModifyGuildWelcomeScreen {
|
|||||||
description?: string | null;
|
description?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add documentation link
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
|
||||||
export type DiscordModifyGuildWelcomeScreen = SnakeCasedPropertiesDeep<
|
export type DiscordModifyGuildWelcomeScreen = SnakeCasedPropertiesDeep<
|
||||||
ModifyGuildWelcomeScreen
|
ModifyGuildWelcomeScreen
|
||||||
>;
|
>;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SnakeCaseProps } from "../util.ts";
|
import { SnakeCasedProperties } from "../util.ts";
|
||||||
|
|
||||||
export interface UpdateOthersVoiceState {
|
export interface UpdateOthersVoiceState {
|
||||||
/** The id of the channel the user is currently in */
|
/** The id of the channel the user is currently in */
|
||||||
@@ -7,7 +7,7 @@ export interface UpdateOthersVoiceState {
|
|||||||
suppress?: boolean;
|
suppress?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add corresponding link to the resource
|
/** https://discord.com/developers/docs/resources/guild#update-user-voice-state */
|
||||||
export type DiscordUpdateOthersVoiceState = SnakeCaseProps<
|
export type DiscordUpdateOthersVoiceState = SnakeCasedProperties<
|
||||||
UpdateOthersVoiceState
|
UpdateOthersVoiceState
|
||||||
>;
|
>;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SnakeCaseProps } from "../util.ts";
|
import { SnakeCasedProperties } from "../util.ts";
|
||||||
|
|
||||||
export interface UpdateSelfVoiceState {
|
export interface UpdateSelfVoiceState {
|
||||||
/** The id of the channel the user is currently in */
|
/** The id of the channel the user is currently in */
|
||||||
@@ -9,5 +9,7 @@ export interface UpdateSelfVoiceState {
|
|||||||
requestToSpeakTimestamp?: string | null;
|
requestToSpeakTimestamp?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add corresponding link to the resource
|
/** https://discord.com/developers/docs/resources/guild#update-current-user-voice-state */
|
||||||
export type DiscordUpdateSelfVoiceState = SnakeCaseProps<UpdateSelfVoiceState>;
|
export type DiscordUpdateSelfVoiceState = SnakeCasedProperties<
|
||||||
|
UpdateSelfVoiceState
|
||||||
|
>;
|
||||||
|
|||||||
+14
-14
@@ -1,3 +1,4 @@
|
|||||||
|
import { DiscordGatewayCloseEventCodes } from "../types/codes/gateway_close_event_codes.ts";
|
||||||
import { identify } from "./identify.ts";
|
import { identify } from "./identify.ts";
|
||||||
import { resume } from "./resume.ts";
|
import { resume } from "./resume.ts";
|
||||||
import { ws } from "./ws.ts";
|
import { ws } from "./ws.ts";
|
||||||
@@ -33,25 +34,24 @@ export async function createShard(shardId: number) {
|
|||||||
return ws.log("CLOSED_RECONNECT", { shardId, payload: event });
|
return ws.log("CLOSED_RECONNECT", { shardId, payload: event });
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: ENUM FOR THESE CODES?
|
|
||||||
switch (event.code) {
|
switch (event.code) {
|
||||||
case 4001:
|
case DiscordGatewayCloseEventCodes.UnknownOpcode:
|
||||||
case 4002:
|
case DiscordGatewayCloseEventCodes.DecodeError:
|
||||||
case 4004:
|
case DiscordGatewayCloseEventCodes.AuthenticationFailed:
|
||||||
case 4005:
|
case DiscordGatewayCloseEventCodes.AlreadyAuthenticated:
|
||||||
case 4010:
|
case DiscordGatewayCloseEventCodes.InvalidShard:
|
||||||
case 4011:
|
case DiscordGatewayCloseEventCodes.ShardingRequired:
|
||||||
case 4012:
|
case DiscordGatewayCloseEventCodes.InvalidApiVersion:
|
||||||
case 4013:
|
case DiscordGatewayCloseEventCodes.InvalidIntents:
|
||||||
case 4014:
|
case DiscordGatewayCloseEventCodes.DisallowedIntents:
|
||||||
throw new Error(
|
throw new Error(
|
||||||
event.reason || "Discord gave no reason! GG! You broke Discord!",
|
event.reason || "Discord gave no reason! GG! You broke Discord!",
|
||||||
);
|
);
|
||||||
// THESE ERRORS CAN NO BE RESUMED! THEY MUST RE-IDENTIFY!
|
// THESE ERRORS CAN NO BE RESUMED! THEY MUST RE-IDENTIFY!
|
||||||
case 4003:
|
case DiscordGatewayCloseEventCodes.NotAuthenticated:
|
||||||
case 4007:
|
case DiscordGatewayCloseEventCodes.InvalidSeq:
|
||||||
case 4008:
|
case DiscordGatewayCloseEventCodes.RateLimited:
|
||||||
case 4009:
|
case DiscordGatewayCloseEventCodes.SessionTimedOut:
|
||||||
identify(shardId, ws.maxShards);
|
identify(shardId, ws.maxShards);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user