📒
discord-super-utils
  • Introduction
  • Installation
  • Managers
    • Base
    • Leveling Manager
    • Database Manager
    • Music Manager
    • Page Manager
    • Reaction Manager
Powered by GitBook
On this page
  • EventManager
  • Attributes
  • Methods
  • CogManager
  • Attributes
  • Methods
  • DatabaseChecker
  • Attributes
  • Methods
  • Events

Was this helpful?

  1. Managers

Base

This page shows you everything about the base of discord-super-utils.

PreviousInstallationNextLeveling Manager

Last updated 3 years ago

Was this helpful?

EventManager

class discordSuperUtils.Base.EventManager()

Initializer of , represents an event manager that manages events for classes of discord-super-utils.

events

remove_event

add_event

event

call_event

Attributes

  • events (dict)

    • The events used by the .

Methods

  • remove_event(func, name=None) Removes an event from the event list. Parameters

    • func (function)

      • Function to remove.

    • name (str)

      • Name of event to remove, defaults to None

  • add_event(func, name=None) Adds an event to the event list. Parameters

    • func (function)

      • Function to add.

    • name (str)

      • Name of event to add, defaults to None

    Raises

    • TypeError

      • Function passed is not coroutine.

  • event(func, name=None) Decorator, adds an event to the event list, use this to register events. Parameters

    • func (function)

      • Function to register as an event. Must be async.

    • name (str)

      • Name of event to register, defaults to None

    Raises

    • TypeError

      • Function passed is not coroutine.

  • call_event(name, *args, **kwargs) Calls the event name with the arguments. This method is a coroutine. Parameters

    • name (str)

      • Name of the event to call.

    • *args, **kwargs

      • Arguments to call the event with.

CogManager

class discordSuperUtils.Base.CogManager()

Cog

event

Attributes

  • Cog (discordSuperUtils.Base.CogManager.Cog)

    • Initializer of CogManager.Cog, represents a class which supports the user to create a cog.

    • This class must be inherited by the user's cog.

    • CogManager.Cog must be initialized after defining all the managers in the cog.

Methods

  • event(func, manager_type) Adds an event and binds it to the manager_type. This method is static. Parameters

    • func (function)

      • Function to add.

    • manager_type (class)

      • Type of manager that should bind to the event.

      • Examples:

        • discordSuperUtils.RoleManager

        • discordSuperUtils.LevelingManager

DatabaseChecker

class discordSuperUtils.Base.DatabaseChecker(tables_column_data, table_identifiers)

database

connect_to_database

on_database_connect

tables

table_identifiers

tables_column_data

Attributes

  • tables (Dict[str, str])

    • The tables the checker will use.

  • table_identifiers (List[str])

  • tables_column_data (List[Dict[str, str]])

Methods

  • connect_to_database(database, tables) Connects to the database and tables specified. Parameters

      • The database to connect to.

    • tables (List[str])

      • The tables the database will create.

Events

  • on_database_connect()

    This event is called when the database connects.

Initializer of , represents a class which supports the user to create a cog.

Initializer of , represents a class which ensures that a database is connected to a manager.

Inherits .

database ()

The database the will use.

The table names of the tables of .

The column types of the tables that the will make.

database()

EventManager
EventManager
CogManager
DatabaseChecker
EventManager
DatabaseChecker
DatabaseChecker
DatabaseChecker
Attributes
Methods
Attributes
Methods
Attributes
Methods
Events
DatabaseManager
DatabaseManager