mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
If you are in a voice channel while playing jeopardy, play the music
This commit is contained in:
Binary file not shown.
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "114.29.0",
|
||||
"version": "114.29.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user