jeudi 3 août 2017

How to read a slack user ID from response and get the username?

Code:

@slackbot.command('hi')
def idk():


    user =  slackbot.slack_client.api_call(
    "users.info",
     user=command.user,

    )
    print(user) 

When the user types of command in slack as !hi, that users information is taken into the command. This is what I have so far, but how do I now extract purely the users first name? print(user) at the moment prints everything I need to see, including the 'first_name:"name", but how do I know single this out?

Please help!! Thank you!

Aucun commentaire:

Enregistrer un commentaire