Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeekTG 3.0 #66

Merged
merged 75 commits into from Feb 22, 2022
Merged

GeekTG 3.0 #66

merged 75 commits into from Feb 22, 2022

Conversation

hikariatama
Copy link
Contributor

Full list of changes:

  • Return possibility to await db ops by returning futurepending
  • Add file_db support
  • Move config from config.ini to config.json with automatic magration
  • Restrict root usage
  • Automatically install dependencies
  • Inline buttons, callbacks are now native
  • Every user now has his own bot
  • Full web rework - now it is not necessary to hold there security and config, they have been moved to inline buttons in tg itself
  • Minor and major bug fixes
  • Modules, loaded from file are now saved in fs if possible
  • Update README
  • REMOVED BOT SUPPORT (now you can't use userbot on behalf of classic bot, bc it's not what is it for!)
  • Removed testing mode, bc it's a lot of code, and no one uses it
  • Make inline logs active by default (can be reverted by .ilogs off)
  • Replace some logging issues, related to incompatible log level
  • Decrease logs' buffer capacity in half
  • Add cool colorful banner on script start with useful info
  • Automatic restart logging messages with debug info
  • Change modules' by @hikariatama license to GNU GPLv3 to match with global one. This applies only to modules, which are core, not for all ones by this author
  • Add inline and callback handlers info to loader
  • Remove redundant dependencies throughout the whole code
  • Remove UNDAR, bc tbh it's non-working bullshit, but a great idea
  • Fix unloadmod so user don't need to put quotes
  • Cutout backuping features from loader, bc they are in separate module since now
  • Replace python module with @hikariatama 's one, due to extended scope
  • Because I moved all web features to telegram, it's not necessary to login in web now, so the ratelimit middleware have been removed

…developers to leave message, but still unload form so it doesn't waste memory. Also added ability to add kwargs to inline button callbacks
…hon.py (.eval) with a new one. Update Backuper to the latest version
….ini with config.json, added migration from ini to json
hikariatama and others added 23 commits February 17, 2022 19:47
…be used for logging and other purposes of modules
…ding database while client is already disconnected
…t. Show inline and callback handlers in loader as if they were commands
…dded natively, so don't worry. Currently, there is only initial setup and restart available in web. Also, in the next commit the login system can be retruned in some way
…inline support, refactor the whole code, full web panel rework, new core modules and many other changes
@sourcery-ai
Copy link

sourcery-ai bot commented Feb 22, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 1.78%.

Quality metrics Before After Change
Complexity 24.63 😞 26.89 😞 2.26 👎
Method Length 64.70 🙂 66.59 🙂 1.89 👎
Working memory 10.03 😞 10.66 😞 0.63 👎
Quality 57.55% 🙂 55.77% 🙂 -1.78% 👎
Other metrics Before After Change
Lines 5324 4827 -497
Changed files Quality Before Quality After Quality Change
friendly-telegram/main.py 77.40% ⭐ 47.38% 😞 -30.02% 👎
friendly-telegram/configurator.py 76.95% ⭐ 76.12% ⭐ -0.83% 👎
friendly-telegram/dispatcher.py 24.54% ⛔ 25.62% 😞 1.08% 👍
friendly-telegram/heroku.py 62.30% 🙂 62.30% 🙂 0.00%
friendly-telegram/loader.py 71.98% 🙂 66.47% 🙂 -5.51% 👎
friendly-telegram/log.py 83.27% ⭐ 83.27% ⭐ 0.00%
friendly-telegram/main.py 35.42% 😞 32.91% 😞 -2.51% 👎
friendly-telegram/security.py 43.89% 😞 43.39% 😞 -0.50% 👎
friendly-telegram/utils.py 55.84% 🙂 55.92% 🙂 0.08% 👍
friendly-telegram/compat/uniborg.py 58.38% 🙂 58.38% 🙂 0.00%
friendly-telegram/compat/util.py 81.12% ⭐ 81.12% ⭐ 0.00%
friendly-telegram/database/backend.py 62.78% 🙂 62.09% 🙂 -0.69% 👎
friendly-telegram/modules/advanced_settings.py 38.07% 😞 38.07% 😞 0.00%
friendly-telegram/modules/backuper.py 78.09% ⭐ 79.26% ⭐ 1.17% 👍
friendly-telegram/modules/corectrl.py 72.87% 🙂 76.23% ⭐ 3.36% 👍
friendly-telegram/modules/help.py 29.90% 😞 30.39% 😞 0.49% 👍
friendly-telegram/modules/loader.py 57.58% 🙂 54.13% 🙂 -3.45% 👎
friendly-telegram/modules/nocollisions.py 77.55% ⭐ 77.55% ⭐ 0.00%
friendly-telegram/modules/python.py 71.75% 🙂 82.46% ⭐ 10.71% 👍
friendly-telegram/modules/stats.py 68.53% 🙂 67.40% 🙂 -1.13% 👎
friendly-telegram/modules/test.py 73.79% 🙂 46.97% 😞 -26.82% 👎
friendly-telegram/modules/uniborg_config.py 89.79% ⭐ 89.79% ⭐ 0.00%
friendly-telegram/modules/updater.py 70.41% 🙂 74.92% 🙂 4.51% 👍
friendly-telegram/web/core.py 52.28% 🙂 82.96% ⭐ 30.68% 👍
friendly-telegram/web/initial_setup.py 61.13% 🙂 65.09% 🙂 3.96% 👍
friendly-telegram/web/root.py 74.46% 🙂 89.98% ⭐ 15.52% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
friendly-telegram/security.py SecurityManager._check 96 ⛔ 394 ⛔ 28 ⛔ 2.81% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/dispatcher.py CommandDispatcher.handle_command 187 ⛔ 1123 ⛔ 22 ⛔ 3.05% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/main.py main 113 ⛔ 806 ⛔ 22 ⛔ 3.14% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/modules/loader.py LoaderMod.load_module 72 ⛔ 646 ⛔ 18 ⛔ 6.53% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/utils.py answer 49 ⛔ 446 ⛔ 19 ⛔ 8.97% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@hikariatama hikariatama merged commit a579074 into GeekTG:master Feb 22, 2022
@hikariatama
Copy link
Contributor Author

@hikariatama Some users may need to update manually because of dependencies change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant