Simple discord bot that retrieves fortnite user stats
This script requires these libraries: discord.py and requests
pip install discord.py
pip install requests
In bot.py
, replace the values of BOT_TOKEN
and FORTNITE_API_TOKEN
with your own API keys.
Discord Developers: https://discordapp.com/developers/docs/intro
Fortnite Tracker API: https://fortnitetracker.com/site-api
Run your bot with:
python bot.py
Go to a Discord server with your bot, then type !ping
to check that the bot is online and responding to your messages. The bot must have VIEW_CHANNEL
and SEND_MESSAGES
permissions in that Discord server in order to respond to you.
Type !stats <platform> <nickname>
to retrieve stats about user with nickname on a platform (pc, xbl, or psn)
The command prefix can be customzied by changing the value of COMMAND_PREFIX
in bot.py
.
The bot can be hosted for free by running the script on Heroku.
-
Install git and Heroku CLI.
-
Create
requirements.txt
by typingpip freeze > requirements.txt
. This lets Heroku detect that you are running a Python app and have it install the required libraries. -
Create a Procfile with
worker: python bot.py
. -
Create a git repository with
git init
. -
Create a heroku app and set config vars:
heroku login
heroku create
heroku config:set BOT_TOKEN=<insert token here>
heroku config:set FORTNITE_API_TOKEN=<insert token here>
- Push to heroku:
git init
git add -A
git commit -m "Initial commit"
git push heroku master
-
Start the worker with
heroku ps:scale worker=1
. -
Check logs with
heroku logs --tail
.
This project is licensed under the MIT License - see the LICENSE.md file for details