omnibot.services.slack package

Submodules

omnibot.services.slack.bot module

class omnibot.services.slack.bot.Bot(team, name, data)

Bases: object

Class for representing a slack bot.

property bot_id
classmethod get_bot_by_bot_id(team, bot_id)
classmethod get_bot_by_name(team, name)
classmethod get_bot_by_verification_token(verification_token)
property interactive_component_handlers
property logging_context
property message_handlers
property name
property oauth_bot_token
property oauth_user_token
property slash_command_handlers
property team
property verification_token
exception omnibot.services.slack.bot.BotInitializationError

Bases: Exception

omnibot.services.slack.interactive_component module

class omnibot.services.slack.interactive_component.InteractiveComponent(bot, component, event_trace)

Bases: object

Class for representing a parsed slack InteractiveComponent.

property action_ts
property actions
property bot

The bot associated with the app that received this message from the slash component api. To get info about a bot that may have sent this message, see bot_id.

property callback_id
property channel
property channel_id
property component_type
property event_trace
property message
property parsed_channel
property parsed_user
property payload
property response_url
property submission
property team
property trigger_id
property user

omnibot.services.slack.message module

class omnibot.services.slack.message.Message(bot, event, event_trace)

Bases: object

Class for representing a parsed slack message.

property bot

The bot associated with the app that received this message from the event subscription api. To get info about a bot that may have sent this message, see bot_id.

property bot_id

The bot_id associated with the message, if the message if from a bot. If this message isn’t from a bot, this will return None.

property channel
property channel_id
property channels
property command_text
property directed
property emails
property event_trace
property match
property match_type
property mentioned
property parsed_text
property payload
set_match(match_type, match)
property specials
property subtype
property team
property text
property thread_ts
property ts
property urls
property user
property users
exception omnibot.services.slack.message.MessageUnsupportedError

Bases: Exception

omnibot.services.slack.parser module

omnibot.services.slack.parser.extract_channels(text, bot)
omnibot.services.slack.parser.extract_command(text, bot)
omnibot.services.slack.parser.extract_emails(text)
omnibot.services.slack.parser.extract_emojis(text)
omnibot.services.slack.parser.extract_mentions(text, bot, channel)
omnibot.services.slack.parser.extract_specials(text)
omnibot.services.slack.parser.extract_subteams(text, bot)
omnibot.services.slack.parser.extract_urls(text)
omnibot.services.slack.parser.extract_users(text, bot)
omnibot.services.slack.parser.replace_channels(text, channels)
omnibot.services.slack.parser.replace_emails(text, emails)
omnibot.services.slack.parser.replace_specials(text, specials)
omnibot.services.slack.parser.replace_urls(text, urls)
omnibot.services.slack.parser.replace_users(text, users)
omnibot.services.slack.parser.unextract_channels(text, bot)
omnibot.services.slack.parser.unextract_specials(text)
omnibot.services.slack.parser.unextract_users(text, bot)

omnibot.services.slack.slash_command module

class omnibot.services.slack.slash_command.SlashCommand(bot, command, event_trace)

Bases: object

Class for representing a parsed slack SlashCommand.

property bot

The bot associated with the app that received this message from the slash command api. To get info about a bot that may have sent this message, see bot_id.

property bot_id

The bot_id associated with the message, if the message if from a bot. If this message isn’t from a bot, this will return None.

property channel
property channel_id
property channels
property command
property emails
property enterprise_id
property enterprise_name
property event_trace
property parsed_text
property payload
property response_url
property specials
property team
property text
property trigger_id
property urls
property user_id
property users

omnibot.services.slack.team module

class omnibot.services.slack.team.Team(name, team_id)

Bases: object

Class for representing a slack team.

classmethod get_team_by_id(team_id)
classmethod get_team_by_name(name)
property logging_context
property name
property team_id
exception omnibot.services.slack.team.TeamInitializationError

Bases: Exception

Module contents

Slackclient wrapper.

omnibot.services.slack.client(bot, client_type='bot')

Global Slack client.

omnibot.services.slack.get_channel(bot, channel)

Get a channel, from its channel id

omnibot.services.slack.get_channel_by_name(bot, channel)

Get a channel, from its channel name. This function will only fetch from cache. If the channel isn’t in cache, it will return None.

omnibot.services.slack.get_channels(bot)
omnibot.services.slack.get_emoji(bot, name)
omnibot.services.slack.get_groups(bot)
omnibot.services.slack.get_im_channel_id(bot, user_id)
omnibot.services.slack.get_ims(bot)
omnibot.services.slack.get_mpims(bot)
omnibot.services.slack.get_name_from_user(user)
omnibot.services.slack.get_user(bot, user_id)

Get a user, from its user id

omnibot.services.slack.get_user_by_email(bot, email)
omnibot.services.slack.get_user_by_name(bot, username)
omnibot.services.slack.get_users(bot)
omnibot.services.slack.update_channel(bot, channel)
omnibot.services.slack.update_conversations(bot, team)
omnibot.services.slack.update_emoji(bot)
omnibot.services.slack.update_group(bot, group)
omnibot.services.slack.update_im(bot, im)
omnibot.services.slack.update_mpim(bot, mpim)
omnibot.services.slack.update_user(bot, user)
omnibot.services.slack.update_users(bot, team)