mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Airhorn, Voice Group, Cow sound
This commit is contained in:
@@ -24,6 +24,7 @@ client.registry
|
|||||||
['events', 'Events'],
|
['events', 'Events'],
|
||||||
['search', 'Search'],
|
['search', 'Search'],
|
||||||
['games', 'Games'],
|
['games', 'Games'],
|
||||||
|
['voice', 'Voice Channel'],
|
||||||
['image-edit', 'Image Manipulation'],
|
['image-edit', 'Image Manipulation'],
|
||||||
['avatar-edit', 'Avatar Manipulation'],
|
['avatar-edit', 'Avatar Manipulation'],
|
||||||
['text-edit', 'Text Manipulation'],
|
['text-edit', 'Text Manipulation'],
|
||||||
|
|||||||
@@ -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,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"airhorn": "airhorn.mp3",
|
|
||||||
"alarm": "alarm.mp3",
|
"alarm": "alarm.mp3",
|
||||||
"ayaya": "ayaya.mp3",
|
"ayaya": "ayaya.mp3",
|
||||||
"car crash": "car-crash.mp3",
|
"car crash": "car-crash.mp3",
|
||||||
"cat": "cat.mp3",
|
"cat": "cat.mp3",
|
||||||
|
"cow": "cow.mp3",
|
||||||
"doh": "doh.mp3",
|
"doh": "doh.mp3",
|
||||||
"dun-dun-dun": "dun-dun-dun.mp3",
|
"dun-dun-dun": "dun-dun-dun.mp3",
|
||||||
"eat my shorts": "eat-my-shorts.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.
@@ -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, {
|
super(client, {
|
||||||
name: 'dec-talk',
|
name: 'dec-talk',
|
||||||
aliases: ['moon-base-alpha', 'text-to-speech', 'tts'],
|
aliases: ['moon-base-alpha', 'text-to-speech', 'tts'],
|
||||||
group: 'text-edit',
|
group: 'voice',
|
||||||
memberName: 'dec-talk',
|
memberName: 'dec-talk',
|
||||||
description: 'The world\'s best Text-to-Speech.',
|
description: 'The world\'s best Text-to-Speech.',
|
||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
@@ -7,8 +7,8 @@ module.exports = class SoundboardCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'soundboard',
|
name: 'soundboard',
|
||||||
aliases: ['sound', 'foley'],
|
aliases: ['sound'],
|
||||||
group: 'other',
|
group: 'voice',
|
||||||
memberName: 'soundboard',
|
memberName: 'soundboard',
|
||||||
description: 'Plays a sound in your voice channel.',
|
description: 'Plays a sound in your voice channel.',
|
||||||
details: `**Sounds**: ${Object.keys(sounds).join(', ')}`,
|
details: `**Sounds**: ${Object.keys(sounds).join(', ')}`,
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "66.4.4",
|
"version": "66.5.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