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 v1 0/3] New Discord bot and full refactor scripts
Date: Thu, 25 Aug 2022 23:02:44 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
Good night, 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.
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/atom/__init__.py | 1 +
daemon/{scraper => atom}/scraper.py | 12 +-
daemon/{scraper => atom}/utils.py | 87 +++++++---
daemon/dc.py | 48 ++++++
daemon/discord.env.example | 8 +
daemon/dscord/config.py.example | 9 ++
daemon/dscord/database/__init__.py | 1 +
daemon/dscord/database/core.py | 19 +++
daemon/dscord/database/methods/__init__.py | 10 ++
.../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/execute_me.sql | 64 ++++++++
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 +
.../db.py => dscord/mailer/database.py} | 96 +++++-------
daemon/dscord/mailer/listener.py | 148 ++++++++++++++++++
daemon/dscord/requirements.txt | 8 +
daemon/{ => dscord}/storage/.gitignore | 0
daemon/{.env.example => telegram.env.example} | 0
daemon/telegram/__init__.py | 0
daemon/{ => telegram}/config.py.example | 0
daemon/telegram/database/__init__.py | 1 +
daemon/telegram/database/core.py | 19 +++
daemon/telegram/database/methods/__init__.py | 10 ++
.../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 | 58 +++++++
.../methods/getter/get_telegram_reply.py | 29 ++++
.../database/methods/insertion/__init__.py | 12 ++
.../database/methods/insertion/insert_atom.py | 20 +++
.../methods/insertion/insert_broadcast.py | 49 ++++++
.../methods/insertion/insert_email.py | 20 +++
.../methods/insertion/insert_telegram.py | 14 ++
daemon/{ => telegram}/db.sql | 0
.../{scraper => telegram/mailer}/__init__.py | 5 +-
.../bot.py => telegram/mailer/listener.py} | 61 ++++----
daemon/{ => telegram}/packages/__init__.py | 0
daemon/{ => telegram}/packages/client.py | 16 +-
daemon/{ => telegram}/packages/decorator.py | 0
.../packages/plugins/callbacks/del_atom.py | 6 +-
.../packages/plugins/callbacks/del_chat.py | 6 +-
.../packages/plugins/commands/debugger.py | 2 +-
.../packages/plugins/commands/manage_atom.py | 8 +-
.../plugins/commands/manage_broadcast.py | 8 +-
.../packages/plugins/commands/scrape.py | 10 +-
daemon/{ => telegram}/requirements.txt | 0
daemon/telegram/storage/.gitignore | 2 +
daemon/{run.py => tg.py} | 20 +--
82 files changed, 1718 insertions(+), 160 deletions(-)
create mode 100644 daemon/atom/__init__.py
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/execute_me.sql
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
rename daemon/{scraper/db.py => dscord/mailer/database.py} (63%)
create mode 100644 daemon/dscord/mailer/listener.py
create mode 100644 daemon/dscord/requirements.txt
rename daemon/{ => dscord}/storage/.gitignore (100%)
rename daemon/{.env.example => telegram.env.example} (100%)
create mode 100644 daemon/telegram/__init__.py
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
rename daemon/{ => telegram}/db.sql (100%)
rename daemon/{scraper => telegram/mailer}/__init__.py (68%)
rename daemon/{scraper/bot.py => telegram/mailer/listener.py} (66%)
rename daemon/{ => telegram}/packages/__init__.py (100%)
rename daemon/{ => telegram}/packages/client.py (84%)
rename daemon/{ => telegram}/packages/decorator.py (100%)
rename daemon/{ => telegram}/packages/plugins/callbacks/del_atom.py (88%)
rename daemon/{ => telegram}/packages/plugins/callbacks/del_chat.py (90%)
rename daemon/{ => telegram}/packages/plugins/commands/debugger.py (97%)
rename daemon/{ => telegram}/packages/plugins/commands/manage_atom.py (91%)
rename daemon/{ => telegram}/packages/plugins/commands/manage_broadcast.py (92%)
rename daemon/{ => telegram}/packages/plugins/commands/scrape.py (86%)
rename daemon/{ => telegram}/requirements.txt (100%)
create mode 100644 daemon/telegram/storage/.gitignore
rename daemon/{run.py => tg.py} (75%)
base-commit: 2582d7e5225d47a01f606808fc71e5e6aa7cb153
--
Muhammad Rizki
next reply other threads:[~2022-08-25 16:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 16:02 Muhammad Rizki [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-08-25 16:09 [PATCH v1 0/3] New Discord bot and full refactor scripts Muhammad Rizki
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