Projects

pybungie

A Python package for interacting with the Bungie.net API

Features

  • Painless interaction with the Bungie.net API

  • Supports most calls and enumeration types, later versions will expand functionality

  • OAuth2 implementation*


*Not suitable for production code

Usage

$ pip install pybungie


from pybungie import BungieAPI, MembershipType, VendorHash, Components


my_membership_type = MembershipType.STEAM

bungie_api = BungieAPI(api_key="api_key")

bungie_api.input_xbox_credentials(xbox_live_email="example@example.com", xbox_live_password="password")

bungie_api.start_oauth2(client_id="client_id", client_secret="client_secret")

membership_id = bungie_api.search_destiny_player(membership_type=my_membership_type, display_name="Hayden23")[0]['membershipId']

character_id = bungie_api.get_profile(membership_type=my_membership_type, membership_id=membership_id,

components=Components.Profiles)['profile']['data']['characterIds'][0]

zavala = bungie_api.get_vendor(membership_type=my_membership_type, membership_id=membership_id,

character_id=character_id, vendor_hash=VendorHash.ZAVALA.value,

components=Components.VendorSales)

bungie_api.close_oauth2()


Xûr Bot

Discord bot that provides vendor information from Destiny 2 using the Bungie.net API

Commands

Currently, Xûr Bot only supports one command:

  • !inv

    • Xur is available

When a user sends the message !inv in the discord server Xûr Bot will respond to the user with an embedded message containing the current week's inventory with links to their corresponding to their appropriate Destiny Tracker page as well as his location:

  • Xur is not available

In the event that Xûr is not available in-game when the command is called, Xûr Bot will send a message telling the user when he will be returning next:

Events

  • Who/What are the Nine?

If a user sends a message asking who/what are the nine, Xûr Bot will respond with one of several in-game quotes:

  • Who/What is Xur?

If a user sends a message asking who/what is Xur, Xûr Bot will respond with one of several in-game quotes:

  • Profanity

    • General Profanity

If a user sends a message containing profane language, it will respond with one of several in-game quotes:

  • Profanity directed at Xûr Bot

If a user sends a message containing profane language directed at Xûr Bot, it will respond with one of several in-game quotes and react the message with a thumbs-down emoji:

  • Hate Speech

In the event that Xûr Bot detects a user has sent a message containing hate speech in the server, he will simply delete the message.

  • Unhandled Message

If Xûr Bot reads a message that should be understood, but causes an error, the server, channel, author, and message contents will be logged in the err.log file: