A Discord bot for NBA scores, stats, news and simulated betting.
The Story Thus Far
Hi, we're Eliot and Justin, and we are the creators of NBABot. We met around 2018 when the project was in its very early stages. We are fans of the Suns and Knicks respectively, Eliot being from New Zealand, and Justin being from New York.
NBABot is truly influenced by our users feedback and our passion for the game of basketball. When NBABot first started, we had no clue it would become as big as it is today, and we owe that to our users. We want people to get involved, give feedback, and be able to see how much this project means to us. Some of the premier features of the bot are:
- Live Scores
- Simulated Betting
- News Updates
- Player Comparisons
And many more. You can check it out by inviting NBABot, or using NBABot in our support server.
Installation
The installation of NBABot to run on your own is something that requires a previous knowledge of discord.js, javascript, and basic coding principals. We are working on documentation and expect some more news on this front soon.
Watch a video guide for macOS here: https://www.youtube.com/watch?v=H43I2qVlAJY
- Download NBABot's source code either through downloading it as a .zip file, or with the command
git clone https://https://github.com/NBABot-Development-Team/NBABot.git
. - Install NodeJS on your computer.
- For MacOS/Linux, I would recommend using nvm.
- For Windows, you can just install NodeJS from the official website here.
- The current reccommended version of NodeJS to install is
v16.17.0
, but you are free to try and get other versions working.
- From the
/src
directory, you will to need to install the required packages with the commandnpm install
.
- Note: the package
node-canvas
usually does not install at first, so make sure you follow the installation steps here if an error occurs during installation.
- Create a Discord bot if you have not already:
- Go to the Discord Developers page here and press the 'New Application' button.
- Give your Discord bot a name
- Then, navigate to the 'Bot' tab, and press 'Add Bot'.
- Now, you can invite your bot to a server:
- Press the 'OAuth2' tab,
- Press the 'URL Generator' tab under 'OAuth2',
- Select 'bot' and 'applications.commands' under 'Scopes'
- Then select - at a minumum - the 'Bot Permissions': 'Send Messages', 'Send Messages in Threads', 'Manage Messages', 'Embed Links', 'Attach Files', 'Read Message History', 'Use External Emojis' and 'Use Slash Commands'. If you ever get into issues with the bot not having enough permissions, you can just give it 'Administrator' and things should be sorted out.
- Copy the link at the bottom and use the link to invite the bot to a server.
- Make a copy of the file
config.json.example
. - Rename the copy to
config.json
. - Open the new
config.json
file and insert the following essential details:
token
is your Discord Bot's token, which you can find back at the Discord Developers page, under the 'Bot' tab. Press 'Reset Token' and copy the long string of letters which appear.clientId
is your Discord Bot's Application ID, which you can find back on the Discord Developers page, under the 'General Information', tab, as 'Application ID'.activityText
is the message NBABot has when you click its profile, change this to whatever you like- For example,
"activityText": "with stats"
, will change NBABot's activity status toPlaying with stats
.
- For example,
- All the rest are unnecessary and only used for the official NBABot.
- Create a
cache
folder in thesrc
directory. - You will need to create a file called
today.json
in asrc/cache
directory, then copy the contents here to that file. - Go back to your command line and run
node bot.js
. - NBABot should now be running in your server!
- To keep it running in the background, I would recommend a package like pm2.
- If the slash commands do not appear when in NBABot's server, type
nba update
into the server and the commands should be added.
Note: NBABot currently is only available in a limited form without the simulated betting and user settings, as those require a MySQL database on your computer. This will later be explained with a guide. If you are confident enough, you can try install MySQL, use the framework database nba.sql
, then try the database commands, but I cannot guarantee they will work at this stage. In other words, betting commands do not work by default as they require installing MySQL.
How to Support Us
NBABot, as much as it is a passion project, is very time consuming and involves a lot of upfront cost. We hope to not only one day be able to pay for the server costs (around $90 USD per month), but also further development and in bringing on other experts to help us with Web Development or marketing.
If you want to support us monetarily, you can support on Patreon.
Otherwise, you can vote for us on top.gg, and you'll also recieve $10 in the virtual betting system!
License
Released under the GNU GPL v3 license.