Add explosion sound effect

This commit is contained in:
Dragon Fire
2021-04-29 18:31:36 -04:00
parent dedf26aa8c
commit 724d358eab
7 changed files with 28 additions and 6 deletions
+1
View File
@@ -4,6 +4,7 @@
["soundboard", "cat.mp3"],
["soundboard", "cow.mp3"],
["soundboard", "dun-dun-dun.mp3"],
["explosion.mp3"],
["soundboard", "hello-there.mp3"],
["soundboard", "here-we-go-again.mp3"],
["jeopardy.mp3"],
Binary file not shown.
+1
View File
@@ -22,6 +22,7 @@ module.exports = class MafiaCommand extends Command {
const usage = this.client.registry.commands.get('join').usage();
return msg.reply(`I am not in a voice channel. Use ${usage} to fix that!`);
}
if (this.client.dispatchers.has(msg.guild.id)) return msg.reply('I am already playing audio in this server.');
for (const member of connection.channel.members.values()) await msg.guild.members.fetch(member.id);
if (connection.channel.members.size > 16) {
return msg.reply('Please do not have more than 15 users in this voice channel.');
+5 -2
View File
@@ -45,8 +45,11 @@ module.exports = class JeopardyCommand extends Command {
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.guild && connection && !this.client.dispatchers.has(msg.guild.id)) {
const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'jeopardy.mp3'));
this.client.dispatchers.set(msg.guild.id, dispatcher);
dispatcher.once('finish', () => this.client.dispatchers.delete(msg.guild.id));
dispatcher.once('error', () => this.client.dispatchers.delete(msg.guild.id));
await reactIfAble(msg, this.client.user, '🔉');
}
await msg.reply(`The category is: **${question.category.title.toUpperCase()}**. 30 seconds, good luck.`, {
+7 -2
View File
@@ -94,8 +94,13 @@ module.exports = class WhosThatPokemonCommand extends Command {
const attachment = await this.createImage(data, true);
const answerAttachment = await this.createImage(data, false);
const connection = msg.guild ? this.client.voice.connections.get(msg.guild.id) : null;
if (connection) {
connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'whos-that-pokemon.mp3'));
if (msg.guild && connection && !this.client.dispatchers.has(msg.guild.id)) {
const dispatcher = connection.play(
path.join(__dirname, '..', '..', 'assets', 'sounds', 'whos-that-pokemon.mp3')
);
this.client.dispatchers.set(msg.guild.id, dispatcher);
dispatcher.once('finish', () => this.client.dispatchers.delete(msg.guild.id));
dispatcher.once('error', () => this.client.dispatchers.delete(msg.guild.id));
await reactIfAble(msg, this.client.user, '🔉');
}
await msg.reply('**You have 15 seconds, who\'s that Pokémon?**', { files: [attachment] });
+1
View File
@@ -11,6 +11,7 @@ module.exports = class ExplodeCommand extends ImgurAlbumCommand {
description: 'Explodes a user.',
clientPermissions: ['ATTACH_FILES'],
albumID: EXPLODE_ALBUM_ID,
audio: 'explosion.mp3',
args: [
{
key: 'user',
+13 -2
View File
@@ -1,5 +1,7 @@
const request = require('node-superfetch');
const Command = require('../Command');
const path = require('path');
const { reactIfAble } = require('../../util/Util');
const { IMGUR_KEY } = process.env;
module.exports = class ImgurAlbumCommand extends Command {
@@ -14,11 +16,20 @@ module.exports = class ImgurAlbumCommand extends Command {
reason: 'API',
reasonURL: 'https://apidocs.imgur.com/'
});
this.noImage = info.noImage || false;
this.audio = info.audio || null;
}
async run(msg, { user }) {
if (this.noImage) return msg.say(this.generateText(msg, user));
if (this.audio) {
const connection = msg.guild ? this.client.voice.connections.get(msg.guild.id) : null;
if (msg.guild && connection && !this.client.dispatchers.has(msg.guild.id)) {
const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', this.audio));
this.client.dispatchers.set(msg.guild.id, dispatcher);
dispatcher.once('finish', () => this.client.dispatchers.delete(msg.guild.id));
dispatcher.once('error', () => this.client.dispatchers.delete(msg.guild.id));
await reactIfAble(msg, this.client.user, '🔉');
}
}
try {
const image = await this.random();
if (!image) return msg.reply('This album has no images...');