Just keep this repo as a souvenir, there's a lot of legacy code here, not worth using as a reference
- Import repo from github
- Setup python env(need 5~10 min)
> python setup_python3.8+.py
Current only support MongoDB
You can use MongoDB Atlas to get a free cloud db without cardit card.
Or you can Install MongoDB on your local machine
If you choose to use atlas, follow the step below to create a free cluster
- Go to MongoDB Atlas
- click
Try Free
at top. - Use Google account login or register below.
- Create a new
Organization
- Create a new
Project
- Create a new
Cluster
(You can create multiple project to get more free cluster) - Create a new
User
and follow the description- If you want connect to this project's cluster at anywhere, set IP filter to
0.0.0.0
- If you want only this machine can to connect this project's cluster, just click
Add My Current IP Address
button
- If you want connect to this project's cluster at anywhere, set IP filter to
- Go to Discord Developer Portal
- Click
New Applitcation
on top right and follow the step - Go to
Bot
page and clickReset Token
to get token (Token will not show again, so be sure to save it to somewhere)
Modify the bot-config.toml
to suit your needs
If you host your bot on heroku, replit, or other services that can set environment variables, don't use the .env
file.
This will cause Discord to reset the bot token and expose the database.
Or you can follow the step below
- Rename
.env-sample
to.env
- Modify
TOKEN_DEV
to you bot token - Modify
DB_HOST
to your database uri- If you use MongoDB Atlas provide database service, click
Connect
on the cluster page then clickConnect your application
to get the url (Don't selectInclude full driver code example
) - If you install MongoDB on your local machine, uri will be
localhost:27017
- If you use MongoDB Atlas provide database service, click
- Go to Discord Developer Portal
- Click the application you just create
- Go to
OAuth
->URL Generator
- Select
bot
scope and permission you want to give your bot - Copy the url below and open it in a new page
- Select a server you want use this bot and then follow the step
- Install bot requirements
> python3 -m pip install -r "requirements.txt"
- Launch MongoDB(if your
DB_HOST_DEV
is set tolocalhost:271017
)
> mongod
- Launch bot
> python3 lrb.py