Skip to content

Sticky Messages #2

@Archasion

Description

@Archasion

Functionality

Send a message in a channel and ensure it is always at the bottom of the chat. This can be achieved by monitoring the MESSAGE_CREATE event for new messages from users (not bots), deleting the previously-sent 'sticky message', and re-sending it.

Store the most recently-sent message in the database so the bot is able to delete it upon a restart/unexpected crash.

Config Schema

sticky_messages:
  - channel_id: "CHANNEL_ID"
    message: ...
  • sticky_messages.[].channel_id - ID of the channel where the message will be sent
  • sticky_messages.[].message - The message to be sent

Database Model

CREATE TABLE sticky_messages
(
    message_id TEXT PRIMARY KEY NOT NULL,
    channel_id TEXT NOT NULL,
);
  • message_id - ID of the most recently sent sticky message
  • channel_id - ID of the channel where the message was sent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions