Commit Graph

89 Commits (73e52e112a7d9a726f8b9ba1ea2b0ba0ee330720)

Author SHA1 Message Date
hikariatama 21c0057bf0 1.6.3
- Add argument `item_type` to `db.pointer` to provide interface for NamedTuple objects
- Add correct exception propagation to inline units
- Add `-fs` arg to `.lm` command
- Add IDM `flush_loader_cache`
- Add ability to cancel QR login using keyboard interrupt
- Fix form invoke error message
- Fix `Backuper`
- Fix backward compatiblity with security groups `SUDO` (0x2) and `SUPPORT` (0x4)
- Fix quickstart language buttons translations
- Fix language buttons disabling on restart
- Migrate inline heta search to userbot instead of centralized service
2023-04-26 18:21:22 +00:00
hikariatama 9a0e4b1b38 1.6.2
- Fix security issue with edited channel messages
- Add interface to interact with raw pointer data (`.data` attribute)
- Translation fixes
- Randomize `device_model` to bypass fraud detection
- Pass proper device information to Telegram
- Update `hikka-tl` in accordance to upstream telethon v1
- Update `hikka-pyro` in accordance to upstream pyrogram
- Rename packages so that they don't conflict with originals
- Partially migrate to `pathlib`
- Code cleanup
2023-03-01 15:36:02 +00:00
hikariatama eb0786e690 1.6.1
- Remove miyahost from official hosts
- Fix memory leak when using 1.6.0 inside Docker
- Fix userbot dying after restart on Docker
- Root out stats mechanism
2023-02-01 16:36:48 +00:00
hikariatama 8e59bc056f 1.6.0
- Fix `EntityLike` validator
- Fix stringifying error in logging
- Fix command escaping when using layout translated prefix
- New `utils.answer_file` method
- New `utils.get_cpu_usage` method
- New `utils.get_ram_usage` method
- New QR login flow
- New license banners
- New error-specific messages for RPCErrors, FloodWaitErrors, NetworkErrors
- Send `start` hook to `InfiniteLoop` instances with `autostart` flag only after `client_ready`
- Replace `__getattr__` in `Module` object with properties for commands and handlers
- Move from monkey-patching concept of filling modules' attributes to native one
- Partial Tatar translation pack
- Logging tweaks
- Add `caller` field to inline units
- Add ability to get module help by command alias
2022-11-19 07:52:53 +00:00
hikariatama 97a219b5fc 1.6.0 2022-11-05 15:38:59 +00:00
hikariatama 15c2e3465f 1.6.0
🌘🌘🌘 1.6.0 beta released

