Initial voice chat #42
This commit is contained in:
@@ -84,6 +84,12 @@ export default async function auth({
|
|||||||
case "authenticated":
|
case "authenticated":
|
||||||
if (!onIndicator) break;
|
if (!onIndicator) break;
|
||||||
msg.params.indicators.forEach(onIndicator);
|
msg.params.indicators.forEach(onIndicator);
|
||||||
|
if (!onVoiceJoin) break;
|
||||||
|
Object.entries(msg.params.voice_chat).forEach(([channelId, users]) =>
|
||||||
|
Object.entries(users).forEach(([userId, voiceId]) =>
|
||||||
|
onVoiceJoin(userId, channelId, voiceId)
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "message_create":
|
case "message_create":
|
||||||
|
|||||||
@@ -25,7 +25,14 @@ export type ClientMessage =
|
|||||||
| EnumType<"leave_voice", { channel_id: string }>;
|
| EnumType<"leave_voice", { channel_id: string }>;
|
||||||
|
|
||||||
export type ServerMessage =
|
export type ServerMessage =
|
||||||
| EnumType<"authenticated", { uuid: string; indicators: IndicatorContext[] }>
|
| EnumType<
|
||||||
|
"authenticated",
|
||||||
|
{
|
||||||
|
uuid: string;
|
||||||
|
indicators: IndicatorContext[];
|
||||||
|
voice_chat: Record<string, Record<string, number>>;
|
||||||
|
}
|
||||||
|
>
|
||||||
| EnumType<"temp_message", { message: string }>
|
| EnumType<"temp_message", { message: string }>
|
||||||
| EnumType<"message_create", Message>
|
| EnumType<"message_create", Message>
|
||||||
| EnumType<"message_update", { message_id: number; contents: string }>
|
| EnumType<"message_update", { message_id: number; contents: string }>
|
||||||
|
|||||||
Reference in New Issue
Block a user