If you are in a voice channel while playing jeopardy, play the music

This commit is contained in:
Dragon Fire
2020-05-24 18:41:07 -04:00
parent 2ce06ec8ab
commit c6512200c7
3 changed files with 9 additions and 2 deletions
Binary file not shown.
+8 -1
View File
@@ -25,7 +25,7 @@ module.exports = class JeopardyCommand extends Command {
{
name: 'Jeopardy',
url: 'https://www.jeopardy.com/',
reason: 'Original Show'
reason: 'Music, Original Show'
},
{
name: 'OPTIFONT',
@@ -41,6 +41,13 @@ module.exports = class JeopardyCommand extends Command {
try {
const question = await this.fetchQuestion();
const clueCard = await this.generateClueCard(question.question.replace(/<\/?i>/gi, ''));
const connection = msg.guild ? this.client.voice.connections.get(msg.guild.id) : null;
if (connection) {
connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'jeopardy.mp3'));
if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
await msg.react('🔉');
}
}
await msg.reply(`The category is: **${question.category.title.toUpperCase()}**. 30 seconds, good luck.`, {
files: [{ attachment: clueCard, name: 'clue-card.png' }]
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "114.29.0",
"version": "114.29.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {