Slack Events

This package contains all events

Base Classes and Utilities

class slackly.events._base.BaseEvent

The base event

classmethod parse(event)

Given an event dictionary, gets the event schema and applies it to the dictionary, otherwise just returns the BaseEvent from the dict.

Parameters:event – A dict representing an event
Returns:A BaseEvent subclass
slackly.events._base.register_event(event_type)

This registered an event in the global event registry

Parameters:event_type – A str representing an event type
Returns:A callable that will register an event class as the given event type

Events

class slackly.events.accounts_changed.AccountsChanged
Example json response
{
    "type": "accounts_changed"
}

For more information see https://api.slack.com/events/accounts_changed

class slackly.events.bot_added.BotAdded
Example json response
{
    "type": "bot_added",
    "bot": {
        "id": "B024BE7LH",
        "app_id": "A4H1JB4AZ",
        "name": "hugbot",
        "icons": {
            "image_48": "https:\/\/slack.com\/path\/to\/hugbot_48.png"
        }
    }
}

For more information see https://api.slack.com/events/bot_added

class slackly.events.accounts_changed.AccountsChanged
Example json response
{
    "type": "accounts_changed"
}

For more information see https://api.slack.com/events/accounts_changed

class slackly.events.bot_added.BotAdded
Example json response
{
    "type": "bot_added",
    "bot": {
        "id": "B024BE7LH",
        "app_id": "A4H1JB4AZ",
        "name": "hugbot",
        "icons": {
            "image_48": "https:\/\/slack.com\/path\/to\/hugbot_48.png"
        }
    }
}

For more information see https://api.slack.com/events/bot_added

class slackly.events.bot_changed.BotChanged
Example json response
{
    "type": "bot_changed",
    "bot": {
        "id": "B024BE7LH",
        "app_id": "A4H1JB4AZ",
        "name": "hugbot",
        "icons": {
            "image_48": "https:\/\/slack.com\/path\/to\/hugbot_48.png"
        }
    }
}

For more information see https://api.slack.com/events/bot_changed

class slackly.events.channel_archive.ChannelArchive
Example json response
{
    "type": "channel_archive",
    "channel": "C024BE91L",
    "user": "U024BE7LH"
}

For more information see https://api.slack.com/events/channel_archive

class slackly.events.channel_created.ChannelCreated
Example json response
{
    "type": "channel_created",
    "channel": {
        "id": "C024BE91L",
        "name": "fun",
        "created": 1360782804,
        "creator": "U024BE7LH"
    }
}

For more information see https://api.slack.com/events/channel_created

class slackly.events.channel_deleted.ChannelDeleted
Example json response
{
    "type": "channel_deleted",
    "channel": "C024BE91L"
}

For more information see https://api.slack.com/events/channel_deleted

class slackly.events.channel_history_changed.ChannelHistoryChanged
Example json response
{
    "type": "channel_history_changed",
    "latest": "1358877455.000010",
    "ts": "1361482916.000003",
    "event_ts": "1361482916.000004"
}

For more information see https://api.slack.com/events/channel_history_changed

class slackly.events.channel_joined.ChannelJoined
Example json response
{
    "type": "channel_joined",
    "channel": {
         ...
    }
}

For more information see https://api.slack.com/events/channel_joined

class slackly.events.channel_left.ChannelLeft
Example json response
{
    "type": "channel_left",
    "channel": "C024BE91L"
}

For more information see https://api.slack.com/events/channel_left

class slackly.events.channel_marked.ChannelMarked
Example json response
{
    "type": "channel_marked",
    "channel": "C024BE91L",
    "ts": "1401383885.000061"
}

For more information see https://api.slack.com/events/channel_marked

class slackly.events.channel_rename.ChannelRename
Example json response
{
    "type": "channel_rename",
    "channel": {
        "id":"C02ELGNBH",
        "name":"new_name",
        "created":1360782804
    }
}

For more information see https://api.slack.com/events/channel_rename

class slackly.events.channel_unarchive.ChannelUnarchive
Example json response
{
    "type": "channel_unarchive",
    "channel": "C024BE91L",
    "user": "U024BE7LH"
}

