cugetreg icon indicating copy to clipboard operation
cugetreg copied to clipboard

feat(discord-bot): Implement Discord Bot Prototype

Open PongDev opened this issue 2 years ago • 16 comments

Why did you create this PR

  • Implement New Discord Bot for CU Get Reg

What did you do

  • Implement Discord Bot Prototype

Demo

https://dev.cugetreg.com

Checklist

  • [ ] Deploy a demo
  • [ ] Check browsers compatibility
  • [ ] Wrote coverage tests

PongDev avatar Jan 25 '23 00:01 PongDev

Please fix conflict so I can review

don't force push

leomotors avatar Jan 25 '23 02:01 leomotors

Can you explain more about the features of this bot. It would be great if you put some image what bot can do here.

Please explain as much as possible you can. So, we'll review this feature later

saenyakorn avatar Jan 25 '23 02:01 saenyakorn

Please fix conflict so I can review

don't force push

I merge wrong branch ;w;

PongDev avatar Jan 25 '23 06:01 PongDev

Can you explain more about the features of this bot. It would be great if you put some image what bot can do here. Please explain as much as possible you can. So, we'll review this feature later

This is a prototype of a discord bot, for now it main feature is summary user usage for 1 week, however the core module of this bot support many metric and dimension for used in further.

This prototype design based on issue 439. (https://github.com/thinc-org/cugetreg/issues/439)

Example feature image

PongDev avatar Jan 25 '23 06:01 PongDev

What does the report look like when the bot send a it into Discord?

saenyakorn avatar Jan 25 '23 13:01 saenyakorn

image

Look like this for example, actually it support both text message and image but text message format is not yet discuss to other, so it has core code and template for that for now. However from the code, text command can be code in very short time (estimate may be < 1 week)

image

The bot use slash command to register channel to send report and report will send at specific cron job time

PongDev avatar Jan 25 '23 13:01 PongDev

Note that this is only a prototype of CU Get Reg Bot, for further improvement I think we should discuss for more further information to used in development

PongDev avatar Jan 25 '23 13:01 PongDev

Why is there so many package.json changes (package name ordering is out of place, versions are upgraded)? That should not happen when you add new packages for your new app.

Since we're using the same package.json for every single app, changing so many dependencies could break other apps and should be avoided.

bombnp avatar Jan 27 '23 04:01 bombnp

In fact, i'd say do this:

  1. Delete node_modules folder
  2. Revert package.json and pnpm lock file back to its original commit
  3. Selectively add new packages that you need for discord bot (prod dependencies and dev dependencies). This should NOT mess up other dependencies.
  4. Commit and push new package.json and lock file to this branch

bombnp avatar Jan 27 '23 04:01 bombnp

Because we may have other features for Discord bot like #438, I would like you to use discord-nestjs, the powerful DiscordJS-wrapper library based on Nestjs, as a main library for implementing Discord bot. Since, Nestjs is fully come with Typescript and Decorator that make other easy to read through the code.

saenyakorn avatar Jan 27 '23 06:01 saenyakorn

Here is the example repos that implemented with discord-nestjs. Feel free to copy the code from them.

  • https://github.com/thinc-org/thinc-discord-bot
  • https://github.com/saenyakorn/paradis-bot

saenyakorn avatar Jan 27 '23 06:01 saenyakorn

hold up this might conflict package.json with turborepo migration in #470

bombnp avatar Jan 27 '23 09:01 bombnp

hold up this might conflict package.json with turborepo migration in #470

do you mean hold the pull request or hold the migration?

PongDev avatar Jan 30 '23 02:01 PongDev

hold up this might conflict package.json with turborepo migration in #470

do you mean hold the pull request or hold the migration?

hold the PR, as it would conflict the package.json a lot. U could keep on implementing the bot tho (like as @saenyakorn suggested), just be prepared to fix the package.json conflict

bombnp avatar Jan 30 '23 02:01 bombnp

@PongDev #470 is merged.

bombnp avatar Feb 02 '23 17:02 bombnp

u'll need to create a new package.json in your app directory with your own dependencies. No more piling every dependencies into single package.json at root.

bombnp avatar Feb 02 '23 17:02 bombnp