From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [101.128.125.87]) by gnuweeb.org (Postfix) with ESMTPSA id CEB817E254; Tue, 18 Oct 2022 08:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666081052; bh=MLibZHa1ojB/R05Vk0USroQW2+tk/XhMmZHgkRvztRg=; h=From:To:Cc:Subject:Date:From; b=IjTBLPgYPTYmCQVFL5DF+dVGO4oT2H/XEdkqmi/gXneqc9ykv9aHIhVhFbUtfaYba E6X4fW4Oi7sIRbsg8zwJLoJTKQzBpD7pSOZQ3l6zybU7F3l7Q+RFFANlpjbXJTSa2d mvGTCsZdS4/uZ1eOTSsLcJ6jU2LL9IbWI9cK3KODpt/yyseOz+AAl2qed7cJsqEdGn j7+ZWydCT0iOIfvJj2qzhhvyeWIB+rvxC2Nb93KZ0pGfffBmQARSCuin92vd1gPuQ6 30DIfnczFIsUBDJLpCzM5WilYIw6epcAhBHIBaKfp7d7EkzUCVMZjLLMCXyE0uYAuV 6Xd+UIGvChBaA== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v1 0/7] Fix some bugs and add some features Date: Tue, 18 Oct 2022 15:16:28 +0700 Message-Id: <20221018081635.1617-1-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Hi sir, This series is to fix some bugs, improve some codes and add some new features. These bugs should have been fixed now, and the email file attachments should have been removed after all attachments have been sent. Known bugs: 1. Email payload extraction result become unicode if the email payload contain non-UTF8 characters like chinese, japanese, and similar like that. 2. remove_patch() doesn't remove all file attachments properly. Improvements: 1. Improve fix_utf8_char() to make it stable for both Discord and Telegram bot. 2. Improve remove_patch() to make it all file attachments removed after sending them. 3. Fix `/lore {raw atom url}` to add a "telegram" onto the create_template() platform parameter. New features: 1. Add send_text_mail_interaction() for the `/lore {raw atom url}` slash command. 2. Add send_patch_mail_interaction() for the `/lore {raw atom url}` slash command. 3. Add `/lore {raw atom url}` slash command. There are 7 patches in this series: - Patch 1 is to add send_text_mail_interaction() - Patch 2 is to add send_patch_mail_interaction() - Patch 3 is to add `/lore` slash command - Patch 4 is to improve fix_utf8_char() code - Patch 5 is to improve remove_patch() code to make it more stable - Patch 6 is to add manage_payload() for manage email payload extraction - Patch 7 is to fix the Telegram `/lore` command How to use: 1. Execute the db.sql file in the daemon directory, 2. Setup .env file, the example is there with suffix .example, this file name must remove the suffix name .example, 3. Set up the config.py in each bot directory, such as dscord and telegram. The example is there with suffix .example & the file name must remove suffix name .example, 4. Run `pip3 install -r requirements.txt` in each bot directory, 5. STORAGE_DIR env value must `storage` to make it work fine, 6. Run the bot by `python3 dc.py` or `python3 tg.py`. Both tested. But, I want to make sure if it's already fixed and stable. So, don't forget to test it too, thanks. Muhammad Rizki (7): discord: Add send_text_mail_interaction() discord: Add send_patch_mail_interaction() discord: Add get lore mail slash command atom: Improve fix_utf8_char() atom: Improve remove_patch() atom: add manage_payload() telegram: Fix get lore command daemon/atom/utils.py | 31 +++++++++++---- daemon/dscord/gnuweeb/client.py | 23 +++++++++++ .../plugins/slash_commands/__init__.py | 2 + .../plugins/slash_commands/get_lore_mail.py | 39 +++++++++++++++++++ daemon/dscord/mailer/listener.py | 4 +- daemon/telegram/mailer/listener.py | 3 +- .../packages/plugins/commands/scrape.py | 5 +-- 7 files changed, 92 insertions(+), 15 deletions(-) create mode 100644 daemon/dscord/gnuweeb/plugins/slash_commands/get_lore_mail.py base-commit: d9b20dab81202b93f48d5365ad680796e5839d80 -- Muhammad Rizki