A fun discord pokemon bot
  • Go 87.1%
  • Jinja 11.8%
  • Dockerfile 0.8%
  • Shell 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-26 20:48:12 +00:00
cmd/pokebot Adapt to new generic server name 2026-09-26 16:43:47 -04:00
k8s Add quotes around int rendered value 2025-02-21 07:52:15 -05:00
pkg Adapt to new generic server name 2026-09-26 16:43:47 -04:00
.gitignore Add tests and test helper script 2024-07-02 22:33:35 -04:00
.gitlab-ci.yml Fix image repo to work with new templates 2025-11-11 08:13:38 -05:00
Dockerfile Use standard golang package structure 2026-08-27 16:19:44 -04:00
go.mod Adapt to new generic server name 2026-09-26 16:43:47 -04:00
go.sum Adapt to new generic server name 2026-09-26 16:43:47 -04:00
README.md Adapt project to new public-repos structure 2026-08-26 12:50:18 -04:00
run_tests.sh Add tests and test helper script 2024-07-02 22:33:35 -04:00

Pokemon Bot

Coverage

PokeBot is a pokemon discord bot that posts a pokemon in a specified channel 2 times a day. To catch the pokemon that has been posted, users can type !catch before pokebot posts the next pokemon. Users can type !list to see all pokemon they have caught so far. Posted pokemon are either the beginning of an evolution line or have no known evolutions. To evolve a pokemon, first select the pokemon by typing !choose <pokemon name or id> where the ID is number of the pokemon in the national pokedex. Next, typing messages in any channel in the server that's not the bot channel evolves the pokemon. You cannot DM pokebot to add to the message evolution counter.

Running Pokebot in Your Server

I currently don't have any plans to allow this bot to run in any server other than my own. If you want to use pokebot in your server, raise an issue on this Gitlab project to start the conversation with me.

Otherwise, if you want to generate your own discord bot token, you can add pokebot to your own server and run it yourself.

The Platform

Pokebot runs in a kubernetes environment because it relies on kubernetes configmaps to store user data. You can spin up your own kubernetes cluster across nodes you own on prem or in a cloud, but the easiest way to get started and test pokebot is by using a single node kubernetes platform like microk8s or minikube.

Build the Docker Image

Use docker or your desired container runtime to build pokebot and publish it to a docker repository that you own. If you don't want to publish pokebot, you can use mine at docker.io/highsaltlevels/pokebot:latest.

docker build -t <image name> .

Running Pokebot

Required Environment Variables

  • Create a discord bot and generate an OAUTH2 token for it.
  • Get the channel ID of the discord channel you want pokebot to post in.
    • Right click on the desired channel in discord and click Copy Link.
    • Paste the link somewhere. The last string of numbers in the URL is the channel ID.

Running Pokebot for Development

If you're running microk8s or minikube, ensure you have a valid kubeconfig at ${HOME}/.kube/config, export the bot token and channel ID as environment variables, and run pokebot directly using go.

export BOT_TOKEN=<YOUR BOT TOKEN>
export CHANNEL_ID=<YOUR DESIRED CHANNEL ID>
go run pokebot.go

Deploying Pokebot to Kubernetes

Inspect the kubernetes manifests in the k8s directory of this project. Replace the bot token and channel id placeholders with your bot token and channel id. If you published your own docker image, replace the image stanza in the deployment spec with your image.

sed -i 's/__BOT_TOKEN_PLACEHOLDER__/<YOUR BOT TOKEN>/g' k8s/pokebot.yaml
sed -i 's/__CHANNEL_ID_PLACEHOLDER__/<YOUR DESIRED CHANNEL_ID>/g' k8s/pokebot.yaml
kubectl create ns pokebot
kubectl -n pokebot apply -f k8s/pokebot.yaml