publiclab / plotsbot

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

modularize .recognize function for re-use in Idle behavior #101

Open jywarren opened 6 years ago

jywarren commented 6 years ago

perhaps if plotsbot knows somebody's been in the chatroom before, they don't need to offer the "idle" response?

what do you think? I think the welcome behavior has a routine to "recognize" people who aren't new, right? Maybe we could modularize that and re-use it, like if user.recognized() ...

The behavior is pretty simple, here -- just collects who's been "greeted":

https://github.com/publiclab/plotsbot/blob/d87ef5dae9d85bd485b6971414e3fec341283ba7/src/behaviors/greet.js#L4-L9

ryzokuken commented 6 years ago

Umm, I believe we should just move where the recognized people are stored from the scope of the behavior to the scope of the entire chatbot. What do you say?

jywarren commented 6 years ago

sounds great! 👍

this is exciting!!!

jywarren commented 6 years ago

How's this going, ryzokuken, need any help? I think this could reduce some traffic in the chatroom. Tell us how we can pitch in!

ryzokuken commented 6 years ago

@jywarren sorry, I got a little busy and forgot that the bot must be spamming the channel meanwhile. I will prioritize this for today.

ryzokuken commented 6 years ago

So, I had just started working on this, trying to hack up a generalized solution first (creating a MemoryBehavior model), but that didn't work because things are a little complicated regarding cross-behavior consistency.

I gave up on that solution and started working on something specific for the unresponsive behavior instead (something exactly along the lines of what we do in the greet behavior), but that didn't work either.

That was because when we first made the specification for the action function, we only passed what was necessary at that time. Until now, we have only needed the username for join behaviors (eg: greet), and never for message behaviors`. Thus we're not passing down the username in that case, which we definitely should.

I'd modify the behavior and make it a little more consistent, and then perhaps we could make the more general solution a little viable.

jywarren commented 6 years ago

Cool! I think we could make a shorter-term fix with a clear pathway to a generalized solution as a next step. If we do outreach well, we can bring other people in for the various steps, no?

Awesome!

On Tue, Apr 10, 2018 at 5:28 AM, Ujjwal Sharma notifications@github.com wrote:

So, I had just started working on this, trying to hack up a generalized solution first (creating a MemoryBehavior model), but that didn't work because things are a little complicated regarding cross-behavior consistency.

I gave up on that solution and started working on something specific for the unresponsive behavior instead (something exactly along the lines of what we do in the greet behavior), but that didn't work either.

That was because when we first made the specification for the action function, we only passed what was necessary at that time. Until now, we have only needed the username for join behaviors (eg: greet), and never for message behaviors`. Thus we're not passing down the username in that case, which we definitely should.

I'd modify the behavior and make it a little more consistent, and then perhaps we could make the more general solution a little viable.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plotsbot/issues/101#issuecomment-380035202, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ1FmIjBBTDDv5era1WzRFWKNTVMGks5tnHtWgaJpZM4TBysP .

ryzokuken commented 6 years ago

@jywarren we can. Thing become much easier when we have multiple contributors.

jywarren commented 6 years ago

very initial start in #109 for just the "nobodys around" behavior -- not the generalized case!

jywarren commented 6 years ago

@pdurbin notes:

Over in #openhatch of freenode Welcomebot has existed in various forms at various times and I like the model it uses where is remembers people by persisting their nicks in a file on disk (nicks.csv) and then never bothers them again. You can read about Welcombot at https://github.com/shaunagm/WelcomeBot

Great extra info!