Skip to content

a channel should have a notification message associated with it. #6

@jxsl13

Description

@jxsl13

002_schema.sql

CREATE TABLE IF NOT EXISTS player_count_notification_messages (
    channel_id BIGINT NOT NULL PRIMARY KEY
        references channels(id)
        ON DELETE CASCADE,
    message_id BIGINT NOT NULL
);

should listen to message deletion events
in order to delete the database entry in case tue message is deleted manually.
we want a more dedicated table name due to potentially other types of notifications.

--- name: AddPlayerCountNotificationMessage :exec
INSERT INTO player_count_notification_messages (channel_id, message_id) VALUES ($1, $2)
ON CONFLICT (channel_id) SET message_id = EXCLUDED.message_id;

--- name:RemovePlayerCountNotifocationMessage :exec
REMOVE FROM player_count_notification_messages
WHERE channel_id = $1 
AND message_id = $2;

do we want to create a central notification message or do we want to send DMs?

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