Skip to content

Commit

Permalink
Upgrade the library to the latest mtproto layer (176).
Browse files Browse the repository at this point in the history
Signed-off-by: Aliwoto <[email protected]>
  • Loading branch information
ALiwoto committed Mar 26, 2024
1 parent f77cf1f commit 551b34b
Show file tree
Hide file tree
Showing 134 changed files with 2,748 additions and 485 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox==4.8.0
pip install tox
- name: Generate API
run: |
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox==4.8.0
pip install tox
- name: Generate API
run: |
Expand All @@ -33,4 +33,3 @@ jobs:
- name: Run tests
run: |
tox
144 changes: 119 additions & 25 deletions compiler/api/source/main_api.tl

Large diffs are not rendered by default.

114 changes: 112 additions & 2 deletions compiler/docs/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def get_title_list(s: str) -> list:
send_chat_action
delete_messages
get_messages
get_scheduled_messages
get_stickers
get_media_group
get_chat_history
get_chat_history_count
Expand All @@ -195,6 +197,9 @@ def get_title_list(s: str) -> list:
get_discussion_replies
get_discussion_replies_count
get_custom_emoji_stickers
send_web_page
start_bot
update_color
""",
chats="""
Chats
Expand Down Expand Up @@ -237,6 +242,25 @@ def get_title_list(s: str) -> list:
get_send_as_chats
set_send_as_chat
set_chat_protected_content
close_forum_topic
create_forum_topic
delete_forum_topic
edit_forum_topic
get_forum_topics
get_forum_topics_by_id
update_color
update_chat_notifications
toggle_forum_topics
delete_folder
export_folder_link
get_folders
update_folder
get_similar_channels
join_folder
leave_folder
toggle_join_to_send
toggle_folder_tags
set_chat_ttl
""",
users="""
Users
Expand All @@ -253,6 +277,8 @@ def get_title_list(s: str) -> list:
get_common_chats
get_default_emoji_statuses
set_emoji_status
update_status
check_username
""",
invite_links="""
Invite Links
Expand Down Expand Up @@ -330,6 +356,32 @@ def get_title_list(s: str) -> list:
invoke
resolve_peer
save_file
""",
stories="""
Stories
can_send_story
copy_story
delete_stories
edit_story_caption
edit_story_media
edit_story_privacy
forward_story
get_all_stories
get_chat_stories
get_pinned_stories
get_stories_archive
get_stories
hide_stories
increment_story_views
pin_stories
read_stories
send_story
""",
premium="""
Premium
apply_boost
get_boosts
get_boosts_status
"""
)

Expand Down Expand Up @@ -371,7 +423,13 @@ def get_title_list(s: str) -> list:
categories = dict(
users_chats="""
Users & Chats
BusinessInfo
BusinessMessage
BusinessRecipients
BusinessWeeklyOpen
BusinessWorkingHours
User
Username
Chat
ChatPreview
ChatPhoto
Expand All @@ -388,6 +446,8 @@ def get_title_list(s: str) -> list:
Dialog
Restriction
EmojiStatus
Folder
ChatColor
""",
messages_media="""
Messages & Media
Expand Down Expand Up @@ -418,6 +478,12 @@ def get_title_list(s: str) -> list:
WebAppData
MessageReactions
ChatReactions
Story
MyBoost
BoostsStatus
Giveaway
GiveawayResult
GiftCode
""",
bot_keyboards="""
Bot keyboards
Expand All @@ -437,6 +503,11 @@ def get_title_list(s: str) -> list:
MenuButtonWebApp
MenuButtonDefault
SentWebAppMessage
ForumTopic
RequestChannelInfo
RequestChatInfo
RequestUserInfo
RequestPollInfo
""",
bot_commands="""
Bot commands
Expand Down Expand Up @@ -557,6 +628,7 @@ def get_title_list(s: str) -> list:
Message.reply_video
Message.reply_video_note
Message.reply_voice
Message.reply_web_page
Message.get_media_group
Message.react
""",
Expand All @@ -567,25 +639,30 @@ def get_title_list(s: str) -> list:
Chat.set_title
Chat.set_description
Chat.set_photo
Chat.set_ttl
Chat.ban_member
Chat.unban_member
Chat.restrict_member
Chat.promote_member
Chat.join
Chat.leave
Chat.export_invite_link
Chat.get_member
Chat.get_members
Chat.add_members
Chat.join
Chat.leave
Chat.mark_unread
Chat.set_protected_content
Chat.unpin_all_messages
Chat.mute
Chat.unmute
""",
user="""
User
User.archive
User.unarchive
User.block
User.unblock
User.get_common_chats
""",
callback_query="""
Callback Query
Expand All @@ -603,6 +680,39 @@ def get_title_list(s: str) -> list:
ChatJoinRequest
ChatJoinRequest.approve
ChatJoinRequest.decline
""",
story="""
Story
Story.reply_text
Story.reply_animation
Story.reply_audio
Story.reply_cached_media
Story.reply_media_group
Story.reply_photo
Story.reply_sticker
Story.reply_video
Story.reply_video_note
Story.reply_voice
Story.copy
Story.delete
Story.edit_media
Story.edit_caption
Story.edit_privacy
Story.react
Story.forward
Story.download
Story.read
""",
folder="""
Folder
Folder.delete
Folder.update
Folder.include_chat
Folder.exclude_chat
Folder.update_color
Folder.pin_chat
Folder.remove_chat
Folder.export_link
"""
)

