From 5081d4a27b81b3f3492a5cda5504a70365c0b1ee Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Sat, 21 May 2022 21:36:31 +0700 Subject: [PATCH] fix ring --- src/structures/DMChannel.js | 18 +++++++++++------- src/structures/PartialGroupDMChannel.js | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/structures/DMChannel.js b/src/structures/DMChannel.js index 96952fa..de81187 100644 --- a/src/structures/DMChannel.js +++ b/src/structures/DMChannel.js @@ -105,12 +105,17 @@ class DMChannel extends Channel { */ call(options = {}) { return new Promise((resolve, reject) => { - this.client.api.channels(this.id).call.ring.post({ - usingApplicationJson: true, - data: { - recipients: null, - }, - }); + this.client.api + .channels(this.id) + .call.ring.post({ + usingApplicationJson: true, + data: { + recipients: null, + }, + }) + .catch(e => { + console.error('Emit ring error:', e.message); + }); const connection = joinVoiceChannel({ channelId: this.id, guildId: null, @@ -141,7 +146,6 @@ class DMChannel extends Channel { self_video: false, }; if (this.shard.status !== Status.READY) return false; - console.log('DM channel send payload', data); this.shard.send(data); return true; }, diff --git a/src/structures/PartialGroupDMChannel.js b/src/structures/PartialGroupDMChannel.js index 4d931e4..8a239c1 100644 --- a/src/structures/PartialGroupDMChannel.js +++ b/src/structures/PartialGroupDMChannel.js @@ -212,12 +212,17 @@ class PartialGroupDMChannel extends Channel { */ call(options = {}) { return new Promise((resolve, reject) => { - this.client.api.channels(this.id).call.ring.post({ - usingApplicationJson: true, - data: { - recipients: null, - }, - }); + this.client.api + .channels(this.id) + .call.ring.post({ + usingApplicationJson: true, + data: { + recipients: null, + }, + }) + .catch(e => { + console.error('Emit ring error:', e.message); + }); const connection = joinVoiceChannel({ channelId: this.id, guildId: null, @@ -248,7 +253,6 @@ class PartialGroupDMChannel extends Channel { self_video: false, }; if (this.shard.status !== Status.READY) return false; - console.log('DM channel send payload', data); this.shard.send(data); return true; },