Skip to content

RoMinjun/mlb-discord-rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MLB-DISCORD-RPC

Show live MLB scores on Discord

Built with the tools and technologies:


Table of Contents

Overview

mlb-discord-rpc shows live Major League Baseball game updates as your Discord status. It uses Discord Rich Presence to display real-time scores, game status, and player info for your favorite team while you use Discord. When no live game is detected, it displays the upcoming matchup with your opponent's logo and shows the score from the previous game. The large and small image tooltips include each team's win–loss record. Pre-game statuses now also show the scheduled start time. Live game updates display the current ball and strike count for the batter only during active half-innings, and show which players are up next between innings.

Screenshots

Screenshosts of different states of matches

Pre Game Example:

pregame

Live Game Example (with player on 1nd base):

livegame

Final Game Example:

finalegameexample

Getting Started

Prerequisites

This project requires the following dependencies:

  • Programming Language: Python (3.9+)
  • Package Manager: Pip

Installation

Build mlb-discord-rpc from the source and install dependencies:

  1. Clone the repository:
    git clone https://github.com/RoMinjun/mlb-discord-rpc
  2. Navigate to the project directory:
    cd mlb-discord-rpc
  3. Install the dependencies: Using pip:
    pip install -r requirements.txt

Usage

Run the project with: Example:

python mlb-discord-rpc.py --team TOR

Options & Configuration

You can configure mlb-discord-rpc via command-line options, a config.toml file, and environment variables (.env file).

Command-Line Arguments

  • --team <TEAM_ABBR> (required) Sets your favorite MLB team by its abbreviation (e.g., LAD, TOR, CHC, etc.).
  • --tz <TIMEZONE> Override the detected local timezone. Use IANA timezone names (e.g., America/Toronto).
  • --live-only Only show your Discord status when your team has a live game.

Example:

python script.py --team TOR --tz America/Toronto --live-only

(Optional) Configuration File: config.toml

You may also set options persistently by editing (or creating) a config.toml file in the project directory. Example:

team = "TOR"
timezone = "America/Toronto"
live_only = true

[display]
base_icon_filled = "🟦"
base_icon_empty = ""

[refresh]
live_interval = 15
idle_interval = 90
  • team - Team abbreviation (required)
  • timezone - IANA timezone string (optional)
  • live_only - Only display presence when game is live (optional)
  • [display] - Customize base icons
  • [refresh] - Customize update intervals in seconds

Environment Variables (.env)

  • CLIENT_ID Your Discord application's client ID. Required to connect to Discord RPC.

Example .env:

CLIENT_ID=your_discord_client_id_here

Quick Start

  1. Set your CLIENT_ID in .env.
  2. Optionally configure your team and preferences in config.toml.
  3. Or run directly with command-line options.

Enjoy seamless MLB presence on Discord!


↑ Return

About

Rich pressence that displays details of the game for your favourite team in Discord

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages