Skip to content

Feat/message convenience methods - #18

Merged
NEFORCEO merged 14 commits into
masterfrom
feat/message-convenience-methods
Jun 27, 2026
Merged

Feat/message convenience methods#18
NEFORCEO merged 14 commits into
masterfrom
feat/message-convenience-methods

Conversation

@NEFORCEO

Copy link
Copy Markdown
Member

Message convenience methods

Add ergonomic methods to Message for common conversation actions:

  • message.search(q, ...) — search messages in the current chat
  • message.get_history(...) — fetch chat history
  • message.get_invite_link(...) — get invite link for the chat
  • message.get_conversation_members(...) — list conversation participants
  • message.mark_as_important(...) — bookmark the message
  • message.restore() — restore a deleted message
  • message.get_by_conversation_message_id(...) — fetch by local conversation ID

Instead of:

result = await bot.messages.search(q="hello", peer_id=message.peer_id)

Now:

result = await message.search(q="hello")

FastVK method namespace properties

Add @property accessors on FastVK so type checkers resolve bot.messages, bot.users, etc. without errors:

Property Methods
bot.messages send, edit, delete, search, pin, unpin, ...
bot.users get, search
bot.groups getById, getMembers, getLongPollServer
bot.wall get, post, getById
bot.photos getMessagesUploadServer, saveMessagesPhoto
bot.docs getMessagesUploadServer, save

Previously only Bot had these — FastVK users had to work around the type checker with # type: ignore or getattr.

Files changed

  • fastvk/types/message.py — 7 new methods on Message
  • fastvk/app.py — 6 @property accessors on FastVK
  • examples/messages/all_methods.py — updated to use message.search() etc.
  • docs/en/tutorial/message.md — new sections (Search, History, Invite link, Members, Bookmark)
  • docs/ru/tutorial/message.md — same in Russian
  • docs/en/reference/types.md — new method signatures
  • docs/ru/reference/types.md — same in Russian
  • docs/en/reference/fastvk.md — namespace table added
  • docs/ru/reference/fastvk.md — added namespace table

@NEFORCEO
NEFORCEO merged commit 347599a into master Jun 27, 2026
4 checks passed
@NEFORCEO
NEFORCEO deleted the feat/message-convenience-methods branch June 27, 2026 11:36
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.

1 participant