N
N
niggaedition2018-09-22 10:11:50
Python
niggaedition, 2018-09-22 10:11:50

How to remove the string indices must be integers error when calling the users.get method?

name = vk.users.get(user_ids = str(actionid))
      actionname = str(name)["first_name"]

actionid is the id of the person who was added or kicked,
I want to get the name from the id

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2018-09-22
@tumbler

str(name)["first_name"]
You have to be more careful. Indexes for strings can indeed only be integers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question