Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/douglascdev/monkebot

Prototype twitch bot made in Go
https://github.com/douglascdev/monkebot

bot buttsbot contributions-welcome go golang good-first-issue good-first-pr twitch

Last synced: 19 days ago
JSON representation

Prototype twitch bot made in Go

Awesome Lists containing this project

README

        

# monkebot

monkebot is a prototype twitch bot made in Go. Type `\join` in the [bot's channel](https://www.twitch.tv/hashtablebot/chat) to join it to your chat.

## Commands

Check out [this link](https://douglascdev.github.io/monkebot)

## Contributing

Fork the repository on github:

![image](https://github.com/user-attachments/assets/dcee4b6b-45f8-4458-ac4b-6962c9eea181)

Clone your fork using `git` and create a new branch for your changes:
```bash
git clone https://github.com//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](https://github.com/douglascdev/monkebot/pulls).

## Running an instance
Requires:
- [Go](https://go.dev/dl/)
- [Git](https://git-scm.com/downloads)

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](https://github.com/douglascdev/monkebot/releases) with `./monkebot-linux` (on linux, remember to `chmod +x monkebot-linux` first).
### Token
You may use a website like [twitch token generator](https://twitchtokengenerator.com/) to get a token for your bot. You'll also need a client id by creating an application in the [twitch dev console](https://dev.twitch.tv/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:
```bash
➜ 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:
```bash
➜ 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
```