20 lines
494 B
Python
20 lines
494 B
Python
from vkbottle import API
|
|
|
|
|
|
class MyAPI(API):
|
|
def __init__(self, bot_id: int, api_token: str):
|
|
super().__init__(api_token)
|
|
self.bot_id = bot_id
|
|
|
|
|
|
def get_bot_id(api: API) -> int:
|
|
my_api: MyAPI = api
|
|
return my_api.bot_id
|
|
|
|
|
|
async def get_user_name_for_ai(api: API, user_id: int):
|
|
user = await api.users.get(user_ids=[user_id])
|
|
if len(user) == 1:
|
|
return "{} {}".format(user[0].first_name, user[0].last_name)
|
|
else:
|
|
return '@id' + str(user_id)
|