Commander for Microsoft Teams - Your Custom Bot that runs on your Command!
copied
Microsoft Teams is a great tool for communicating with your co-workers or friends. But maybe you have some functionality you’d like to create or install into your Team’s space? Nimbella Commander is your bot that allows you to not only install pre-built commands into your Microsoft Teams workspace, but you can also build custom commands or customize pre-built commands.
In this article, we will:
- Install pre-built commands with ZERO programming knowledge.
- Create and edit your custom commands in JavaScript.
- Apply secrets to your commands, keep your API keys a secret!
How to Install pre-built commands with ZERO programming knowledge?
What’s great about Nimbella Commander is that there are several pre-built commands you can install and get started. We got utility commands for all users, commands for DevOps and developers, and commands for business folks. So regardless if you’re working in tech, finance, education, healthcare, or just want a command that is interesting or fun, there’s something for you! We keep all of our open-source command sets in our GitHub repository.
Here’s a list of all the pre-built commands that we have:
Utilities:
corona_stats - Live stats for the pandemic, worldwide, or in a specific country.
times - Displays the current time in AM/PM format for the given cities.
translate - Translates text to a given language.
weather - Get weather conditions for a city.
DevOps:
aws - Interact with AWS. Display your bill and run commands for EC2, Dynamodb, RDS, and Route53.
dig - lookup DNS.
do - Interact with you DigitalOcean drops. You can fetch your DO usage, list IP addresses, list droplets, power them on and off, reboot them, take a snapshot of them, and see the status.
github - Interface with GitHub. There are 10 commands where you can interact with issues, pull requests, and other aspects of your repositories.
gitlab - Interface with GitLab. You can view contribution stats, create a ticket, assign issues, and list users in a repo.
ibm - Interact with IBM Cloud & IBM Watson services, such as Cloud Functions, Visual Recognition, Language Translator, and the Tone Analyzer.
jira - Interact with Jira by creating, assigning, and transitioning issues.
Circleci - Interact with CircleCI.
BizOps:
awsbill - Fetch AWS billing information. You can display your current bill or select a specific month/year.
dobill - Fetch DigitalOcean billing information.
shopify - Interface with Shopify by adding notes to orders, displaying orders & inventory, and display the number of products sold.
If you type registry
, it will show the list of available command sets, clicking one will give out the details and an installation button. For example, the “translate” command is a fun way of taking text and translating it into whatever language you want inside of Teams. This allows you to communicate with other members of the channel in their own language.
Or you can also install using csm install command
If you want to say “How are you” in French, you can just type run translate french "hello"
, and it told me how to say that in French.
To view the list of command sets that are installed within your team’s workspace, type csm list.
How to Create and Edit your custom commands?
So maybe you have some functionality you want to build, but you don’t want to deal with learning about server logic or setting up the infrastructure to host your app. Here is an easy way to build and edit code so that you can start building your custom commands.
After selecting Commander, type command create helloWorld
. This will create a command called helloWorld that can be edited. The name does not have to be helloWorld. Running command create anyNameHere
will create the same template that can be edited.
To run this helloWorld command, you can click on the run helloWorld button from the response. Alternatively, you can type run helloWorld
to execute this command.
The template this generates displays some basic text. So now you can see how simple it is to display text from a command in your Teams workspace.
When creating a command, multiple parameters can be specified - required <> or optional [<>]:
command create anyNameHere <parameter1> [<parameter2>]
Now that you’ve created a custom command, you can now edit it!
Click the “edit the code” link that was generated when you created the command to get redirected to where you can edit the code.
This code is very straightforward. You have a return type that’s selected as “in_channel”, which means it will display in the channel. You also have a value called “text” which displays the text.
To test what it is like to edit the code:
- Go to
text: “This is a default response for a newly created command with text: “ + commandText
- Change it to
text: “I just changed this text”
- Click the save button at the top right corner.
- Go back to Teams and run the command again.
The response will now say “I just changed this text”. And just like that, you’ve edited your first command! From here, you can start thinking about new functionality you can build and start building on top of this template!
To learn more about creating commands, check out the reference guide from Nimbella Commander to see all the commands that can be run on Microsoft Teams.
How to Apply Secrets to your Commands on Microsoft Teams?
Lots of services are accessible only through APIs but imagine how horrible it would be if your API keys got out? It’s important to make sure that your API keys, credentials, and anything you don’t want public is kept outside of Teams. Commander natively provides an option to store and securely share secret keys within the commands. The Secret Creator is what you’ll use to encrypt these values outside of Teams.
To start creating secrets, type secret create
Click the link that says “Secret Creator” to be redirected to where you can start encrypting values. Once you create a secret, the UI will prompt you to copy a command.
Example command: secret add <secretName> <encrypted_value>
Copy that command by clicking the “Clipboard Copy” button and run the command inside of Teams.
The response for the secret add command will show the encrypted value of your secret to keep it secure.
In this example, we have created a secret with the name of myApiToken. We can use this to play around with secrets.
Now, to use this secret within your command, you would need to edit the command code. Type command code helloWorld
to get the edit code link. Click on “edit the code” to be redirected to your code.
Here we will access the myApiToken secret by using the code below:
let myToken = secrets.myApiToken;
Add + myToken
to the end of the text:
field.
The parameter “secrets” is what is storing all the secrets you generated and applied to your workspace.
Type run helloWorld
to execute the command.
Now you’re ready to start building amazing and powerful commands inside your Microsoft Teams workspace. You have your custom robot that you can teach to do anything and run anything. At this point, the only limitation is your creativity! To learn more about building commands in Microsoft Teams, check out the documentation to learn more from Nimbella.
Recent Posts
- How to deploy Node.js functions on Nimbella
- Kick-Start Your Serverless Journey
- AWS re:Invent Serverless Highlights
- Opportunities in the Wake of the AWS Juggernaut
- FaaS Wars: Serverless & Virtual Robot Competition
- #DeveloperIPL Online Hackathon Results & Feedback on Nimbella's Integration for Postman
- How to connect to the 3rd party database such as MySQL at Nimbella (example in Java)
- What can you do with the Nimbella Workbench?
- Deploy your Shopify Storefront to Nimbella
- Not All Serverless Platforms Are Created Equal
- Nimbella + Netlify: Uplevel Your Development Speed
- How we learned to Jamstack, Our Caputron Story.
- Commander for Microsoft Teams - Your Custom Bot that runs on your Command!
- How to Build a Stateful Cloud App on Nimbella vs. AWS
- Starter Kit and Resources to Build a Serverless Cloud Application
- How to Build Serverless Slack Apps and Commands
- How to Set up your Serverless Environment and Get Started in Less than 2 Minutes!
- How to Quickly Deploy Stateful Serverless Apps with Nimbella?
- What is Serverless Computing? 3 reasons to start now
- How to Build a Serverless Slack App in Minutes.
- How to Manage your Netlify Website from Slack?
- How to Build a Serverless Slack Command in minutes
- How to Build a Stateful Serverless Cloud Web Application?
- How to Create an Optical Character Recognition (OCR) Application?
- Development at the Speed of Innovation – Nimbella, the Serverless Cloud
- Software Security Features on Enterprise Serverless Slack Apps Enabled by Nimbella Commander
- Coronathon India’s first demo day has 18 projects to help fight COVID-19
- See the time in different cities on Slack with Nimbella Commander
- Greet your friends in their native language in Slack with Nimbella Commander
- Install Commander on your Mattermost Instance
- How to Fetch your Digital Ocean Billing Info on Slack?
- How to Stay Updated with Coronavirus Statistics on Slack?
- Create BlueJeans meetings on Mattermost using Commander
- How to Fetch your AWS Billing Info on Slack?
- Get your Datadog billing info in Slack with Nimbella Commander
- Serverless Slack Apps and Slash Commands
- How to use Slack Effectively with Nimbella Commander?
- How to Create a multi-user Chatroom Hosted on Serverless Cloud?
- Using Docker actions, running Golang, and other fun things with OpenWhisk
- The duality between serverless functions and APIs
- Serverless HTTP handlers with OpenWhisk
- Serverless functions in your favorite language with OpenWhisk
- Run Swiftly: precompiled Swift actions
- Performance debugging for serverless functions using the Cloud Shell
- Locally debugging OpenWhisk actions
- Composing functions into applications
- A Serverless Composition of Functions
- The Serverless Contract
- The dawn of the Cloud Computer
- Security and Serverless Functions