Dynamic mod.

add_object

async 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

async daf.core.add_object(obj: typing.Union[daf.guild.guilduser.USER, daf.guild.guilduser.GUILD, daf.guild.autoguild.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.

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

add_object

async 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.guilduser.GUILD, daf.guild.guilduser.USER]) None

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: 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.