Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jywarren opened this issue Mar 30, 2018 · 9 comments
Open

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

jywarren opened this issue Mar 30, 2018 · 9 comments

Comments

@jywarren
Copy link
Member

jywarren commented Mar 30, 2018

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":

let greeted = [];
const greetAction = (channel, username, botNick) => {
if(!utils.contains(greeted, username)) {
greeted.push(username);
return `Welcome to Publiclab, ${username}! Here's a link to the Code of Conduct that's in effect in this, and all other spaces of Public Lab: https://publiclab.org/conduct. For a quick walkthrough, send the message: \`${botNick} help\``;

@ryzokuken
Copy link
Member

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
Copy link
Member Author

sounds great! 👍

this is exciting!!!

@jywarren
Copy link
Member Author

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
Copy link
Member

@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
Copy link
Member

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
Copy link
Member Author

jywarren commented Apr 10, 2018 via email

@ryzokuken
Copy link
Member

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

@jywarren
Copy link
Member Author

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

@jywarren
Copy link
Member Author

jywarren commented May 1, 2018

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants