This is just a Golang bot quickly thrown together which connects to the Telegram Bot API, waits for messages with specific words to be sent as messages and replies to them with the corresponding audio file.
Make sure you have a standard Go building environment set up (GOPATH
should be set up etc.).
Download main.go, make sure dependencies are available (go get -v -d
) and then build with go build -v
.
Create a config file config.yml
like this one in the working directory:
telegram:
# Insert your bot token here
token: 012345678:ABCDEFG...
triggers:
# This will make the bot respond to the word "pew" by posting the audio file at sounds/pew.ogg
pew: sounds/pew.ogg
# You can append other triggers similarly here.
- Viper is used for configuration management (will theoretically load configuration from environment variables or system directories as well)
- telegram-bot-api for communication with the Telegram Bot API.