\n",
"\n",
"Welcome to the Opsdroid Playground.\n",
"\n",
"This interactive environment allows you to run opsdroid, build skills and test out your conversations.\n",
"\n",
"You will see four windows open in front of you. \n",
"\n",
"- **Notebook instructions and testing** - This page you are reading contains some instructions on how to use opsdroid and a handy `NotebookChat` tester.\n",
"- **skill.py** - An Opsdroid skill to get you started.\n",
"- **configuration.yaml** - An example Opsdroid configuration.\n",
"- **Terminal window** - Where we will run Opsdroid.\n",
"\n",
"We should already have Opsdroid installed so you can get things running by typing this command in the terminal window and pressing enter.\n",
"\n",
"```bash\n",
"opsdroid start -f configuration.yaml\n",
"```\n",
"\n",
"Then once you see the line `Opsdroid is now running` in the log output run the below notebook cell to connect the tester. Once you see the chat prompt and it says `Connected` try typing `ping` in the chat and hitting send."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from notebookchat import NotebookChat \n",
"chat = NotebookChat(\"localhost\", 8080)\n",
"chat.start()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Hopefully you should see Opsdroid reply with `pong`. This is because Opsdroid ran the `skill.py` script and matched on the phrase `ping`.\n",
"\n",
"Try editing the `skill.py` so that Opsdroid responds with something other than `pong` and save the file. \n",
"\n",
"Then restart Opsdroid by pressing `ctrl+c` in the terminal window and then `up` and `enter` to run the start command again.\n",
"\n",
"Once Opsdroid startup up run the cell above again to reconnect the chat. Then try sending `ping` again to see Opsdroid respond with your new message.\n",
"\n",
"## Next steps\n",
"\n",
"Now that you are up to speed with how to use the playground why don't you check out the [Opsdroid documentation](https://docs.opsdroid.dev) to find out what you can build with Opsdroid."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:opsdroid]",
"language": "python",
"name": "conda-env-opsdroid-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.1"
}
},
"nbformat": 4,
"nbformat_minor": 4
}