mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 00:07:36 +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',
|
name: 'Jeopardy',
|
||||||
url: 'https://www.jeopardy.com/',
|
url: 'https://www.jeopardy.com/',
|
||||||
reason: 'Original Show'
|
reason: 'Music, Original Show'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'OPTIFONT',
|
name: 'OPTIFONT',
|
||||||
@@ -41,6 +41,13 @@ module.exports = class JeopardyCommand extends Command {
|
|||||||
try {
|
try {
|
||||||
const question = await this.fetchQuestion();
|
const question = await this.fetchQuestion();
|
||||||
const clueCard = await this.generateClueCard(question.question.replace(/<\/?i>/gi, ''));
|
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.`, {
|
await msg.reply(`The category is: **${question.category.title.toUpperCase()}**. 30 seconds, good luck.`, {
|
||||||
files: [{ attachment: clueCard, name: 'clue-card.png' }]
|
files: [{ attachment: clueCard, name: 'clue-card.png' }]
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "114.29.0",
|
"version": "114.29.1",
|
||||||
"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