core module

class shellbot.plugins.core.setup.Core(*args, **kwargs)

Implement the Core plugin. This plugin requires an update when the Discord Client is ready.

coroutine cat(ctx, *, target)

Implement the cat command.

Parameters:
  • ctx (Context) – The command context.
  • target (str) – Data name to read.
coroutine chmod(ctx, *, px=None, nx=None)

Implement the chmod command.

Parameters:
  • ctx (Context) – The command context.
  • px (list[str] [optional]) – List of names to enable.
  • nx (list[str] [optional]) – List of names to disable.
coroutine config(ctx, **kwargs)

Implement the config command.

Parameters:
  • ctx (Context) – The command context.
  • L (bool [optional]) – Require mentions.
  • K (bool [optional]) – Keep the voice connection.
  • reset (bool [optional]) – Reset the configuration.
  • default (bool [optional]) – Display default configuration.
  • prefix (str [optional]) – New prefix.
  • verbose (int [optional]) – Logging verbosity.
coroutine config_export(ctx, **kwargs)

Implement the config_export command.

Parameters:ctx (Context) – The command context.
Raise:NotFound – No configuration found.
coroutine config_import(ctx, *, keep=False)

Implement the config_import command.

Parameters:
  • ctx (Context) – The command context.
  • keep (bool [optional]) – Keep configuration after import.
Raise:

NotFound – Nothing to import.

Raise:

BadArgument – Cannot import.

coroutine debug_command(ctx)

Implement the debug command.

Parameters:ctx (Context) – The command context.
coroutine ignoreme(ctx)

Implement the ignore command.

Parameters:ctx (Context) – The command context.
coroutine log(ctx, *, stderr=None, dates=None, **kwargs)

Implement the log command.

Parameters:
  • ctx (Context) – The command context.
  • stderr (str [optional]) – A valid channel id.
  • reset (bool [optional]) – Delete stderr channel.
  • dates (list [optional]) – Fetch the logs for given period or specific date.
Raise:

NotFound – Channel not found.

Raise:

CommandError – Not in stderr.

coroutine ragequit(ctx)

Implement the rq command.

Parameters:ctx (Context) – The command context.
coroutine sleep(ctx, *, time=None, delay=None, dt=None, cancel=False)

Implement the sleep command.

Parameters:
  • ctx (Context) – The command context.
  • time (TimeData) – Optional time descriptor.
  • delay (TimeExpression) – Optional sleeping task delay.
  • dt (TimeExpression) – Optional sleeping task duration.
  • cancel (bool [optional]) – Cancel the sleeping task.
coroutine test(ctx)

Implement the test command.

coroutine top(ctx)

Implement the top command.

Parameters:ctx (Context) – The command context.

Helpers

class shellbot.plugins.core.lib.helpers.UI

Namespace for user interfaces.

class chmod(context, resolver, messenger)

A helper context for the chmod command. Concerned context data are given by the context data property.

Parameters:
  • context (Context) – The command context.
  • resolver (callable) – Helper to resolve names.
  • messenger (callable) – A messenger service used for context notifications.
__init__(context, resolver, messenger)

Initialize self. See help(type(self)) for accurate signature.

on_server()

Return a py314.theory.TheoreticSet of plugins currently enabled on the server.

__enter__()

Return self and open a context.

__exit__(exc_type, exc_val, exc_tb)

If an exception is raised while in the context, a rollback is done via the Memento in Server. Otherwise, save the new server components.

parse(names)

For every name in names, search for a component according to a set of predefined rules. Each name is either a normal component name which contains no special prefix or suffix, or an extended name whose prefix or suffix follow the forgoing mentioned rules.

A component is stored inside a dictionary, whose structure is given by arrows scope → component, where scope is the interpreted prefix and component is a Component.

The search is performed by the API resolver. Exceptions are raised if a component does not exist, is essential or is disabled.

Parameters:names (list) – Extended components names.

See also

ComponentMatch

See also

ComponentSyntax

update(state, scope, components)

Change the server’s state components on the same given scope via update_component().

Parameters:
  • state (State) – New component state.
  • scope (Scope) – Scope where to update the component.
  • components (list) – A list of Component.
__weakref__

list of weak references to the object (if defined)

coroutine notify(state, scope, components)

Notify the channel context that modifications were applied.

Parameters:
  • state (State) – New component state.
  • scope (Scope) – Modifications scope.
  • components (list) – Components changed.
coroutine parse_and_commit(state, names)

For all (extended) name in names, retrieve the component and update its state to state accordingly.

Parameters:
  • state (State) – New component state.
  • names (list) – List of extended components names.
__weakref__

list of weak references to the object (if defined)