GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
From: Muhammad Rizki <[email protected]>
To: Ammar Faizi <[email protected]>
Cc: Muhammad Rizki <[email protected]>,
	Alviro Iskandar Setiawan <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>
Subject: [PATCH v1 00/26] The complete version of the Discord bot
Date: Sat,  1 Oct 2022 20:03:28 +0700	[thread overview]
Message-ID: <[email protected]> (raw)

Hi, sir
In this series, I create the complete version of the Discord bot.
This series contains slash commands, events, and basic commands for
syncing the slash commands to the global. Add getter and deletion
database methods. Add a mail listener to get the new lore email message.
Add filters to only the lore admin who can use the atom and
broadcast manager slash commands.

This series contains fix a bug in the storage management on the
atom/utils.py, because I forgot to test the Telegram bot in the past.

Rename some utility functions to make it simple and readable. Add a
button UI to go direct to its lore email message. Some changes on the
on_ready event give a tip message on what to do when the bot first
starts.

There are 26 patches in this series:
- Patch 1 is to add get_atom_urls() to get the list of atom URLs in the DB
- Patch 2 is to fix the storage management on the atom/utils.py
- Patch 3 is to add get_broadcast_chats() to get the list of Discord ch
- Patch 4 is to add get_email_id() to get the email ID of the PK emails
- Patch 5 is to add get_reply_id() to get the Discord message ID
- Patch 6 is to inherit Getter() to the DBMethods() class
- Patch 7 is to add delet_atom() to delete specific atom URL
- Patch 8 is to add delete_broadcast() to delete current Discord channel
- Patch 9 is to inherit Deletion() to the DBMethods() class
- Patch 10 is to inherit DBMethods() to the DB() class
- Patch 11 is to implement the created DB() class in the GWClient() class
- Patch 12 is to rename some utility functions
- Patch 13 is to add a FullMessageBtn() button URL class to go to the lore
- Patch 14 is to add a @filters.wait_on_limit() to handle the rate limit
- Patch 15 is to add send lore email message functions
- Patch 16 is to add a mail listener to get the new lore email message
- Patch 17 is to implement the mail Listener() class in the dc.py
- Patch 18 is to add a @filters.lore_admin() to filter only the lore admin
- Patch 19 is to add a `/atom list` slash command
- Patch 20 is to add a `/atom add` slash command
- Patch 21 is to add a `/atom delete` slash command
- Patch 22 is to add a channel_link() util function in the atom/utils.py
- Patch 23 is to add a `/broadcast list` slash command
- Patch 24 is to add a `/broadcast add` slash command
- Patch 25 is to add a `/broadcast delete` slash command
- Patch 26 is to add a tip message on the on_ready event

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!

Muhammad Rizki (26):
  discord: Add get_atom_urls() to get the list of atom URLs
  Fix the storage management after the refactor was happened
  discord: Add get_broadcast_chats() to get the list of broadcast chats
  discord: Add get_email_id() in getter directory
  discord: Add get_reply_id() in getter directory
  discord: Inherit Getter() class to the DBMethods() class
  discord: Add delete_atom() in deletion directory
  discord: Add delete_broadcast() in deletion directory
  discord: Inherit the Deletion() class to the DBMethods() class
  discord: Inherit the DBMethods() class to the DB() class
  discord: Use the created DB() class
  telegram: Rename some utility functions
  discord: Add a FullMessageBtn() class in models
  discord: Add filters.wait_on_limit() decorator
  discord: Add send lore email message functions
  discord: Add mail listener
  discord: Implement the mail Listener() class
  discord: Add @filters.lore_admin() decorator
  discord: Add a list of atom URL slash command
  discord: Add an add atom slash command
  discord: Add a delete atom slash command
  discord: Add channel_link() in the atom/utils.py
  discord: Add a list broadcast slash command
  discord: Add an add broadcast slash command
  discord: Add a delete broadcast slash command
  discord: Change the on_ready message

 daemon/atom/utils.py                          |  81 ++++++---
 daemon/dc.py                                  |  30 +++-
 daemon/dscord/database/core.py                |   5 +-
 daemon/dscord/database/methods/__init__.py    |   6 +-
 .../database/methods/deletion/__init__.py     |  14 ++
 .../database/methods/deletion/delete_atom.py  |  15 ++
 .../methods/deletion/delete_broadcast.py      |  15 ++
 .../database/methods/getter/__init__.py       |  18 ++
 .../database/methods/getter/get_atom_urls.py  |  21 +++
 .../methods/getter/get_broadcast_chats.py     |  21 +++
 .../database/methods/getter/get_email_id.py   |  60 +++++++
 .../database/methods/getter/get_reply.py      |  33 ++++
 daemon/dscord/gnuweeb/client.py               |  52 +++++-
 daemon/dscord/gnuweeb/filters.py              |  53 ++++++
 daemon/dscord/gnuweeb/models/__init__.py      |   6 +
 .../dscord/gnuweeb/models/full_message_btn.py |  12 ++
 daemon/dscord/gnuweeb/plugins/__init__.py     |   4 +-
 .../dscord/gnuweeb/plugins/events/on_ready.py |   7 +-
 .../plugins/slash_commands/__init__.py        |  13 ++
 .../plugins/slash_commands/manage_atom.py     |  81 +++++++++
 .../slash_commands/manage_broadcast.py        |  84 ++++++++++
 daemon/dscord/mailer/__init__.py              |   7 +
 daemon/dscord/mailer/listener.py              | 154 ++++++++++++++++++
 daemon/telegram/mailer/listener.py            |   2 +-
 daemon/telegram/packages/client.py            |   6 +-
 25 files changed, 770 insertions(+), 30 deletions(-)
 create mode 100644 daemon/dscord/database/methods/deletion/__init__.py
 create mode 100644 daemon/dscord/database/methods/deletion/delete_atom.py
 create mode 100644 daemon/dscord/database/methods/deletion/delete_broadcast.py
 create mode 100644 daemon/dscord/database/methods/getter/__init__.py
 create mode 100644 daemon/dscord/database/methods/getter/get_atom_urls.py
 create mode 100644 daemon/dscord/database/methods/getter/get_broadcast_chats.py
 create mode 100644 daemon/dscord/database/methods/getter/get_email_id.py
 create mode 100644 daemon/dscord/database/methods/getter/get_reply.py
 create mode 100644 daemon/dscord/gnuweeb/filters.py
 create mode 100644 daemon/dscord/gnuweeb/models/__init__.py
 create mode 100644 daemon/dscord/gnuweeb/models/full_message_btn.py
 create mode 100644 daemon/dscord/gnuweeb/plugins/slash_commands/__init__.py
 create mode 100644 daemon/dscord/gnuweeb/plugins/slash_commands/manage_atom.py
 create mode 100644 daemon/dscord/gnuweeb/plugins/slash_commands/manage_broadcast.py
 create mode 100644 daemon/dscord/mailer/__init__.py
 create mode 100644 daemon/dscord/mailer/listener.py


base-commit: fdbccda0372a7869b7ac6b8c5b31ec1761b5e084
--
Muhammad Rizki

             reply	other threads:[~2022-10-01 13:04 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-01 13:03 Muhammad Rizki [this message]
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 ` [PATCH v1 00/26] The complete version of the Discord bot Ammar Faizi
2022-10-03 13:04   ` 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