Updated airhorn readme file

This commit is contained in:
Bruce 2017-04-13 14:54:34 +00:00
parent f05856893b
commit 2b282540ef

View file

@ -1,19 +1,23 @@
<img align="right" src="http://bwmarrin.github.io/discordgo/img/discordgo.png"> <img align="right" src="http://bwmarrin.github.io/discordgo/img/discordgo.png">
Airhorn Example
==== ## DiscordGo Airhorn Example
This example demonstrates how to utilize DiscordGo to listen to an !airhorn This example demonstrates how to utilize DiscordGo to listen to an !airhorn
command in a channel and play a sound to that users current voice channel. command in a channel and play a sound to that user's current voice channel.
**Join [Discord Gophers](https://discord.gg/0f1SbxBZjYoCtNPP)
Discord chat channel for support.**
### Build ### Build
This assumes you already have a working Go environment setup and that This assumes you already have a working Go environment setup and that
DiscordGo is correctly installed on your system. DiscordGo is correctly installed on your system.
From within the airhorn example folder, run the below command to compile the
example.
```sh ```sh
go install github.com/bwmarrin/discordgo/examples/airhorn go build
cd $GOPATH/bin
cp ../src/github.com/bwmarrin/discordgo/examples/airhorn/airhorn.dca .
``` ```
### Usage ### Usage
@ -24,7 +28,7 @@ Usage of ./airhorn:
Bot Token Bot Token
``` ```
The below example shows how to start the bot. The below example shows how to start the bot from the airhorn example folder.
```sh ```sh
./airhorn -t YOUR_BOT_TOKEN ./airhorn -t YOUR_BOT_TOKEN
@ -32,11 +36,15 @@ The below example shows how to start the bot.
### Creating sounds ### Creating sounds
Airhorn bot uses DCA files that are pre-computed files that are easy to send to Discord. Airhorn bot uses [DCA](https://github.com/bwmarrin/dca) files, which are
pre-computed files that are easy to send to Discord.
If you would like to create your own DCA files, please use either: If you would like to create your own DCA files, please use:
* [dca-rs](https://github.com/nstafie/dca-rs) * [dca-rs](https://github.com/nstafie/dca-rs)
* [dca](https://github.com/bwmarrin/dca/tree/master/cmd/dca)
See the below example of creating a DCA file from a WAV file. This also works
with MP3, FLAC, and many other file formats. Of course, you will need to
[install](https://github.com/nstafie/dca-rs#installation) dca-rs first :)
```sh ```sh
./dca-rs -i <input wav file> --raw > <output file> ./dca-rs -i <input wav file> --raw > <output file>