From 80115acecdfc23c62d81842f275d71b05da4d9c9 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Fri, 29 Apr 2022 12:12:50 +0700 Subject: [PATCH] New Event (userSettingsUpdate) --- src/client/websocket/handlers/USER_SETTINGS_UPDATE.js | 3 ++- typings/index.d.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/websocket/handlers/USER_SETTINGS_UPDATE.js b/src/client/websocket/handlers/USER_SETTINGS_UPDATE.js index fa44cf1..265a8be 100644 --- a/src/client/websocket/handlers/USER_SETTINGS_UPDATE.js +++ b/src/client/websocket/handlers/USER_SETTINGS_UPDATE.js @@ -1,5 +1,6 @@ 'use strict'; - +const { Events } = require('../../../util/Constants'); module.exports = (client, { d: data }) => { client.setting._patch(data); + return client.emit(Events.USER_SETTINGS_UPDATE, data); }; diff --git a/typings/index.d.ts b/typings/index.d.ts index 913089b..9581da7 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -4147,6 +4147,7 @@ export interface ClientEvents extends BaseClientEvents { threadUpdate: [oldThread: ThreadChannel, newThread: ThreadChannel]; typingStart: [typing: Typing]; userUpdate: [oldUser: User | PartialUser, newUser: User]; + userSettingsUpdate: [setting: RawUserSettingsData]; voiceStateUpdate: [oldState: VoiceState, newState: VoiceState]; webhookUpdate: [channel: TextChannel | NewsChannel]; /** @deprecated Use interactionCreate instead */ @@ -4393,6 +4394,7 @@ export interface ConstantsEvents { THREAD_MEMBER_UPDATE: 'threadMemberUpdate'; THREAD_MEMBERS_UPDATE: 'threadMembersUpdate'; USER_UPDATE: 'userUpdate'; + USER_SETTINGS_UPDATE: 'userSettingsUpdate'; PRESENCE_UPDATE: 'presenceUpdate'; VOICE_SERVER_UPDATE: 'voiceServerUpdate'; VOICE_STATE_UPDATE: 'voiceStateUpdate';