mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Remove Soundboard
This commit is contained in:
@@ -46,14 +46,12 @@ module.exports = class InfoCommand extends commando.Command {
|
||||
moment.duration(this.client.uptime).format('d[d]h[h]m[m]s[s]'), true)
|
||||
.addField('Node Version',
|
||||
process.version, true)
|
||||
.addField('Voice Connections',
|
||||
`${this.client.voiceConnections.size} / ${vCConnections.reduce((prev, val) => prev + val, 0)}`, true)
|
||||
.addField('Library',
|
||||
'[discord.js](https://discord.js.org/#/)', true)
|
||||
.addField('Modules',
|
||||
'[discord.js](https://discord.js.org/#/), [commando](https://github.com/Gawdl3y/discord.js-commando), [pirate-speak](https://github.com/mikewesthad/pirate-speak), [google-translate-api](https://github.com/matheuss/google-translate-api), [zalgoize](https://github.com/clux/zalgolize), [hepburn](https://github.com/lovell/hepburn), [string-to-binary](https://www.npmjs.com/package/string-to-binary), [roman-numeral-converter-mmxvi](https://github.com/Cein-Markey/roman-numeral-conversion-library), [cowsay](https://github.com/piuccio/cowsay), [morse](https://github.com/ecto/morse), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [opusscript](https://github.com/abalabahaha/opusscript), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/)')
|
||||
'[commando](https://github.com/Gawdl3y/discord.js-commando), [pirate-speak](https://github.com/mikewesthad/pirate-speak), [google-translate-api](https://github.com/matheuss/google-translate-api), [zalgoize](https://github.com/clux/zalgolize), [hepburn](https://github.com/lovell/hepburn), [string-to-binary](https://www.npmjs.com/package/string-to-binary), [roman-numeral-converter-mmxvi](https://github.com/Cein-Markey/roman-numeral-conversion-library), [cowsay](https://github.com/piuccio/cowsay), [morse](https://github.com/ecto/morse), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/)')
|
||||
.addField('APIs',
|
||||
'[Wattpad API](https://developer.wattpad.com/docs/api), [Wordnik API](http://developer.wordnik.com/docs.html), [osu! API](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices API](http://docs.yugiohprices.apiary.io/#), [YouTube Data API](https://developers.google.com/youtube/v3/), [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots API](https://bots.discord.pw/api), [Today in History API](http://history.muffinlabs.com/#api), [jService API](http://jservice.io/), [Strawpoll API](https://github.com/strawpoll/strawpoll/wiki/API), [Urban Dictionary API](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB API](http://www.omdbapi.com/), [Yahoo Weather API](https://developer.yahoo.com/weather/), [iTunes Store Search API](https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/)')
|
||||
.addField('Other Credit',
|
||||
'[Heroku](https://www.heroku.com/), [Cloud9](https://c9.io/), [heroku-buildpack-ffmpeg-latest](https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest)');
|
||||
'[Wattpad API](https://developer.wattpad.com/docs/api), [Wordnik API](http://developer.wordnik.com/docs.html), [osu! API](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices API](http://docs.yugiohprices.apiary.io/#), [YouTube Data API](https://developers.google.com/youtube/v3/), [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots API](https://bots.discord.pw/api), [Today in History API](http://history.muffinlabs.com/#api), [jService API](http://jservice.io/), [Strawpoll API](https://github.com/strawpoll/strawpoll/wiki/API), [Urban Dictionary API](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB API](http://www.omdbapi.com/), [Yahoo Weather API](https://developer.yahoo.com/weather/), [iTunes Store Search API](https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/)');
|
||||
return message.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
const commando = require('discord.js-commando');
|
||||
const sounds = ['cat', 'pikachu', 'vader', 'doh', 'it\'s a trap', 'mario death', 'pokemon center', 'dun dun dun', 'spongebob', 'ugly barnacle', 'woo hoo', 'space', 'glados bird', 'airhorn', 'zelda chest', 'eat my shorts', 'no this is patrick', 'wumbo'];
|
||||
const paths = {
|
||||
"cat": "./sounds/cat.mp3",
|
||||
"pikachu": "./sounds/pikachu.mp3",
|
||||
"vader": "./sounds/vader.mp3",
|
||||
"doh": "./sounds/doh.mp3",
|
||||
"it's a trap": "./sounds/its-a-trap.mp3",
|
||||
"mario death": "./sounds/mario-death.mp3",
|
||||
"pokemon center": "./sounds/pokemon-center.mp3",
|
||||
"dun dun dun": "./sounds/dun-dun-dun.mp3",
|
||||
"spongebob": "./sounds/spongebob.mp3",
|
||||
"ugly barnacle": "./sounds/ugly-barnacle.mp3",
|
||||
"woo hoo": "./sounds/woohoo.mp3",
|
||||
"space": "./sounds/space.mp3",
|
||||
"glados bird": "./sounds/glados-bird.mp3",
|
||||
"airhorn": "./sounds/airhorn.mp3",
|
||||
"zelda chest": "./sounds/zelda-chest.mp3",
|
||||
"eat my shorts": "./sounds/eat-my-shorts.mp3",
|
||||
"no this is patrick": "./sounds/no-this-is-patrick.mp3",
|
||||
"wumbo": "./sounds/wumbo.mp3"
|
||||
};
|
||||
|
||||
module.exports = class SoundBoardCommand extends commando.Command {
|
||||
constructor(Client) {
|
||||
super(Client, {
|
||||
name: 'soundboard',
|
||||
aliases: [
|
||||
'sound',
|
||||
'play'
|
||||
],
|
||||
group: 'random',
|
||||
memberName: 'soundboard',
|
||||
description: 'Plays a sound in your voice channel. (;soundboard cat)',
|
||||
details: '**Sounds:** Cat, Pikachu, Vader, Doh, It\'s a Trap, Mario Death, Pokemon Center, Dun Dun Dun, Spongebob, Ugly Barnacle, Woo Hoo, Space, GLaDOS Bird, Airhorn, Zelda Chest, Eat my Shorts, No This is Patrick, Wumbo',
|
||||
examples: [';soundboard cat'],
|
||||
guildOnly: true,
|
||||
args: [{
|
||||
key: 'sound',
|
||||
prompt: 'What sound do you want me to play?',
|
||||
type: 'string',
|
||||
validate: sound => {
|
||||
if (sounds.some(soundArray => sound.toLowerCase() === soundArray)) {
|
||||
return true;
|
||||
}
|
||||
return 'Sound not found. Use `;help soundboard` to view a list of sounds.';
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'CONNECT', 'SPEAK', 'ADD_REACTIONS'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
const voiceChannel = message.member.voiceChannel;
|
||||
if (!voiceChannel) return message.say(`:x: Error! Please be in a voice channel first!`);
|
||||
const soundToPlay = args.sound.toLowerCase();
|
||||
const alreadyConnected = await this.client.voiceConnections.get(voiceChannel.guild.id);
|
||||
if (alreadyConnected) {
|
||||
if (alreadyConnected.channel.id === voiceChannel.id) return message.say(':x: Error! I am already playing a sound!');
|
||||
return message.say(':x: Error! I am already playing a sound!');
|
||||
}
|
||||
const connection = await voiceChannel.join();
|
||||
const stream = paths[soundToPlay];
|
||||
const dispatcher = connection.playStream(stream);
|
||||
message.react('🔊');
|
||||
dispatcher.on('end', () => {
|
||||
message.react('✅');
|
||||
return voiceChannel.leave();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -29,7 +29,6 @@
|
||||
<li><a href="https://github.com/piuccio/cowsay">cowsay</a></li>
|
||||
<li><a href="http://momentjs.com">moment</a></li>
|
||||
<li><a href="https://github.com/jsmreese/moment-duration-format">moment-duration-format</a></li>
|
||||
<li><a href="https://github.com/abalabahaha/opusscript">opusscript</a></li>
|
||||
<li><a href="https://github.com/ecto/morse">morse</a></li>
|
||||
<li><a href="https://cheerio.js.org/">cheerio</a></li>
|
||||
</ul>
|
||||
@@ -54,7 +53,7 @@
|
||||
<h2>Information</h2>
|
||||
<ul>
|
||||
<li><a href="https://discord.gg/fqQF8mc">Home Server</a></li>
|
||||
<li>Command Count: 115</li>
|
||||
<li>Command Count: 114</li>
|
||||
<li>Server Host: <a href="https://www.heroku.com/">Heroku</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
<li>Avatar Editing (RIP, Bob Ross, etc.)</li>
|
||||
<li>Make Strawpolls</li>
|
||||
<li>Meme Generator</li>
|
||||
<li>Soundboard</li>
|
||||
<li>Math</li>
|
||||
<li>Typing and Math Games</li>
|
||||
<li>Random Roasts and Compliments</li>
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
<li>Avatar Editing (RIP, Bob Ross, etc.)</li>
|
||||
<li>Make Strawpolls</li>
|
||||
<li>Meme Generator</li>
|
||||
<li>Soundboard</li>
|
||||
<li>Math</li>
|
||||
<li>Typing and Math Games</li>
|
||||
<li>Random Roasts and Compliments</li>
|
||||
@@ -78,7 +77,6 @@
|
||||
<li><a href="https://github.com/piuccio/cowsay">cowsay</a></li>
|
||||
<li><a href="http://momentjs.com">moment</a></li>
|
||||
<li><a href="https://github.com/jsmreese/moment-duration-format">moment-duration-format</a></li>
|
||||
<li><a href="https://github.com/abalabahaha/opusscript">opusscript</a></li>
|
||||
<li><a href="https://github.com/ecto/morse">morse</a></li>
|
||||
<li><a href="https://cheerio.js.org/">cheerio</a></li>
|
||||
</ul>
|
||||
@@ -104,7 +102,7 @@
|
||||
<h2>Information</h2>
|
||||
<ul>
|
||||
<li><a href="https://discord.gg/fqQF8mc">Home Server</a></li>
|
||||
<li>Command Count: 115</li>
|
||||
<li>Command Count: 114</li>
|
||||
<li>Server Host: <a href="https://www.heroku.com/">Heroku</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
"moment": "^2.18.1",
|
||||
"moment-duration-format": "^1.3.0",
|
||||
"morse": "^0.1.0",
|
||||
"opusscript": "0.0.3",
|
||||
"pirate-speak": "^1.0.1",
|
||||
"roman-numeral-converter-mmxvi": "^1.0.5",
|
||||
"string-to-binary": "^0.1.2",
|
||||
|
||||
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.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user