For more information see https://api.slack.com/events/channel_unarchive

class slackly.events.commands_changed.CommandsChanged
Example json response
{
    "type": "commands_changed",
    "event_ts" : "1361482916.000004"
}

For more information see https://api.slack.com/events/commands_changed

class slackly.events.desktop_notification.DesktopNotification
Example json response
{
    "type": "desktop_notification",
    "title": "FoolishBotDev",
    "subtitle": "#new_channel",
    "msg": "1489584201.102512",
    "content": "hunter: hi @basebot",
    "channel": "C1QCTSZAM",
    "launchUri": "slack://channel?id=C1QCTSZAM&message=1489584201102512&team=T1NASNDSP",
    "avatarImage": "https://secure.gravatar.com/avatar/13affcd29fcf0d3e861f5ca2c8eedc44.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0019-192.png",
    "ssbFilename": "knock_brush.mp3",
    "imageUri": null,
    "is_shared": false,
    "event_ts": "1489584201.895898"
}

This event tye is undocumented

class slackly.events.dnd_updated.DndUpdated
Example json response
{
    "type": "dnd_updated",
    "user": "U1234",
    "dnd_status": {
        "dnd_enabled": true,
        "next_dnd_start_ts": 1450387800,
        "next_dnd_end_ts": 1450423800,
        "snooze_enabled": true,
        "snooze_endtime": 1450373897
    }
}

For more information see https://api.slack.com/events/dnd_updated

class slackly.events.dnd_updated_user.DndUpdatedUser
Example json response
{
    "type": "dnd_updated_user",
    "user": "U1234",
    "dnd_status": {
        "dnd_enabled": true,
        "next_dnd_start_ts": 1450387800,
        "next_dnd_end_ts": 1450423800
    }
}

For more information see https://api.slack.com/events/dnd_updated_user

class slackly.events.email_domain_changed.EmailDomainChanged
Example json response
{
    "type": "email_domain_changed",
    "email_domain":"example.com",
    "event_ts": "1360782804.083113"
}

For more information see https://api.slack.com/events/email_domain_changed

class slackly.events.emoji_changed.EmojiChanged
Example json response
{
    "type": "emoji_changed",
    "subtype": "remove",
    "names": ["picard_facepalm"],
    "event_ts" : "1361482916.000004"
}

For more information see https://api.slack.com/events/emoji_changed

class slackly.events.file_change.FileChange
Example json response
{
    "type": "file_change",
    "file": {  ...  }
}

For more information see https://api.slack.com/events/file_change

class slackly.events.file_comment_added.FileCommentAdded
Example json response
{
    "type": "file_comment_added",
    "file": {  ...  },
    "comment": {  ...  }
}

For more information see https://api.slack.com/events/file_comment_added

class slackly.events.file_comment_deleted.FileCommentDeleted
Example json response
{
    "type": "file_comment_deleted",
    "file": {  ...  },
    "comment": "Fc67890"
}

For more information see https://api.slack.com/events/file_comment_deleted

class slackly.events.file_comment_edited.FileCommentEdited
Example json response
{
    "type": "file_comment_edited",
    "file": {  ...  },
    "comment": {  ...  }
}

For more information see https://api.slack.com/events/file_comment_edited

class slackly.events.file_created.FileCreated
Example json response
{
    "type": "file_created",
    "file": {  ...  }
}

For more information see https://api.slack.com/events/file_created

class slackly.events.file_deleted.FileDeleted
Example json response
{
    "type": "file_deleted",
    "file_id": "F2147483862",
    "event_ts": "1361482916.000004"
}

For more information see https://api.slack.com/events/file_deleted

class slackly.events.file_public.FilePublic
Example json response
{
    "type": "file_public",
    "file_id": "F4LDY26EL",
    "user_id": "USLACKBOT",
    "file": {  ...  }
    "event_ts": "1490062255.798583",
}

For more information see https://api.slack.com/events/file_public

class slackly.events.file_shared.FileShared
Example json response
{
    "type": "file_shared",
    "file": {  ...  }
}

