mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 03:14:35 +02:00
Add loading icon during voice commands
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
const { LOADING_EMOJI_ID } = process.env;
|
||||
|
||||
module.exports = class DECTalkCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -52,6 +53,9 @@ module.exports = class DECTalkCommand extends Command {
|
||||
return msg.reply(`I am not in a voice channel. Use ${usage} to fix that!`);
|
||||
}
|
||||
try {
|
||||
if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
|
||||
await msg.react(LOADING_EMOJI_ID);
|
||||
}
|
||||
const { url } = await request
|
||||
.get('http://tts.cyzon.us/tts')
|
||||
.query({ text });
|
||||
|
||||
@@ -51,6 +51,9 @@ module.exports = class VocodesCommand extends Command {
|
||||
return msg.reply(`I am not in a voice channel. Use ${usage} to fix that!`);
|
||||
}
|
||||
try {
|
||||
if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
|
||||
await msg.react(LOADING_EMOJI_ID);
|
||||
}
|
||||
const { body } = await request
|
||||
.post('https://mumble.stream/speak_spectrogram')
|
||||
.send({
|
||||
|
||||
Reference in New Issue
Block a user