Методы¶
Типизированные обёртки VK API методов. Все находятся в fastvk.methods и регистрируются в глобальном _REGISTRY.
messages¶
messages.send¶
await bot.messages.send(
peer_id: int,
message: str,
*,
random_id: int = 0,
keyboard: str | None = None,
attachment: str | None = None,
reply_to: int | None = None,
dont_parse_links: bool = False,
disable_mentions: bool = False,
) -> int # ID сообщения
messages.edit¶
await bot.messages.edit(
peer_id: int,
message_id: int,
message: str,
*,
keyboard: str | None = None,
attachment: str | None = None,
) -> int
messages.delete¶
await bot.messages.delete(
message_ids: int | list[int],
*,
peer_id: int | None = None,
delete_for_all: bool = False,
) -> int
messages.pin¶
messages.unpin¶
messages.mark_as_read¶
messages.get_history¶
await bot.messages.get_history(
peer_id: int,
*,
count: int = 20,
offset: int = 0,
) -> dict # {"count": int, "items": list[dict]}
messages.set_activity¶
messages.send_event_answer¶
await bot.messages.send_event_answer(
event_id: str,
user_id: int,
peer_id: int,
*,
event_data: str | None = None,
) -> int
users¶
users.get¶
groups¶
groups.get_by_id¶
wall¶
wall.post¶
await bot.wall.post(
owner_id: int,
message: str,
*,
attachments: str | None = None,
) -> dict # {"post_id": int}
wall.get_by_id¶
Формат posts: "{owner_id}_{post_id}" или список через запятую.
photos¶
photos.get_messages_upload_server¶
await bot.photos.get_messages_upload_server(peer_id: int) -> dict
# {"upload_url": str, "album_id": int, "user_id": int}
photos.save_messages_photo¶
docs¶
docs.get_messages_upload_server¶
await bot.docs.get_messages_upload_server(
peer_id: int,
*,
type: str = "doc",
) -> dict # {"upload_url": str}