2023-11-17 19:37:51 +00:00
GarfBot is a discord bot that uses openai generative pre-trained AI models to produce text and images for your personal entertainment and companionship.
2023-11-20 02:53:41 +00:00
2023-11-17 19:46:39 +00:00
JonBot is his owner and MoneyBot is his eccentric friend who plays the classic F2P video game Planetside 2.
2023-11-17 19:37:51 +00:00
To interact: (not case-sensitive)
`"hey garfield"`
responds with text.
`"garfpic"`
responds with image.
2023-11-20 02:53:41 +00:00
`"hey jon"`
responds with text.
`"hey money"`
responds with text.
2023-11-17 19:37:51 +00:00
To get started, clone this repo and create a `config.py` file in GarfBot's root directory. Open your favorite text editor or IDE and add your various API tokens as such:
```python
2023-11-17 23:59:34 +00:00
GARFBOT_TOKEN = "token"
JONBOT_TOKEN = "token"
MONEYBOT_TOKEN = "token"
OPENAI_TOKEN = "token"
GIF_TOKEN = "token"
2023-11-17 19:37:51 +00:00
```
2023-11-17 23:59:34 +00:00
If you want to configure a more secure setup, go ahead.
2023-11-17 22:04:50 +00:00
2023-11-17 23:59:34 +00:00
Next, I recommend building a docker image for each bot using the included DockerFile as a template. Run each container binding /usr/src/app to GarfBot's CWD.
2023-11-20 02:53:41 +00:00
2023-11-20 02:32:05 +00:00
A terraform file has been included to launch all three containers, or you can do it manually.
2023-11-17 22:04:50 +00:00
Example:
```console
2023-11-17 23:59:34 +00:00
crate@raspberrypi:~/garfbot $ docker build -t garfbot .
crate@raspberrypi:~/garfbot $ docker run -d --restart always -v $PWD:/usr/src/app --name garfbot garfbot
```
2023-11-20 02:53:41 +00:00
Or if you prefer to install dependencies (from requirements.txt) on you own host and run as a systemd service:
2023-11-17 23:59:34 +00:00
```console
[Unit]
Description=garfbot
After=multi-user.target
[Service]
Type=simple
Restart=always
User=pi
WorkingDirectory=/home/crate/garfbot
ExecStart=/usr/bin/python ./garfbot.py
[Install]
WantedBy=multi-user.target
2023-11-20 02:32:05 +00:00
```