slackminion.plugins.core package

Submodules

slackminion.plugins.core.acl module

class slackminion.plugins.core.acl.AuthManager(bot: Bot, **kwargs)[source]

Bases: slackminion.plugin.base.BasePlugin

Basic Authorization Plugin

acl(msg, args)[source]

ACL Management.

Usage: !acl _action_ [args]

Actions: new _acl_ - Create a new ACL delete _acl_ - Delete an ACL

allow _acl_ _user_ - Add user to the acl allow block deny _acl_ _user_ - Add user to the acl deny block remove _acl_ _user_ - Remove user from acl allow and deny blocks

show - Show all defined ACLs show _acl_ - Show allow and deny blocks of specified ACL

acl_allow(name, user)[source]
acl_check(cmd, user)[source]
acl_delete(name)[source]
acl_deny(name, user)[source]
acl_new(name)[source]
acl_remove(name, user)[source]
acl_show(msg, args)[source]

Show current allow and deny blocks for the given acl.

add_user_to_allow(name, user)[source]

Add a user to the given acl allow block.

add_user_to_deny(name, user)[source]

Add a user to the given acl deny block.

static admin_check(cmd, user)[source]
create_acl(name)[source]

Create a new acl.

delete_acl(name)[source]

Delete an acl.

on_load()[source]

Executes when a plugin is loaded.

Override this if your plugin needs to do initialization when loading. Do not use this to restore runtime changes to variables – they will be overwritten later on by PluginManager.load_state()

remove_user_from_acl(name, user)[source]

Remove a user from the given acl (both allow and deny).

slackminion.plugins.core.acl.acl_mgt_command(f)[source]
slackminion.plugins.core.acl.user_mgt_command(f)[source]

slackminion.plugins.core.core module

class slackminion.plugins.core.core.Core(bot: Bot, **kwargs)[source]

Bases: slackminion.plugin.base.BasePlugin

bot_status()[source]
help(msg, args)[source]

Displays help for each command

save(msg, args)[source]

Causes the bot to write its current state to backend.

shutdown(msg, args)[source]

Causes the bot to gracefully shutdown.

sleep(msg, args)[source]

Causes the bot to ignore all messages from the channel.

Usage: !sleep [channel name] - ignore the specified channel (or current if none specified)

wake(msg, args)[source]

Causes the bot to resume operation in the channel.

Usage: !wake [channel name] - unignore the specified channel (or current if none specified)

whoami(msg, args)[source]

Prints information about the user and bot version.

slackminion.plugins.core.user module

class slackminion.plugins.core.user.UserManager(bot: Bot, **kwargs)[source]

Bases: slackminion.plugin.base.BasePlugin

Loads and stores user information

get(userid)[source]

Retrieve user by id

get_by_username(username)[source]

Retrieve user by username

load_user_info(user)[source]

Loads additional user information and stores in user object

load_user_rights(user)[source]

Sets permissions on user object

on_load()[source]

Executes when a plugin is loaded.

Override this if your plugin needs to do initialization when loading. Do not use this to restore runtime changes to variables – they will be overwritten later on by PluginManager.load_state()

set(user)[source]

Adds a user object to the user manager

user - a SlackUser object

Module contents