public inbox for gwml@vger.gnuweeb.org
 help / color / mirror / Atom feed
* [GIT PULL] go-wrsbmkg-telegram: MSG_MEMORY_DIR feature
@ 2025-07-13 10:34 Ammar Faizi
  2025-07-13 10:58 ` Yonle
  0 siblings, 1 reply; 2+ messages in thread
From: Ammar Faizi @ 2025-07-13 10:34 UTC (permalink / raw)
  To: Yonle; +Cc: GNU/Weeb Mailing List

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [GIT PULL] go-wrsbmkg-telegram: MSG_MEMORY_DIR feature
  2025-07-13 10:34 [GIT PULL] go-wrsbmkg-telegram: MSG_MEMORY_DIR feature Ammar Faizi
@ 2025-07-13 10:58 ` Yonle
  0 siblings, 0 replies; 2+ messages in thread
From: Yonle @ 2025-07-13 10:58 UTC (permalink / raw)
  To: Ammar Faizi; +Cc: GNU/Weeb Mailing List

Greetings.

Your requested change has been merged to the master branch.

- 
https://codeberg.org/Yonle/go-wrsbmkg-telegram/commit/47b93229fc11f451bf4494dea753a05b8f6c67f1

- 
https://codeberg.org/Yonle/go-wrsbmkg-telegram/commit/da3a22ff4ac57f974ee84d985b009456a3672dac

- 
https://codeberg.org/Yonle/go-wrsbmkg-telegram/commit/1fb468818593276a317821bc7c090cf523687931

Thank you!

---

Yonle

https://gnuweeb.org

On 7/13/25 17:34, Ammar Faizi wrote:
> 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(-)
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-13 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-13 10:34 [GIT PULL] go-wrsbmkg-telegram: MSG_MEMORY_DIR feature Ammar Faizi
2025-07-13 10:58 ` Yonle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox