Skip to content

Apollonaut13/r2-d7

 
 

Repository files navigation

R2-D7

A bot for xwingtmg.slack.com.

Supports Slack and Discord!

Add to Slack

Add to Discord

Features

Detects links to lists

Card lookup via [[]] queries

  • [[:t65xwing:luke]] will trigger a response with Luke Skywalker's pilot details
  • [[luke]] will trigger a response letting you choose between the Pilot and the Gunner cards.
  • [[marksmanship]] will trigger a response with the Marksmanship card's details
  • [[fang]] will show the Fang Fighter ship chassis information (stats, maneuvers, ship ability), and list the pilots that exist for that ship.
  • Try looking up [[hellothere]] or [[squid]] ;)

Card Image Lookup via {{}} queries

Basic dice rolls with stats from http://gateofstorms.net/2/multi/

To add the icons:

Written in Python. (Requires version 3.6 or later)

Uses card data from guidokessels/xwing-data2.

Required Permissions

Slack

  • View information about a user’s identity,
  • Add the ability for people to direct message or mention @r2-d7
  • Add shortcuts and/or slash commands that people can use

Discord

  • Text channel permissions:
    • View Channels
    • Send Messages
    • Access Public Threads (future-proofing for potential new features)
    • Send Messages in Threads (future-proofing for potential new features)
    • Manage Messages (enables prompt to delete a user's data query message)
    • Embed Links
    • Attach Files
    • Use External Emojis
    • Add Reactions

Running locally

Setup

Set up a virtual env and install requirements. Standard python stuff, but easy to forget so it's written here for convenience.

mkdir env               # only needed 1st time
python3 -m venv env     # only needed 1st time
source env/bin/activate
pip3 install -r requirements.txt

Run

First, create or obtain a slack (or discord) token (see slack API documentation). Then set your token as an environment variable and launch r2d7:

export SLACK_TOKEN="123456-your-slack-token-here"
python -m r2d7.slack

Or for discord:

export DISCORD_TOKEN="123456-your-discord-token-here"
python -m r2d7.discord

About

A bot for xwingtmg.slack.com

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.9%
  • Other 0.1%