GithubHelp home page GithubHelp logo

elprimobot's People

Contributors

kajahno avatar not4now avatar nramirez avatar vetom avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

vetom

elprimobot's Issues

User participation Stats

Eventually, we'd like to remove users who are not active in the community, first step is to collect some participation stats.

AC

  • Post participation stats in the following format
Stats 
Start Date -> End Date | Last 7 days | This Month
           Messages | Words | Letters
@Nazzz     40        250     1534
@whoan     40        250     1534
@domichon  40        250     1534
@nohabla   0      0       0

We don't have a DB for elprimo, so we can do the following process:

  • Collect stats from the last update
  • Count letters/words/messages from that time
  • Post new stats

Create CLI for Puppeteer component

It should have a POSIX interface with the following features:

  • Action to the Google Group Membership should be specified: Add, List, Remove
  • To Add and Remove members the parameter should be a list separated by comma
  • The interface should be self documented
  • The interface should have a help

elprimobot sends onboarding message when a user has joined the server

  • Onboard message should contain:
    • Welcome message:
      • "welcome to server X"
    • Send group mission and objectives
      • This needs to be established, somehow. It's not a blocker.
    • Send rules of the group
      • This needs to be established, somehow. It's not a blocker.
    • Ask for welcome form data
      • First Name
      • Last Name
      • Preffered timezone
      • gmail (for google group)
      • github handle (for repositories)

Technical notes:

  • The form data should be persisted in a database (could be a JSON file, for now)
  • It should invoke the G-Group Manager the new member to add to the google group
  • It should receive the response from G-Group Manager and reply to the user as follows:
    • In case of success: happy message saying there's a pending invite in the provided Gmail account
    • In case of failure: sad message indicating there might be a bug somewhere, including the error

References:

  • We've used the user flow in here

Stats: Initialize stats based on previous bot messages

We have some limitations with discord API, as it only pulls 100 messages per channel and only a few days of data. At the moment, the bot crawls messages for the last 24h.

We will have weekly and probably monthly stats #37 - we'll need a way to collect those stats for previous days.

An alternative.

  • Post daily stats in a single channel only to post these stats
  • Maybe disable everyone else from posting here
  • Post weekly/monthly stats in a more visible channel like welcome or general
  • Construct the weekly/monthly updates from prev daily posts

PS: Consider appending a json file with the stats object for easier management of the data

Modularise functionalities

At the moment there's too much logic in the main app, this issue is to refactor that and make sure there's a better separation of concerns.

Refactor app.js

The app.js file is a bit messy, and after the introduction of the CLI, things are becoming trickier to follow. Please refactor the file. It's worth looking into the techniques from Refactoring Guru to address this issue.

Create handling of member gists

Description

This one needs more refinement but the idea is that we manage: retrieve, list, potentially create, members gists with problems.

Considerations

  • Format of the gist
  • Template to fill
  • Permissions
  • Maybe more..

Create error handling methods

This can also be done in parallel with the logging issue #8, as we might use logging with error handling.
Also consider a debug mode

Days of inactivity

We need to communicate in the stats how long folks have been inactive, this might be one way:

Daily Stats
No activity last 24h
List the names here

  • Weekly stats will have 3 buckets, over 1, 2, or 3 weeks of inactivity

Weekly Stats
No activity over
1 week: list the names
2 weeks: list the names
3 weeks: list the names

  • if a given week doesn't have any users don't show it, eg:

Weekly Stats
No activity over
1 week: list the names
3 weeks: list the names

Track weeks of inactivity

At the moment we're including all the members with no activity last 24 for daily stats and the last 7 days for the weekly updates.

We can rely on the previous week's update and count how many weeks a member has been inactive, this way we'll be able to take action based on how many weeks a given user has been inactive.

image

Only send stats weekly

We're trying to reduce the noise of daily stats, and we think that weekly stats are enough.

Push leetcode daily challenge

It'd be great if the bot can push the leetcode daily challenge to a channel, so we don't have to manually search for it every day.

Context:

Nazz: podemos poner al @elprimobot a que mande el daily cada vez que salga? asi no hay que dar un viaje pa leetcode para ver el problema del dia

Create CLI for the bot

It should have a POSIX interface with the following features:

  • Adhoc commands, for example to post the daily leetcode message
  • The interface should be self documented
  • The interface should have a help

Pin Messages

We don't want to allow everyone to pin messages on discord, because it also allows people to delete messages.
image

An alternative is to give these bits to elprimobot and pin the messages through requests.

AC

  • Discord should ping a message when we reply to a message with a reply: @elprimobot pin

Weekly inactivity repeats names across weeks

When someone has been inactive for a few weeks, they will show up each week, this is not a real problem, but we could improve the UI.

Screenshot 2023-01-25 at 7 58 34 AM

AC

  • If someone has been inactive for multiple weeks, only show them on the latest week.

Pkg + babel not transpiling or packaging top level await

With the packaging system that we have now:

  • babel transpiling everything to ES5
  • pkg packaging in a static binary

Seems we cannot have top level awaits working correctly:

pkg/prelude/bootstrap.js:1930
      return wrapper.apply(this.exports, args);
                     ^

ReferenceError: await is not defined
    at Object.<anonymous> (/snapshot/elprimobot/es5-packaged/app.js)
    at Module._compile (pkg/prelude/bootstrap.js:1930:22)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.runMain (pkg/prelude/bootstrap.js:1983:12)
    at node:internal/main/run_main_module:17:47

Even though they're supported now since Node v14.8.0

I've been playing around with this babel plugin, but no luck.

Send gist suggestion

When sending messages about leetcode problems, also send a suggested github gist name

Members usernames

We got an error the last time we tried to retrieve all the members part of the client.

This is crucial for the stats logic, and we need to systematically know who's in the client.

Find a way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.