kajahno / elprimobot Goto Github PK
View Code? Open in Web Editor NEWBot to manage Domination discord channel
Bot to manage Domination discord channel
We can maybe use the same clock that leetcode
uses since that happens every 24h, or we can pick our own cycle (server - cycle).
We might be calling the server many times, and sometimes there might be concurrent calls, to make well use of resources/quota and easily handle Discord client initialization we can have a singleton https://refactoring.guru/design-patterns/singleton
It would be nice for people that don't have premium to see the problem's description
Create stub command to receive and respond to commands sent by users in a channel
After creating the server we need to find a way to configure it (either init script or something else like Ansible)
Consider the version management
The folder named "pupeteer" should be "puppeteer"
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.
Placeholder for posting weekly stats updates
The deployment is very manual at the moment, it would be great to have scripts to deploy everything without worrying about manual error.
The approach we're trying is in here.
The idea is to have a google account and use something like puppeteer or selenium to do it for us, managed by the bot
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.
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.
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
Because the GSuite API doesnt allow to do this if it's neither a Business or Education account.
Reference: https://stackoverflow.com/a/63114546
It should have a POSIX interface with the following features:
Pick anytime after the daily update, could be anytime after the Daily update on Sunday Night, maybe Monday morning?
Notes:
I think we can potentially get users' last activity from presence https://discord.js.org/#/docs/main/stable/class/Presence
When enabled add Intents.FLAGS.GUILD_PRESENCES
to the client initialization
This one needs more refinement but the idea is that we manage: retrieve, list, potentially create, members gists with problems.
We're trying to reduce the noise of daily stats, and we think that weekly stats are enough.
It should have a POSIX interface with the following features:
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.
Categories include: Array, Hashmap, Dynamic Programming, etc.
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.
PS: Consider appending a json file with the stats object for easier management of the data
Eventually, we'd like to remove users who are not active in the community, first step is to collect some participation stats.
AC
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:
When sending messages about leetcode problems, also send a suggested github gist name
Technical notes:
References:
With the packaging system that we have now:
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.
Context:
Nazz: Feature Request: Puede salir el de la semana tambien? sale una vez por semana
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
No activity over
1 week: list the names
2 weeks: list the names
3 weeks: list the names
Weekly Stats
No activity over
1 week: list the names
3 weeks: list the names
It should work with Docker and have as default entrypoint the packaged app
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.