A chatbot based todo list and buddy, built to facilitate other features over time.
- Discord Interface
- CLI Interface
- To Do List
And more to come :)
git clone https://github.com/bacarpenter/bot.bot.git
Go to the project directory
cd bot.bot
Install dependencies
python3 -m pip install -r requirements.txt
Next, we will set up a data base for your todos. This will be done with firebase, because it is free and I like it. If you haven't already, sign up for firebase
- Create a project in the dashboard. I named mine bot.bot
- In the project, select Firestore Database from the side bar. Select create database. Chose a location close to you, as this database will only house your data. When asked for security rules, select start in production mode. You won't need to worry about security rules for this.
- In your project sidebar, click the cog towards the top, select "Project settings"
- Select the service accounts tab
- Choose "Generate new private key". This will download a .json file.
- Copy this file into the source code, under the
secrets/
directory and rename itfirebase-adminsdk.json
Phew, now the database should be setup!
Optional: With this step done you can use the bot in it's CLI form. Todo this, run python3 cli.py
. Make sure to add a todo before you try to read them.
To set up the discord bot, please follow this tutorial, up until the heading "How to Code a Basic Discord Bot with the discord.py Library". Save the token. Then, create a new file, named discord_token.json
under the secrets/
directory. Use the following template:
{
"token": "[TOKEN]"
}
and fill in [TOKEN]
with your actual token!
Now, you are ready to use the bot. Start talk to it through discord by using
python3 discord_interface.py
or, use the CLI with
python3 cli.py
To deploy this project, I use repl.it free hacker plan for students. Learn more about setting up a Repl.it here. And getting your free, time limited, hacker plan here.
Alternatively, any PaaS provider that allows for always online python projects should work just fine!
Client: Discord
Server: Python, Discord.py, Firebase
Make sure not to share anything in the secrets/
directory publicly online!
Thank you to...
- readme.so for helping to create this readme.
- freecodecamp.org for demonstrating how to use discord bots
Licensed under the MIT license. Learn more about the MIT license