mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add loading icon during voice commands
This commit is contained in:
@@ -26,6 +26,7 @@ FLANKER_EMOJI_ID=
|
||||
FRONT_LINE_EMOJI_ID=
|
||||
SUPPORT_EMOJI_ID=
|
||||
DAMAGE_EMOJI_ID=
|
||||
LOADING_EMOJI_ID=
|
||||
|
||||
# Dating info
|
||||
DATING_OFF=
|
||||
|
||||
@@ -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({
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "119.34.1",
|
||||
"version": "119.34.2",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user