Skip to content

douglascdev/monkebot

Repository files navigation

monkebot

monkebot is a prototype twitch bot made in Go. Type \join in the bot's channel to join it to your chat.

Commands

Check out this link

Contributing

Fork the repository on github:

image

Clone your fork using git and create a new branch for your changes:

git clone https://github.com/<your username>/monkebot
cd monkebot
git checkout -b my-improvement-on-x-y-z

Check the next section for instructions on how to test the bot locally.

After making your changes, commit and push them:

git add changed-file.go
git commit -m "Changed x, improved z"
git push origin my-improvement-on-x-y-z

Then make a pull request.

Running an instance

Requires:

The bot takes arguments using CLI arguments, either using go run main.go to run straigth from source code or the binary in the releases section with ./monkebot-linux (on linux, remember to chmod +x monkebot-linux first).

Token

You may use a website like twitch token generator to get a token for your bot. You'll also need a client id by creating an application in the twitch dev console. These will be placed in the bot's config file as specified in the following section.

Config

The bot loads configurations from a json file. A template is created for you if the config file you specify doesn't exist yet:

➜  monkebot git:(main) go run main.go -cfg config.json
2024-10-01 10:00:23 WRN config file does not exist, creating from template path=config.json
2024-10-01 10:00:23 INF template created successfully, please edit the file and run the bot again path=config.json

After that, edit the config file using a text editor and add your settings, then run it again. If a valid config file was provided, the bot will run and an sqlite3 file will be created in the path specified in the config file containing the database:

➜  monkebot git:(main) go run main.go -cfg config.json
2024-10-01 10:01:36 INF connected to Twitch login=hashtablebot
2024-10-01 10:01:36 INF successfully joined saved channels channels=["hash_table"]
2024-10-01 10:01:36 INF joined channel channel=hash_table