diff --git a/docs/configuration.md b/docs/configuration.md index eb6edde..ad29ce8 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -222,6 +222,15 @@ Make sure to do the necessary [port forwarding](https://portforward.com/) and ad **Default:** `!` Prefix for bot commands +#### reactOnSeen +**Default:** `off` +If enabled, the bot will react to messages sent to it with the emoji defined in `reactOnSeenEmoji` + +#### reactOnSeenEmoji +**Default:** `📨` +The emoji that the bot will react with when it sees a message. Requires `reactOnSeen` to be enabled. +Must be pasted in the config file as the Emoji representation and not as a unicode codepoint. + #### relaySmallAttachmentsAsAttachments **Default:** `off` If enabled, small attachments from users are sent as real attachments rather than links in modmail threads. diff --git a/src/data/Thread.js b/src/data/Thread.js index 2912b11..ffedd55 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -323,6 +323,10 @@ class Thread { await this._updateThreadMessage(threadMessage.id, { inbox_message_id: inboxMessage.id }); } + if (config.reactOnSeen) { + await msg.addReaction(config.reactOnSeenEmoji); + } + // Interrupt scheduled closing, if in progress if (this.scheduled_close_at) { await this.cancelScheduledClose(); diff --git a/src/data/cfg.schema.json b/src/data/cfg.schema.json index 198c87a..94738a3 100644 --- a/src/data/cfg.schema.json +++ b/src/data/cfg.schema.json @@ -244,6 +244,16 @@ } }, + "reactOnSeen": { + "$ref": "#/definitions/customBoolean", + "default": false + }, + + "reactOnSeenEmoji": { + "type": "string", + "default": "\uD83D\uDCE8" + }, + "port": { "type": "number", "maximum": 65535,