Expand Down
19 changes: 14 additions & 5 deletions compiler/errors/source/400_BAD_REQUEST.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ CHANNEL_TOO_LARGE The channel is too large
CHAT_ABOUT_NOT_MODIFIED The chat about text was not modified because you tried to edit it using the same content
CHAT_ABOUT_TOO_LONG The chat about text is too long
CHAT_ADMIN_REQUIRED The method requires chat admin privileges
CHAT_FORWARDS_RESTRICTED The chat restricts forwarding content
CHAT_DISCUSSION_UNALLOWED The chat discussion is not allowed
CHAT_FORWARDS_RESTRICTED The chat restricts forwarding content
CHAT_ID_EMPTY The provided chat id is empty
CHAT_ID_INVALID The chat id being used is invalid or not known yet. Make sure you see the chat before interacting with it
CHAT_INVALID The chat is invalid
Expand All @@ -72,6 +72,7 @@ CHAT_TOO_BIG The chat is too big for this action
CODE_EMPTY The provided code is empty
CODE_HASH_INVALID The provided code hash invalid
CODE_INVALID The provided code is invalid (i.e. from email)
COLOR_INVALID The provided color is invalid
CONNECTION_API_ID_INVALID The provided API id is invalid
CONNECTION_APP_VERSION_EMPTY App version is empty
CONNECTION_DEVICE_MODEL_EMPTY The device model is empty
Expand Down Expand Up @@ -127,6 +128,7 @@ FILE_REFERENCE_EMPTY The file id contains an empty file reference, you must obta
FILE_REFERENCE_EXPIRED The file id contains an expired file reference, you must obtain a valid one by fetching the message from the origin context
FILE_REFERENCE_INVALID The file id contains an invalid file reference, you must obtain a valid one by fetching the message from the origin context
FILTER_ID_INVALID The specified filter ID is invalid
FILTER_INCLUDE_EMPTY The filter include is empty
FIRSTNAME_INVALID The first name is invalid
FOLDER_ID_EMPTY The folder you tried to delete was already empty
FOLDER_ID_INVALID The folder id is invalid
Expand All @@ -135,6 +137,7 @@ FROM_MESSAGE_BOT_DISABLED Bots can't use fromMessage min constructors
FROM_PEER_INVALID The from peer value is invalid
GAME_BOT_INVALID You cannot send that game with the current bot
GEO_POINT_INVALID Invalid geo point provided
GIFT_SLUG_EXPIRED The gift slug is expired
GIF_CONTENT_TYPE_INVALID GIF content-type invalid
GIF_ID_INVALID The provided gif/animation id is invalid
GRAPH_INVALID_RELOAD Invalid graph token provided, please reload the stats and provide the updated token
Expand All @@ -161,6 +164,8 @@ INVITE_HASH_EXPIRED The chat invite link is no longer valid
INVITE_HASH_INVALID The invite link hash is invalid
INVITE_REQUEST_SENT The request to join this chat or channel has been successfully sent
INVITE_REVOKED_MISSING The action required a chat invite link to be revoked first
INVITE_SLUG_EMPTY The invite slug is empty
INVITE_SLUG_EXPIRED The invite slug is expired
LANG_PACK_INVALID The provided language pack is invalid
LASTNAME_INVALID The last name is invalid
LIMIT_INVALID The limit parameter is invalid
Expand All @@ -171,7 +176,7 @@ MAX_QTS_INVALID The provided QTS is invalid
MD5_CHECKSUM_INVALID The file's checksum did not match the md5_checksum parameter
MEDIA_CAPTION_TOO_LONG The media caption is too long
MEDIA_EMPTY The media you tried to send is invalid
MEDIA_FILE_INVALID The media file is invalid
MEDIA_FILE_INVALID The provided media file is invalid
MEDIA_INVALID The media is invalid
MEDIA_NEW_INVALID The new media to edit the message with is invalid
MEDIA_PREV_INVALID The previous media cannot be edited with anything else
Expand Down Expand Up @@ -258,17 +263,20 @@ QUIZ_CORRECT_ANSWERS_EMPTY The correct answers of the quiz are empty
QUIZ_CORRECT_ANSWERS_TOO_MUCH The quiz contains too many correct answers
QUIZ_CORRECT_ANSWER_INVALID The correct answers of the quiz are invalid
QUIZ_MULTIPLE_INVALID A quiz can't have multiple answers
QUOTE_TEXT_INVALID The quote text is invalid
RANDOM_ID_EMPTY The random ID is empty
RANDOM_ID_INVALID The provided random ID is invalid
RANDOM_LENGTH_INVALID The random length is invalid
RANGES_INVALID Invalid range provided
REACTIONS_TOO_MANY Non-premium users, can set up only one reaction per message
REACTION_EMPTY The reaction provided is empty
REACTION_INVALID Invalid reaction provided (only valid emoji are allowed)
REFLECTOR_NOT_AVAILABLE The call reflector is not available
REPLY_MARKUP_BUY_EMPTY Reply markup for buy button empty
REPLY_MARKUP_GAME_EMPTY The provided reply markup for the game is empty
REPLY_MARKUP_INVALID The provided reply markup is invalid
REPLY_MARKUP_TOO_LONG The reply markup is too long
REPLY_MESSAGE_ID_INVALID The reply message id is invalid
RESULTS_TOO_MUCH The result contains too many items
RESULT_ID_DUPLICATE The result contains items with duplicated identifiers
RESULT_ID_EMPTY Result ID empty
Expand Down Expand Up @@ -310,7 +318,9 @@ STICKER_PNG_NOPNG Stickers must be png files but the provided image was not a pn
STICKER_TGS_NOTGS A tgs sticker file was expected, but something else was provided
STICKER_THUMB_PNG_NOPNG A png sticker thumbnail file was expected, but something else was provided
STICKER_VIDEO_NOWEBM A webm video file was expected, but something else was provided
STORIES_NEVER_CREATED You have never created any stories
STORIES_TOO_MUCH Too many stories in the current account
STORY_PERIOD_INVALID The story period is invalid
TAKEOUT_INVALID The takeout id is invalid
TAKEOUT_REQUIRED The method must be invoked inside a takeout session
TEMP_AUTH_KEY_EMPTY The temporary auth key provided is empty
Expand Down Expand Up @@ -357,6 +367,7 @@ USER_IS_BOT A bot cannot send messages to other bots or to itself
USER_KICKED This user was kicked from this chat
USER_NOT_MUTUAL_CONTACT The user is not a mutual contact
USER_NOT_PARTICIPANT The user is not a member of this chat
USER_PUBLIC_MISSING The accounts username is missing
VIDEO_CONTENT_TYPE_INVALID The video content type is invalid (i.e.: not streamable)
VIDEO_FILE_INVALID The video file is invalid
VOICE_MESSAGES_FORBIDDEN Voice messages are restricted
Expand All @@ -372,6 +383,4 @@ WEBDOCUMENT_URL_EMPTY The web document URL is empty
WEBDOCUMENT_URL_INVALID The web document URL is invalid
WEBPAGE_CURL_FAILED Telegram server could not fetch the provided URL
WEBPAGE_MEDIA_EMPTY The URL doesn't contain any valid media
YOU_BLOCKED_USER You blocked this user
STORIES_NEVER_CREATED You have never created any stories
MEDIA_FILE_INVALID The provided media file is invalid
YOU_BLOCKED_USER You blocked this user
Loading

0 comments on commit 551b34b

Please sign in to comment.