Bot

class glados.bot.BotImporter(bots_dir)[source]
Parameters:bots_dir (str) –
import_bots()[source]

Import all bots in the bots config folder

class glados.bot.GladosBot(token, name, signing_secret=None, **kwargs)[source]

GLaDOS Bot represents all the required data and functions for a Slack bot.

Notes

All Slack Web API functions can be called from MyBot.client.*

Parameters:
  • name (str) – The name of the bot (URL Safe)
  • token (Union[str, Dict[str, str]]) – The bot token
  • signing_secret (Union[str, Dict[str, str], None]) – The bot signing secret.
name

The name of the bot (URL Safe)

Type:str
token

The bot token

Type:str
client

A Slack client generated for that bot

Type:WebClient
signing_secret

The bots signing secret.

Type:str
delete_message(channel, ts)[source]

Deletes a message that was sent by a bot

Parameters:
  • channel (str) –
  • ts (str) –
Return type:

MockObject

send_message(channel, message)[source]

Send a message as the bot

Parameters:
  • channel (str) – channel to send the message to
  • message (MockObject) – message object to send
Return type:

MockObject

update_message(channel, ts, message)[source]

Updates a message that was sent by the bot

Parameters:
  • channel (str) –
  • ts (str) –
  • message (MockObject) –
Return type:

MockObject

validate_slack_signature(request)[source]
Parameters:request (GladosRequest) –