From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Yonle <yonle@gnuweeb.org>
Cc: GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Subject: [GIT PULL] go-wrsbmkg-telegram: MSG_MEMORY_DIR feature
Date: Sun, 13 Jul 2025 17:34:00 +0700 [thread overview]
Message-ID: <aHOLmDZ/AV6mhE8a@biznet-home.integral.gnuweeb.org> (raw)
Introducing a feature to remember sent messages in the Telegram bot.
Designed to prevent the bot from resending messages that have already
been sent. It utilizes a simple file-based memory system to keep track
of sent messages. The bot hashes each message and checks if a file
with that hash exists in a specified memory directory. If the file
exists, the bot skips sending that message. If it does not exist, the
bot creates the file to remember the message.
There are three main changes in this pull request:
1) config: Introduce `MSG_MEMORY_DIR` field
A preparation patch to introduce a feature to remember sent messages.
It is used to avoid resending messages that have already been sent.
2) wrs: Introduce `IsNewMessage()` function.
3) wrs: Introduce `MemDirHouseKeeping()` function.
To avoid blowing up the disk space, introduce `MemDirHouseKeeping()` to
delete saved hashed messages older than 7 days.
Consider pulling this feature.
The following changes since commit 2a0832d3e534143b761654956a3572498f32078e:
my bad for returning in a loop than continuing (2025-07-13 15:40:22 +0700)
are available in the Git repository at:
https://github.com/ammarfaizi2/go-wrsbmkg-tg.git tags/memmsg-2025-07-13
for you to fetch changes up to 1fb468818593276a317821bc7c090cf523687931:
wrs: Introduce `MemDirHouseKeeping()` function (2025-07-13 17:21:32 +0700)
----------------------------------------------------------------
memmsg-2025-07-13
----------------------------------------------------------------
Ammar Faizi (3):
config: Introduce `MSG_MEMORY_DIR` field
wrs: Introduce `IsNewMessage()` function
wrs: Introduce `MemDirHouseKeeping()` function
config.go | 4 +-
wrs.go | 108 ++++++++++++++++++++++++++++++++++++++++
wrsbmkg_telegrambot_config.yaml.example | 8 +++
3 files changed, 119 insertions(+), 1 deletion(-)
--
Ammar Faizi
next reply other threads:[~2025-07-13 10:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-13 10:34 Ammar Faizi [this message]
2025-07-13 10:58 ` [GIT PULL] go-wrsbmkg-telegram: MSG_MEMORY_DIR feature Yonle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aHOLmDZ/AV6mhE8a@biznet-home.integral.gnuweeb.org \
--to=ammarfaizi2@gnuweeb.org \
--cc=gwml@vger.gnuweeb.org \
--cc=yonle@gnuweeb.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox