Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message scheduler #2

Open
mehrdadmms opened this issue Mar 2, 2023 · 0 comments
Open

Message scheduler #2

mehrdadmms opened this issue Mar 2, 2023 · 0 comments
Labels
400 Points By redeeming the points you'll receive compensation. 35% fiat and the rest is project token. enhancement New feature or request good first issue Good for newcomers

Comments

@mehrdadmms
Copy link
Contributor

Goal

  • As a user, I'd like to schedule announcements to go to a certain channel at a certain time.

How

  • First read the current code and understand the repo
  • Add a new command for scheduling messages which receives the date and the channel to send the scheduled message
  • Connect to MongoDB using the dbComm repo.
  • Create a new collection for each guild to store the scheduled message. You need to update dbComm repo to create an interface for your new collection.
  • Store the scheduled message
  • Create a cron tab to run every minute and check for sending scheduled messages
  • Send the scheduled message to the specified channel or thread
  • Create a command to show the scheduled messages
  • Create a command for removing a scheduled message

Suggestion

You can use this schema for the new collection, you might need to add new fields based on your need. this is only a jump start.

{ created_at: date, channelId: string, threadId: string, scheduled_for: date, message: string, userId: string, status: Enum(pending, done, failed) status_reason: string }

@mehrdadmms mehrdadmms added good first issue Good for newcomers 400 Points By redeeming the points you'll receive compensation. 35% fiat and the rest is project token. enhancement New feature or request labels Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
400 Points By redeeming the points you'll receive compensation. 35% fiat and the rest is project token. enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant