[ANN] lita-alias handler plugin

12 views
Skip to first unread message

Alex Soto

unread,
Jun 29, 2015, 1:16:33 AM6/29/15
to lit...@googlegroups.com

Just released a first version of lita-alias.  It allows you to alias long commands into shorter/simpler commands.

It's an early version, but I've been using it myself for a bit.

Hope it can help others.

Mike

unread,
Jun 29, 2015, 7:46:23 AM6/29/15
to Alex Soto, lit...@googlegroups.com
Hi Alex,

You seem to have beaten me to the finish line! I had started something similar over here: https://github.com/miketheman/lita-alias

Our typical use case is to have chat handler aliases not be direct commands to the bot, so as to allow users to run commands like:

> DEPLOYTIME
<bot does whatever that was aliased to>

> Let's talk about DEPLOYTIME
<bot does nothing, as it's not invoked form the beginning of the line>

> DEPLOYTIME webapps
<bot performs the alias, with an optional argument>

Do you foresee this kind of behavior, or are you expecting _every_ invocation of an alias to be directed at the bot?

Love the work, would be happy to help get things up and tested, if you wanted to collab.

Best,
-M

--
You received this message because you are subscribed to the Google Groups "Lita" group.
To unsubscribe from this group and stop receiving emails from it, send an email to litaio+un...@googlegroups.com.
To post to this group, send email to lit...@googlegroups.com.
Visit this group at http://groups.google.com/group/litaio.
To view this discussion on the web visit https://groups.google.com/d/msgid/litaio/d36d77e2-1660-4038-94e3-266817935004%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Soto

unread,
Jun 29, 2015, 1:22:51 PM6/29/15
to Mike, lit...@googlegroups.com
Hey there,

First off, I would welcome any collaboration.

Regarding your examples:

> DEPLOYTIME

It does this right now, but you have to issue a command instead of just sending the message (eg: /DEPLOYTIME)

> Let's talk about DEPLOYTIME
It also does this because the alias is pinned to the beginning of the message

> DEPLOYTIME webapps
It does not do this at this time.  I figured that adding args is a bit out of scope. One thing that comes to mind is how to alias things and pass arguments when the arguments can vary and their position in the aliased command can vary too.  To support passing args you'd have to have some sort parameter substitution going on in the original aliased command.  It quickly gets complicated and defeats the purpose of a 'simple' alias IMO.

However,  open a ticket or pull request and let's discuss the pros and cons.





Reply all
Reply to author
Forward
0 new messages