Skip to content

themattrix/discord-caravan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Caravan Bot

A Discord bot 🤖 for managing Pokémon GO raid caravans.

Status: Useful!

Build Status

Usage

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.*].

Docker Usage

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

gyms.json

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.

Contributing

Create a bot and server for testing:

  1. Create a "Caravan" app in discord.

  2. In the app, create a "Caravan Bot" bot.

  3. Create a personal Discord server just for bot testing.

  4. 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:

  1. Install Python 3.7.

  2. Clone this repository (or your own fork of it).

  3. Install project dependencies with pipenv

     pipenv install --dev
    

Testing

  1. Install tox in Python 3.7.
  2. Run tox from the root of the repo. This will run the same checks that Travis CI does on pull requests.

Design Goals

  • similar interface to Meowth 2.0
  • bot state should be stored purely in Discord

Roadmap

  • 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

Maybe

  • 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

About

A Discord bot 🤖 for managing Pokémon GO raid caravans.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published