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=1752404310; bh=UrHz2LZIcAo9RNw5n73pt532pI/vEDDqJ+nULWzOWFE=; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding: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=KRD395TCUlHAs/ZwK0FV1BrZ7T44nElwzt3SgIKVmv9SKom62RMDuExmcATjrhTGO o0hnrjznd+q0xhdb6FF3AJThENxGFV1QDIoEvEXhNI03hFBzWYZ8nfq+v/z0253cp4 L3vN5Q69ZmXyQ2YQ7kNvufa3EJYV4yDPDXk3tzt3tNbDlAFg2hHohPdPUrc5Tn0G04 nA3Nq7zPxMmV+hOChYeMPEwIk/zygx/mmd20FdYghs3JIbwpnTqJZYkvh7wMChcCYw NDF0VNoqEKKQAE9fXoYJemJ3VCxeqcmyuFl5rSeW3A6XLAt+gHIy1Y9JLS8pJMgAkH TYmGnbzBt90cw== Received: from [IPV6:2400:9800:5c0:2f1b:4d64:5328:d235:4e1c] (unknown [IPv6:2400:9800:5c0:2f1b:4d64:5328:d235:4e1c]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id CC2EC21099FD; Sun, 13 Jul 2025 10:58:29 +0000 (UTC) Message-ID: <5b6b7eb4-8dfc-4c39-a87a-00492b0c13c2@gnuweeb.org> Date: Sun, 13 Jul 2025 17:58:27 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [GIT PULL] go-wrsbmkg-telegram: MSG_MEMORY_DIR feature To: Ammar Faizi Cc: GNU/Weeb Mailing List References: Content-Language: en-US From: Yonle In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: 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(-) >