Skip to content

OoriData/DF_Discord

Repository files navigation

╔═════════════════════════════════════════════════════════════════════════════════════╗
║ ┏┳┓┏━┓┏━┓┏━┓┳  ┏━┓┏┳┓┏━┓  ┏━┓┳━┓┏━┓┏┓┏┏┳┓┳┏━┓┳━┓┏━┓  ┏┳┓┳┏━┓┏━┓┏━┓┳━┓┏┳┓  ┏━┓┏━┓┏━┓ ║
║  ┃┃┣┫ ┗━┓┃ ┃┃  ┣━┫ ┃ ┣┫   ┣┫ ┣┳┛┃ ┃┃┃┃ ┃ ┃┣┫ ┣┳┛┗━┓   ┃┃┃┗━┓┃  ┃ ┃┣┳┛ ┃┃  ┣━┫┣━┛┣━┛ ║
║ ╺┻┛┗━┛┗━┛┗━┛┻━┛┻ ┻ ┻ ┗━┛  ┗  ┻┗━┗━┛┛┗┛ ┻ ┻┗━┛┻┗━┗━┛  ━┻┛┻┗━┛┗━┛┗━┛┻┗━╺┻┛  ┻ ┻┻  ┻   ║
╚═════════════════════════════════════════════════════════════════════════════════════╝

Desolate Frontiers Discord Frontend

Running the Discord frontend

To run the Desolate Frontiers Discord frontend, you can use this command (from the root folder):

source $HOME/.local/venv/df_discord/bin/activate
op run --env-file op_discord.env --no-masking -- python -m discord_app.df_discord

You'll also need to have the map renderer running, which is a seperate program (so, run in a seperate terminal/tab):

source $HOME/.local/venv/df_discord/bin/activate
cd map_render
hypercorn server:app --workers=2 --bind=0.0.0.0:9100

environment (internal version, remove before open-source)

To run that discord bot in a test environment, your op_discord.env should look something like this:

LOG_LEVEL = "INFO"

DF_API_HOST = "http://localhost:1337"

DF_MAP_RENDERER = "http://localhost:9100"

DISCORD_TOKEN = "SECRET REFERENCE TO THE TOKEN OF THE BOT YOU'RE TESTING WITH"  # Discord bot/app to use
# Find this as the "Copy Secret Reference" option in the dropdown for the credential in 1Password

# Server that is used as the presumed playerbase to send notifications to 
DF_GUILD_ID = "1119003654800822302"    # (oori dev server)
# Channel to send those notifications in
DF_CHANNEL_ID = "1179194033923432578"  # (#bot-attic)

WASTELANDER_ROLE = "1201669829140942970"  # "WASTELANDER test" role in oori dev server
ALPHA_ROLE = "1201669791866441748"        # "ALPHA test" role in oori dev server
BETA_ROLE = "1201669724987990096"         # "BETA test" role in oori dev server

You'll need to have the 1Password CLI tools installed to make this work ("Manual" reccomended over "Homebrew")

Setup

Venv

The Desolate Frontiers Discord App requires Python 3.12. It is highly reccomended to create a new virtual environment (venv) setup specifically for the DF Discord App.

To create a venv in the "standard" location of ~/.local/venv/:

/usr/local/bin/python3.12 -m venv $HOME/.local/venv/df_discord

You can manually activate that with:

source $HOME/.local/venv/df_discord/bin/activate

Libraries

Get the correct libraries installed to the venv:

pip install -U pip
pip install -U -r requirements.txt -c constraints.txt

For ease of development, you can install the libraries for the map renderer to the same venv:

pip install -U -r map_render/requirements.txt -c map_render/constraints.txt

VSCode

To activate that in VSCode, open a python file and select the python version in the status bar in the bottom right in your VSCode window and click Enter interpreter path..., and enter:

~/.local/venv/df_discord/bin/python3.12

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages