mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 02:15:10 +02:00
Soundboard Command is Back
This commit is contained in:
@@ -224,7 +224,7 @@ in the appropriate channel's topic to use it.
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
Total: 444
|
Total: 445
|
||||||
|
|
||||||
### Utility:
|
### Utility:
|
||||||
|
|
||||||
@@ -691,6 +691,7 @@ Total: 444
|
|||||||
* **dec-talk:** The world's best Text-to-Speech.
|
* **dec-talk:** The world's best Text-to-Speech.
|
||||||
* **join:** Joins your voice channel.
|
* **join:** Joins your voice channel.
|
||||||
* **leave:** Leaves the current voice channel.
|
* **leave:** Leaves the current voice channel.
|
||||||
|
* **soundboard:** Plays a sound in a voice channel.
|
||||||
|
|
||||||
### Phone:
|
### Phone:
|
||||||
|
|
||||||
@@ -768,6 +769,7 @@ here.
|
|||||||
|
|
||||||
- [07th Expansion](http://07th-expansion.net/)
|
- [07th Expansion](http://07th-expansion.net/)
|
||||||
* box-choosing (Original Game)
|
* box-choosing (Original Game)
|
||||||
|
* soundboard (Nipah Sound)
|
||||||
- [20th Century Fox](https://www.foxmovies.com/)
|
- [20th Century Fox](https://www.foxmovies.com/)
|
||||||
* bart-chalkboard ([Image, Original "The Simpsons" Show](http://www.simpsonsworld.com/))
|
* bart-chalkboard ([Image, Original "The Simpsons" Show](http://www.simpsonsworld.com/))
|
||||||
* eat-pant ([Original "The Simpsons" Show](http://www.simpsonsworld.com/))
|
* eat-pant ([Original "The Simpsons" Show](http://www.simpsonsworld.com/))
|
||||||
@@ -1230,6 +1232,7 @@ here.
|
|||||||
* hat (Ash Hat Original Anime)
|
* hat (Ash Hat Original Anime)
|
||||||
* pokedex (Images, Original Game)
|
* pokedex (Images, Original Game)
|
||||||
* pokemon-fusion (Original Game)
|
* pokemon-fusion (Original Game)
|
||||||
|
* soundboard (Pikachu Sound)
|
||||||
* whos-that-pokemon (Images, Original Game)
|
* whos-that-pokemon (Images, Original Game)
|
||||||
* wynaut (Image, Original Anime)
|
* wynaut (Image, Original Anime)
|
||||||
- [Pottermore](https://my.pottermore.com/sorting)
|
- [Pottermore](https://my.pottermore.com/sorting)
|
||||||
@@ -1249,6 +1252,8 @@ here.
|
|||||||
* cat (API)
|
* cat (API)
|
||||||
- [RandomFox](https://randomfox.ca/)
|
- [RandomFox](https://randomfox.ca/)
|
||||||
* fox (API)
|
* fox (API)
|
||||||
|
- [Re:ZERO -Starting Life in Another World-](http://re-zero-anime.jp/)
|
||||||
|
* soundboard (Subaru Ringtone Sound)
|
||||||
- [Recipe Puppy](http://www.recipepuppy.com/)
|
- [Recipe Puppy](http://www.recipepuppy.com/)
|
||||||
* recipe ([API](http://www.recipepuppy.com/about/api/))
|
* recipe ([API](http://www.recipepuppy.com/about/api/))
|
||||||
- [RedBubble - Akbar Mna](https://www.redbubble.com/en/people/akbarmna/shop)
|
- [RedBubble - Akbar Mna](https://www.redbubble.com/en/people/akbarmna/shop)
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[
|
||||||
|
"nipah",
|
||||||
|
"pikachu",
|
||||||
|
"subaru ringtone"
|
||||||
|
]
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,61 @@
|
|||||||
|
const Command = require('../../structures/Command');
|
||||||
|
const path = require('path');
|
||||||
|
const sounds = require('../../assets/json/soundboard');
|
||||||
|
|
||||||
|
module.exports = class SoundboardCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'soundboard',
|
||||||
|
aliases: ['sound'],
|
||||||
|
group: 'voice',
|
||||||
|
memberName: 'soundboard',
|
||||||
|
description: 'Plays a sound in a voice channel.',
|
||||||
|
guildOnly: true,
|
||||||
|
throttling: {
|
||||||
|
usages: 1,
|
||||||
|
duration: 10
|
||||||
|
},
|
||||||
|
userPermissions: ['CONNECT', 'SPEAK'],
|
||||||
|
credit: [
|
||||||
|
{
|
||||||
|
name: 'Pokémon',
|
||||||
|
url: 'https://www.pokemon.com/us/',
|
||||||
|
reason: 'Pikachu Sound'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '07th Expansion',
|
||||||
|
url: 'http://07th-expansion.net/',
|
||||||
|
reason: 'Nipah Sound'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Re:ZERO -Starting Life in Another World-',
|
||||||
|
url: 'http://re-zero-anime.jp/',
|
||||||
|
reason: 'Subaru Ringtone Sound'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
key: 'sound',
|
||||||
|
prompt: `What sound do you want to play? Either ${list(sounds, 'or')}.`,
|
||||||
|
type: 'string',
|
||||||
|
default: () => `${sounds[Math.floor(Math.random() * sounds.length)]}.mp3`,
|
||||||
|
oneOf: sounds,
|
||||||
|
parse: sound => `${sound.toLowerCase()}.mp3`
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(msg, { sound }) {
|
||||||
|
const inGuild = msg.guild ? undefined : null;
|
||||||
|
const connection = this.client.voice.connections.get(msg.guild.id);
|
||||||
|
if (!connection) {
|
||||||
|
return msg.reply(`I am not in a voice channel. Use ${msg.anyUsage('join', inGuild, inGuild)} to fix that!`);
|
||||||
|
}
|
||||||
|
connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'soundboard', sound));
|
||||||
|
if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {
|
||||||
|
await msg.react('🔉');
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "114.29.6",
|
"version": "114.30.0",
|
||||||
"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