Skip to main content

Discord bot calling Steam Web API on command

Project description

steamscordbot

pypi status docker status

Discord Bot written in Python 3.8 using the Steamworks Web API to provide Steam user data through chat commands.

It depends on:

Features

  • Resolve a vanity URL name into a Steam ID and display name
  • List rarest or latest achievements of a public Steam profile
  • List games most owned or recently played by friends of a public Steam profile

Prerequisites

Installation

With pip

pip install steamscordbot

With Docker

docker pull esabouraud/steamscordbot

From source

git clone https://github.com/esabouraud/steamscordbot.git
cd steamscordbot

Then

pip install -U -r requirements.txt

Or

docker build -t esabouraud/steamscordbot .

Run

Generic

python -m steamscordbot --steam_apikey=<Steam API key> --discord-token=<Discord Bot Token>

The CLI arguments can also be passed as environment variables (useful when running in a container hosted by a cloud service provider). The CLI arguments override the corresponding environment variables when both are available.

Windows

set STEAM_APIKEY=<Steam API key>
set DISCORD_TOKEN=<Discord Bot Token>
py -3 -m steamscordbot

Linux (Bash)

export STEAM_APIKEY=<Steam API key>
export DISCORD_TOKEN=<Discord Bot Token>
python3 -m steamscordbot

Docker

docker run -d -e STEAM_APIKEY=<Steam API key> -e DISCORD_TOKEN=<Discord Bot Token> --restart=unless-stopped --name steamscord esabouraud/steamscordbot

Usage

Use discord to send a message to the bot or to a text channel it is present on.

The bot command prefix is: !$

A Steam user is identified by either:

Supported commands are:

  • achievements: Get achievements of a Steam user
  • check: Perform a simple Steam API availability check
  • friends: Get most owned or recently played games among friends of a profile
  • help: Shows help message
  • profile: Get profile info based on provided Steam vanity URL or steamid

Samples:

  • !$check
  • !$profile gaben
  • !$achievements gaben rarest
  • !$achievements 76561197968052866 latest
  • !$friends gaben list 5
  • !$friends 76561197968052866 owned 15
  • !$friends 76561197968052866 recent

TODO

  • list Discord users on server that have linked their Steam accounts (+ mention friends if caller has linked his steam account)
    • cannot be done, see limitations below.
  • List rarest or latest badges of a public Steam profile
  • List badges most owned or recently obtained by friends of a public Steam profile
  • make it a proper chatbot with NLP ?

Limitations

The User.profile() Discord API is forbidden to bots. This means the bot cannot leverage the Steam connected account even when it is available.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steamscordbot-0.2.2.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

steamscordbot-0.2.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file steamscordbot-0.2.2.tar.gz.

File metadata

  • Download URL: steamscordbot-0.2.2.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for steamscordbot-0.2.2.tar.gz
Algorithm Hash digest
SHA256 526a1a62c6cfca34086259d097a79eefd0930d47ead32320a600526f60d322c3
MD5 ea2c27b0b4540392287dcb47a1562a41
BLAKE2b-256 75dd0a9c6a93f6f99bee419aca8c0f1fb423cea0f69606a6e1f6200018e91e78

See more details on using hashes here.

File details

Details for the file steamscordbot-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: steamscordbot-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for steamscordbot-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9bccaf6f4fe75e3c7b72c94138c83a8559763cb8bc77af54a031c0f11d57b56f
MD5 078b6fa9cf71c739de3c2bad370ce924
BLAKE2b-256 1ef39342477302a2141a8376b837137ab0cec28685f76c268926b0c7dde4eb00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page