dgtlmoon / changedetection.io

The best and simplest free open source web page change detection, website watcher, restock monitor and notification service. Restock Monitor, change detection. Designed for simplicity - Simply monitor which websites had a text change for free. Free Open source web page change detection, Website defacement monitoring, Price change notification
https://changedetection.io
Apache License 2.0
17.33k stars 966 forks source link

[feature] Better discord formatting, size limit workaround #2723

Open Reginald-Gillespie opened 5 hours ago

Reginald-Gillespie commented 5 hours ago

Version and OS v0.46.03 on linux/docker

Is your feature request related to a problem? Please describe. The change summary sent to discord webhooks is always cut off by discord's 2000 char limit.

Describe the solution you'd like A .txt file upload of the changes would allow it to be millions of chars longer. The downside is that it would take a discord bot to send which is more complex to setup (opening discord devs tab, creating new bot, adding it to the server, grabbing the token), but shouldn't be hard to implement. On detecting a change, have a queue of messages it adds to that the bot should upload as .txt files. The bot could either be always online, or it could login to the bot any time the queue has messages, and log out a minute after the queue is empty.

With the file upload, you could even name the file ending in .diff and use the standard git formatting for changed lines, and it will look like this: image

Technically you could (I know I technically should open a second issue for this) get this same rendering with the current system if you wrap the changes in three backticks with the word diff after the first three like so:

```diff
Before
+ Addition
- Subtration
After

Just gotta make sure that you don't trim the last three backticks off when limiting the message size to 2000 chars.

**Describe the use-case and give concrete real-world examples**
I think I've been clear enough.
Reginald-Gillespie commented 5 hours ago

Formatting comments are similar to https://github.com/dgtlmoon/changedetection.io/issues/2554, file upload idea still applies.