File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11import * as zod from 'zod' ;
22import { zodCoerceUnhandledValue } from '../utils/zodUtils' ;
3- import { AuthenticateResponseSchema } from '../generated/schemas' ;
3+ import { AuthenticateResponseSchema , GetRelationshipsResponseSchema } from '../generated/schemas' ;
44
55// DISPATCH is sent as cmd but is a special case, so is excluded from Commands enum
66export const DISPATCH = 'DISPATCH' ;
@@ -58,6 +58,8 @@ export const ScopesObject = {
5858
5959export const Scopes = zodCoerceUnhandledValue ( ScopesObject ) ;
6060
61+ export const Relationship = GetRelationshipsResponseSchema . shape . relationships . element ;
62+
6163export const User = zod . object ( {
6264 id : zod . string ( ) ,
6365 username : zod . string ( ) ,
Original file line number Diff line number Diff line change 11import * as zod from 'zod' ;
22import { Orientation } from '../Constants' ;
3- import { DISPATCH , GuildMemberRPC , UserVoiceState } from './common' ;
3+ import { DISPATCH , GuildMemberRPC , Relationship , UserVoiceState } from './common' ;
44import { zodCoerceUnhandledValue } from '../utils/zodUtils' ;
55import {
66 Entitlement ,
@@ -27,6 +27,7 @@ export enum Events {
2727 ENTITLEMENT_CREATE = 'ENTITLEMENT_CREATE' ,
2828 THERMAL_STATE_UPDATE = 'THERMAL_STATE_UPDATE' ,
2929 ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE = 'ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE' ,
30+ RELATIONSHIP_UPDATE = 'RELATIONSHIP_UPDATE' ,
3031}
3132
3233export const DispatchEventFrame = ReceiveFrame . extend ( {
@@ -229,4 +230,10 @@ export const EventSchema = {
229230 } ) ,
230231 } ) ,
231232 } ,
233+ [ Events . RELATIONSHIP_UPDATE ] : {
234+ payload : DispatchEventFrame . extend ( {
235+ evt : zod . literal ( Events . RELATIONSHIP_UPDATE ) ,
236+ data : Relationship ,
237+ } ) ,
238+ } ,
232239} satisfies Record < keyof typeof Events , EventArgs > ;
You can’t perform that action at this time.
0 commit comments