Add loading icon during voice commands

This commit is contained in:
Dragon Fire
2020-10-28 20:30:12 -04:00
parent 880ef83ed8
commit d2d877832b
4 changed files with 9 additions and 1 deletions
+1
View File
@@ -26,6 +26,7 @@ FLANKER_EMOJI_ID=
FRONT_LINE_EMOJI_ID=
SUPPORT_EMOJI_ID=
DAMAGE_EMOJI_ID=
LOADING_EMOJI_ID=
# Dating info
DATING_OFF=
+4
View File
@@ -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 });
+3
View File
@@ -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({
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "119.34.1",
"version": "119.34.2",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {