publiclab / plotsbot

A bot for Public Lab
GNU General Public License v3.0
17 stars 28 forks source link

Simple "keyword/response" mini-behaviors #95

Closed jywarren closed 6 years ago

jywarren commented 6 years ago

In Slack, the slackbot can be configured to respond to a list of keyword triggers in a simple format, where you type the trigger words and then the string that's returned:

It'd be great to be able to add simple behaviors to plotsbot by just adding a single line like this to a "keywords" list. What do you think?

ryzokuken commented 6 years ago

Sure! We could modify the core to make it accept an array of strings for a behavior as compared to a single string or sth and then make a behavior that can accept multiple triggers.

Or perhaps add another function in the core to aid the programmer in adding simpler mini-behaviors?

jywarren commented 6 years ago

Which do you think would make for the simplest way to submit a new behavior? I imagine even a one-line change could be possible, no?

On Thu, Mar 22, 2018, 8:53 AM Ujjwal Sharma notifications@github.com wrote:

Sure! We could modify the core to make it accept an array of strings for a behavior as compared to a single string or sth and then make a behavior that can accept multiple triggers.

Or perhaps add another function in the core to aid the programmer in adding simpler mini-behaviors?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plotsbot/issues/95#issuecomment-375293119, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ3dPSJ9-UqWFHks8q4irps62R0oeks5tg56dgaJpZM4S1vYE .

jywarren commented 6 years ago

Also, potentially as a next step a function could be passed instead of a response string and it could produce a simple dynamic response, like:

"trigger phrase": function response(user, message) { return responseString; }

But simple string response is even easier as a first step.

I think doing this could be a great way to encourage new behavior submission and start getting more people working on plotsbot - a nice simple onramp!

ryzokuken commented 6 years ago

@jywarren sounds great! Let me dive into it.

jywarren commented 6 years ago

Awesome!!!