For more information see https://api.slack.com/events/file_shared

class slackly.events.file_unshared.FileUnshared
Example json response
{
    "type": "file_unshared",
    "file": {  ...  }
}

For more information see https://api.slack.com/events/file_unshared

class slackly.events.goodbye.Goodbye
Example json response
{
    "type": "goodbye"
}

For more information see https://api.slack.com/events/goodbye

class slackly.events.group_archive.GroupArchive
Example json response
{
    "type": "group_archive",
    "channel": "G024BE91L"
}

For more information see https://api.slack.com/events/group_archive

class slackly.events.group_close.GroupClose
Example json response
{
    "type": "group_close",
    "user": "U024BE7LH",
    "channel": "G024BE91L"
}

For more information see https://api.slack.com/events/group_close

class slackly.events.group_history_changed.GroupHistoryChanged
Example json response
{
    "type": "group_history_changed",
    "latest": "1358877455.000010",
    "ts": "1361482916.000003",
    "event_ts": "1361482916.000004"
}

For more information see https://api.slack.com/events/group_history_changed

class slackly.events.group_joined.GroupJoined
Example json response
{
    "type": "group_joined",
    "channel": {
         ...
    }
}

For more information see https://api.slack.com/events/group_joined

class slackly.events.group_left.GroupLeft
Example json response
{
    "type": "group_left",
    "channel": "G02ELGNBH"
}

For more information see https://api.slack.com/events/group_left

class slackly.events.group_marked.GroupMarked
Example json response
{
    "type": "group_marked",
    "channel": "G024BE91L",
    "ts": "1401383885.000061"
}

For more information see https://api.slack.com/events/group_marked

class slackly.events.group_open.GroupOpen
Example json response
{
    "type": "group_open",
    "user": "U024BE7LH",
    "channel": "G024BE91L"
}

For more information see https://api.slack.com/events/group_open

class slackly.events.group_rename.GroupRename
Example json response
{
    "type": "group_rename",
    "channel": {
        "id":"G02ELGNBH",
        "name":"new_name",
        "created":1360782804
    }
}

For more information see https://api.slack.com/events/group_rename

class slackly.events.group_unarchive.GroupUnarchive
Example json response
{
    "type": "group_unarchive",
    "channel": "G024BE91L"
}

For more information see https://api.slack.com/events/group_unarchive

class slackly.events.hello.Hello
Example json response
{
    "type": "hello"
}

For more information see https://api.slack.com/events/hello

class slackly.events.im_close.ImClose
Example json response
{
    "type": "im_close",
    "user": "U024BE7LH",
    "channel": "D024BE91L"
}

For more information see https://api.slack.com/events/im_close

class slackly.events.im_created.ImCreated
Example json response
{
    "type": "im_created",
    "user": "U024BE7LH",
    "channel": {...}
}

For more information see https://api.slack.com/events/im_created

class slackly.events.im_history_changed.ImHistoryChanged
Example json response
{
    "type": "im_history_changed",
    "latest": "1358877455.000010",
    "ts": "1361482916.000003",
    "event_ts": "1361482916.000004"
}

For more information see https://api.slack.com/events/im_history_changed

class slackly.events.im_marked.ImMarked
Example json response
{
    "type": "im_marked",
    "channel": "D024BE91L",
    "ts": "1401383885.000061"
}

For more information see https://api.slack.com/events/im_marked

class slackly.events.im_open.ImOpen
Example json response
{
    "type": "im_open",
    "user": "U024BE7LH",
    "channel": "D024BE91L"
}

For more information see https://api.slack.com/events/im_open

class slackly.events.manual_presence_change.ManualPresenceChange
Example json response
{
    "type": "manual_presence_change",
    "presence": "away"
}

For more information see https://api.slack.com/events/manual_presence_change

class slackly.events.member_joined_channel.MemberJoinedChannel
Example json response
{
    "type": "member_joined_channel",
    "user": "W06GH7XHN",
    "channel": "C0698JE0H",
    "channel_type": "C",
    "inviter": "U123456789"
}

