ljsc / hbot Goto Github PK
View Code? Open in Web Editor NEWA simple Haskell chat bot for Hipchat
License: GNU General Public License v3.0
A simple Haskell chat bot for Hipchat
License: GNU General Public License v3.0
We need to integrate Hbot with my upcoming Chiptole CLI so that he can order us burritos on the fly.
The json from the hipchat api has a section for mentions, but not sure why it wouldn't just ignore that. Need to figure out what's going on there.
The Plugin type we have is simple and easy to implement, but it leaves a bit to be desired feature-wise. Right now, you can only print out grey text messages, when it would be a lot better to allow different values for color
and messageFormat
fields in ChatNotification
. At the same time it's a little awkward passing in a tuple for the input when the BotCommand
can be directly extracted from the event. I've added the help text in a recent commit, but we might want additional fields for plugins to use as well.
One thing to keep in mind is that these things should be easy to implement. Right now if you have any function from Text->Text
you can trivially lift it to a plugin via textPlugin
. It should continue to be that easy in the simple case.
Right now I'm thinking of having a typeclass somewhere so we can have the simple case continue to have a really straightforward type, and then possibly have a different concrete version for stuff that does html messages and the like via blaze-html.
Via @AndrewO. Figure out how to get notifications in the chat when anybody posts a link to /r/econify.
I want to be able to type : google some query
and have Hbot post the first 1-3 links in the chat.
It would be cool to have a hbot plugin that allowed dice rolls. Since this is already implemented in Haskell as example code for the roller blog series, we should see if we can just reuse/integrate with that. So it would be something like:
: roll 1d20+3
20+3 = 23
Crit!
So the whole idea behind creating this bot is so we can get something that makes it easy to add custom commands. In order to have a something that is maintainable and extensible, we're going to want some sort of plugin system. I think the best way to go about this is to have monoidal plugin data that we can compose into the running program. Something along the lines of the Plugin
type found in Equational reasoning at scale.
Since we're hosting hbot as a scotty application we're probably going to want something that does actions in the Scotty's action monad. I'm thinking something along the lines of:
type Plugin = IO (Text -> ActionM ())
So when the plugins are installed they will return an action that takes every chat message in the group and does some action based on it. I'm not sure yet how we should be filtering the incomming messages--rather by at-mentions or by some other prefix--but the plugins shouldn't have to worry about that sort of stuff if it's done correctly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.