Skip to content

Destiny is a looter shooter FPS/MMO from Bungie, the creators of Halo. This repo will post Xur's location and inventory of exotic loot to a Discord webhook, designed to be run from cron or as a cloud function

License

Notifications You must be signed in to change notification settings

alchemydc/destiny2-xur-discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

destiny2-xur-discord

Overview

Xur is an NPC in Bungie's MMO shooter Destiny2 which is a space magic infused descendant of Halo.
Xur visits only for a few days a week, landing on Fridays and selling different exotic weapons and armor from a random location.

This script Post Xur's location and inventory to a Discord webhook, and is designed to be run from cron or as a cloud function.

alt text

Gratitude

  • Thanks to @nev for exposing the magical API that shares Xur's location as JSON.
  • Thanks to the kind folks on the Destiny API Discussion Discord for helping me wrap my head around the new D2 API.

Requirements

Installation (Linux or OSX)

  1. Create a separate user named 'xur'
sudo adduser xur
  1. Change to the 'xur' user
sudo su - xur
  1. Clone the repo
git clone https://github.com/alchemydc/destiny2-xur-discord.git
  1. Create and activate a python virtual environment (recommended to keep deps separate from system python)
python3 -m virtualenv . && source bin/activate
  1. Install python dependencies (requests for making the https API calls, python-dotenv for keeping secrets out of the source)
python -m pip install -r requirements.txt

Configuration

  1. Copy the environment template
cp .env-template .env
  1. Populate the .env file with your Bungie API key and Discord webhook URL

Test run

python3 xur.py

Schedule it to run automatically

Xur comes on Fridays after the daily reset, so it's convenient to have this script run right after that. If Xur has something you don't, then go see him!

  1. Make xur wrapper bash script and python script executable
chmod u+x xur.sh xur.py
  1. Install crontab to run script automatically
/usr/bin/crontab xur.crontab

Troubleshooting

If things aren't working as expected, ensure that your Bungie API key and Discord webhook are set correctly.

If the script works when run directly, but fails when run by cron, check to ensure your home directory is correct in xur.sh, and that env vars are being properly imported by python-dotenv.

About

Destiny is a looter shooter FPS/MMO from Bungie, the creators of Halo. This repo will post Xur's location and inventory of exotic loot to a Discord webhook, designed to be run from cron or as a cloud function

Topics

Resources

License

Stars

Watchers

Forks