For more information see https://api.slack.com/events/member_joined_channel

class slackly.events.message.Message
Example json response
{
    "type": "message",
    "channel": "C2147483705",
    "user": "U2147483697",
    "text": "Hello world",
    "ts": "1355517523.000005"
}

For more information see https://api.slack.com/events/message

class slackly.events.pin_added.PinAdded
Example json response
{
    "type": "pin_added",
    "user": "U024BE7LH",
    "channel_id": "C02ELGNBH",
    "item": {
         ...
    },
    "event_ts": "1360782804.083113"
}

For more information see https://api.slack.com/events/pin_added

class slackly.events.pin_removed.PinRemoved
Example json response
{
    "type": "pin_removed",
    "user": "U024BE7LH",
    "channel_id": "C02ELGNBH",
    "item": {
         ...
    },
    "has_pins": false,
    "event_ts": "1360782804.083113"
}

For more information see https://api.slack.com/events/pin_removed

class slackly.events.pong.Pong
Example json response
{
    'type': 'pong'
}

This event type is returned after doing the special ping message

class slackly.events.pref_change.PrefChange
Example json response
{
    "type": "pref_change",
    "name": "messages_theme",
    "value": "dense"
}

For more information see https://api.slack.com/events/pref_change

class slackly.events.presence_change.PresenceChange
Example json response
{
    "type": "presence_change",
    "user": "U024BE7LH",
    "presence": "away"
}

For more information see https://api.slack.com/events/presence_change

class slackly.events.reaction_added.ReactionAdded
Example json response
{
    "type": "reaction_added",
    "user": "U024BE7LH",
    "reaction": "thumbsup",
    "item_user": "U0G9QF9C6",
    "item": {
        ...
    },
    "event_ts": "1360782804.083113"
}

For more information see https://api.slack.com/events/reaction_added

class slackly.events.reaction_removed.ReactionRemoved
Example json response
{
    "type": "reaction_removed",
    "user": "U024BE7LH",
    "reaction": "thumbsup",
    "item_user":"U0G9QF9C6",
    "item": {
        ...
    },
    "event_ts": "1360782804.083113"
}

For more information see https://api.slack.com/events/reaction_removed

class slackly.events.reconnect_url.ReconnectUrl
Example json response
{
    "type": "reconnect_url",
    "url": "wss://mpmulti-0m6f.slack-msgs.com/websocket/...."
}

For more information see https://api.slack.com/events/reconnect_url

class slackly.events.star_added.StarAdded
Example json response
{
    "type": "star_added",
    "user": "U024BE7LH",
    "item": {
         ...
    },
    "event_ts": "1360782804.083113"
}

For more information see https://api.slack.com/events/star_added

class slackly.events.star_removed.StarRemoved
Example json response
{
    "type": "star_removed",
    "user": "U024BE7LH",
    "item": {
         ...
    },
    "event_ts": "1360782804.083113"
}

For more information see https://api.slack.com/events/star_removed

class slackly.events.subteam_created.SubteamCreated
Example json response
{
    "type": "subteam_created",
    "subteam": {
        "id": "S0615G0KT",
        "team_id": "T060RNRCH",
        "is_usergroup": true,
        "name": "Marketing Team",
        "description": "Marketing gurus, PR experts and product advocates.",
        "handle": "marketing-team",
        "is_external": false,
        "date_create": 1446746793,
        "date_update": 1446746793,
        "date_delete": 0,
        "auto_type": null,
        "created_by": "U060RNRCZ",
        "updated_by": "U060RNRCZ",
        "deleted_by": null,
        "prefs": {
            "channels": [

            ],
            "groups": [

            ]
        },
        "user_count": "0"
        }
}

For more information see https://api.slack.com/events/subteam_created

class slackly.events.subteam_self_added.SubteamSelfAdded
Example json response
{
    "type": "subteam_self_added",
    "subteam_id": "S0615G0KT"
}

For more information see https://api.slack.com/events/subteam_self_added

class slackly.events.subteam_self_removed.SubteamSelfRemoved
Example json response
{
    "type": "subteam_self_removed",
    "subteam_id": "S0615G0KT"
}

