erin.db.drivers package

Submodules

erin.db.drivers.mongo module

class erin.db.drivers.mongo.MongoClient(config, bot=None, *args, **kwargs)[source]

Bases: motor.motor_asyncio.AsyncIOMotorClient, erin.db.abc.DatabaseDriverBase

get(entity, state)[source]

Grabs the value stored for an entity’s state.

Parameters:
  • entity – Any discord object with an id attribute
  • state – An event passed as str
Returns:

Returns the state’s value if found or returns None

increment(entity, state, value)[source]

Increments an existing state’s value.

Parameters:
  • entity – Any discord object with an id attribute
  • state – A state of type int
  • value – The value to increment the state by
upsert(entity, **states)[source]

Updates an existing state’s value. Creates a state if it does not exist. Also creates a database collection for each entity type when needed.

Parameters:
  • entity – Any discord object with an id attribute
  • states – A dict of state and possible values

Module contents