Skip to content

Hahaa13/eco-bot-test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EcoBot

A Economy Bot made using py-cord and mongoDB


Usage

Install the required modules

pip install -r requirements.txt

Create a file data.json with these contents

{
    "name" : "Bot Name",
    "token" : "Bot Token",
    "mongo" : "Mongo Url (mongodb+srv://.......)"
}

Edit market.json for items/products

{
    "IoT" : [
        ["Smart Watch",100,"smart-watch"]
    ],
    "Food" : [
        ["Water",5,"water"]
    ],
    "Cars" : [
        ["Car",10000,"car"]
    ]
}

For MongoDB create

Database -> eco
            Collection -> money, bag

Setup of mongodb

Click on project 0 , then click on new project

  • Name your project ( anything ), then add members ( if any ). After that click create.

  • Here for img

Click on build database, select Free (for starters), let the default settings be there, but you can chnage the last field of cluster name.

  • Then let the default things be selected and enter your username/password ( remember them ).

  • In the IP access list enter 0.0.0.0/0 (allow from everywhere).

  • Finish and clear

  • After that it will take some time to create. Once its finished go to Connect and select Connect your application. Select python and 3.6 or later. Then copy the link and paste in data.json. Edit the password (remove < > too). And done

  • Now go to Browse Collections and click Add My Own Data . Enter whatever db and collection name you want to use. Later to connect to that db you can do foo = cluster["database"]["collection"] in the code. Like ecomoney = cluster["eco"]["money"].

  • That's it for db setup.

About

A Economy Bot made using discord module of python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%