public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: Muhammad Rizki <[email protected]>
Cc: Alviro Iskandar Setiawan <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>
Subject: Re: [PATCH v1 00/26] The complete version of the Discord bot
Date: Mon, 3 Oct 2022 19:48:12 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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=<snip>

# Input your MySQL connection below
DB_HOST=127.0.0.1
DB_USER=<snip>
DB_PASS=<snip>
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 <[email protected]>
#

# 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

  parent reply	other threads:[~2022-10-03 12:48 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-01 13:03 [PATCH v1 00/26] The complete version of the Discord bot Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 01/26] discord: Add get_atom_urls() to get the list of atom URLs Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 02/26] Fix the storage management after the refactor was happened Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 03/26] discord: Add get_broadcast_chats() to get the list of broadcast chats Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 04/26] discord: Add get_email_id() in getter directory Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 05/26] discord: Add get_reply_id() " Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 06/26] discord: Inherit Getter() class to the DBMethods() class Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 07/26] discord: Add delete_atom() in deletion directory Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 08/26] discord: Add delete_broadcast() " Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 09/26] discord: Inherit the Deletion() class to the DBMethods() class Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 10/26] discord: Inherit the DBMethods() class to the DB() class Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 11/26] discord: Use the created " Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 12/26] telegram: Rename some utility functions Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 13/26] discord: Add a FullMessageBtn() class in models Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 14/26] discord: Add filters.wait_on_limit() decorator Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 15/26] discord: Add send lore email message functions Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 16/26] discord: Add mail listener Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 17/26] discord: Implement the mail Listener() class Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 18/26] discord: Add @filters.lore_admin() decorator Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 19/26] discord: Add a list of atom URL slash command Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 20/26] discord: Add an add atom " Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 21/26] discord: Add a delete " Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 22/26] discord: Add channel_link() in the atom/utils.py Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 23/26] discord: Add a list broadcast slash command Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 24/26] discord: Add an add " Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 25/26] discord: Add a delete " Muhammad Rizki
2022-10-01 13:03 ` [PATCH v1 26/26] discord: Change the on_ready message Muhammad Rizki
2022-10-03 12:48 ` Ammar Faizi [this message]
2022-10-03 13:04   ` [PATCH v1 00/26] The complete version of the Discord bot Muhammad Rizki
2022-10-03 13:13     ` Ammar Faizi
2022-10-03 13:12   ` Muhammad Rizki
2022-10-03 13:13     ` Ammar Faizi
2022-10-03 23:12   ` Alviro Iskandar Setiawan
2022-10-03 23:14     ` Ammar Faizi
2022-10-03 23:18     ` Muhammad Rizki
2022-10-03 23:22       ` Alviro Iskandar Setiawan
2022-10-03 23:31         ` Ammar Faizi
2022-10-03 23:33         ` Muhammad Rizki
2022-10-03 23:36           ` Ammar Faizi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox