crate aecafc53fc
All checks were successful
Garfbot CI/CD Deployment / Deploy (push) Successful in 17s
fix garfbot help
2025-06-06 01:22:29 -05:00
2025-06-06 00:41:52 -05:00
2025-06-03 20:33:55 -05:00
2025-05-25 04:11:57 -05:00
2024-10-21 01:51:43 -05:00
2023-11-19 20:30:49 -06:00
2025-06-06 01:22:29 -05:00
2024-10-21 01:39:42 -05:00
2023-11-19 16:57:16 -06:00
2024-10-21 01:39:42 -05:00
2025-06-06 01:22:29 -05:00
2025-05-25 04:11:57 -05:00

Who is GarfBot?

garfield

GarfBot is a discord bot that uses OpenAI's generative pre-trained models to produce text and images for your personal entertainment and companionship.
There are a few ways you can interact with him on discord, either in a public server or by direct message:

hey garfield {prompt}
Responds with text.

garfpic {prompt}
Responds with an image.

garfping {target}
Responds with iputils-ping result from target.

garfdns {target}
Responds with dns lookup result from target.

garfhack {target}
Responds with nmap scan result from target.

garfshop {item} {zip}
Responds with 10 grocery {item}s from the nearest Kroger location, listed from least to most expensive.

garfwiki {query}
Garfbot looks up a wikipedia article and will summarize it for you.

garfqr {text}
Create a QR code for any string up to 1000 characters.

garfbot response {add} {trigger} {response}
Add a GarfBot auto response for your server. Use "quotes" if you like.

garfbot response {remove} {trigger}
Remove a GarfBot auto response for your server.

garfbot response {list}
List current GarfBot auto responses for your server.

garfbot help
Show a list of these commands.

Installation

To get started, clone this repo and create a config file.

$ git clone https://git.crate.zip/crate/garfbot.git && cd garfbot/ && nano config.py

Add your various API tokens:

GARFBOT_TOKEN = "Discord API token"
OPENAI_TOKEN = "OpenAI API token"

I recommend building a docker image using the included DockerFile as a template.
Run the container binding /usr/src/app to GarfBot's CWD:

$ docker build -t garfbot .
$ docker run -d --restart always -v $PWD:/usr/src/app --name garfbot garfbot

In case you'd rather not do it manually, a garfbot.tf file has been included to launch GarfBot and his friends' containers.

If you prefer to install dependencies on you own host and run as a systemd service:

$ sudo nano /etc/systemd/system/garfbot.service

Replace $USER with your username:

[Unit]
Description=garfbot
After=multi-user.target

[Service]
Type=simple
Restart=always
User=$USER
WorkingDirectory=/home/$USER/garfbot
ExecStart=/usr/bin/python garfbot.py

[Install]
WantedBy=multi-user.target

And finally:

$ sudo systemctl daemon-reload
$ sudo systemctl enable garfbot
$ sudo systemctl start garfbot
Description
No description provided
Readme 218 KiB
2024-11-08 21:19:12 +00:00
Languages
Python 96.6%
HCL 1.9%
Dockerfile 1.2%
Shell 0.3%