public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH v5 00/19] New feature to handle atom URLs and broadcast
@ 2022-08-01  0:18 Muhammad Rizki
  2022-08-01  0:18 ` [PATCH v5 01/19] Add new table for atom URLs and broadcast chats in db.sql Muhammad Rizki
                   ` (20 more replies)
  0 siblings, 21 replies; 26+ messages in thread
From: Muhammad Rizki @ 2022-08-01  0:18 UTC (permalink / raw)
  To: Ammar Faizi
  Cc: Muhammad Rizki, GNU/Weeb Mailing List, Alviro Iskandar Setiawan

Morning guys,

This is v5 revision of new feature to handle atom URLs and broadcast.

In this series, I add a comment in ../.gitignore to define what it is
for. I've edit for /del_bc --list to make the message disable the web
preview in the packages/plugins/commands/manage_broadcast.py file.

This series contains a new feature to handle the atom URLs and broadcast
chats, such as add atom, add chat, del_atom and del_chat, with this
feature, we do not manual manage them again, just using the bot commands
and it will update in database.

There are 19 patches in this series:
- Patch 1 is to add new table for atom URLs and broadcast chats
- Patch 2 is to add a comment in .gitignore
- Patch 3 is to add get atom URLs and get broadcast chats
- Patch 4 is to fix MySQL InternalError when query the atom and chats
- Patch 5 is to create /add_atom bot command to atom URL to database
- Patch 6 is to add some utility functions to handle code in /add_atom
- Patch 7 is to refactor db class to easily access over DaemonClient
- Patch 8 is to add insert_atom() in scraper/db.py to insert atom URLs
- Patch 9 is to rename admin.py to debugger.
- Patch 10 is to add delete_atom() in scraper/db.py for /del_atom command
- Patch 11 is to add button_numbers() in utility file to create btn nums
- Patch 12 is to split files between bot commands and bot CallbackQuery
- Patch 13 is to add del_atom for CallbackQuery to handle delete atom
- Patch 14 is to add insert_broadcast() in scraper/db.py to insert chats
- Patch 15 is to add delete_broadcast() in scraper/db.py to delete chats
- Patch 16 is to create /add_bc bot command to add chat to the database
- Patch 17 is to add create_chat_link() in utility file for chat link
- Patch 18 is to add /del_bc bot command to remove chat in the database
- Patch 19 is to add del_chat in bot CallbackQuery to handle delete chat

A bit changes to improve the code, no other change in bot scripts, this
should be works fine.

## Changelog

v4 -> v5
- Add a comment # PATCH in ../.gitignore
- Add disable_web_page_preview for /del_bc --list

v3 -> v4
- Simplify create_chat_link() in scraper/utils.py
- Remove RFC in .gitignore and fix no newline at EOF

v2 -> v3
- Combine the atom_urls and broadcast_chats tables in db.py
- Remove atom_broadcast.sql
- Change atom_urls data type of `type` field to VARCHAR(255)

v1 -> v2
- Improve delete_broadcast() source code in scraper/db.py
- Fix typehints to int for chat_id param in scraper/db.py

Signed-off-by: Muhammad Rizki <[email protected]>
---

Muhammad Rizki (19):
  Add new table for atom URLs and broadcast chats in db.sql
  Add a comment in .gitignore
  Add ATOM_URLS and BROADCAST_CHAT methods
  Fix MySQL InternalError: Unread result found
  Create /add_atom command
  Add utility functions for /add_atom
  Refactor database methods
  Add insert_atom() in scraper/db.py
  Rename admin.py to debugger.py
  Add delete_atom() function in scraper/db.py
  Add utility function buton_numbers()
  Move bot commands related files to packages/plugins/commands/
  Add del_atom callback query
  Add insert_broadcast() in scraper/db.py
  Add delete_broadcast() in scraper/db.py
  Create /add_bc bot command
  Add create_chat_link() function
  Add /del_bc bot command
  Add del_chat callback query

 .gitignore                                    |   1 +
 daemon/db.sql                                 |  25 +++++
 daemon/packages/client.py                     |   4 +-
 daemon/packages/plugins/callbacks/del_atom.py |  31 +++++
 daemon/packages/plugins/callbacks/del_chat.py |  36 ++++++
 .../{admin.py => commands/debugger.py}        |   0
 .../packages/plugins/commands/manage_atom.py  |  50 +++++++++
 .../plugins/commands/manage_broadcast.py      |  70 ++++++++++++
 .../packages/plugins/{ => commands}/scrape.py |   0
 daemon/run.py                                 |  16 +--
 daemon/scraper/bot.py                         |  22 +---
 daemon/scraper/db.py                          | 106 +++++++++++++++++-
 daemon/scraper/utils.py                       |  43 +++++++
 13 files changed, 378 insertions(+), 26 deletions(-)
 create mode 100644 daemon/packages/plugins/callbacks/del_atom.py
 create mode 100644 daemon/packages/plugins/callbacks/del_chat.py
 rename daemon/packages/plugins/{admin.py => commands/debugger.py} (100%)
 create mode 100644 daemon/packages/plugins/commands/manage_atom.py
 create mode 100644 daemon/packages/plugins/commands/manage_broadcast.py
 rename daemon/packages/plugins/{ => commands}/scrape.py (100%)


base-commit: f8c5aef0aa85e1262c90f818638d255c3c38373f
-- 
Muhammad Rizki


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2022-08-03  0:14 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-01  0:18 [PATCH v5 00/19] New feature to handle atom URLs and broadcast Muhammad Rizki
2022-08-01  0:18 ` [PATCH v5 01/19] Add new table for atom URLs and broadcast chats in db.sql Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 02/19] Add a comment in .gitignore Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 03/19] Add ATOM_URLS and BROADCAST_CHAT methods Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 04/19] Fix MySQL InternalError: Unread result found Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 05/19] Create /add_atom command Muhammad Rizki
2022-08-02 21:43   ` Ammar Faizi
2022-08-01  0:19 ` [PATCH v5 06/19] Add utility functions for /add_atom Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 07/19] Refactor database methods Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 08/19] Add insert_atom() in scraper/db.py Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 09/19] Rename admin.py to debugger.py Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 10/19] Add delete_atom() function in scraper/db.py Muhammad Rizki
2022-08-02 21:45   ` Ammar Faizi
2022-08-01  0:19 ` [PATCH v5 11/19] Add utility function buton_numbers() Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 12/19] Move bot commands related files to packages/plugins/commands/ Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 13/19] Add del_atom callback query Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 14/19] Add insert_broadcast() in scraper/db.py Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 15/19] Add delete_broadcast() " Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 16/19] Create /add_bc bot command Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 17/19] Add create_chat_link() function Muhammad Rizki
2022-08-01  0:19 ` [PATCH v5 18/19] Add /del_bc bot command Muhammad Rizki
2022-08-02 21:47   ` Ammar Faizi
2022-08-01  0:19 ` [PATCH v5 19/19] Add del_chat callback query Muhammad Rizki
2022-08-02 21:47   ` Ammar Faizi
2022-08-03  0:13 ` [PATCH v5 00/19] New feature to handle atom URLs and broadcast Ammar Faizi
2022-08-03  0:14 ` Ammar Faizi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox