API Reference

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

DiscordDB Client

class discordDBPlus.DiscordDB
save(data, channel_id)

Send a message with the data in it to the data channel.

Parameters
  • data (dict) – The dict data to save

  • channel_id (int) – The channel to send the data in.

Returns

An int containing the message’s in which the data was saved.

Return type

int


saves(data)

Send multiple messages with multiple data in them.

Parameters

data (list) – A list of dict datas to send messages from

Returns

A list containing ints of the messages in which the data dicts was saved in.

Return type

list[int]

Note

The format of the dict must follow this pattern:

{"channel_id": int, "data": {The normal data you want to send.}}


get(message_id, channel_id)

Get the data from a given message.

Parameters
  • message_id (int) – The id of the message to get the data from

  • channel_id (int) – The channel to get the data from

Returns

Data

Return type

dict


getf(message_id, field, channel_id)

Get only one data field from the given message.

Parameters
  • message_id (int) – The id of the message to get the data from

  • field (str) – The field name from which the data will be taken.

  • channel_id (int) – The channel to get the data from

Returns

The field value

Return type

str


edit(data, id, channel_id)

Edit a given message.

Parameters
  • data (dict) – The data which will be used to update the embed message

  • id (int) – The id of the message to update

  • channel_id (int) – The channel to edit the data in


search(ids, field, channel_ids)

Searches a field value in multiple messages and channels and returns all the results.

Parameters
  • ids (list) – Ids in which to search the data in

  • field (str) – A field name

  • channel_ids (list[int]) – The channel to search the data in

Returns

A list of dicts with message id and field value

Return type

list[dict] or None


Data Types

class discordDBPlus.models.Data

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

Exceptions

class discordDBPlus.models.FieldError

Raised when a specified Field doesn’t exists in a given message data