mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
change: prettier code
This commit is contained in:
committed by
GitHub Action
parent
2427a5d2c8
commit
88609ddbd2
@@ -10,8 +10,7 @@ export async function handlePresenceUpdate(bot: Bot, data: DiscordGatewayPayload
|
||||
|
||||
const oldPresence = await bot.cache.presence.get(id);
|
||||
const presence = bot.transformers.presence(bot, payload);
|
||||
await bot.cache.presence.set(id, presence)
|
||||
|
||||
await bot.cache.presence.set(id, presence);
|
||||
|
||||
bot.events.presenceUpdate(bot, presence, oldPresence);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import type { DiscordReady } from "../../types/gateway/ready.ts";
|
||||
export function handleReady(bot: Bot, data: DiscordGatewayPayload, shardId: number) {
|
||||
const payload = data.d as DiscordReady;
|
||||
// Triggered on each shard
|
||||
bot.events.ready(bot, {
|
||||
bot.events.ready(
|
||||
bot,
|
||||
{
|
||||
shardId,
|
||||
v: payload.v,
|
||||
user: bot.transformers.user(bot, payload.user),
|
||||
@@ -13,7 +15,9 @@ export function handleReady(bot: Bot, data: DiscordGatewayPayload, shardId: numb
|
||||
sessionId: payload.session_id,
|
||||
shard: payload.shard,
|
||||
applicationId: bot.transformers.snowflake(payload.application.id),
|
||||
}, payload);
|
||||
},
|
||||
payload
|
||||
);
|
||||
|
||||
if (!bot.id) bot.id = bot.transformers.snowflake(payload.user.id);
|
||||
if (!bot.applicationId) bot.applicationId = bot.transformers.snowflake(payload.application.id);
|
||||
|
||||
@@ -16,7 +16,9 @@ export function transformVoiceState(
|
||||
(payload.voiceState.self_video ? 32n : 0n) |
|
||||
(payload.voiceState.suppress ? 64n : 0n),
|
||||
|
||||
requestToSpeakTimestamp: payload.voiceState.request_to_speak_timestamp ? Date.parse(payload.voiceState.request_to_speak_timestamp) : undefined,
|
||||
requestToSpeakTimestamp: payload.voiceState.request_to_speak_timestamp
|
||||
? Date.parse(payload.voiceState.request_to_speak_timestamp)
|
||||
: undefined,
|
||||
sessionId: payload.voiceState.session_id,
|
||||
|
||||
channelId: payload.voiceState.channel_id ? bot.transformers.snowflake(payload.voiceState.channel_id) : undefined,
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
/** https://discord.com/developers/docs/topics/gateway#update-status-status-types */
|
||||
export type DiscordStatusTypes = "online" | "dnd" | "idle" | "invisible" | "offline";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user