Discord bot and independent helper functions displaying sports news and convenient stats.
This Discord bot allows users to view NBA and NFL news, scores, and stats on their servers with intuitive commands. The commands are named after the key words I always search with. I always found it annoying to constantly search up stats for a game I was monitoring while studying and I was too lazy to install official apps too. This alleviates the inconvenience of always having to manually search up stats or open one's phone while working or playing games with friends as Discord is usually always open on someone's computer.
pip install sports-box
from sportsbox import showUpcomingGames, getPlayer, playerStats, playerNextNGames, getTeam, getScores, getNBANews, getNFLNews
#Get basic player information and career regular season stats returned as dataframes
player_info_df = getPlayer("Lebron James")
player_stats_df = playerStats("Lebron James")
#Show upcoming next N games for a player as a matplotlib plot
showUpcomingGames("Lebron James", 3)
#Get upcoming next N games with more details for a player returned as a dataframe
player_games_df = playerNextNGames("Lebron James", "3")
#Get basic team information returned as dataframe
team_info_df = getTeam("mil")
#Get today's NBA box scores returned as a list of Game objects
today_scores = getScores()
#Get 5 recent NBA or NFL articles returned as set of Article objects
nbanews = getNBANews()
nflnews = getNFLNews()
Attribute Variable | Value |
---|---|
gameStatus | 1 not started, 2 in progress, 3 finished |
gameStatusText | start time (ET) , Qx and time remaining , FINAL |
homeTeam | EX: LAL |
hWins | home team wins |
hLosses | home team losses |
hScore | home team's current score |
awayTeam | EX: LAC |
aWins | away team wins |
aLosses | away team losses |
aScore | away team's current score |
Attribute Variable | Value |
---|---|
headline | headline of the ESPN article |
description | description of the ESPN article |
link | link to ESPN article |
Invite sportsbox to your Discord server!
!nbanews
- Shows 5 random recent NBA news articles
!nflnews
- Shows 5 random recent NFL news articles
!nbascores
- Shows today's NBA box scores
!nbavids
- Shows 5 recent NBA tiktok videos
!nflvids
- Shows 5 recent NFL tiktok videos
Read CONTRIBUTING.md file