Giter VIP home page Giter VIP logo

soloq_notifier's Introduction

Solo Queue Notifier

This script is a simple tool to track League of Legends games of a specific player and send notifications about their games to a Discord channel. It utilizes Riot Games API to fetch game data and uses webhooks to send messages to Discord.

Features

  • Sends a Discord message whenever the player starts a new game
  • Sends a Discord message whenever the player finishes a game

Screenshots

Below are a few examples of messages sent using this script:


Lost unranked game

Lost ranked game

Won ranked game

New game message

Dependencies

This script was tested on Python 3.10 and requires the requests library. You can install it with pip:

pip3 install requests

Configuration

Before running the script, a config.ini file needs to be created in the same directory as the script. The file should contain a section SOLOQ with the following keys:

  • RIOT_API_KEY: Your Riot Games API Key.
  • WEBHOOK_URL: The Discord webhook URL you want to use to send notifications.
  • RIOT_ID: The Riot ID of the player you want to track, e.g., USER#TAG.
  • USER_REGION: The specific region the player plays in, e.g., na1 for North America.
  • WIDE_REGION: The broad region the player is in, e.g., americas for North America.
  • DATA_FILE: The name of the data file to store game and error information. This file should be unique for each username (when using multiple config files).
  • ERROR_URL: (OPTIONAL) The Discord webhook URL where errors will be posted. Errors won't be posted if this is not specified. Errors may contain sensitive data.

You can get your Riot Games API key here. User and wide regions should match Riot Games API routing values. Information on how to generate a Discord channel webhook is provided in this article.

Running the script

This script can be run with the following command:

python3 soloq.py

A path to a configuration file can optionally be passed as a command line argument:

python3 soloq.py other_config.ini

You can setup a cron job to run the script automatically every few minutes. To do that run crontab -e to open the cron table editor and add a new line at the bottom:

*/1 * * * * cd /path-to-your-script && python3 soloq.py 2>> soloq.log

This will run the script once every minute. Errors will be saved in soloq.log file.

Note

This script makes between 4 and 8 requests to different Riot APIs each time it's run. Riot Games API has strict rate limits. If your application exceeds those limits, your IP may be temporarily blacklisted. Always ensure you are within the API usage limits to prevent this from happening.

Disclaimer

This script is not endorsed by Riot Games and does not reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties, are trademarks or registered trademarks of Riot Games, Inc.

This script uses the Discord API but is not endorsed or certified by Discord. Discord, the Discord logo, and any associated marks and logos are trademarks or registered trademarks of Discord, Inc., in the U.S. and other countries.

soloq_notifier's People

Contributors

verylongnicknamesuchwow avatar

Stargazers

Dawid Kardacz avatar Jan Smółka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.