By Alec (AlecM33)
View on GithubThis bot and its author are not affiliated with the MLB. The bot uses the MLB Stats API, which is subject to the notice posted at http://gdx.mlb.com/components/copyright.txt
This is the centerpiece of the bot's functionality. For whichever team you configure it for, the bot will automatically detect whenever a game is live and report those updates to any subscribed Discord channels, respecting each channel's preferences:
The embeds are styled with contrasting colors from each team's color set. For balls in play, the bot will give Statcast metrics. This includes not only exit velo, launch angle, and distance, but also xBA and HR/Park, which are sourced separately from the MLB Savant site. By default, the bot will report the result of each at bat, plus any key events that happen during at-bats, such as baserunning events. If this is too much, the bot can be configured to report scoring plays only. Furthermore, if you wish to avoid spoilers for people watching or listening on a delay, you can provide a delay from 0-180 seconds when subscribing. For example, in a server for the Guardians, the bot reports on a 45-second delay, providing nice context right in the chat where people are following the game. You can of course personalize it to have a bit more flair for your team: