Skip to content

Commit bf6f6d1

Browse files
authored
Merge pull request beveiled#98 from hikariatama/v1.6.2
V1.6.2
2 parents 7008b54 + 77cbb01 commit bf6f6d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+11327
-14589
lines changed

.deepsource.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
version = 1
22

3+
exclude_patterns = ["hikka/qr.py"]
4+
35
[[analyzers]]
46
name = "shell"
57
enabled = true

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
ignore = E501,W503,E203,ASN001,E701,E231,E225,W504
3+
exclude = .git,__pycache__,loaded_modules

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.ruff_cache
12
# Byte-compiled / optimized / DLL files
23
__pycache__/
34
*.py[cod]

CHANGELOG.md

Lines changed: 67 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
# Hikka Changelog
22

3+
## 🌑 Hikka 1.6.2
4+
5+
- Fix security issue with edited channel messages
6+
- Add interface to interact with raw pointer data (`.data` attribute)
7+
- Translation fixes
8+
- Randomize `device_model` to bypass fraud detection
9+
- Pass proper device information to Telegram
10+
- Update `hikka-tl` in accordance to upstream telethon v1
11+
- Update `hikka-pyro` in accordance to upstream pyrogram
12+
- Rename packages so that they don't conflict with originals
13+
- Partially migrate to `pathlib`
14+
- Code cleanup
15+
- Add ability to log in using QR code and --no-web
16+
- Disable web interface for Termux and fallback to CLI login instead
17+
- Add fancy ANSI banners
18+
- Add guidelines to `--no-web` login
19+
- Fix session not being saved after logging in using QR without 2fa
20+
- Minify static assets in web
21+
- Replace snowfall with sakura flowers
22+
- Update Termux installation design
23+
- Whitelist requests in APILimiter to ignore internals
24+
- Start web when using `.weburl` and `--no-web` is used
25+
- Add inline commands targeted security rules control
26+
- Completely remove security groups `sudo` and `support`
27+
- Fix proxy-pass
28+
- New core modules: `UnitHeta`, `Translator`
29+
- New watcher tags: `no_pm`, `no_channels`, `no_groups`, `no_inline`, `no_stickers`, `no_docs`, `no_audios`, `no_videos`, `no_photos`, `no_forwards`, `no_reply`, `no_mention`, `mention`, `only_reply`, `only_forwards`
30+
- Remove default presets since they are the security risk
31+
- Update and extend Tatar translation pack
32+
- Restrict setting `s` as command prefix, since it will break command `setprefix`
33+
- Transfer all previously non-essential modules to core ones
34+
- Add alternative translation mechanism using YAML
35+
336
## 🌑 Hikka 1.6.1
437

538
- Remove miyahost from official hosts
@@ -473,15 +506,15 @@
473506
## 🌑 Hikka 1.1.26
474507

475508
- Hopefully finally fix aliases being reset after restart
476-
- Remove redundant internal hook \_client\_ready2
509+
- Remove redundant internal hook \_client_ready2
477510
- Show user evaluated version of config value instead of pre-comp one
478511
- Add validator for each item to Series, remove separator
479512
- Add new validator: TelegramID
480513

481514
## 🌑 Hikka 1.1.25
482515

483-
- Add separate messages on restart and full\_restart. Second one is shown, when all modules are loaded
484-
- Replace .uninstall\_hikka with full uninstallation (remove bot, asset chats and folder)
516+
- Add separate messages on restart and full_restart. Second one is shown, when all modules are loaded
517+
- Replace .uninstall_hikka with full uninstallation (remove bot, asset chats and folder)
485518
- Suggest update if it is required by module
486519
- New validator: Float
487520
- Buttons in .config of option is a boolean value
@@ -499,7 +532,7 @@
499532

500533
- Add config validators (loader.validators, Boolean, Integer, Choice, Series)
501534
- Change info layout
502-
- Add .uninstall\_hikka
535+
- Add .uninstall_hikka
503536
- Add .clearlogs
504537
- Refactor code
505538
- Fix minor bugs
@@ -512,7 +545,7 @@
512545
- Add uvloop so the asyncio runs faster
513546
- Add Docker badge to info
514547
- Improve Okteto performance by adjusting settings in okteto-stack.yml
515-
- New ascii\_faces in utils
548+
- New ascii_faces in utils
516549
- Typehints update
517550
- Fix Okteto pinger messages removal
518551

