Telegram and Discord bot that gets information on Fortnite players
Talk to @fortnite_info_bot on Telegram!
Add the bot to your Discord server!
- Clone the repo to your computer.
$ git clone https://github.com/abhinavk99/fortnite-bot.git $ cd fortnite-bot
- Install the required dependencies with yarn or npm.
# Installs all dependencies with yarn $ yarn install # If you don't want the dev dependencies $ yarn install --prod # OR # Installs all dependencies with npm $ npm install # If you don't want the dev dependencies $ npm install --only=prod
- Go to Fortnite Tracker API and get an API key.
- Get a Discord bot token from making a Bot User. This tutorial should help.
- Get a Telegram bot token from @BotFather.
- Start a Firebase project. This is used for caching Fortnite usernames for the
/set
command. - Create a file called
.env
in the repo directory. - Copy/paste the below into the file.
TELEGRAM_TOKEN=Token here FORTNITE_KEY=Key here DISCORD_TOKEN=Token here FIREBASE_KEY=Key here FIREBASE_DOMAIN=your-project-id.firebaseapp.com FIREBASE_URL=https://your-project-id.firebaseio.com FIREBASE_ID=your-project-id FIREBASE_BUCKET=your-project-id.appspot.com
- Put your tokens and key where it says to in the config. Do not put quotes around the tokens.
- Run the bot.
$ npm start
# Requires dev dependencies to be installed
$ npm test
Do /start
, /help
, or /info
to get a list of commands from the bot.
Command | Description | Usage |
---|---|---|
/user | Get global stats for a player | /user <username> |
/pc | Get global stats for a PC player | /pc <username> |
/xbox | Get global stats for an XBOX player | /xbox <username> |
/ps4 | Get global stats for a PS4 player | /ps4 <username> |
/season9 or /s9 | Get all season 9 stats for a player | /season9 <username> |
Command | Description | Usage |
---|---|---|
/solo | Get lifetime solo stats for a player | /solo <username> |
/duo | Get lifetime duo stats for a player | /duo <username> |
/squad | Get lifetime squad stats for a player | /squad <username> |
/solos9 | Get season 9 solo stats for a player | /solos9 <username> |
/duos9 | Get season 9 duo stats for a player | /duos9 <username> |
/squads9 | Get season 9 squad stats for a player | /squads9 <username> |
Command | Description | Usage |
---|---|---|
/recent | Get recent match stats for a player | /recent <username> |
/rold | Get recent match stats for a player (old format) | /rold <username> |
/compare | Compare two players | /compare <username1>, <username2> |
/rating | Get TRN rating stats for a player | /rating <username> |
/kd | Get K/D ratio stats for a player | /kd <username> |
/winrate or /wr | Get win rate stats for a player | /winrate <username> |
/set | Set username to your messaging account | /set <username> |
/leaderboards | Get leaderboard data | /leaderboards |
/challenges | Get current weekly challenges | /challenges |
/store | Get current store items | /store |
/matches | Get match history | /matches <username> |
/nick | Set nickname for a username | /nick <nickname>, <username> |
/deletenick | Delete a nickname that was set | /deletenick <nickname> |
Command | Description | Usage |
---|---|---|
/season3 or /s3 | Get all season 3 stats for a player | /season3 <username> |
/solos3 | Get season 3 solo stats for a player | /solos3 <username> |
/duos3 | Get season 3 duo stats for a player | /duos3 <username> |
/squads3 | Get season 3 squad stats for a player | /squads3 <username> |
/season4 or /s4 | Get all season 4 stats for a player | /season4 <username> |
/solos4 | Get season 4 solo stats for a player | /solos4 <username> |
/duos4 | Get season 4 duo stats for a player | /duos4 <username> |
/squads4 | Get season 4 squad stats for a player | /squads4 <username> |
/season5 or /s5 | Get all season 5 stats for a player | /season5 <username> |
/solos5 | Get season 5 solo stats for a player | /solos5 <username> |
/duos5 | Get season 5 duo stats for a player | /duos5 <username> |
/squads5 | Get season 5 squad stats for a player | /squads5 <username> |
/season6 or /s6 | Get all season 6 stats for a player | /season6 <username> |
/solos6 | Get season 6 solo stats for a player | /solos6 <username> |
/duos6 | Get season 6 duo stats for a player | /duos6 <username> |
/squads6 | Get season 6 squad stats for a player | /squads6 <username> |
/season7 or /s7 | Get all season 7 stats for a player | /season7 <username> |
/solos7 | Get season 7 solo stats for a player | /solos7 <username> |
/duos7 | Get season 7 duo stats for a player | /duos7 <username> |
/squads7 | Get season 7 squad stats for a player | /squads7 <username> |
/solos8 | Get season 8 solo stats for a player | /solos8 <username> |
/duos8 | Get season 8 duo stats for a player | /duos8 <username> |
/squads8 | Get season 8 squad stats for a player | /squads8 <username> |
You can end any command (except /set
, /pc
, /xbox
, /ps4
, /compare
, /leaderboards
, /challenges
, and /store
) with pc
, xbox
, or ps4
to specify the platform
to search for the user.
Example:
/duopc ninja
/squads4ps4 AlexRamiGaming
- Message the bot
/set yourusername
.Example: /set ninja
- Use any of the above commands (except
/set
) without your username.Example: /user /squads3 /recent /compare TSM_Myth
- The bot will use the username that you set with
/set yourusername
for your stats.
Contributions are greatly appreciated!
# 1. Fork the bot and clone it to your computer
$ git clone https://github.com/your-username/fortnite-bot.git
$ cd fortnite-bot
# 2. Connect your fork with this repo to stay up to date on any changes
$ git remote add upstream https://github.com/abhinavk99/fortnite-bot.git
# 3. Make your feature branch
$ git checkout -b new-feature
# 4. Add and commit the changes you made
$ git add .
$ git commit -m "Added new feature"
# 5. Push to your branch
$ git push origin new-feature
# 6. Create a pull request on GitHub
Alternatively, feel free to open an issue.
Go to the changelog here! Releases start at v2.0.1 because I didn't know how to use git tags before then and never updated version numbers in package.json
.
Powered by Fortnite Tracker API and fortnite.js.