A Discord bot 🤖 for managing Pokémon GO raid caravans.
Status: Useful!
Set your secret discord bot token, then run caravan_bot
via pipenv.
export DISCORD_BOT_TOKEN=YOUR_SECRET_TOKEN
pipenv run python -m caravan_bot <ARGS>
All options:
caravan_bot --gyms=JSON [--server-filter=REGEX] [--channel-filter=REGEX]
caravan_bot (-h | --help)
caravan_bot --version
Options:
-h --help Show this screen.
--version Show version.
--gyms=JSON JSON file containing gyms names, coordinates, and
optional aliases.
--server-filter=REGEX Restrict bot to servers matching this pattern
[default: .*].
--channel-filter=REGEX Restrict bot to channels matching this pattern
[default: .*caravan.*].
First, ensure that you have a gyms.json
file in the appropriate format at the root of the project. Then:
export DISCORD_BOT_TOKEN=YOUR_SECRET_TOKEN
docker-compose run -e DISCORD_BOT_TOKEN="${DISCORD_BOT_TOKEN}" --rm caravan_bot <args>
Where <args>
are the same, minus the --gyms
option since that's already mounted into the container.
If you change the gyms, restart the container. If you change the code, restart the container after running:
docker-compose build
Here's an example gyms.json
:
{
"Gym Name 1": {
"location": "latitude,longitude"
},
"Gym Name 2": {
"location": "latitude,longitude",
"aliases": [
"Alias A",
"Alias B"
]
}
}
The gym names should be the "official" in-game Pokémon GO Gym names. Aliases are optional, but are useful in situations where the gym is known in the community by other names.
The latitude,longitude
pairs can be grabbed from Google Maps or another mapping service.
There are also websites dedicated to mapping gym locations.
Create a bot and server for testing:
-
Create a "Caravan" app in discord.
-
In the app, create a "Caravan Bot" bot.
-
Create a personal Discord server just for bot testing.
-
Paste this link into your browser, with your app's client ID in place of
YOUR_CLIENT_ID
:https://discordapp.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=268528640&scope=bot
Authorize the bot to access your bot testing server.
Set up your development environment:
-
Install Python 3.7.
-
Clone this repository (or your own fork of it).
-
Install project dependencies with pipenv
pipenv install --dev
- Install tox in Python 3.7.
- Run
tox
from the root of the repo. This will run the same checks that Travis CI does on pull requests.
- similar interface to Meowth 2.0
- bot state should be stored purely in Discord
- skeleton Discord bot project
- at bot startup, pin a welcome message to each caravan channel
- on caravan channel creation, pin a welcome message to the new channel
- in response to posted itinerary, update pinned message with Google Maps route
- in response to posted itinerary, update pinned message with list of stops
- switch pinned message to "embeds" for better formatting
- allow admins to delegate caravan leaders
- restrict route setting to leaders
- introduce caravan modes: allow leaders to start/stop caravan
- allow leaders to advance caravan (
!next
and!skip [reason]
) - allow leaders to add a new next stop while in active mode
- cache pins
- add help
- disallow duplicate stops
-
!remove
/!delete
command to skip gym by name - allow anyone to
!join
the caravan, optionally with guests - allow members to
!leave
the caravan - warn when the attendance nears 20 for any individual gym
- lots of unit tests
- Docker Compose runner
- handle members who have left (or were banned from) the server
- CI: linting, type-checking, test running, and PR integration
-
!prev
command for when you accidentally!next
- take gym distance into consideration when ranking gym name matches
- allow messaging of all caravan members (
!notify
) - when the caravan is active, allow members to signal
!here
for current stop (this applies until!leave
) - import gym JSON information into "gym channel" at start-up
- allow gym channel users to supply new gyms, modify gyms, and delete gyms
- allow gym channel users to supply gym aliases
- allow gym channel users to supply helpful hints per gym (e.g., parking info)
-
!kick
command - handle pins containing unrecognized gym names
- allow caravan members to restrict their attendance to partial routes
- allow leaders to register start/stop times
- notify members one hour prior to the caravan starting of the start time and starting location
- automatically start/stop the caravan at the expected times