Feat/message convenience methods - #18
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Message convenience methods
Add ergonomic methods to
Messagefor common conversation actions:message.search(q, ...)— search messages in the current chatmessage.get_history(...)— fetch chat historymessage.get_invite_link(...)— get invite link for the chatmessage.get_conversation_members(...)— list conversation participantsmessage.mark_as_important(...)— bookmark the messagemessage.restore()— restore a deleted messagemessage.get_by_conversation_message_id(...)— fetch by local conversation IDInstead of:
Now:
FastVK method namespace properties
Add
@propertyaccessors onFastVKso type checkers resolvebot.messages,bot.users, etc. without errors:bot.messagessend,edit,delete,search,pin,unpin, ...bot.usersget,searchbot.groupsgetById,getMembers,getLongPollServerbot.wallget,post,getByIdbot.photosgetMessagesUploadServer,saveMessagesPhotobot.docsgetMessagesUploadServer,savePreviously only
Bothad these —FastVKusers had to work around the type checker with# type: ignoreorgetattr.Files changed
fastvk/types/message.py— 7 new methods onMessagefastvk/app.py— 6@propertyaccessors onFastVKexamples/messages/all_methods.py— updated to usemessage.search()etc.docs/en/tutorial/message.md— new sections (Search, History, Invite link, Members, Bookmark)docs/ru/tutorial/message.md— same in Russiandocs/en/reference/types.md— new method signaturesdocs/ru/reference/types.md— same in Russiandocs/en/reference/fastvk.md— namespace table addeddocs/ru/reference/fastvk.md— added namespace table