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=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [172.16.0.2] (unknown [104.28.213.130]) by gnuweeb.org (Postfix) with ESMTPSA id E100480908; Mon, 3 Oct 2022 12:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1664801296; bh=tXwWn6dgY/6a4b4WojglOQw3zi3SssV/qP+F8EQDpl0=; h=Date:To:Cc:References:From:Subject:In-Reply-To:From; b=d+7+/B9tYQzY7FQCn8xuWIvec9Oqe6mpZqlabf4L83voFrke60yg3QNOEozcYvR72 2mA/51rlvCZzYjZSj955wiZq2T/2ewr1B/VkouC3+sMLmC5j1rkT7qUfCsSEKoIrd0 cvsLVZBhedsVWtU3aSu6G8imbCrENCn0HJVCdfTebiBQ1RbuMBeXONXGbCfqkzMTof Wa9dXEX4C7oPvnXNWxxef7rEyf+z5L+eSfcnu57ov/ahQ7SzfVlJDNGCfuilDgU6hw aAHQtCFoJnHrG8YScX7j1C8nLDY7rj/C+smWj9kSOwHuA5dS8+G7wc2/3NDWYC61gj qOXyPeEYEUVWQ== Message-ID: <7c6e2632-b8b2-a7dd-f972-07b2b864c20a@gnuweeb.org> Date: Mon, 3 Oct 2022 19:48:12 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: Muhammad Rizki Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20221001130355.784-1-kiizuha@gnuweeb.org> From: Ammar Faizi Subject: Re: [PATCH v1 00/26] The complete version of the Discord bot In-Reply-To: <20221001130355.784-1-kiizuha@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 10/1/22 8:03 PM, Muhammad Rizki wrote: > 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 and worked fine. Please give it a test if I still forgot > something like in the past, thanks! Hi, I have tested the bot, it runs well when it delivers an email that doesn't have an attachment, but sometimes it is broken. See the traces below. Also, the files in storage dir are not deleted. Do you know what may be going wrong here? Files are not deleted: ammarfaizi2@integral2:~/app/lore-daemon.dev/daemon$ ls dscord/storage -l total 0 drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 78 Sep 3 17:25 23035eeb480f2b3501ba0841ef10ce3f drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 12 Oct 3 19:42 6766c45fa800d71173893158b2c7d640 drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 0 Sep 3 17:22 78380c23529749c280e4cca46f7519c9 drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 0 Sep 3 17:23 a23e986acc2c75d08a3e98377f06bbfe drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 356 Sep 3 17:22 b241bd7c932c70e6a81d107da019cb67 drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 12 Sep 3 17:25 bcaac8364eaf04951d504faa1f1df826 drwxrwxr-x 1 ammarfaizi2 ammarfaizi2 0 Sep 3 17:23 c36cdede05b536d395c5b55dbae92288 ammarfaizi2@integral2:~/app/lore-daemon.dev/daemon$ -------------------------------------------- ammarfaizi2@integral2:~/app/lore-daemon.dev/daemon$ python3 dc.py Initialize listener... [ GNU/Weeb Bot is connected ] ID : 1015428932612403221 Name : GNUWeeb2 Tags : GNUWeeb2#3452 Send `$sync` message to the Discord channel where the bot is running. [__run]: Running... [send_text_email] Traceback (most recent call last): File "/home/ammarfaizi2/app/lore-daemon.dev/daemon/dscord/mailer/listener.py", line 56, in __run await self.__handle_atom_url(url) File "/home/ammarfaizi2/app/lore-daemon.dev/daemon/dscord/mailer/listener.py", line 75, in __handle_atom_url await self.__handle_mail(url, mail) File "/home/ammarfaizi2/app/lore-daemon.dev/daemon/dscord/mailer/listener.py", line 83, in __handle_mail await self.__send_to_discord(url, mail, File "/home/ammarfaizi2/app/lore-daemon.dev/daemon/dscord/mailer/listener.py", line 127, in __send_to_discord await m.reply(f"{d}/{f}", file=File(f)) File "/home/ammarfaizi2/.local/lib/python3.10/site-packages/discord/file.py", line 97, in __init__ self.fp = open(fp, 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'config' [__run]: Running... --------------------------------------- My discord.env is: # Input your Discord bot token below DISCORD_TOKEN= # Input your MySQL connection below DB_HOST=127.0.0.1 DB_USER= DB_PASS= DB_NAME=lored_testing # Storage directory to save patch files STORAGE_DIR=storage --------------------------------------- My config.py is: # SPDX-License-Identifier: GPL-2.0-only # # Copyright (C) 2022 Muhammad Rizki # # Paste the admin role ID below # to filter only admin who can # access add/delete lore commands. ADMIN_ROLE_ID = 865885118878711828 # The activity name like "Playing Genshin Impact" # you set the value as "Genshin Impact" ACTIVITY_NAME = "aaaaaaaaaaaa" -- Ammar Faizi