Commands

LAST EDIT Feb 16 2021

By default the following commands are supported:

  • /giphy query
  • /imgur query
  • /ban @userid reason
  • /unban @userid
  • /mute @userid
  • /unmute @userid
  • /flag @userid

Additionally, it’s possible to add your own commands. Commands are implemented using actions and attachments. Let’s have a look what data is returned when you run /giphy rock.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ 
    "args": "rock", 
    "attachments": [ 
        { 
            "type": "image", 
            "thumb_url": "https://media0.giphy.com/media/3o85xx69HG11jP4QI/giphy.gif", 
        } 
        "actions": [ 
            { 
                "name": "image_action", 
                "text": "Send", 
                "style": "primary", 
                "type": "button", 
                "value": "send" 
            }, 
            { 
                "name": "image_action", 
                "text": "Shuffle", 
                "style": "default", 
                "type": "button", 
                "value": "shuffle" 
            }, 
            { 
                "name": "image_action", 
                "text": "Cancel", 
                "style": "default", 
                "type": "button", 
                "value": "cancel" 
            } 
        ] 
    ], 
    "command": "giphy", 
    "created_at": "2018-11-30T21:25:04.147725Z", 
    "html": "<p>/gihpy rock</p>\n", 
    "id": "33", 
    "reactions": [], 
    "reply_count": 0, 
    "status": "received", 
    "text": "/giphy rock", 
    "type": "ephemeral", 
    "updated_at": "2018-11-30T21:25:04.147725Z", 
    "user": { 
        "id": "thierry", 
        "image": "myimageurl", 
        "name": "Thierry", 
        "role": "admin", 
        "status": "busy" 
    } 
}

Actions

Copied!

Actions have a name, text, style, type, and value attributes. These simple fields allow you to build complex interactions with your bots & slash commands. All of the available Stream UI Components know how to render these actions. So for /giphy ocean, the result will be this: