Code Monkey home page Code Monkey logo

tc-botcomm's Introduction

RnPulse Discord bot

This is the official RnPulse discord bot Repository

Available scripts

Extract messages from one guild

  • node .

    • Run the bot using registered token and extract messages from all selected guilds
  • node . -- --guild=939491779110117407

    • Run the bot using registered token and extract messages from one guild

tc-botcomm's People

Contributors

codecookerpro avatar daniel-ospina avatar legendsort avatar magicpalmtree avatar mehrdadmms avatar sepehr2github avatar thegadget-eth avatar wkarshat avatar zargarzadehm avatar

Stargazers

 avatar  avatar

tc-botcomm's Issues

Sender of the reaction is missing

Origin

@TjitsevdM noticed a mistake in the format in which the raw data is stored.
The data under reactions doesn't list the sender of the emoji

Goal

  • Add the sender of the emoji when storing the raw data

How

  • Update dbComm repo and change the schema based on the necessity
  • Update dbComm tests
  • Extract and store the information related to the senders of reactions
  • Add the correct schema to readme

Proof of concept for the new architecture

Goal

we need a way to make our data extraction and analysis scalable.

needs

  • Parallelly extract information from different sources and different guilds
  • Parallelly analyze the stored raw information
  • Have different analysis scripts working at the same time
  • Have the ability to add more nodes of same analysis script for parallel analysis and load balancing
  • Have the ability to run second, third, and Nth level analysis (analysis that uses the data of another analysis)

Tasks

Migrate to Typescript

Our codebase currently uses plain JavaScript, which can lead to errors and inconsistencies as the codebase grows. Migrating to Typescript will allow us to take advantage of its strong typing system and catch errors earlier in the development process. Additionally, since some of our other applications are already using Typescript, it will help us maintain consistency across our codebase. This task has been requested to improve the maintainability and consistency of our codebase.

Speak with @Behzad-rabiei for best practice (what they did on serverComm)

Remove the command trigger from the bot.

Goal

  • The bot should fetch the settings configured by appetizer user from DB
  • Upon those settings fetch the information from different guilds on daily bases

Example

Let's assume John wants to fetch to see the analysis of RnDAO for the past 3 months.
He'll use appetizer and configures these settings

Period: 1 months
Channels: tc-backend, tc-frontend and tc-business

The bot should fetch the settings from DB, then check how much messages we have from before.
Let's say we've fetched the messages for all the three channels from 1 month ago till past week, hence the bot has to fetch the new messages from past week and add them to database.

Note: keep in mind, user might extend the 3 month period. Let's say John decides to extend the period from 1 month to 3 months, then bot has to fetch the data from 3 moths ago till 1 month ago in addition to the past week's information. I believe to do so, you can the if of the first message we have in db.

How

  • Remove command trigger
  • Fetch different guilds settings from RnDAO database
  • Iterate over guilds and check for missing messages
  • Fetch the data from Discord until you reach overlap

Appendix

Reduce bot permission

Goal

  • The goal is to reduce bot permission to read and only read.
  • We should not need any other permission
  • All code related to sending surveys should move to tc-survey repo

How

  • Move all survey code to the other repo
  • Reduce the permission to read only

Bug: Database schema is missing the relationship to channel and replaces it the thread relationship

Goal

  • Following the same issue in TogetherCrew/mongo-lib#36 we need to update the bot to store the information according to the new schema
  • Also a new collection has been added to store channel names which needs to be updated every day.

How

  • Update dbComm version
  • Store channel id instead of channel name an preserve the relationship between messages and their channel
  • Store thread name and thread id
  • Update channels collection on each cron run

Refactor botComm (fix buggy code)

Description

The bugs that are stopping us from moving the charts into production (mvp) come from incomplete extraction and processing of data from Discord. Overall, this repository doesn't follow best practices. The idea is to refactor this component, including tests and a set of requirements.

Tasks

  • Should use typescript
  • Should have tests
  • Should connect to discord
  • Should stay within the API rate limits
  • Should extract discord id and discord name
  • Should get a list of all channels (GET /guilds/[{guild.id}/threads/active) - what does it do with it?
  • Should get channel permissions (VIEW_CHANNEL, READ_MESSAGE_HISTORY) - do we persist this?
  • Should get messages from a channel (GET /channels/[{channel.id}/messages)
  • Should get all messages from every thread in a channel
  • Should persist using discordIds (not usernames)
  • Should extract reactions from message
  • Should extract user_mentions from message
  • Should extract role_mentions from message
  • Should extract replied_user from message
  • Should extract thread and threadId from message
  • Should persist message data + processing to rawInfo
  • Should extract joined date per account
  • Should extract profile picture per account
  • Should get intents?

Next

  • Should send messages to users
  • Should extract voice?
  • Should extract meeting/event attendants

Documentation

Replace excel extraction with DB integration

Goal

  • Raw data should be stored in MongoDB database
  • All database interfaces and models should be developed in tc-dbcomm repo

How

  • When a command is triggered you'll respond with data will be stored in database
  • You start to store the data in database
  • In order to finish this task you first need to resolve Store server's data schema #2 issue then using tc-dbcomm pachange you're able to connect to db
  • using the above you're able to store the raw data
  • When finished, you should notify the user via a dm message (for now, later we remove this and user can work in dashboard)

Upload logo for bot

Problem: After authenticating my discord account, the image at the top shows an empty circle for the bot, and then my image (see link if my text isn't clear).
Solution: replace the empty image with the TogetherCrew's logo (Benzima has them)

Rename bot

When installing the bot in my discord community, after authenticating myself I see that an external application wants to access my discord account.

Problem: The name of the bot is RnDAO-Dev.
Solution: Rename it to TogetherCrew

Check data per channel

Goal

  • When a new channel has been selected we need to get its information from the beginning of the period till now

How

  • Fetch all selected channels from the setting
  • Check the period that has been covered for each channel
  • Start fetching the missing period from each channel

Add sentry.io to enable error monitoring

As our product grows, it's becoming increasingly important to monitor and address errors quickly. Adding sentry.io to our codebase will enable us to collect error data and alerts, allowing us to quickly diagnose and resolve issues that impact our users. This task has been requested to improve our product's reliability and user experience.

  • Configure sentry for the DSN
  • Implement environments

Documentation:

Suggested environments:

  • development (for a local machine)
  • review (for pull requests)
  • staging
  • production

suggested environment variables naming convention:

  • SENTRY_DSN
  • SENTRY_ENV

Remove channel data

Goal

  • If a user deletes a channel form her guild we need to remove the data on our side (both heatmap and rawinfo)
  • This has an effect on the charts information

unclear what survey-by-time does

Is the survey send to all members between start and end time? or to all members who joined between start and end time? Or something else

Update bot status

Goal

  • Check bot status and update accordingly
  • Report data extraction status

How

  • Wait for the schema to be updated
  • Update the bot status after checking the connection
  • Fetch the data only for the connected bots (db query needs update)
  • Toggle on the field for data extraction status when starting the extraction
  • Toggle off the field for data extraction when the data extraction ends

RabbitMQ: Channel Selection - Send Discord Message (Bot)

In reference to:
https://www.notion.so/channel-selection-connected-to-data-shown-in-line-graphs-and-heatmap-c3d454ad0ea140649728ea0b62a1c4d8?pvs=4

This should be implemented as per the following diagram:
https://miro.com/app/board/uXjVMPYA244=/?share_link_id=123845624136

Tasks:

  • Listen for discord.analysis.completed event
  • Send discord message to user

Open Questions

  • Should it be public or private?
  • In which channel should the message be sent to?
  • Should we send a DM if the users DM is open?

Cannabis Genome DAO (dashboard v1.25)

Onboarding guide: https://www.notion.so/Getting-started-with-the-Health-Pulse-Onboarding-guide-8545d383ec5d4d70aeb4b2aae22d97d7

Discord export:
Some channels have different permissions. The bot needs to have access to these permissions.

Keep note of when and how data is collected

Read more about this task and rewards on Dework.xyz

Originally created from Github issue: https://github.com/RnDAO/DAOlytics/issues/5

Read more about this task and rewards on Dework.xyz

Get the data for new users and notify them

Goal

  • When a new guild is added to our system we want to instantly start fetching the information for the guild, analyze it and then notify the person through discord

How

  • We need the functionality to be implemented in the bot.
  • This functionality should be triggered on each new guild registration

Questions

  • Should we use a messaging system or rest APIs?
  • How can we run the analysis directly after the completed extraction?

Data extraction based on specified params

Goal

  • The script can be scheduled to fetch the information periodically form the specified channels
  • The script will fetch the information, minimize the data size by removing unnecessary information and store it in the database

how

  • Get the list of specified servers and channels from the settings collection alongside the extraction period
  • Check if there's data already available in database for this server
  • Fetch the missing data based on the period and previous data extractions
  • Clean the raw data and minimaize the amount of data we're going to store
  • Create a new database for the server
  • Store raw data in the raw data collection

More data

For checking the data schema you can go here

Extract discord roles

Description

  • every day, the accounts that belong to each discord role need to be added and store in a db

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.