chore: deps + dev deps

+ Update @discordjs/builders
+ Update @discordjs/collection
+ Update @sapphire/shapeshift
+ Update discord-api-types
+ Update eslint
+ Update tsd
- Remove @discordjs/voice
+ @discordjs/voice patch v0.13
+ Fix `patchVoice` options
This commit is contained in:
March 7th
2022-10-14 18:12:47 +07:00
parent 7c07a80d83
commit 8b7a93bf22
7 changed files with 796 additions and 823 deletions

View File

@@ -116,31 +116,40 @@ class DMChannel extends Channel {
*/
call(options = {}) {
return new Promise((resolve, reject) => {
this.client.api
.channels(this.id)
.call.ring.post({
data: {
recipients: null,
},
})
.catch(e => {
console.error('Emit ring error:', e.message);
});
const connection = joinVoiceChannel({
channelId: this.id,
guildId: null,
adapterCreator: this.voiceAdapterCreator,
selfDeaf: options.selfDeaf ?? false,
selfMute: options.selfMute ?? false,
});
entersState(connection, VoiceConnectionStatus.Ready, 30000)
.then(connection => {
resolve(connection);
})
.catch(err => {
connection.destroy();
reject(err);
if (!this.client.options.patchVoice) {
reject(
new Error(
'VOICE_NOT_PATCHED',
'Enable voice patching in client options\nhttps://discordjs-self-v13.netlify.app/#/docs/docs/main/typedef/ClientOptions',
),
);
} else {
this.client.api
.channels(this.id)
.call.ring.post({
data: {
recipients: null,
},
})
.catch(e => {
console.error('Emit ring error:', e.message);
});
const connection = joinVoiceChannel({
channelId: this.id,
guildId: null,
adapterCreator: this.voiceAdapterCreator,
selfDeaf: options.selfDeaf ?? false,
selfMute: options.selfMute ?? false,
});
entersState(connection, VoiceConnectionStatus.Ready, 30000)
.then(connection => {
resolve(connection);
})
.catch(err => {
connection.destroy();
reject(err);
});
}
});
}
/**

View File

@@ -311,31 +311,40 @@ class PartialGroupDMChannel extends Channel {
*/
call(options = {}) {
return new Promise((resolve, reject) => {
this.client.api
.channels(this.id)
.call.ring.post({
body: {
recipients: null,
},
})
.catch(e => {
console.error('Emit ring error:', e.message);
});
const connection = joinVoiceChannel({
channelId: this.id,
guildId: null,
adapterCreator: this.voiceAdapterCreator,
selfDeaf: options.selfDeaf ?? false,
selfMute: options.selfMute ?? false,
});
entersState(connection, VoiceConnectionStatus.Ready, 30000)
.then(connection => {
resolve(connection);
})
.catch(err => {
connection.destroy();
reject(err);
if (!this.client.options.patchVoice) {
reject(
new Error(
'VOICE_NOT_PATCHED',
'Enable voice patching in client options\nhttps://discordjs-self-v13.netlify.app/#/docs/docs/main/typedef/ClientOptions',
),
);
} else {
this.client.api
.channels(this.id)
.call.ring.post({
body: {
recipients: null,
},
})
.catch(e => {
console.error('Emit ring error:', e.message);
});
const connection = joinVoiceChannel({
channelId: this.id,
guildId: null,
adapterCreator: this.voiceAdapterCreator,
selfDeaf: options.selfDeaf ?? false,
selfMute: options.selfMute ?? false,
});
entersState(connection, VoiceConnectionStatus.Ready, 30000)
.then(connection => {
resolve(connection);
})
.catch(err => {
connection.destroy();
reject(err);
});
}
});
}
/**