mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 06:42:51 +02:00
Update
This commit is contained in:
@@ -42,8 +42,8 @@ module.exports = class SoundboardCommand extends Command {
|
|||||||
if (this.client.voiceConnections.has(channel.guild.id)) return msg.reply('I am already playing a sound.');
|
if (this.client.voiceConnections.has(channel.guild.id)) return msg.reply('I am already playing a sound.');
|
||||||
try {
|
try {
|
||||||
const connection = await channel.join();
|
const connection = await channel.join();
|
||||||
const dispatcher = connection.playFile(path.join(__dirname, '..', '..', 'assets', 'sounds', sounds[sound]));
|
const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', sounds[sound]));
|
||||||
dispatcher.once('end', () => channel.leave());
|
dispatcher.once('finish', () => channel.leave());
|
||||||
dispatcher.once('error', () => channel.leave());
|
dispatcher.once('error', () => channel.leave());
|
||||||
return null;
|
return null;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ module.exports = class DECTalkCommand extends Command {
|
|||||||
const data = await snekfetch
|
const data = await snekfetch
|
||||||
.get('http://tts.cyzon.us/tts', { followRedirects: false })
|
.get('http://tts.cyzon.us/tts', { followRedirects: false })
|
||||||
.query({ text });
|
.query({ text });
|
||||||
const dispatcher = connection.playArbitraryInput(`http://tts.cyzon.us${data.headers.location}`);
|
const dispatcher = connection.play(`http://tts.cyzon.us${data.headers.location}`);
|
||||||
dispatcher.once('end', () => channel.leave());
|
dispatcher.once('finish', () => channel.leave());
|
||||||
dispatcher.once('error', () => channel.leave());
|
dispatcher.once('error', () => channel.leave());
|
||||||
return null;
|
return null;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user