Constructor
new RandomImageResponder(options)
Create a bot random image responder.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The responder options.
|
Examples
new Bot.Responder.RandomImage({
images: [
'https://i.imgur.com/ydM3Wb4.gif',
'https://media.giphy.com/media/XdACBmg3lx6RG/giphy.gif'
]
});
new Bot.Responder.RandomImage({
images: [
{
image: 'https://i.imgur.com/ydM3Wb4.gif',
label: 'Some cute goats'
},
{
image: 'https://media.giphy.com/media/XdACBmg3lx6RG/giphy.gif',
label: 'A goat with ice-skating skills'
}
]
});
new Bot.Responder.RandomImage({
label: 'Have a goat',
color: '#ffced8',
images: [
'https://i.imgur.com/ydM3Wb4.gif',
'https://media.giphy.com/media/XdACBmg3lx6RG/giphy.gif'
]
});
Extends
Methods
(static) create() → {RandomImageResponder}
Create a bot random image responder (see RandomImageResponder for parameters).
- Source:
(async) respond(message) → {Promise}
Respond to an incoming message with a random responder message.
- Overrides:
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Object
|
The Slack message to respond to. |
Returns:
- Type:
-
Promise
A promise which resolves when the message is sent.