• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..05-Feb-2021-

README.mdH A D05-Feb-20211.3 KiB5235

main.goH A D05-Feb-20215 KiB216131

README.md

1<img align="right" src="http://bwmarrin.github.io/discordgo/img/discordgo.png">
2
3## DiscordGo Airhorn Example
4
5This example demonstrates how to utilize DiscordGo to listen for an !airhorn
6command in a channel and then play a sound to that user's current voice channel.
7
8**Join [Discord Gophers](https://discord.gg/0f1SbxBZjYoCtNPP)
9Discord chat channel for support.**
10
11### Build
12
13This assumes you already have a working Go environment setup and that
14DiscordGo is correctly installed on your system.
15
16From within the airhorn example folder, run the below command to compile the
17example.
18
19```sh
20go build
21```
22
23### Usage
24
25```
26Usage of ./airhorn:
27  -t string
28        Bot Token
29```
30
31The below example shows how to start the bot from the airhorn example folder.
32
33```sh
34./airhorn -t YOUR_BOT_TOKEN
35```
36
37### Creating sounds
38
39Airhorn bot uses [DCA](https://github.com/bwmarrin/dca) files, which are
40pre-computed files that are easy to send to Discord.
41
42If you would like to create your own DCA files, please use:
43* [dca-rs](https://github.com/nstafie/dca-rs)
44
45See the below example of creating a DCA file from a WAV file.  This also works
46with MP3, FLAC, and many other file formats. Of course, you will need to
47[install](https://github.com/nstafie/dca-rs#installation) dca-rs first :)
48
49```sh
50./dca-rs -i <input wav file> --raw > <output file>
51```
52