mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 15:57:47 +02:00
Add loading icon during voice commands
This commit is contained in:
@@ -26,6 +26,7 @@ FLANKER_EMOJI_ID=
|
|||||||
FRONT_LINE_EMOJI_ID=
|
FRONT_LINE_EMOJI_ID=
|
||||||
SUPPORT_EMOJI_ID=
|
SUPPORT_EMOJI_ID=
|
||||||
DAMAGE_EMOJI_ID=
|
DAMAGE_EMOJI_ID=
|
||||||
|
LOADING_EMOJI_ID=
|
||||||
|
|
||||||
# Dating info
|
# Dating info
|
||||||
DATING_OFF=
|
DATING_OFF=
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const request = require('node-superfetch');
|
const request = require('node-superfetch');
|
||||||
|
const { LOADING_EMOJI_ID } = process.env;
|
||||||
|
|
||||||
module.exports = class DECTalkCommand extends Command {
|
module.exports = class DECTalkCommand extends Command {
|
||||||
constructor(client) {
|
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!`);
|
return msg.reply(`I am not in a voice channel. Use ${usage} to fix that!`);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
|
||||||
|
await msg.react(LOADING_EMOJI_ID);
|
||||||
|
}
|
||||||
const { url } = await request
|
const { url } = await request
|
||||||
.get('http://tts.cyzon.us/tts')
|
.get('http://tts.cyzon.us/tts')
|
||||||
.query({ text });
|
.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!`);
|
return msg.reply(`I am not in a voice channel. Use ${usage} to fix that!`);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
|
||||||
|
await msg.react(LOADING_EMOJI_ID);
|
||||||
|
}
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.post('https://mumble.stream/speak_spectrogram')
|
.post('https://mumble.stream/speak_spectrogram')
|
||||||
.send({
|
.send({
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "119.34.1",
|
"version": "119.34.2",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user