V
V
Valde01832022-03-24 18:30:42
Python
Valde0183, 2022-03-24 18:30:42

Name declension?

Good evening! I do not quite understand and Google does not give answers on how to make declension of names in a command.
There is a Users.get method, there is a name_case - a case of names, nothing is written about the implementation, or maybe I'm just blind, but your help would not hurt!
"User, User" looks somehow ugly. It is beautiful when the Name and Surname of a person is inclined. An example code is desirable, I will be grateful!
If you know the answer, then give it, please, and do not pass by! Thanks to.
There is this code:

@bp.on.chat_message(text=["обнять", "обнять <member>"])
async def rp_handler(message: Message, member=None):
    User = await bp.api.users.get(user_ids=message.from_id)
    try:
        if message.reply_message is not None:
            await message.answer(f"  | @id{User[0].id} ({User[0].first_name} {User[0].last_name}) нежно обнял @id{message.reply_message.from_id}(Пользователя)")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2022-03-24
@Valde0183

name_case - case of names, nothing about the implementation is written there

Everything is written in the documentation. May matter
• nominative - nom,
• genitive - gen,
• dative - dat,
• accusative - acc,
• instrumental - ins,
• prepositional - abl.
The default is nom.

Actually, you pass this parameter when calling and add one of the values. First_name and last_name will contain updated data
https://dev.vk.com/method/users.get

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question