$ pip install discobase
You can add the demo bot to a server with this integration, or self-host it using the following commands:
$ git clone https://github.com/zerointensity/discobase
$ cd discobase/src/demo
$ export DB_BOT_TOKEN="first bot token"
$ export BOOKMARK_BOT_TOKEN="second bot token"
$ python3 main.py
import asyncio
import discobase
db = discobase.Database("My database")
@db.table
class User(discobase.Table):
name: str
password: str
async def main():
async with db.conn("My bot token"):
admin = await User.find(name="admin")
if not admin:
User.save(name="admin", password="admin")
if __name__ == "__main__":
asyncio.run(main())
Documentation is available here.
discobase
is distributed under the MIT
license.