Once added the bot, try sending the “dice” command. Let’s run the code in Teams client again, using the “F5” tool and see how it works. In the video, I copy & paste the JSON first then modify some content manually, instead of editing all properties in the visual tool. In the YouTube tutorial, you can follow the instruction at 4:46 and watch me how to use the tool. Now, copy the generated JSON into the helloworldCommand.json. Set the title style property for weight to “bolder”īut feel free to customize in the way you want!.Find the commands in commandLists in the JSON and change the title and description to:Īsync handleCommandReceived ( context, message ) ” This is the file where the suggestions UI content is defined. Go to the file, templates > appPackage >. This is the result of what we are going to do here: We are going to edit the suggestions content first. Now, let’s go back to Visual Studio Code and modify the code to turn it into a dice bot. Try clicking it to send the command to the bot. This is a hint for the users for what bot commands are available. Notice that the command suggestions box pops up, like the screenshot below. Once you add the bot, play around and see how it works. So, go ahead and click Add to install your bot: It will take a while, but when it is done, a browser will load Teams client, then ask you to install the bot. ![]() If this is your first time, you will be asked to sign in to your Microsoft 365 account. Teams Toolkit will do some work for you, including checking prerequisites, Azure provision and bot registration, running ngrok to tunnel your local server, etc. Or alternatively, press F5 key on your keyboard. Now, let’s try running the scaffolded code on the Teams client to see how the bot user-experience works.įrom the Run and Debug menu, choose Debug (Edge) (Chrome is fine, if you prefer!), and run by clicking the Start debugging green triangle. Take a look around the code structure and familiarize yourself with the files! ⌨️ Running the template code in Teams Teams Toolkit will then generate the scaffolding for you. Let’s choose JavaScript for this tutorial where you create the project in your local folder. See the screenshot below:įollow Teams Toolkit by choosing a language. In the Teams Toolkit extension in Visual Studio Code, click Create a new Teams app then select the Command bot from the menu. I have created a YouTube video this time, so check it out! The tutorial was written for the earlier version of Toolkit, but the initial setup process is the same. If this is your first-time using Teams Toolkit, please first go to this tutorial, Using VS Code Teams Toolkit Extension for Teams App Development, follow the Prerequisites section and then Installing Teams Toolkit section. We are going to build a dice bot, which returns a random number between 1 and 6, when a user sends a command, “dice”. In this tutorial, I will show you a practical example by walking you through how to build a command bot. Previously, in Beginners’ crash course to build apps for Teams using Teams Toolkit for Visual Studio Code, Rabia and Zhidi explained new features in Teams Toolkit and how the tool simplifies your experience.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |