From: Muhammad Rizki <[email protected]>
To: Ammar Faizi <[email protected]>
Cc: Muhammad Rizki <[email protected]>,
GNU/Weeb Mailing List <[email protected]>,
Alviro Iskandar Setiawan <[email protected]>
Subject: [PATCH v2 0/3] New Discord bot and full refactor scripts
Date: Sat, 27 Aug 2022 10:02:33 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
Good morning, sir
In this series I created a Discord bot, the functionality and features
still the same with the Telegram bot, this series contains full refactor
both Discord and Telegram bot scripts which is more cleaner.
Refactors:
Moving the atom related files outside the bot scripts which is can be
reusable with each other bot scripts.
Moving the database related files and create a directory for themselves,
this method is more clean so it's more easier to develop and maintain.
Mass refactor for Telegram and Discord bot scripts.
Combine the SQL file for Discord and Telegram bot, so we don't have to
make a new database.
There are 3 patches in this series:
1. Patch 1 is moving the Telegram bot for splitting between Discord bot.
2. Patch 2 is to release the Discord bot.
3. Patch 3 is to mass refactor like atom, Telegram bot, and Discord bot.
Both bot scripts are tested and works fine, please give it a test too if
there is any unexpted errors, bugs, and results, thanks.
Muhammad Rizki (3):
Move the Telegram bot source code
First release Discord bot
Full refactor bot scripts
.gitignore | 7 +-
daemon/{scraper => atom}/__init__.py | 4 +-
daemon/{scraper => atom}/scraper.py | 12 +-
daemon/{scraper => atom}/utils.py | 87 +++++--
daemon/db.sql | 75 +++++-
daemon/dc.py | 48 ++++
daemon/discord.env.example | 8 +
daemon/dscord/config.py.example | 9 +
daemon/dscord/database/__init__.py | 6 +
daemon/dscord/database/core.py | 19 ++
daemon/dscord/database/methods/__init__.py | 16 ++
.../database/methods/deletion/__init__.py | 8 +
.../database/methods/deletion/delet_atom.py | 12 +
.../methods/deletion/delete_broadcast.py | 12 +
.../database/methods/getter/__init__.py | 12 +
.../database/methods/getter/get_atom_urls.py | 18 ++
.../methods/getter/get_broadcast_chats.py | 18 ++
.../database/methods/getter/get_email_id.py | 56 +++++
.../database/methods/getter/get_reply.py | 29 +++
.../database/methods/insertion/__init__.py | 12 +
.../database/methods/insertion/insert_atom.py | 20 ++
.../methods/insertion/insert_broadcast.py | 42 ++++
.../methods/insertion/insert_discord.py | 14 ++
.../methods/insertion/insert_email.py | 20 ++
daemon/dscord/gnuweeb/__init__.py | 6 +
daemon/dscord/gnuweeb/client.py | 108 +++++++++
daemon/dscord/gnuweeb/filters.py | 67 ++++++
daemon/dscord/gnuweeb/models/__init__.py | 6 +
daemon/dscord/gnuweeb/models/ui/__init__.py | 6 +
.../gnuweeb/models/ui/buttons/__init__.py | 6 +
.../models/ui/buttons/full_message_btn.py | 21 ++
daemon/dscord/gnuweeb/plugins/__init__.py | 20 ++
.../plugins/basic_commands/__init__.py | 13 ++
.../plugins/basic_commands/debugger.py | 20 ++
.../gnuweeb/plugins/basic_commands/sync_it.py | 20 ++
.../dscord/gnuweeb/plugins/events/__init__.py | 13 ++
.../dscord/gnuweeb/plugins/events/on_error.py | 17 ++
.../dscord/gnuweeb/plugins/events/on_ready.py | 24 ++
.../plugins/slash_commands/__init__.py | 15 ++
.../plugins/slash_commands/get_lore_mail.py | 47 ++++
.../plugins/slash_commands/manage_atom.py | 81 +++++++
.../slash_commands/manage_broadcast.py | 83 +++++++
daemon/dscord/gnuweeb/utils.py | 52 +++++
daemon/dscord/mailer/__init__.py | 6 +
daemon/dscord/mailer/listener.py | 148 ++++++++++++
daemon/dscord/requirements.txt | 8 +
daemon/{ => dscord}/storage/.gitignore | 0
daemon/packages/__init__.py | 1 -
daemon/scraper/db.py | 217 ------------------
daemon/{.env.example => telegram.env.example} | 0
daemon/{ => telegram}/config.py.example | 0
daemon/telegram/database/__init__.py | 7 +
daemon/telegram/database/core.py | 20 ++
daemon/telegram/database/methods/__init__.py | 17 ++
.../database/methods/deletion/__init__.py | 14 ++
.../database/methods/deletion/delet_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 | 62 +++++
.../methods/getter/get_telegram_reply.py | 33 +++
.../database/methods/insertion/__init__.py | 18 ++
.../database/methods/insertion/insert_atom.py | 27 +++
.../methods/insertion/insert_broadcast.py | 56 +++++
.../methods/insertion/insert_email.py | 27 +++
.../methods/insertion/insert_telegram.py | 21 ++
daemon/telegram/mailer/__init__.py | 8 +
.../bot.py => telegram/mailer/listener.py} | 63 +++--
daemon/telegram/packages/__init__.py | 6 +
daemon/{ => telegram}/packages/client.py | 18 +-
daemon/{ => telegram}/packages/decorator.py | 6 +-
.../packages/plugins/callbacks/del_atom.py | 8 +-
.../packages/plugins/callbacks/del_chat.py | 8 +-
.../packages/plugins/commands/debugger.py | 4 +-
.../packages/plugins/commands/manage_atom.py | 10 +-
.../plugins/commands/manage_broadcast.py | 10 +-
.../packages/plugins/commands/scrape.py | 12 +-
daemon/{ => telegram}/requirements.txt | 0
daemon/telegram/storage/.gitignore | 2 +
daemon/{run.py => tg.py} | 22 +-
81 files changed, 1793 insertions(+), 345 deletions(-)
rename daemon/{scraper => atom}/__init__.py (54%)
rename daemon/{scraper => atom}/scraper.py (79%)
rename daemon/{scraper => atom}/utils.py (72%)
create mode 100644 daemon/dc.py
create mode 100644 daemon/discord.env.example
create mode 100644 daemon/dscord/config.py.example
create mode 100644 daemon/dscord/database/__init__.py
create mode 100644 daemon/dscord/database/core.py
create mode 100644 daemon/dscord/database/methods/__init__.py
create mode 100644 daemon/dscord/database/methods/deletion/__init__.py
create mode 100644 daemon/dscord/database/methods/deletion/delet_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/database/methods/insertion/__init__.py
create mode 100644 daemon/dscord/database/methods/insertion/insert_atom.py
create mode 100644 daemon/dscord/database/methods/insertion/insert_broadcast.py
create mode 100644 daemon/dscord/database/methods/insertion/insert_discord.py
create mode 100644 daemon/dscord/database/methods/insertion/insert_email.py
create mode 100644 daemon/dscord/gnuweeb/__init__.py
create mode 100644 daemon/dscord/gnuweeb/client.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/ui/__init__.py
create mode 100644 daemon/dscord/gnuweeb/models/ui/buttons/__init__.py
create mode 100644 daemon/dscord/gnuweeb/models/ui/buttons/full_message_btn.py
create mode 100644 daemon/dscord/gnuweeb/plugins/__init__.py
create mode 100644 daemon/dscord/gnuweeb/plugins/basic_commands/__init__.py
create mode 100644 daemon/dscord/gnuweeb/plugins/basic_commands/debugger.py
create mode 100644 daemon/dscord/gnuweeb/plugins/basic_commands/sync_it.py
create mode 100644 daemon/dscord/gnuweeb/plugins/events/__init__.py
create mode 100644 daemon/dscord/gnuweeb/plugins/events/on_error.py
create mode 100644 daemon/dscord/gnuweeb/plugins/events/on_ready.py
create mode 100644 daemon/dscord/gnuweeb/plugins/slash_commands/__init__.py
create mode 100644 daemon/dscord/gnuweeb/plugins/slash_commands/get_lore_mail.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/gnuweeb/utils.py
create mode 100644 daemon/dscord/mailer/__init__.py
create mode 100644 daemon/dscord/mailer/listener.py
create mode 100644 daemon/dscord/requirements.txt
rename daemon/{ => dscord}/storage/.gitignore (100%)
delete mode 100644 daemon/packages/__init__.py
delete mode 100644 daemon/scraper/db.py
rename daemon/{.env.example => telegram.env.example} (100%)
rename daemon/{ => telegram}/config.py.example (100%)
create mode 100644 daemon/telegram/database/__init__.py
create mode 100644 daemon/telegram/database/core.py
create mode 100644 daemon/telegram/database/methods/__init__.py
create mode 100644 daemon/telegram/database/methods/deletion/__init__.py
create mode 100644 daemon/telegram/database/methods/deletion/delet_atom.py
create mode 100644 daemon/telegram/database/methods/deletion/delete_broadcast.py
create mode 100644 daemon/telegram/database/methods/getter/__init__.py
create mode 100644 daemon/telegram/database/methods/getter/get_atom_urls.py
create mode 100644 daemon/telegram/database/methods/getter/get_broadcast_chats.py
create mode 100644 daemon/telegram/database/methods/getter/get_email_id.py
create mode 100644 daemon/telegram/database/methods/getter/get_telegram_reply.py
create mode 100644 daemon/telegram/database/methods/insertion/__init__.py
create mode 100644 daemon/telegram/database/methods/insertion/insert_atom.py
create mode 100644 daemon/telegram/database/methods/insertion/insert_broadcast.py
create mode 100644 daemon/telegram/database/methods/insertion/insert_email.py
create mode 100644 daemon/telegram/database/methods/insertion/insert_telegram.py
create mode 100644 daemon/telegram/mailer/__init__.py
rename daemon/{scraper/bot.py => telegram/mailer/listener.py} (64%)
create mode 100644 daemon/telegram/packages/__init__.py
rename daemon/{ => telegram}/packages/client.py (80%)
rename daemon/{ => telegram}/packages/decorator.py (88%)
rename daemon/{ => telegram}/packages/plugins/callbacks/del_atom.py (80%)
rename daemon/{ => telegram}/packages/plugins/callbacks/del_chat.py (85%)
rename daemon/{ => telegram}/packages/plugins/commands/debugger.py (91%)
rename daemon/{ => telegram}/packages/plugins/commands/manage_atom.py (86%)
rename daemon/{ => telegram}/packages/plugins/commands/manage_broadcast.py (89%)
rename daemon/{ => telegram}/packages/plugins/commands/scrape.py (82%)
rename daemon/{ => telegram}/requirements.txt (100%)
create mode 100644 daemon/telegram/storage/.gitignore
rename daemon/{run.py => tg.py} (69%)
base-commit: 2582d7e5225d47a01f606808fc71e5e6aa7cb153
--
Muhammad Rizki
next reply other threads:[~2022-08-27 3:02 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 3:02 Muhammad Rizki [this message]
2022-08-27 3:02 ` [PATCH v2 1/3] Move the Telegram bot source code Muhammad Rizki
2022-08-27 3:02 ` [PATCH v2 2/3] First release Discord bot Muhammad Rizki
2022-09-03 0:29 ` Ammar Faizi
2022-08-27 3:02 ` [PATCH v2 3/3] Full refactor bot scripts Muhammad Rizki
2022-08-27 10:40 ` [PATCH v2 0/3] New Discord bot and full refactor scripts Ammar Faizi
2022-08-27 16:00 ` Muhammad Rizki
2022-08-29 3:39 ` Ammar Faizi
2022-09-03 0:42 ` Ammar Faizi
2022-09-03 0:45 ` Ammar Faizi
2022-09-03 1:01 ` Muhammad Rizki
2022-09-03 9:44 ` Ammar Faizi
2022-09-03 9:46 ` Ammar Faizi
2022-09-03 10:05 ` Muhammad Rizki
2022-09-03 10:32 ` Ammar Faizi
2022-09-03 10:34 ` Ammar Faizi
2022-09-03 10:40 ` Ammar Faizi
2022-09-03 10:58 ` Muhammad Rizki
2022-09-03 10:52 ` Muhammad Rizki
2022-09-03 10:43 ` Muhammad Rizki
2022-09-03 0:56 ` Muhammad Rizki
2022-09-03 1:00 ` Ammar Faizi
2022-09-03 0:29 ` Ammar Faizi
2022-09-03 1:28 ` Ammar Faizi
2022-09-03 3:09 ` Muhammad Rizki
2022-09-03 9:56 ` Alviro Iskandar Setiawan
2022-09-03 9:58 ` Ammar Faizi
2022-09-03 10:06 ` Alviro Iskandar Setiawan
2022-09-03 10:12 ` Ammar Faizi
2022-09-03 10:43 ` Alviro Iskandar Setiawan
2022-09-03 11:09 ` 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