API Reference

Reference to all of available classes, methods, attributes, etc.

DiscordDB Client

class discordDB.DiscordDB(bot, db_channel_id: int)[source]

The Discord database client.

Parameters
  • bot (discord.ext.commands.Bot) – An instance of discord.py Client or Bot representing your discord application.

  • db_channel_id (int) – An integer representing ID of Discord channel you want to be used as database.

property channel

A property which returns an instance of discord.TextChannel which is being used as database.

async get(_id: int) discordDB.models.types.Data[source]

A method used to get your saved data from the database channel.

Parameters

_id (int) – An special integer which was received from the discordDB.DiscordDB.set() method.

Returns

An instance of discordDB.models.Data, similar to python dictionaries but also supports accessing of its key using . syntax.

Return type

Data

async set(data: dict) int[source]

A method to post and save data to your database channel.

Parameters

data (dict) – Dictionary representing your raw data.

Returns

An special integer which should be saved by the client to get this same data later.

Return type

int

Data Types

class discordDB.models.Data[source]

Actually a superset class of python dictionaries, which also supports accessing of its keys using . syntax.

created_atdatetime.datetime

The time this data was created in UTC.