@@ -542,15 +575,15 @@
542575
## 🌑 Hikka 1.1.18
543576

544577
- Add notification about not exact match in help
545-
- Add automatic progress bar generation to self.fast\_upload and self.fast\_download
578+
- Add automatic progress bar generation to self.fast_upload and self.fast_download
546579
- Make Mod ending in modules class name not mandatory
547580

548581
## 🌑 Hikka 1.1.17
549582

550583
- Fix some weird looking code
551584
- Fix some emojies and translation issues
552585
- Add native lavHost support (.restart, .update) via internal API
553-
- Add utils.get\_lang\_flag()
586+
- Add utils.get_lang_flag()
554587

555588
## 🌑 Hikka 1.1.16
556589

@@ -569,15 +602,15 @@
569602
- Add automatic database autofix and rollback if database was broken by module
570603
- Fix translation issues
571604
- Warn user, if he tries to view .help when userbot is not yet fully loaded
572-
- Create alias for \_generate\_markup (generate\_markup)
605+
- Create alias for \_generate_markup (generate_markup)
573606
- Fix modules which are deleting from helphide
574607
- Automatically save db if it was edited via classic dictionary methods
575608

576609
## 🌑 Hikka 1.1.14
577610

578-
- Fix utils.asset\_channel()'s archive param
611+
- Fix utils.asset_channel()'s archive param
579612
- Fix defect, which forced installation from additional trusted repo, rather than from primary one if the file names are matched
580-
- 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)
613+
- 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)
581614
- Add automatic hikka folder processing
582615
- Add avatars to all official repo modules, which require asset chats (and add them to hikka folder)
583616
- Rework database assets chat processing
@@ -586,7 +619,7 @@
586619
- Add .fconfig command to forcefully set known config value if it doesn't fit in Telegram query
587620
- Add dataclasses for module config (read the docs for more info), bc old way is blasphemy
588621
- Automatically save config value if it was set to module self.config\[option\] = value
589-
- Add utils.is\_serializable(), utils.set\_avatar()
622+
- Add utils.is_serializable(), utils.set_avatar()
590623
- Send very large (over 4096\*10 symbols) output in a file rather than in an inline list
591624

592625
## 🌑 Hikka 1.1.13
@@ -597,15 +630,15 @@
597630
- Add --force restart
598631
- Add ability to customize .info (this is only your problem, if you break something)
599632
- Properly censor known tokens in logs
600-
- Replace regex check in utils.check\_url() with urllib parser
633+
- Replace regex check in utils.check_url() with urllib parser
601634

602635
## 🌑 Hikka 1.1.12
603636

604-
- Consider avoiding redundant requests to TG API in order to get the client id and rather using self.\_tg\_id, which is now available for all modules
637+
- Consider avoiding redundant requests to TG API in order to get the client id and rather using self.\_tg_id, which is now available for all modules
605638

606639
## 🌑 Hikka 1.1.11
607640

608-
- Add fast uploader (self.fast\_upload, self.fast\_download)
641+
- Add fast uploader (self.fast_upload, self.fast_download)
609642
- Fix translations
610643

611644
## 🌑 Hikka 1.1.10
@@ -614,16 +647,16 @@
614647

615648
## 🌑 Hikka 1.1.9
616649

617-
- Fix \_generate\_markup in order that it automatically sets up callback hooks to \_custom\_map if callback was passed in buttons
618-
- Add switch\_inline\_query and switch\_inline\_query\_current\_chat parsers
650+
- Fix \_generate_markup in order that it automatically sets up callback hooks to \_custom_map if callback was passed in buttons
651+
- Add switch_inline_query and switch_inline_query_current_chat parsers
619652
- Fix minor issues
620653

621654
## 🌑 Hikka 1.1.8
622655

623656
- Stuff, related to translation issues
624-
- Add self.get\_prefix() to all modules, which returns current command prefix
657+
- Add self.get_prefix() to all modules, which returns current command prefix
625658
- Add possibility to silently self-unload mod, e.g if some condition is not matched. Usecase can be found in modules/okteto.py
626-
- Add async def on\_dlmod(self, client: "TelegramClient", db: "database.Database") handling. This can be e.g. used to subscribe to module's author's channel
659+
- Add async def on_dlmod(self, client: "TelegramClient", db: "database.Database") handling. This can be e.g. used to subscribe to module's author's channel
627660
- Rework Okteto Pinger, so it removes messages, if userbot is installed on other platform and so it even works
628661
- Add trusted developers to quickstart message
629662
- Automatically switch language via quickstart message button
@@ -634,12 +667,12 @@
634667

