mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Airhorn Command
This commit is contained in:
@@ -132,7 +132,7 @@ in the appropriate channel's topic to use it.
|
||||
|
||||
## Commands
|
||||
|
||||
Total: 410
|
||||
Total: 411
|
||||
|
||||
### Utility:
|
||||
|
||||
@@ -567,6 +567,7 @@ Total: 410
|
||||
|
||||
### Other:
|
||||
|
||||
* **airhorn:** Plays an airhorn sound in a voice channel.
|
||||
* **cleverbot:** Talk to Cleverbot. (Owner-Only)
|
||||
* **phone-book:** Looks up phone-enabled servers.
|
||||
* **phone:** Starts a phone call with a random server.
|
||||
@@ -733,6 +734,8 @@ here.
|
||||
* owo (Code)
|
||||
- [Digital Equipment Corporation](http://gordonbell.azurewebsites.net/digital/timeline/tmlnhome.htm)
|
||||
* dec-talk (Original DECTalk Software)
|
||||
- [Discord](https://discord.com/)
|
||||
* airhorn ([Airhorn Sounds](https://github.com/discord/airhornbot/tree/master/audio))
|
||||
- [Discord Status Button](https://discord.c99.nl/)
|
||||
* status-button (API)
|
||||
- [Disney](https://www.disney.com/)
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
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,48 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const path = require('path');
|
||||
const sounds = require('../../assets/json/airhorn');
|
||||
|
||||
module.exports = class AirhornCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'airhorn',
|
||||
group: 'other',
|
||||
memberName: 'airhorn',
|
||||
description: 'Plays an airhorn sound in a voice channel.',
|
||||
guildOnly: true,
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 10
|
||||
},
|
||||
credit: [
|
||||
{
|
||||
name: 'Discord',
|
||||
url: 'https://discord.com/',
|
||||
reason: 'Airhorn Sounds',
|
||||
reasonURL: 'https://github.com/discord/airhornbot/tree/master/audio'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const voiceChannel = msg.member.voice.channel;
|
||||
if (!voiceChannel) return msg.say('Please enter a voice channel first.');
|
||||
if (!voiceChannel.permissionsFor(this.client.user).has(['CONNECT', 'SPEAK'])) {
|
||||
return msg.say('Missing the "Connect" or "Speak" permission for the voice channel.');
|
||||
}
|
||||
if (!voiceChannel.joinable) return msg.say('Your voice channel is not joinable.');
|
||||
if (this.client.voice.connections.has(voiceChannel.guild.id)) return msg.say('I am already playing a sound.');
|
||||
try {
|
||||
const connection = await voiceChannel.join();
|
||||
const airhorn = sounds[Math.floor(Math.random() * sounds.length)];
|
||||
const dispatcher = connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'airhorn', airhorn));
|
||||
dispatcher.once('finish', () => voiceChannel.leave());
|
||||
dispatcher.once('error', () => voiceChannel.leave());
|
||||
return null;
|
||||
} catch (err) {
|
||||
voiceChannel.leave();
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "114.3.0",
|
||||
"version": "114.4.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user