Clients#

get_accounts#

daf.core.get_accounts() List[ACCOUNT]#

New in version v2.4.

Returns:

List of running accounts.

Return type:

List[client.ACCOUNT]

ACCOUNT#

class daf.client.ACCOUNT(token: str, is_user: Optional[bool] = False, intents: Optional[Intents] = None, proxy: Optional[str] = None, servers: Optional[List[Union[GUILD, USER, AutoGUILD]]] = None)#

New in version v2.4.

Represents an individual Discord account.

Each ACCOUNT instance runs it’s own shilling task.

Parameters:
  • token (str) – The Discord account’s token

  • is_user (Optional[bool] =False) – Declares that the token is a user account token (“self-bot”)

  • intents (Optional[discord.Intents]=discord.Intents.default()) – Discord Intents (settings of events that the client will subscribe to)

  • proxy (Optional[str]=None) –

    The proxy to use when connecting to Discord.

    Important

    It is RECOMMENDED to use a proxy if you are running MULTIPLE accounts. Running multiple accounts from the same IP address, can result in Discord detecting self-bots.

    Running multiple bot accounts on the other hand is perfectly fine without a proxy.

  • servers (Optional[List[guild.GUILD | guild.USER | guild.AutoGUILD]]=[]) – Predefined list of servers (guilds, users, auto-guilds).

property running: bool#

Is the account still running?

Returns:

  • True – The account is logged in and shilling is active.

  • False – The shilling has ended or not begun.

property deleted: bool#
returns: * True – The object is no longer in the framework and should no longer

be used.

  • False – Object is in the framework in normal operation.

property servers#

Returns all guild like objects inside the account’s s shilling list. This also includes AutoGUILD

property client: Client#

Returns the API wrapper client

async initialize()#

Initializes the API wrapper client layer.

Raises:

RuntimeError – Unable to login to Discord.

async add_server(server: Union[GUILD, USER, AutoGUILD])#

Initializes a guild like object and adds it to the internal account shill list.

Parameters:

server (guild.GUILD | guild.USER | guild.AutoGUILD) – The guild like object to add

Raises:

Any – Raised in daf.guild.GUILD.initialize() | daf.guild.USER.initialize() | daf.guild.AutoGUILD.initialize()

remove_server(server: Union[GUILD, USER, AutoGUILD])#

Removes a guild like object from the shilling list.

Parameters:

server (guild.GUILD | guild.USER | guild.AutoGUILD) – The guild like object to remove

Raises:

ValueErrorserver is not in the shilling list.

get_server(snowflake: Union[int, Guild, User, Object]) Optional[Union[GUILD, USER]]#

Retrieves the server based on the snowflake id or discord API object.

Parameters:

snowflake (Union[int, discord.Guild, discord.User, discord.Object]) – Snowflake ID or Discord API object.

Returns:

  • Union[guild.GUILD, guild.USER] – The DAF server object.

  • None – The object was not found.

async update(**kwargs)#

Updates the object with new parameters and afterwards updates all lower layers (GUILD->MESSAGE->CHANNEL).

Warning

After calling this method the entire object is reset.