slackminion package

Submodules

slackminion.bot module

class slackminion.bot.Bot(config, test_mode=False, dev_mode=False)[source]

Bases: object

always_send_dm = []
api_client = None
at_user(user, channel_id, text, **kwargs)[source]

Appends @user Slack formatting to the beginning of a message.

  • user - The SlackUser to send to.
  • channel_id - The channel ID of the channel to send to
  • text - String to send
  • kwargs - add’l keyword arguments to pass to send_message()
bot_start_time = None
channels
get_channel(channel_id)[source]
get_channel_by_name(channel_name)[source]
get_my_conversations(*args, **kwargs)[source]
graceful_shutdown()[source]
is_setup = False
my_userid
my_username
rtm_client = None
run()[source]

Connects to slack and enters the main loop.

runnable = True
sc
send_im(user, text, parse=None)[source]

Sends a message to a user as an IM

  • user - The user to send to. This can be a SlackUser object, a user id, or the username (without the @)
  • text - String to send
send_message(channel, text, thread=None, reply_broadcast=None, attachments=None, parse=None, link_names=1)[source]

Sends a message to the specified channel

  • channel - The channel to send to. This can be a SlackConversation object, a channel id, or a channel name

(without the #) * text - String to send * thread - reply to the thread. See https://api.slack.com/docs/message-threading#threads_party * reply_broadcast - Set to true to indicate your reply is germane to all members of a channel * parse - Set to “full” for the slack api to linkify names and channels

shutting_down = False
start()[source]

Initializes the bot, plugins, and everything.

stop()[source]

Does cleanup of bot and plugins.

timers = []
update_channels()[source]
webserver = None

slackminion.dispatcher module

class slackminion.dispatcher.BaseCommand(method)[source]

Bases: object

execute(*args, **kwargs)[source]
formatted_help
short_help
class slackminion.dispatcher.MessageDispatcher[source]

Bases: object

ignore(channel)[source]
push(event, dev_mode=False)[source]

Takes a SlackEvent, parses it for a command, and runs against registered plugin

register_plugin(plugin)[source]

Registers a plugin and commands with the dispatcher for push()

unignore(channel)[source]
class slackminion.dispatcher.PluginCommand(method)[source]

Bases: slackminion.dispatcher.BaseCommand

class slackminion.dispatcher.WebhookCommand(method, form_params)[source]

Bases: slackminion.dispatcher.BaseCommand

execute()[source]

slackminion.exceptions module

exception slackminion.exceptions.DuplicateCommandError(name)[source]

Bases: Exception

exception slackminion.exceptions.DuplicatePluginError(name)[source]

Bases: Exception

exception slackminion.exceptions.NotSetupError[source]

Bases: Exception

slackminion.webserver module

class slackminion.webserver.Webserver(host, port)[source]

Bases: object

start()[source]
stop()[source]

Module contents