Skip to content

Message scheduler #2

@mehrdadmms

Description

@mehrdadmms

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 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    400 PointsBy redeeming the points you'll receive compensation. 35% fiat and the rest is project token.enhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions