Template for HipChat bot Serverless service using C#
- AWS account
- The services used by this example should be free, but you're responsible for grokking AWS pricing
- Serverless:
npm i -g serverless
oryarn global add serverless
- You'll need to configure your installation with your AWS credentials:
serverless config credentials --provider aws --key <ACCESS_KEY> --secret <SECRET_KEY>
- See here for more details: https://serverless.com/framework/docs/providers/aws/guide/credentials/
- You'll need to configure your installation with your AWS credentials:
dotnet
CLI tools: https://www.microsoft.com/net/core
- Install this service:
serverless install -u https://github.com/FLGMwt/serverless-csharp-hipchat
- Note that this creates a directory named
serverless-csharp-hipchat
. I'd recommend renaming that to whatever makes sense for you
cd serverless-csharp-hipchat
- Run the build script for your system:
./build.sh
or./build.ps1
- Deploy your app:
sls deploy
- In the HipChat console, find the page for the room you want to add your integration to
- Note that you must own the room or be a HipChat admin for the installation
- Click "Integrations"
- Click "Build Your Own Integration" (first box in the grid)
- Name it whatever you please
- Click "Create"
- Check "Add a command"
- For the "slash command" enter how you want your integration to be invoked, e.g. "/officemap"
- For the integration url, enter the POST endpoint route listed under
endpoints
during yoursls deploy
, e.g. "https://asdfzxcvfoobar.execute-api.us-east-1.amazonaws.com/dev/hello"
- You can also get this output outside of deploys using
serverless info
- Click "Save"
- In your room, test out your slash command.
- If your slash command doesn't respond, you can try looking at the serverless logs:
serverless logs -f <your_function_name>
serverless
is aliased assls
.sls deploy
is easier to write thanserverless deploy
- Note this gets clobbered by PowerShell's
sls
alias forSelect-String
. If you wantsls
to be theserverless
alias, add the following to your$PROFILE
:rm Alias:\sls