Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 05-Feb-2021 | - | ||||
README.md | H A D | 05-Feb-2021 | 1.3 KiB | 52 | 35 | |
main.go | H A D | 05-Feb-2021 | 5 KiB | 216 | 131 |
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