- Bring support for Dragon Userbot modules
- Make `db` attribute of `Modules` public
- Mess up with some translations
- Fix `.helphide` command
- Fix visual bug with phone input field in web
- Drop Okteto support
- Show Hikka platform and version in Telegram sessions list
- New type `DragonModule`
- New argument of `get_prefix` - `userbot`. Pass in `"dragon"` to get its prefix
- New attribute of `Modules` - `dragon_modules`
- New attribute of `CustomTelegramClient` - `pyro_proxy`. Use pyrogram methods natively
- New appearence of `help` command
- New module loading animation
- New README.md with installation steps and new web recording
2022-10-23 11:38:06 +00:00
hikariatama bdf4cd1f1e 1.5.3
- Add Uzbek, Turkish, German and Hindi translation packs
- Fix module and command docs not being translated on-the-flight
2022-10-15 15:56:28 +00:00
hikariatama f475d6c05a 1.5.2
- Change the behavior of `@loader.raw_handler` decorator to accept starred arguments instead of list-like value
2022-10-12 16:59:18 +00:00
hikariatama e90367c6ef 1.5.1
- Fix `--no-web` arg
- Fix `tglog_level` config option of module `Tester`
- Add `--proxy-pass` arg
- Add `utils.invite_inline_bot` method
- Add `invite_bot` method to `utils.asset_channel`
- Add support for `String` validator's `min_len` and `max_len` parameters
2022-10-06 10:48:25 +00:00
hikariatama 066f7a46a2 1.5.0
- Fix `on_change` param processing in config
- Fix `hikka.types.CoreOverwriteError`
- Fix incorrect commit in info for users with multiple origins
- Fix error with module configs not being updated to values which were set by user
- Fix core unload and core overwrite errors not being raised correctly
- Fix config descriptions in `APIRatelimiter`
- Fix `CoreOverwriteError` handling
- Fix `TelegramID` validator to work with values between 2^32 and 2^64 - 1
- Fix web authorization messages being sent twice
- Fix duplicated animations in web
- Fix installation banner being shown after auth in web
- Fix form placeholder button being shown when not necessary
- Add `@loader.tag(thumb_url="")` decorator
- Add new inline help format
- Add internal method for debug calls (`.invoke`)
- Add Internal Debug Method (IDM) to inspect cache (`inspect_cache`)
- Add IDM `inspect_modules`
- Add IDM `clear_cache`, `clear_entity_cache`, `clear_fulluser_cache`, `clear_fullchannel_cache`, `clear_perms_cache`
- Add IDM `reload_core` to automatically reload core modules from disk
- Add `hikka.validators.MultiChoice`
- Add `utils.get_args_html` to get arguments of command with HTML
- Add switch to mute @BotFather only once in hikka inline
- Add ability to forbid certain tl methods using `.config APIRatelimiter`
- Add new web interface design
- Clean type-hint mess, document utils and other methods, which were undocumented
- Remove redundant non-working code from configurator
- Remove redundant useless params `--hosting`, `--no-nickname`, `--token`, `--web-only`, `--docker-deps-internal`
- Migrate to lazy string interpolation in logging
- Reformat the whole code to match the desired code style
- Rename `APIRatelimiter` -> `APILimiter`
- Enable `joinChannel` and `importChatInvite` calls-by-external-modules blockage for all users by default
- Change inline query placeholder to `user@hikka:~$` + legacy migration
2022-09-18 15:47:09 +00:00
hikariatama 6476c4adda 1.4.2
- Fix authorization error
2022-09-05 06:17:05 +00:00
hikariatama e90b91ba9d 1.4.1
- Create new type :obj:`hikka.tl_cache.CustomTelegramClient` to avoid monkeypatching
- Add `ttl` param for :method:`hikka.utils.asset_channel`
- Add support for custom branches (e.g. for beta testers and users, who rolled back)
- Fix automatic modules reactions
- Fix :method:`hikka.inline.utils.Utils._find_caller_sec_map`
- Refactor validators to be classes, not functions
- Refactor typehints
2022-08-27 16:55:15 +00:00
hikariatama aeddd7a870 1.4.0
- Publish hikka telethon fork and migrate to it in requirements, thereby fixing the deployment error on Heroku
- Add custom emojis filter to `utils.remove_html`
- Fix `client.get_perms_cached`
- Fix translation flaw in `HikkaSecurity`
- Fix `.uninstall_hikka` being accessible by sudo
- Fix `utils.find_caller` for :method:`hikka.inline.utils.Utils._find_caller_sec_map`
- Add more animated emojis to modules
- Add targeted security for users and chats (`.tsec`)
- Add support for `tg_level` in `.config Tester`
2022-08-21 14:55:51 +00:00
hikariatama 15dbdf7ae2 1.3.3 - Fix severe typo, which broke `client.get_fulluser` 2022-08-16 14:22:40 +00:00
hikariatama bdad473eb8 1.3.2
- Add `on_change` param to `loader.ConfigValue`
- Rework commands\inline handlers\callback handlers\watchers registration and unload process
- Rework tags processing
- Add junk collector aka reloader to `Modules`
2022-08-15 16:43:34 +00:00
hikariatama 06917f188f 1.3.1
- Add caching to `utils.asset_channel`
- Add `channel` param to `utils.asset_channel` to actually create a channel, not supergroup
- Add watcher tags: `startswith`, `endswith`, `contains`, `regex`, `func`, `from_id`, `chat_id`
- Add buttons to `Choice` validator in `.config`
- Add new types: `PointerInt`, `PointerList`, `PointerTuple`, `PointerDict`, `PointerStr`, `PointerBool`
- Add `db.pointer`
- Add support for multiaccounting on Heroku
- Add ability to edit only reply markup or only media of message, w/o touching the actual text
- Add support for `@loader.command`-like commands in inline caller finder
- Add `utils.find_caller`
- Add possible cause of error in logs (module and method)
- Add `client.get_perms_cached` to cache native `client.get_permissions`
- Change errors format in web to more human-readable
- Change visible line of traceback in logs to be the last one
- Fix bug with custom_bot option on installation page
- Fix `RecursionError` in entity cacher
- Fix command execution with space between prefix and command
- Fix `utils.answer` for forwarded messages
- Remove `heroku3` from classic requirements, along with heroku installation code snippet
- Remove `termux_requirements.txt`
2022-08-08 20:32:54 +00:00
hikariatama 65e05e578e Switch version 1.2.13 -> 1.3.0 2022-08-03 13:35:33 +00:00
hikariatama a460f94a8f 1.2.13
- Patch stats so they correctly recognize links
- Fix bug when `...` is being replaced with `..` (unnecessary prefix escape)
- Add `@loader.tag`
- Add `@loader.tag("no_commands")` for watchers. Ignores commands
- Do not cut off prefix in `message.message`, `message.text` and `message.raw_text`
- Partially rework events processing and dispatching
2022-08-02 16:34:59 +00:00
hikariatama 5a5a5c55b5 Revert "1.2.13"
This reverts commit d00f6960db.
2022-08-02 16:21:37 +00:00
hikariatama d00f6960db 1.2.13
- Patch stats so they correctly recognize links
- Fix bug when `...` is being replaced with `..` (unnecessary prefix escape)
- Add `@loader.tag`
- Add `@loader.tag("no_commands")` for watchers. Ignores commands
- Do not cut off prefix in `message.message`, `message.text` and `message.raw_text`
- Partially rework events processing and dispatching
2022-08-02 16:20:38 +00:00
hikariatama 1413def49e 1.2.12
- Automatically patch reply markup in inline form in the way, that edit stays available anyway
- Do not unload inline form automatically, keep it for 10 minutes instead
- Use `telethon.utils.resolve_inline_message_id` to remove inline unit
- Add `self.request_join`
- Allow developers to declare `client_ready` without arguments
2022-07-27 16:54:58 +00:00
hikariatama 8e3647b45b 1.2.11
- Add support for lib attribute `version` (must be defined BEFORE `init` method)
- Add `self.lookup` to libs
- Add `self.allmodules` to libs
- Add `self.lib_get` to libs
- Add `self.lib_set` to libs
- Add support for hook `on_lib_update` (invoked when library is being updated by new version)
2022-07-14 19:40:38 +00:00
hikariatama 1af82d85b2 1.2.10
- Completely drop fast_uploader support
- Add :method:`utils.import_lib`
- Add protection for :obj:`CheckChatInviteRequest` in forbid_joins
- Add ability to search modules by classname in :method:`self.lookup`
- Add anonymous stats of modules loading (YOU CAN DISABLE THEM IN `.settings`)
- Add telethon objects formatting in `.e`
- Add :obj:`loader.SelfSuspend` to disable module commands and watcher loading, e.g. if library is unavailable
- Add migration native modules db storage from `strings["name"]` to classname. ⚠️ Might break some stuff in the beginning in rare cases
- Fix heroku-specific config error
2022-07-13 18:39:19 +00:00
hikariatama 402ed878c6 1.2.9
Small fixing, which allows developer to specify audio metadata in form and `_edit_unit`
2022-07-03 14:41:58 +00:00
hikariatama f40a4eba09 1.2.8
- Add automatic webpage bot unblock in heroku waker
- Add secure boot feature
- Update native heroku postgre database saving method
- Add easter egg to `.ping`
- Add platform-specific errors while installing requirements
- Change postgresql column `id` datatype from int32 to int64 + legacy migration
- Change proxypass tunnel behavior - now it only opens on setup and via command `.weburl`
- Lavhost-specific web url
- Meaningful errors in web
- ⚠️ Drop `fast_uploader` support. It will be completely removed in next major update
- Deepsource fixes
- Multiple languages with priority
2022-07-02 22:04:27 +00:00
hikariatama 91db334a89 1.2.7
- Add automatic proxy pass
- Fix --no-web argument parsing
- Fix localization error in updater
- Print out only INFO statements to stdout
- Add rotating file handler (logfile with max 10MB size)
- Show web endpoint on startup if available
- Fix gallery `inline_message_id` error
- Add support for `custom_buttons` in `inline.list`
- Add support for `custom_buttons` in `inline.gallery`
- Smart fast_uploader (Do not use hard download on files smaller than 1 MB)
- Attempt to parse `unit_id` from passed `InlineCall` object in `inline._delete_unit_message`
- Reformatting
- Change typehints
- Show list-like values in formatted way in config
- Properly escape html in config
- Split config to pages and categories (core \ non-core)
- Properly edit dictionary config (iter)
- Properly remove items from series options through built-in configurator
- Remove warning from web by replacing coroutine generation with `functools.partial`
2022-06-17 22:22:30 +00:00
hikariatama 879aefa1ed 1.2.6
- Fix processing of `# scope: hikka_min`
- Add `forbid_joins.py` (to use it, download module from official repo with the same name)
2022-06-12 18:45:02 +00:00
hikariatama e382cbc7a5 1.2.5
- Add additional exit on restart to avoid port block
- Add unloaded module name on `.unloadmod`
- Add `banner_url` config var to `HikkaInfo`
- Add `loader.validators.Hidden`
- Add `websockets` dependency, so users can load hikarichat on Heroku
- Add `reply_markup` kwarg to `utils.answer`. This will automatically add buttons to plain message or edit buttons of inline unit
- Add suggestion to join developer's channel on module load if available
- Add `client.force_get_entity` to bypass Hikka Cacher
- Add clickable link to loaded module message if specified meta developer is channel
- Add support of `action` attributes for buttons ("action": "close", "action": "unload", "action": "answer")
- Add log splitter between different clients of instance (if possible)
- Fix inline events `IndexError`
- Fix text in inline input
- Fix translation issue in HikkaConfig
- Fix `.dump`
- Fix modules list reset if you perform `.dlmod` when userbot is not yet fully loaded
- Update links in README
- Remove nalinor from official repos until new modules appear
2022-06-12 09:46:48 +00:00
hikariatama ac8e7371e9 1.2.4
- Show current options in module config
- Add new validators: `loader.validators.Union`, `loader.validators.NoneType`
2022-06-06 16:54:31 +00:00
hikariatama c410f97089 1.2.3
- Add field `action` to inline buttons. You can pass there `close` to close inline form, `unload` to unload it from memory, `answer` & `text` | `show_alert` to answer callback query with message
- Update docstrings in inline to match unified format
- Add surrogate error ignorance in dispatcher
- Fix :obj:`EntityCache` caching username `@None`
- Return :obj:`InlineMessage` in `hikka.inline.gallery.Gallery.gallery`
- Fix typo in docstring
2022-06-03 12:11:49 +00:00
hikariatama 07c3cb15e6 1.2.2
- Update gitignore so git doesn't count shit on heroku
- Visual heroku fixes in updater
- Deepsource fixes
- Add `utils.get_entity_url`, `utils.get_message_link`, `utils.remove_html`, `utils.get_kwargs`
- Disable modules debugging on heroku
- Add `.nonickusers`, `.nonickcmds`, `.nonickchats`
- Update blacklist command docs
- Fix grep removing everything in <...>
- Add `loader.validators.RegExp`
- Automatically convert `None` to empty string \ zero integer etc., if validator is specified
- More meaningful errors in `inline_handler`s
- More meaningful errors in `self.inline.form`, `self.inline.gallery`, `self.inline.list` on user-side
- Allow editing\adding media to form via `call.edit`. Currently supported: `photo`, `file`, `video`, `audio`, `gif`
2022-06-02 16:15:08 +00:00
hikariatama 071f88db5e 1.2.1
- Add termux specific requirements
- Ignore `heroku3` import error on non-heroku platforms
- Refactor `heroku.py` app searching algorithm
- Refactor postgresql database saving process
- Fix heroku restart message not being edited
- Add heroku waker
- Make `hikka-` app naming optional
2022-06-01 22:14:55 +00:00
hikariatama 5d21fca599 Update version and changelog 2022-05-30 21:56:56 +00:00
hikariatama 3fc77b5529 1.1.28
- Fix non-working param `share_link` in loader
- Assure logging bot is a member of logchat
- Do not store partial phone number in session, only ID
- Rework fast uploader so more types can be passed. For more information check code docstrings and typehints
- Rework installer so it properly displays which action is currently happening
- Fix `Series` not accepting one item
- Show upcoming commit in update and warn if update is not required
- Add reset to default button to config
- Merge `hikka_logger.py` with `test.py`
- Localization
- Allow opening options of specific mod via arguments in `.config`
- Add `add` and `remove` buttons to `Series` params
- Do not unload form immediately, if `ttl` param was passed explicitly
2022-05-25 16:32:39 +00:00
hikariatama ec647fe34e 1.1.27
- Reorder the steps of parsing in `loader.validators.Series`
- Fix aliases (yet another time)
- Fix minor bug in `loader.validators.Series`, which allowed to put empty string in it
- Fix some translation issues and type conversion ones
- Fix incorrect modules loading if multiple links end with specified name
- Fix type conversion bug in `loader.validators.String`
- Fix typehints flaws
- Add additional fields to `inline.form`: `gif`, `file`, `mime\_type`, `video`, `location`, `audio`
- Add reset-to-default action, if config is invalid while loading the userbot to prevent fall
- Add verification emoji to `input` to let user know, that new value was processed
- Add badge showing how much the last restart took
- Add `min_len`, `max_len`, `fixed_len` params to `loader.validators.Series`
- Add option to show downloaded module link in result message of `.dlmod`
- Add explicit database save after applying new config
- Add hint to web
- Add code of conduct
- Add changelog
- Remove redundant code in `database.py` as it literally does nothing
2022-05-21 18:34:45 +00:00
hikariatama 34bbb44a3a 1.1.26
- Hopefully finally fix aliases being reset after restart
- Remove redundant internal hook `_client_ready2`
- Show user evaluated version of config value instead of pre-comp one
- Add validator for each item to `Series`, remove `separator`
- Add new validator: `TelegramID`
2022-05-20 19:02:27 +00:00
hikariatama eae0c413f0 1.1.25
- Add separate messages on `restart` and `full_restart`. Second one is shown, when all modules are loaded
- Replace `.uninstall_hikka` with full uninstallation (remove bot, asset chats and folder)
- Clean code
- Suggest update if it is required by module
- New validator: `Float`
- Buttons in `.config` of option is a boolean value
- Drop support of argument `positive` in `loader.validators.Integer` as it can be easily replaced with `minimum=0`
- Update semantic generator in validators
- Yet another protection from monkey-patching
2022-05-20 13:42:39 +00:00
hikariatama 059d531d39 1.1.24
- Add `String` and `Link` validators
- Fix `Series` validator
- Reformat core modules to use validators
2022-05-19 19:26:03 +00:00
hikariatama 6caa7a0e4e 1.1.23
- Add config validators (`loader.validators`, `Boolean`, `Integer`, `Choice`, `Series`)
- Change info layout
- Add `.uninstall_hikka`
- Add `.clearlogs`
- Refactor code
- Fix minor bugs
- Fix aliases being reset after restart (aliases will now be available only when userbot is fully loaded)
2022-05-19 18:55:37 +00:00
hikariatama a6d01c6cdb 1.1.22
- Fix bugs related to web, more specifically: Session save timing, adding more than 1 account and proper restart
- Rework Dockerfiles so they work properly
- Add `uvloop` so the asyncio runs faster
- Add `Docker` badge to info
- Improve Okteto performance by adjusting settings in `okteto-stack.yml`
- New ascii_faces in utils
- Typehints update
- Fix Okteto pinger messages removal
2022-05-14 17:46:52 +00:00
hikariatama 9cd320e91e 1.1.21
- Fix translation typos
- Add nonick suggestion when adding user to group
- Add entity caching
2022-05-12 18:42:53 +00:00
hikariatama e713035099 1.1.20
- Add legacy fs modules migration
- Add `ready` asyncio Event to help track userbot loading process from outside
- Replace logging in loader with module-dependent one
- Fix some bugs and bug-rist issues
- Refactor code
- Send big logs as file, rather than an infinite series of messages
- HTML-escape `# meta developer:`
- Make `self.animate` available for core modules and modules, loaded from file
2022-05-11 17:46:36 +00:00
hikariatama 0893947d2c 1.1.19
- Fix infinite loops
- Add client-specific check of fs modules
- Use classname of module, if it is possible to parse it with ast
- Rework infinite loops stopping and modules instance placement
2022-05-11 11:28:10 +00:00
hikariatama 3d9d243d1b 1.1.18
- Add notification about not exact match in help
- Add automatic progress bar generation to `self.fast_upload` and `self.fast_download`
- Make `Mod` ending in modules class name not mandatory
2022-05-09 18:14:58 +00:00
hikariatama b282bee88d 1.1.17
- Fix some weird looking code
- Fix some emojies and translation issues
- Add native lavHost support (.restart, .update) via internal API
- Add utils.get_lang_flag()
2022-05-07 19:38:52 +00:00
hikariatama ed686343bb 1.1.16
- Fix config docstrings and html escaping
- Fix typehints
- Fix some security staff
- Add additional bot username check
- Add additional foolchecks
- Migrate to walrus operator where necessary
- Remove redundant code block
- Add default aiogram parse mode
- Rename some core stuff which was not supposed to be used by external developers
2022-05-07 16:40:29 +00:00
hikariatama 334643178c 1.1.15
- Add automatic database autofix and rollback if database was broken by module
- Fix translation issues
- Warn user, if he tries to view .help when userbot is not yet fully loaded
- Create alias for `_generate_markup` (`generate_markup`)
- Fix modules which are deleting from helphide
- Automatically save db if it was edited via classic dictionary methods
2022-05-06 12:13:01 +00:00
hikariatama c7dfb35270 1.1.14
- Fix utils.asset_channel()'s archive param
- Fix defect, which forced installation from additional trusted repo, rather than from primary one if the file names are matched
- Add avatar to utils.asset_channel() which automatically sets chat pic on creation (be careful, bc it leads to floodwaits, if you do it often)
- Add automatic hikka folder processing
- Add avatars to all official repo modules, which require asset chats (and add them to hikka folder)
- Rework database assets chat processing
- Replace some minor stuff like texts and emojies
- Force many core modules to use self.get\self.set rather than digging the db
- Add .fconfig command to forcefully set known config value if it doesn't fit in Telegram query
- Add dataclasses for module config (read the docs for more info), bc old way is blasphemy
- Automatically save config value if it was set to module self.config[option] = value
- Add utils.is_serializable(), utils.set_avatar()
- Send very large (over 4096*10 symbols) output in a file rather than in an inline list
2022-05-05 17:39:09 +00:00
hikariatama 1b96f8f8cc 1.1.13: Fix bugs, clean code, replace redundant methods. More info in t.me/hikka_ub 2022-05-04 17:18:45 +00:00
hikariatama d2d7674575 1.1.12: Add modules' attr `self._tg_id` which represents the client id 2022-05-01 06:52:18 +00:00