mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
Improve soundboard and dec-talk
This commit is contained in:
@@ -17,15 +17,14 @@ module.exports = class SoundboardCommand extends Command {
|
|||||||
usages: 1,
|
usages: 1,
|
||||||
duration: 10
|
duration: 10
|
||||||
},
|
},
|
||||||
|
userPermissions: ['CONNECT', 'SPEAK'],
|
||||||
|
clientPermissions: ['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'],
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'sound',
|
key: 'sound',
|
||||||
prompt: `What sound would you like to play? Either ${list(Object.keys(sounds), 'or')}.`,
|
prompt: `What sound would you like to play? Either ${list(Object.keys(sounds), 'or')}.`,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
validate: sound => {
|
oneOf: Object.keys(sounds),
|
||||||
if (sounds[sound.toLowerCase()]) return true;
|
|
||||||
return `Invalid sound, please enter either ${list(Object.keys(sounds), 'or')}.`;
|
|
||||||
},
|
|
||||||
parse: sound => sound.toLowerCase()
|
parse: sound => sound.toLowerCase()
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -43,6 +42,7 @@ module.exports = class SoundboardCommand extends Command {
|
|||||||
try {
|
try {
|
||||||
const connection = await voiceChannel.join();
|
const connection = await voiceChannel.join();
|
||||||
const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', sounds[sound]));
|
const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', sounds[sound]));
|
||||||
|
await msg.react('🔉');
|
||||||
dispatcher.once('finish', () => voiceChannel.leave());
|
dispatcher.once('finish', () => voiceChannel.leave());
|
||||||
dispatcher.once('error', () => voiceChannel.leave());
|
dispatcher.once('error', () => voiceChannel.leave());
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "95.1.0",
|
"version": "95.1.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