MLB Game Feed Bot: Difference between revisions

From ChewWiki
Jump to navigation Jump to search
(mlb game bot lore)
 
m (whoops)
Line 11: Line 11:
==== <code>/startgame</code> ====
==== <code>/startgame</code> ====


Starts a game. When you run the command, auto-complete will show currently live Major League games. If a game is final, or currently experiencing a delay, it will not show up. Games appear here usually once a notification goes out (when the game goes into "warm up"). However, if you have a gamePk, you can paste that in and listen to any game. To find a gamePk, you can find a game on [[mlb.chew.pw Chew's MLB Stats]], and grab the 6 digit number at the end of the URL.
Starts a game. When you run the command, auto-complete will show currently live Major League games. If a game is final, or currently experiencing a delay, it will not show up. Games appear here usually once a notification goes out (when the game goes into "warm up"). However, if you have a gamePk, you can paste that in and listen to any game. To find a gamePk, you can find a game on [[Chew's MLB Stats|mlb.chew.pw]], and grab the 6 digit number at the end of the URL.


==== <code>/stopgame</code> ====
==== <code>/stopgame</code> ====
Line 21: Line 21:
This command shows the score of the active game. It shows the current amount of outs and the inning, as well.
This command shows the score of the active game. It shows the current amount of outs and the inning, as well.


=== <code>/setinfo</code> ====
==== <code>/setinfo</code> ====


Sets info for a voice channel name. Teams will be autofilled, and, if you search, it will narrow down results. Currently, these are supported:
Sets info for a voice channel name. Teams will be autofilled, and, if you search, it will narrow down results. Currently, these are supported:

Revision as of 19:51, 17 October 2022

MLB Game Feed Bot is a Discord bot developed by Chew and is used to hook into the MLB (Major League Baseball) API and track live game data, much like the MLB's Gameday. It is written in JDA (Java).

Features

The bot allows you to start a live game and have the plays come in when they're posted to the endpoint. By default, in-play events have a 13 second delay, and plays that don't (strikeouts, walks, etc) have a 18 second delay. This can be configured per channel, as desired. These times were chosen as they closely line up with the play happening live on TV, to prevent spoilers. Watching a game in-person, there is a few second delay before the result is posted to the API.

Commands

The bot communicates solely though slash commands. There are currently 5 commands. None of the commands have permissions by default. This can be configured in server settings under integrations.

/startgame

Starts a game. When you run the command, auto-complete will show currently live Major League games. If a game is final, or currently experiencing a delay, it will not show up. Games appear here usually once a notification goes out (when the game goes into "warm up"). However, if you have a gamePk, you can paste that in and listen to any game. To find a gamePk, you can find a game on mlb.chew.pw, and grab the 6 digit number at the end of the URL.

/stopgame

Use this command to forcibly stop an active game. Games will stop on their own once they reach "Final."

/score

This command shows the score of the active game. It shows the current amount of outs and the inning, as well.

/setinfo

Sets info for a voice channel name. Teams will be autofilled, and, if you search, it will narrow down results. Currently, these are supported:

  • Next game, formatted as (Date: versus/at opponent, @ team's local time). Example: 10/5: vs NYY, 3:05 PM.
  • Standings, formatted as (Team abbreviation: record - rank in division abbreviation). Example: TEX: 68-94, 4th in ALW.

/config</code

Use these commands to get or set the channel's game config. Currently, there are 4 options:

  • In-Play Delay - Set the delay (in seconds) before a ball in-play is shown to the channel. Default: 13 seconds.
  • Out-of-play Delay - Set the delay (in seconds) before a ball not in-play is shown to the channel. Default: 18 seconds.
  • Only Scoring Plays - Only show scoring plays.
  • Game Advisories - Whether to show game advisories, such as pitching changes or substitutions.