Skip to content

SogeMoge/4-A7

Repository files navigation

4-A7

Discord bot that converts http://xwing-legacy.com/ URL to rich embed messages

Add to Discord

Features

Convert Legacy YASB URL to human-readable lists

Just paste your list URL into a channel and let the bot handle it! (on Windows, you can press F6 then CTRL+C to copy URL to clipboard)

What happens under the hood:

  1. Parses user messages in server channels for https://xwing-legacy.com/ urls.
  2. Converts YASB URSL to XWS with https://rollbetter-linux.azurewebsites.net/lists/xwing-legacy? endpoint.
  3. Enriches pilots and upgrades with full data from xwing-data2-legacy
  4. Contructs human-readable rich embedded messages and sends them in original channel as a response.
  5. Creates a view with confirmation buttons for a user to delete their origina message to redce channel clutter.

Slash / commands

Display links to X-Wing 2.0 Legacy Rules

Type /rules in discord channel to get rules for gamemodes:

And more!

Display links to X-Wing 2.0 Legacy compatible builders

Type /builders in discord channel to get URLs for gamemodes:

Show them the way

Type /thisistheway in discord channel to get directions.

Show True Love

Type /reinforcements in discord channel to greet newcomers.

How To

Run tests

Tests are located in test_main.py

python -m pytest

Start MongoDB

4-A7 checks if DB is initialised upon start and populates it with data if it is not present.

Run docker-compose stack with mondodb for storing xwing-data2-legacy repo.

sudo docker-compose -f /deploy/db/stack.yml up -d

Generate ship emojis

Run fonts/fonts_mapping.py to extract ship icons from fonts/xwing-miniatures-ships.ttf

Start api server (WIP):

Linux

uvicorn api:app --port 7000 --reload

Windows

C:/Python311/python.exe -m uvicorn api:app --port 7000 --reload

Inspired by

R2-D7 bot

About

Discord bot that converts http://xwing-legacy.com/ links to rich embed messages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •