Dynamic mod.#

add_object#

daf.core.add_object(obj: <class 'daf.client.ACCOUNT'>) None#

Adds an account to the framework.

Parameters:

obj (client.ACCOUNT) – The account object to add

Raises:
  • ValueError – The account has already been added to the list.

  • TypeErrorobj is of invalid type.

add_object#

daf.core.add_object(obj: typing.Union[daf.guild.USER, daf.guild.GUILD, daf.guild.AutoGUILD],snowflake: <class 'daf.client.ACCOUNT'>) None#

Adds a guild or an user to the daf.

Parameters:
  • obj (guild.USER | guild.GUILD | guild.AutoGUILD) – The guild object to add into the account (snowflake).

  • snowflake (client.ACCOUNT=None) – The account to add this guild/user to.

Raises:
  • ValueError – The guild/user is already added to the daf.

  • TypeError – The object provided is not supported for addition.

  • TypeError – Invalid parameter type.

  • RuntimeError – When using deprecated method of adding items to the shill list, no accounts were available.

  • Other – Raised in the obj.initialize() method

add_object#

daf.core.add_object(obj: Union[daf.message.text_based.DirectMESSAGE, daf.message.text_based.TextMESSAGE, daf.message.voice_based.VoiceMESSAGE], snowflake: Union[daf.guild.GUILD, daf.guild.USER]) None#

Deprecated since version v2.4: Using int, discord.* objects in the snowflake parameter. This functionality is planned for removal in v2.5.

Adds a message to the daf.

Parameters:
Raises:
  • TypeError – The object provided is not supported for addition.

  • ValueError – guild_id wasn’t provided when adding a message object (to which guild should it add)

  • ValueError – Missing snowflake parameter.

  • ValueError – Could not find guild with that id.

  • Other – Raised in the obj.add_message() method

remove_object#

async daf.core.remove_object(snowflake: Union[_BaseGUILD, BaseMESSAGE, AutoGUILD, ACCOUNT]) None#

Changed in version v2.4.1: Turned async for fix bug of missing functionality

Changed in version v2.4: | Now accepts client.ACCOUNT. | Removed support for int and for API wrapper (PyCord) objects.

Removes an object from the daf.

Parameters:

snowflake (guild._BaseGUILD | message.BaseMESSAGE | guild.AutoGUILD | client.ACCOUNT) – The object to remove from the framework.

Raises:
  • ValueError – Item (with specified snowflake) not in the shilling list.

  • TypeError – Invalid argument.