635668
## 🌑 Hikka 1.1.6
636669

637-
- Allow and process callback field in result of inline query answer. You can also use this in your own functions. Simply pass prepare\_callbacks=True to \_generate\_markup
638-
- Generate InlineCall object on \_custom\_map handlers
670+
- Allow and process callback field in result of inline query answer. You can also use this in your own functions. Simply pass prepare_callbacks=True to \_generate_markup
671+
- Generate InlineCall object on \_custom_map handlers
639672

640673
## 🌑 Hikka 1.1.5
641674

642-
- Minor update: Allow passing disable\_security and always\_allow to buttons directly
675+
- Minor update: Allow passing disable_security and always_allow to buttons directly
643676

644677
## 🌑 Hikka 1.1.4
645678

@@ -650,7 +683,7 @@
650683
- Fix HikkaDL link parsing
651684
- Suggest enabling value in bounding mask if it is not
652685
- Mask tokens in logs
653-
- Add utils.get\_git\_hash()
686+
- Add utils.get_git_hash()
654687
- Add debugging mode for developers
655688

656689
## 🌑 Hikka 1.1.3
@@ -672,7 +705,7 @@
672705
- Make inline commands' docstrings translatable
673706
- Introducing HikkaDynamicTranslate - the possibility for developers to translate their own modules to other language without usage of native translates
674707
- Rework translates system, because «translate channels wut¿». Now translate pack can be loaded from disk or from web
675-
- Add utils.check\_url
708+
- Add utils.check_url
676709
- Get rid of babel
677710
- Add IP address and possible cities to web auth popup
678711
- Add web auth popup ratelimit
@@ -690,28 +723,28 @@
690723

691724
## 🌑 Hikka 1.0.29
692725

693-
- Add option to control inline and callback handlers' security via loader decorators, including brand new @loader.inline\_everyone
726+
- Add option to control inline and callback handlers' security via loader decorators, including brand new @loader.inline_everyone
694727
- Refactor HikkaSecurity, especially the bounding mask control
695728

696729
## 🌑 Hikka 1.0.28
697730

698731
- Add silent param to inline.form, inline.gallery, inline.list
699732
- Add photo param to inline.form
700-
- Add URL validator to inline.\_generate\_markup
733+
- Add URL validator to inline.\_generate_markup
701734
- Ignore MessageIdInvalidError in .e
702735

703736
## 🌑 Hikka 1.0.27
704737

705-
Thankfully to @bsolute, now we have a cool smart\_split in utils. The messages are split without loosing formatting and emojies, preferably on line breakes / spaces.
738+
Thankfully to @bsolute, now we have a cool smart_split in utils. The messages are split without loosing formatting and emojies, preferably on line breakes / spaces.
706739

707740
## 🌑 Hikka 1.0.26
708741

