mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
feat: voice channel effect send event (#250)
This commit is contained in:
parent
753a70f94c
commit
0bc8a6789c
@ -1,4 +1,8 @@
|
|||||||
import type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from '../../types';
|
import type {
|
||||||
|
GatewayVoiceChannelEffectSendDispachData,
|
||||||
|
GatewayVoiceServerUpdateDispatchData,
|
||||||
|
GatewayVoiceStateUpdateDispatchData,
|
||||||
|
} from '../../types';
|
||||||
import { toCamelCase } from '../../common';
|
import { toCamelCase } from '../../common';
|
||||||
import type { UsingClient } from '../../commands';
|
import type { UsingClient } from '../../commands';
|
||||||
import { Transformers, type VoiceStateStructure } from '../../client/transformers';
|
import { Transformers, type VoiceStateStructure } from '../../client/transformers';
|
||||||
@ -14,3 +18,7 @@ export const VOICE_STATE_UPDATE = async (
|
|||||||
if (!data.guild_id) return [Transformers.VoiceState(self, data)];
|
if (!data.guild_id) return [Transformers.VoiceState(self, data)];
|
||||||
return [Transformers.VoiceState(self, data), await self.cache.voiceStates?.get(data.user_id, data.guild_id)];
|
return [Transformers.VoiceState(self, data), await self.cache.voiceStates?.get(data.user_id, data.guild_id)];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const VOICE_CHANNEL_EFFECT_SEND = (_self: UsingClient, data: GatewayVoiceChannelEffectSendDispachData) => {
|
||||||
|
return toCamelCase(data);
|
||||||
|
};
|
||||||
|
@ -32,9 +32,10 @@ import type {
|
|||||||
AutoModerationRuleTriggerType,
|
AutoModerationRuleTriggerType,
|
||||||
APIAuditLogEntry,
|
APIAuditLogEntry,
|
||||||
APIEntitlement,
|
APIEntitlement,
|
||||||
|
APIPartialEmoji,
|
||||||
} from './payloads/index';
|
} from './payloads/index';
|
||||||
import type { ReactionType } from './rest/index';
|
import type { ReactionType } from './rest/index';
|
||||||
import type { Nullable } from './utils';
|
import type { AnimationTypes, Nullable } from './utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params
|
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params
|
||||||
@ -1496,6 +1497,47 @@ export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUp
|
|||||||
*/
|
*/
|
||||||
export type GatewayUserUpdateDispatchData = APIUser;
|
export type GatewayUserUpdateDispatchData = APIUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send
|
||||||
|
*/
|
||||||
|
export type GatewayVoiceChannelEffectSendDispach = DataPayload<
|
||||||
|
GatewayDispatchEvents.VoiceChannelEffectSend,
|
||||||
|
GatewayVoiceChannelEffectSendDispachData
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-voice-channel-effect-send-event-fields
|
||||||
|
*/
|
||||||
|
export type GatewayVoiceChannelEffectSendDispachData =
|
||||||
|
| GatewayVoiceChannelEffectSendSoundboard
|
||||||
|
| GatewayVoiceChannelEffectSendReaction;
|
||||||
|
|
||||||
|
export type _GatewayVoiceChannelEffectSendDispachData = {
|
||||||
|
/** ID of the channel the effect was sent in */
|
||||||
|
channel_id: string;
|
||||||
|
/** ID of the guild the effect was sent in */
|
||||||
|
guild_id: string;
|
||||||
|
/** ID of the user who sent the effect */
|
||||||
|
user_id: string;
|
||||||
|
/** The emoji sent, for emoji reaction and soundboard effects */
|
||||||
|
emoji?: APIPartialEmoji | null;
|
||||||
|
/** The type of emoji animation, for emoji reaction and soundboard effects */
|
||||||
|
animation_type?: AnimationTypes | null;
|
||||||
|
/** The ID of the emoji animation, for emoji reaction and soundboard effects */
|
||||||
|
animation_id?: number;
|
||||||
|
/** The ID of the soundboard sound, for soundboard effects */
|
||||||
|
sound_id: string | number;
|
||||||
|
/** The volume of the soundboard sound, from 0 to 1, for soundboard effects */
|
||||||
|
sound_volume?: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type GatewayVoiceChannelEffectSendReaction = Omit<
|
||||||
|
_GatewayVoiceChannelEffectSendDispachData,
|
||||||
|
'sound_id' | 'sound_volume'
|
||||||
|
>;
|
||||||
|
|
||||||
|
export type GatewayVoiceChannelEffectSendSoundboard = _GatewayVoiceChannelEffectSendDispachData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
|
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
|
||||||
*/
|
*/
|
||||||
|
@ -367,6 +367,7 @@ export enum GatewayDispatchEvents {
|
|||||||
ThreadUpdate = 'THREAD_UPDATE',
|
ThreadUpdate = 'THREAD_UPDATE',
|
||||||
TypingStart = 'TYPING_START',
|
TypingStart = 'TYPING_START',
|
||||||
UserUpdate = 'USER_UPDATE',
|
UserUpdate = 'USER_UPDATE',
|
||||||
|
VoiceChannelEffectSend = 'VOICE_CHANNEL_EFFECT_SEND',
|
||||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||||
@ -835,3 +836,13 @@ export enum OverwriteType {
|
|||||||
Role,
|
Role,
|
||||||
Member,
|
Member,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types
|
||||||
|
*/
|
||||||
|
export enum AnimationTypes {
|
||||||
|
/** A fun animation, sent by a Nitro subscriber */
|
||||||
|
PREMIUM = 0,
|
||||||
|
/** The standard animation */
|
||||||
|
BASIC,
|
||||||
|
}
|
||||||
|
@ -58,6 +58,7 @@ import type {
|
|||||||
APIChannel,
|
APIChannel,
|
||||||
APIAutoModerationRule,
|
APIAutoModerationRule,
|
||||||
APIEntitlement,
|
APIEntitlement,
|
||||||
|
GatewayVoiceChannelEffectSendDispachData,
|
||||||
} from '../types';
|
} from '../types';
|
||||||
import { GatewayDispatchEvents } from '../types';
|
import { GatewayDispatchEvents } from '../types';
|
||||||
|
|
||||||
@ -141,6 +142,7 @@ export interface Events {
|
|||||||
[GatewayDispatchEvents.PresenceUpdate]: GatewayPresenceUpdateDispatchData;
|
[GatewayDispatchEvents.PresenceUpdate]: GatewayPresenceUpdateDispatchData;
|
||||||
[GatewayDispatchEvents.TypingStart]: GatewayTypingStartDispatchData;
|
[GatewayDispatchEvents.TypingStart]: GatewayTypingStartDispatchData;
|
||||||
[GatewayDispatchEvents.UserUpdate]: GatewayUserUpdateDispatchData;
|
[GatewayDispatchEvents.UserUpdate]: GatewayUserUpdateDispatchData;
|
||||||
|
[GatewayDispatchEvents.VoiceChannelEffectSend]: GatewayVoiceChannelEffectSendDispachData;
|
||||||
[GatewayDispatchEvents.VoiceStateUpdate]: GatewayVoiceStateUpdateData;
|
[GatewayDispatchEvents.VoiceStateUpdate]: GatewayVoiceStateUpdateData;
|
||||||
[GatewayDispatchEvents.VoiceServerUpdate]: GatewayVoiceServerUpdateDispatchData;
|
[GatewayDispatchEvents.VoiceServerUpdate]: GatewayVoiceServerUpdateDispatchData;
|
||||||
[GatewayDispatchEvents.WebhooksUpdate]: GatewayWebhooksUpdateDispatchData;
|
[GatewayDispatchEvents.WebhooksUpdate]: GatewayWebhooksUpdateDispatchData;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user