|
@@ -1,19 +1,23 @@
|
|
|
<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
|
|
|
-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
|
|
|
|
|
|
This assumes you already have a working Go environment setup and that
|
|
|
DiscordGo is correctly installed on your system.
|
|
|
|
|
|
+From within the airhorn example folder, run the below command to compile the
|
|
|
+example.
|
|
|
+
|
|
|
```sh
|
|
|
-go install github.com/bwmarrin/discordgo/examples/airhorn
|
|
|
-cd $GOPATH/bin
|
|
|
-cp ../src/github.com/bwmarrin/discordgo/examples/airhorn/airhorn.dca .
|
|
|
+go build
|
|
|
```
|
|
|
|
|
|
### Usage
|
|
@@ -24,7 +28,7 @@ Usage of ./airhorn:
|
|
|
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
|
|
|
./airhorn -t YOUR_BOT_TOKEN
|
|
@@ -32,11 +36,15 @@ The below example shows how to start the bot.
|
|
|
|
|
|
### 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](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
|
|
|
./dca-rs -i <input wav file> --raw > <output file>
|