Airhorn, Voice Group, Cow sound

This commit is contained in:
Daniel Odendahl Jr
2018-02-26 14:21:41 +00:00
parent aceb12af2b
commit 555d43e25f
23 changed files with 62 additions and 5 deletions
+1
View File
@@ -24,6 +24,7 @@ client.registry
['events', 'Events'],
['search', 'Search'],
['games', 'Games'],
['voice', 'Voice Channel'],
['image-edit', 'Image Manipulation'],
['avatar-edit', 'Avatar Manipulation'],
['text-edit', 'Text Manipulation'],
+16
View File
@@ -0,0 +1,16 @@
[
"clownfull.mp3",
"clownshort.mp3",
"clownspam.mp3",
"default.mp3",
"distant.mp3",
"echo.mp3",
"fourtap.mp3",
"highfartlong.mp3",
"highfartshort.mp3",
"midshort.mp3",
"reverb.mp3",
"spam.mp3",
"tripletap.mp3",
"truck.mp3"
]
+1 -1
View File
@@ -1,9 +1,9 @@
{
"airhorn": "airhorn.mp3",
"alarm": "alarm.mp3",
"ayaya": "ayaya.mp3",
"car crash": "car-crash.mp3",
"cat": "cat.mp3",
"cow": "cow.mp3",
"doh": "doh.mp3",
"dun-dun-dun": "dun-dun-dun.mp3",
"eat my shorts": "eat-my-shorts.mp3",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+40
View File
@@ -0,0 +1,40 @@
const { Command } = require('discord.js-commando');
const path = require('path');
const sounds = require('../../assets/json/airhorn');
module.exports = class AirhornCommand extends Command {
constructor(client) {
super(client, {
name: 'airhorn',
group: 'voice',
memberName: 'airhorn',
description: 'Plays an airhorn sound in your voice channel.',
guildOnly: true,
throttling: {
usages: 1,
duration: 10
}
});
}
async run(msg) {
const channel = msg.member.voiceChannel;
if (!channel) return msg.reply('Please enter a voice channel first.');
if (!channel.permissionsFor(this.client.user).has(['CONNECT', 'SPEAK'])) {
return msg.reply('Missing the "Connect" or "Speak" permission for the voice channel.');
}
if (!channel.joinable) return msg.reply('Your voice channel is not joinable.');
if (this.client.voiceConnections.has(channel.guild.id)) return msg.reply('I am already playing a sound.');
try {
const connection = await channel.join();
const airhorn = sounds[Math.floor(Math.random() * sounds.length)];
const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'airhorn', airhorn));
dispatcher.once('finish', () => channel.leave());
dispatcher.once('error', () => channel.leave());
return null;
} catch (err) {
channel.leave();
throw err;
}
}
};
@@ -6,7 +6,7 @@ module.exports = class DECTalkCommand extends Command {
super(client, {
name: 'dec-talk',
aliases: ['moon-base-alpha', 'text-to-speech', 'tts'],
group: 'text-edit',
group: 'voice',
memberName: 'dec-talk',
description: 'The world\'s best Text-to-Speech.',
guildOnly: true,
@@ -7,8 +7,8 @@ module.exports = class SoundboardCommand extends Command {
constructor(client) {
super(client, {
name: 'soundboard',
aliases: ['sound', 'foley'],
group: 'other',
aliases: ['sound'],
group: 'voice',
memberName: 'soundboard',
description: 'Plays a sound in your voice channel.',
details: `**Sounds**: ${Object.keys(sounds).join(', ')}`,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "66.4.4",
"version": "66.5.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {