core icon indicating copy to clipboard operation
core copied to clipboard

Option to Disable Automatic Database Logging of Updates

Open cyrus-fa opened this issue 1 year ago • 3 comments

🎉 Feature Request

Summary

I noticed that the library automatically inserts all updates into the database, which is handled in the DB.php file.

However, in my case, this behavior leads to unnecessary data accumulation in my database, as I don’t need to log all updates. Is there a way to disable or customize this behavior without modifying the core library files?

cyrus-fa avatar Jan 09 '25 21:01 cyrus-fa

While not ideal you might simply add a trigger or schedule in the database to clean the table periodically

jacklul avatar Jan 10 '25 05:01 jacklul

You can extend a new class from Telegram.php and another one from DB.php, change them however you like, and then use those classes in your codes instead of the main ones. I've done something similar here: https://github.com/FourteenDev/telegram-bot-wordpress-plugin-boilerplate/tree/main/src/Telegram/ExtendedClasses

Koorosh14 avatar Jan 10 '25 14:01 Koorosh14

@jacklul @Koorosh14, Thank you both for your help.

cyrus-fa avatar Jan 11 '25 11:01 cyrus-fa