From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1752402844; bh=Qipti8OwEW5JTxw3T+GrewGcOQP2T9CaNZTwQ8cK/jw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:References: Resent-Date:Resent-From:Resent-To:Resent-Cc:User-Agent: Content-Type:Content-Transfer-Encoding; b=O5eIy72UMNQhC9uQHoescPSa13ch9DVcLQDG9Yjj6TtAf+NpNXzTE7sVxeOxE33SX hT5UW+9WeudtCibVrMycIsCmWii//q+/Ckvgxkc2Cs+a2dGbr5r+utXHeL6fp5rNU3 4wcJWebyhVhaLtZi38ge7CUX2kJ7pNrRaWnbQ0Fg5S2BVi3E6bkeHEk8nwcMM5qH6H WSfZ+x70xbHLpNzNrW3yQPdME/T3EQ9NEQR6rZ3+fa/cnLx/4SjdjM0RwjcP3w/Bwt WJGGgZMhu42cGaKQxD4TnI3oqsu6Z1ArjYB8nN00obd3D0Ggok3aSW0OUhIma+C/M3 dtVJ2hws4Zq6A== Received: from biznet-home.integral.gnuweeb.org (unknown [182.253.126.146]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id 8061021099E3; Sun, 13 Jul 2025 10:34:03 +0000 (UTC) Date: Sun, 13 Jul 2025 17:34:00 +0700 From: Ammar Faizi To: Yonle Cc: GNU/Weeb Mailing List Subject: [GIT PULL] go-wrsbmkg-telegram: MSG_MEMORY_DIR feature Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Bpl: hUx9VaHkTWcLO7S8CQCslj6OzqBx2hfLChRz45nPESx5VSB/xuJQVOKOB1zSXE3yc9ntP27bV1M1 List-Id: 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