Slashbot makes it easy to create slash commands using AWS Lambda functions. These can be handy for creating a secure way to execute automated tasks, even from a mobile device. Perfect for “chatops”.


  • Uses Slack’s Apps API (rather than the legacy slash command API)
  • Authenticates requests following Slack’s recommended best practice (
  • Supports multiple slash commands with a single bot
  • Enables limiting certain commands to specific users via a simple ACL model.


pip install slashbot [–target=source_directory]
(the –target option is used to include your packages in your source folder so they willl be included in your AWS Lambda artifact)


import os
import slashbot


# Define a default response
def default(cmd: slashbot.SlashCommand):
    if not cmd.provided_verb: #Nothing beyond the slash command
        return help(cmd)
    return (
        f"This is a default response. `{cmd.provided_verb}` is not a recognized command. \n"
        + help(cmd)

#Handlers take a SlashCommand as input and return text
def help(cmd: slashbot.SlashCommand):
    return f"Here is some helpful text"

def functionnamesdontmatter(cmd: slashbot.SlashCommand):
    return f"Hello {cmd.user_name}"

#This is your AWS Lambda event handler
def handler(event, context):
    return slashbot.main(event, context)


View Github