enigma.core package

Submodules

enigma.core.constants module

enigma.core.exceptions module

exception enigma.core.exceptions.CoreError[source]

Bases: Exception

Base exception class for Core modules and internal use

exception enigma.core.exceptions.DatabaseError[source]

Bases: enigma.core.exceptions.CoreError

Error raised when a database operation fails.

exception enigma.core.exceptions.DatabaseKeyError(message)[source]

Bases: enigma.core.exceptions.DatabaseError

Raised when an attempt to fetch from the key value store fails.

exception enigma.core.exceptions.DatabaseTypeError(message)[source]

Bases: enigma.core.exceptions.DatabaseError

Raised when parameters passed are incorrect.

exception enigma.core.exceptions.EnvironmentVariableError(message)[source]

Bases: enigma.core.exceptions.UserError

Error raised when an environment variable is not configured properly.

exception enigma.core.exceptions.PluginError[source]

Bases: Exception

Base exception class for plugin errors

exception enigma.core.exceptions.PrimaryKeyError(message)[source]

Bases: enigma.core.exceptions.DatabaseError

Raised when there is either a primary key is missing or required.

exception enigma.core.exceptions.RecordExistsError(message)[source]

Bases: enigma.core.exceptions.DatabaseError

Raised when a record already exists.

exception enigma.core.exceptions.TableNotFoundError(message)[source]

Bases: enigma.core.exceptions.DatabaseError

Raised when a table is missing.

exception enigma.core.exceptions.UserError[source]

Bases: Exception

Base exception class raised as a byproduct of misconfiguration

enigma.core.loggers module

class enigma.core.loggers.BotLogger(name, level=0)[source]

Bases: logging.Logger

PLUGIN = 25
plugin(msg, *args, **kwargs)[source]

enigma.core.utils module

enigma.core.utils.config_loader(mappings, optional_envs)[source]
enigma.core.utils.find_cogs(package)[source]

Finds all modules in package and presents them in the format required by discord.ext.cli.Bot.load_extension().

This is useful when you need to load cogs from multiple areas of your bot. Simply convert your cogs directory into a package and run this method on it.

Parameters:package (package) – Your cogs directory as a python package.
Returns:A list of strings of format foo.bar as required by :func: load_extension. If package passed is not valid then None is returned instead.
Return type:list or None
enigma.core.utils.get_plugin_data(plugin)[source]

Retrieve the plugin_data dictionary defined in a plugin.

Parameters:plugin (path to a plugin in module import format) –
Returns:The plugin_data dict defined in a plugin or None if the dict is not defined.
Return type:dict or None

Module contents