For more information see https://api.slack.com/events/subteam_self_removed

class slackly.events.subteam_updated.SubteamUpdated
Example json response
{
    "type": "subteam_updated",
    "subteam": {
       "id": "S0614TZR7",
       "team_id": "T060RNRCH",
       "is_usergroup": true,
       "name": "Team Admins",
       "description": "A group of all Administrators on your team.",
       "handle": "admins",
       "is_external": false,
       "date_create": 1446598059,
       "date_update": 1446670362,
       "date_delete": 0,
       "auto_type": "admin",
       "created_by": "USLACKBOT",
       "updated_by": "U060RNRCZ",
       "deleted_by": null,
       "prefs": {
           "channels": [

           ],
           "groups": [

           ]
       },
       "users": [
           "U060RNRCZ",
           "U060ULRC0",
           "U06129G2V",
           "U061309JM"
       ],
       "user_count": "4"
    }
}

For more information see https://api.slack.com/events/subteam_updated

class slackly.events.team_domain_change.TeamDomainChange
Example json response
{
    "type": "team_domain_change",
    "url": "https://my.slack.com",
    "domain": "my"
}

For more information see https://api.slack.com/events/team_domain_change

class slackly.events.team_join.TeamJoin
Example json response
{
    "type": "team_join",
    "user": {
         ...
    }
}

For more information see https://api.slack.com/events/team_join

class slackly.events.team_migration_started.TeamMigrationStarted
Example json response
{
    "type": "team_migration_started",
}

For more information see https://api.slack.com/events/team_migration_started

class slackly.events.team_plan_change.TeamPlanChange
Example json response
{
    "type": "team_plan_change",
    "plan": "std"
}

For more information see https://api.slack.com/events/team_plan_change

class slackly.events.team_pref_change.TeamPrefChange
Example json response
{
    "type": "team_pref_change",
    "name": "slackbot_responses_only_admins",
    "value": true
}

For more information see https://api.slack.com/events/team_pref_change

class slackly.events.team_profile_change.TeamProfileChange
Example json response
{
    "type": "team_profile_change",
    "profile": {
        "fields": [
            {
                "id": "Xf06054AAA",
                ...
            },
            ...
        ]
    }
}

For more information see https://api.slack.com/events/team_profile_change

class slackly.events.team_profile_delete.TeamProfileDelete
Example json response
{
    "type": "team_profile_delete",
    "profile": {
        "fields": [
            "Xf06054AAA",
            ...
        ]
    }
}

For more information see https://api.slack.com/events/team_profile_delete

class slackly.events.team_profile_reorder.TeamProfileReorder
Example json response
{
    "type": "team_profile_reorder",
    "profile": {
        "fields": [
            {
                "id": "Xf06054AAA",
                "ordering": 0,
            },
            ...
        ]
    }
}

For more information see https://api.slack.com/events/team_profile_reorder

class slackly.events.team_rename.TeamRename
Example json response
{
    "type": "team_rename",
    "name": "New Team Name Inc."
}

For more information see https://api.slack.com/events/team_rename

class slackly.events.thread_marked.ThreadMarked

This event type is under development

class slackly.events.thread_subscribed.ThreadSubscribed

This event type is under development

class slackly.events.thread_unsubscribed.ThreadUnsubscribed

This event type is under development

class slackly.events.update_thread_state.UpdateThreadState

This event type is under development

class slackly.events.url_verification.UrlVerification
Example json response
{
    "token": "Jhj5dZrVaK7ZwHHjRyZWjbDl",
    "challenge": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P",
    "type": "url_verification"
}

For more information see https://api.slack.com/events/url_verification

class slackly.events.user_change.UserChange
Example json response
{
    "type": "user_change",
    "user": {
        ...
    }
}

For more information see https://api.slack.com/events/user_change

class slackly.events.user_typing.UserTyping
Example json response
{
    "type": "user_typing",
    "channel": "C02ELGNBH",
    "user": "U024BE7LH"
}

For more information see https://api.slack.com/events/user_typing