This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code for a very basic bot using response metadata
- Loading branch information
Showing
15 changed files
with
296 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
var demo_features_quick_reply = require('./demo_features_quick_reply') | ||
|
||
module.exports = { | ||
"welcome_message": { | ||
"message_data": { | ||
"text": "Select a feature to demo.", | ||
"quick_reply": demo_features_quick_reply | ||
"quick_reply": require('./fragment_demo_features_options') | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = { | ||
metadata_trigger: 'feature_buttons', | ||
message_event: { | ||
"event": { | ||
"type": "message_create", | ||
"message_create": { | ||
"target": { | ||
"recipient_id": undefined | ||
}, | ||
"message_data": { | ||
"text": "You can see buttons attached to this message! Some customer experiences require actions outside of Direct Messages. Create interactions that open webviews, Tweet compose windows and other external links. \n\nNotice that you can combine Buttons with a Quick Reply. Select another feature when you are ready.", | ||
"quick_reply": require('./fragment_demo_features_options'), | ||
"ctas": [ | ||
{ | ||
"type": "web_url", | ||
"label": "Follow @TwitterDev", | ||
"url": "https://twitter.com/intent/follow?screen_name=twitterdev" | ||
}, | ||
{ | ||
"type": "web_url", | ||
"label": "Visit dev.twitter.com", | ||
"url": "https://dev.twitter.com" | ||
}, | ||
{ | ||
"type": "web_url", | ||
"label": "Learn more about Buttons", | ||
"url": "https://dev.twitter.com/rest/direct-messages/buttons" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
metadata_trigger: 'feature_location_sharing', | ||
message_event: { | ||
"event": { | ||
"type": "message_create", | ||
"message_create": { | ||
"target": { | ||
"recipient_id": undefined | ||
}, | ||
"message_data": { | ||
"text": "You can see a request to share your location attached to this message! Location sharing allows business to get essential context for delivering many customer experiences -- examples include an automated location finder bot, helping a human agent interpret complaints about mobile phone service, or personalizing news content.", | ||
"quick_reply": { | ||
"type": "location", | ||
"location": { | ||
"metadata": "feature_location_sharing_response" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
metadata_trigger: 'feature_location_sharing_response', | ||
message_event: { | ||
"event": { | ||
"type": "message_create", | ||
"message_create": { | ||
"target": { | ||
"recipient_id": undefined | ||
}, | ||
"message_data": { | ||
"text": "Select another feature or learn more about Location Sharing.", | ||
"quick_reply": require('./fragment_demo_features_options'), | ||
"ctas": [ | ||
{ | ||
"type": "web_url", | ||
"label": "Learn more about Location Sharing", | ||
"url": "https://dev.twitter.com/rest/direct-messages/quick-replies/location" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
metadata_trigger: 'feature_quick_reply_input_response', | ||
message_event: { | ||
"event": { | ||
"type": "message_create", | ||
"message_create": { | ||
"target": { | ||
"recipient_id": undefined | ||
}, | ||
"message_data": { | ||
"text": "Select another feature or learn more about Quick Reply Text Input.", | ||
"quick_reply": require('./fragment_demo_features_options'), | ||
"ctas": [ | ||
{ | ||
"type": "web_url", | ||
"label": "Learn more about Text Input", | ||
"url": "https://dev.twitter.com/rest/direct-messages/quick-replies/text-input" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
metadata_trigger: 'feature_quick_reply_options_response', | ||
message_event: { | ||
"event": { | ||
"type": "message_create", | ||
"message_create": { | ||
"target": { | ||
"recipient_id": undefined | ||
}, | ||
"message_data": { | ||
"text": "Select another feature or learn more about Quick Reply Options.", | ||
"quick_reply": require('./fragment_demo_features_options'), | ||
"ctas": [ | ||
{ | ||
"type": "web_url", | ||
"label": "Learn more about Options", | ||
"url": "https://dev.twitter.com/rest/direct-messages/quick-replies/options" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = { | ||
"type": "options", | ||
"options": [ | ||
{ | ||
"label": "Quick Reply: Options", | ||
"description": "Prompt a user to select from list of predefined options.", | ||
"metadata": "feature_quick_reply_options" | ||
}, | ||
{ | ||
"label": "Quick Reply: Text Input", | ||
"description": "Prompt a user with hint text and a restricted keyboard.", | ||
"metadata": "feature_quick_reply_input" | ||
}, | ||
{ | ||
"label": "Location Sharing", | ||
"description": "Prompt a user to share their location with an interactive map.", | ||
"metadata": "feature_location_sharing" | ||
}, | ||
{ | ||
"label": "Buttons", | ||
"description": "Prompt a user with buttons linked to URLs.", | ||
"metadata": "feature_buttons" | ||
} | ||
] | ||
} |
Oops, something went wrong.