Skip to content

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

@jywarren

Description

@jywarren

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\``;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions