DinoBot is a fun, engaging bot that sends the GroupMe dinosaur emoji to your groups on GroupMe.
- "[n] dinos" -> The number n dinosaur emojis will be sent to the chat with a max of 100. If the original message was a reply, Dinobot will also reply to that message.
- "Hey Dinobot" -> Dinobot will respond with a Dino.
- "[Any question]" -> Dinobot will use super sophisticated AI to determine if he should answer with a dino.
DinoBot is designed to run as an Azure Function that is triggered when messages are sent to the group in which it is installed. The instructions provided below explain how to install DinoBot with an Azure Function as the host.
There is no hard requirement to use Azure Functions, though. The majority of the code is portable to any C#-based hosting solution. Just set up your own listener, and instantiate and invoke DinoBot
in the same manner as the Run method.
- An active Azure account
- An active GroupMe account
- Visual Studio with .NET 4.6.1
- Create a .NET Azure Function resource on https://portal.azure.com
- Open https://[yourappurl].scm.azurewebsites.net
- Click
Debug Console
thenPowershell
- Open
D:\home\site\wwwroot
- Open
Dinobot.sln
in Visual Studio and build - Drag-and-drop the files from
DinoBot\bin\release\net461
to this folder in your browser - Open new Azure Function resource
- Open the
Functions
tab then theDinobot
function - Click
Get Function URL
and copy this value. It shoould look like this: https://[yourappurl].azurewebsites.net/api/Dinocallback/{botId}?code=[functioncode]
Your bot is now ready to use! Now, add the bot to GroupMe
- Open https://dev.groupme.com and click
Bots
at the top - Click
Create Bot
- Choose your group and avatar. We recommend using dino_avatar.png
- Set the Azure Function URL from step 9 above as the
Callback URL
- Save the new bot
- Copy the
botId
for the newly created bot - Click
Edit
on the bot, and replace{botId}
in the CallbackURL with this ID, so it looks like https://[yourappurl].azurewebsites.net/api/Dinocallback/1234?code=[functioncode]
Save and enjoy!
You can set App Settings variables in Azure to change who can address DinoBot.
CanAddressDino
: A comma-delimited list of user IDs that can use the "hey dinobot" command. Should be lower case.DinoAddressTrigger
: A comma-delimited list of phrases that Dinobot will respond to. Should be lower case.
These settings can be tested locally by creating a local.settings
file in the DinoBot
project and including them under Values
. Do not deploy local.settings
to Azure as it will be ignored.
- Upgrade to Azure Functions 3
- Move shared code to a re-usable nuget package
- Make Dinobot do math, e.g. "10-3 dinos"
- Make more things configurable, like the maximum number of dinos
- More detailed tests