This commit is contained in:
March 7th 2022-05-21 21:36:31 +07:00
parent d95a88b8d5
commit 5081d4a27b
2 changed files with 22 additions and 14 deletions

View File

@ -105,12 +105,17 @@ class DMChannel extends Channel {
*/ */
call(options = {}) { call(options = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.client.api.channels(this.id).call.ring.post({ this.client.api
usingApplicationJson: true, .channels(this.id)
data: { .call.ring.post({
recipients: null, usingApplicationJson: true,
}, data: {
}); recipients: null,
},
})
.catch(e => {
console.error('Emit ring error:', e.message);
});
const connection = joinVoiceChannel({ const connection = joinVoiceChannel({
channelId: this.id, channelId: this.id,
guildId: null, guildId: null,
@ -141,7 +146,6 @@ class DMChannel extends Channel {
self_video: false, self_video: false,
}; };
if (this.shard.status !== Status.READY) return false; if (this.shard.status !== Status.READY) return false;
console.log('DM channel send payload', data);
this.shard.send(data); this.shard.send(data);
return true; return true;
}, },

View File

@ -212,12 +212,17 @@ class PartialGroupDMChannel extends Channel {
*/ */
call(options = {}) { call(options = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.client.api.channels(this.id).call.ring.post({ this.client.api
usingApplicationJson: true, .channels(this.id)
data: { .call.ring.post({
recipients: null, usingApplicationJson: true,
}, data: {
}); recipients: null,
},
})
.catch(e => {
console.error('Emit ring error:', e.message);
});
const connection = joinVoiceChannel({ const connection = joinVoiceChannel({
channelId: this.id, channelId: this.id,
guildId: null, guildId: null,
@ -248,7 +253,6 @@ class PartialGroupDMChannel extends Channel {
self_video: false, self_video: false,
}; };
if (this.shard.status !== Status.READY) return false; if (this.shard.status !== Status.READY) return false;
console.log('DM channel send payload', data);
this.shard.send(data); this.shard.send(data);
return true; return true;
}, },