709-
- Add utils.smart\_split which splits message in chunks of chunk\_size, keeping parse\_mode and entities in a right way (relocates 'em)
742+
- Add utils.smart_split which splits message in chunks of chunk_size, keeping parse_mode and entities in a right way (relocates 'em)
710743
- If response of utils.answer is too big to be sent in one particular message, it will be split in chunks of 4096 and sent via inline.list
711744

712745
## 🌑 Hikka 1.0.25
713746

714-
- Add disable\_security to inline forms, lists and galleries
747+
- Add disable_security to inline forms, lists and galleries
715748

716749
## 🌑 Hikka 1.0.24
717750

@@ -735,17 +768,17 @@ A lot of stuff: web fixes, bug fixes, automatic seamless userbot restart when ad
735768

736769
## 🌑 Hikka 1.0.20
737770

738-
- Allow passing reply\_markup field to InlineQuery's result
771+
- Allow passing reply_markup field to InlineQuery's result
739772
- Refactor reply markup parser so it accepts more formats of inline markup
740773

741774
## 🌑 Hikka 1.0.19
742775

743776
- Allow developers to pass InlineQuery result via return operator in inline handlers. Read the docs for more info
744-
- Move query\_gallery to a separate module
777+
- Move query_gallery to a separate module
745778

746779
## 🌑 Hikka 1.0.18
747780

748-
- Add silent and archive params to utils.asset\_channel.
781+
- Add silent and archive params to utils.asset_channel.
749782
- Remake logging so it become native with `BotLogger`.
750783
- Inject `BotLogger` analog directly
751784

@@ -776,13 +809,13 @@ A lot of stuff: web fixes, bug fixes, automatic seamless userbot restart when ad
776809

777810
## 🌑 Hikka 1.0.12
778811

779-
- Optimize forms, galleries and custom\_map storage by ommiting keys with default values and dynamically generate them.
812+
- Optimize forms, galleries and custom_map storage by ommiting keys with default values and dynamically generate them.
780813
- Add feature to inherit command-caller permissions on form and gallery (crutchy).
781814
- Minor improvements and bug fixes
782815

783816
## 🌑 Hikka 1.0.11
784817

785-
- Add inline.query\_gallery to add ability to call inline gallery via inline query.
818+
- Add inline.query_gallery to add ability to call inline gallery via inline query.
786819
- Add `e404` attribute to `InlineQuery`, which should be shown, that no results were found
787820

788821
## 🌑 Hikka 1.0.10
@@ -823,7 +856,7 @@ A lot of stuff: web fixes, bug fixes, automatic seamless userbot restart when ad
823856

824857
- Fix a lot of stuff in web
825858
- Add new features to web
826-
- Merge root and initial\_root
859+
- Merge root and initial_root
827860
- Remove trailing whitespaces
828861

829862
## 🌑 Hikka 1.0.2

CODE_OF_CONDUCT.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Contributor Covenant Code of Conduct
32

43
## Our Pledge
@@ -18,24 +17,24 @@ diverse, inclusive, and healthy community.
1817
Examples of behavior that contributes to a positive environment for our
1918
community include:
2019

21-
* Demonstrating empathy and kindness toward other people
22-
* Being respectful of differing opinions, viewpoints, and experiences
23-
* Giving and gracefully accepting constructive feedback
24-
* Accepting responsibility and apologizing to those affected by our mistakes,
25-
and learning from the experience
26-
* Focusing on what is best not just for us as individuals, but for the
27-
overall community
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
2827

2928
Examples of unacceptable behavior include:
3029

31-
* The use of sexualized language or imagery, and sexual attention or
32-
advances of any kind
33-
* Trolling, insulting or derogatory comments, and personal or political attacks
34-
* Public or private harassment
35-
* Publishing others' private information, such as a physical or email
36-
address, without their explicit permission
37-
* Other conduct which could reasonably be considered inappropriate in a
38-
professional setting
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
3938

4039
## Enforcement Responsibilities
4140

@@ -107,7 +106,7 @@ Violating these terms may lead to a permanent ban.
107106
### 4. Permanent Ban
108107

109108
**Community Impact**: Demonstrating a pattern of violation of community
110-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
111110
individual, or aggression toward or disparagement of classes of individuals.
112111

113112
**Consequence**: A permanent ban from any sort of public interaction within
@@ -119,11 +118,11 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119118
version 2.0, available at
120119
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
121120

122-
Community Impact Guidelines were inspired by
121+
Community Impact Guidelines were inspired by
123122
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124123

125124
For answers to common questions about this code of conduct, see the FAQ at
126-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
127126
at [https://www.contributor-covenant.org/translations][translations].
128127

129128
[homepage]: https://www.contributor-covenant.org

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ ENV PIP_NO_CACHE_DIR=1 \
88

99
RUN apt update && apt install libcairo2 git build-essential -y --no-install-recommends
1010
RUN rm -rf /var/lib/apt/lists /var/cache/apt/archives /tmp/*
11-
RUN git clone https://github.com/hikariatama/Hikka /Hikka
1211

13-
WORKDIR /Hikka
14-
RUN pip install --no-warn-script-location --no-cache-dir -r requirements.txt
12+
RUN mkdir /data
13+
14+
COPY . /data/Hikka
15+
WORKDIR /data/Hikka
16+
17+
RUN pip install --no-warn-script-location --no-cache-dir -U -r requirements.txt
1518

1619
EXPOSE 8080
17-
RUN mkdir /data
1820

1921
CMD python -m hikka

0 commit comments

Comments
 (0)