Last active
September 7, 2017 08:05
-
-
Save toracle/de93c142fcb5a81e44a4b080c1928899 to your computer and use it in GitHub Desktop.
tutorial-opsworksbot-start
This file contains hidden or 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
| from bothub_client.bot import BaseBot | |
| class Bot(BaseBot): | |
| def on_start(self, event, context): | |
| message = Message(event) | |
| message.set_text('\n'.join([ | |
| "Hello, I'm OpsworksBot.", | |
| '', | |
| 'I help you to manage Opsworks with ease. You can navigate stacks and layers, execute a deployment with me.', | |
| '', | |
| 'To let me work, you need to tell me your access-key and secret-access-key which has a proper permission on Opsworks', | |
| ])) | |
| message.add_quick_reply("Yes, I'll tell you my credentials", '/intent credentials') | |
| message.add_quick_reply("No, thanks") | |
| self.send_message(message) | |
| def on_help(self, event, context): | |
| message = Message(event) | |
| message.set_text('Let me tell you what can I do.') | |
| message.add_postback_button('Stack List', '/stacks') | |
| message.add_postback_button('Layer List', '/layers') | |
| message.add_postback_button('Deploy', '/deploy') | |
| self.send_message(message) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment