scrapinghub / slackbot

A chat bot for Slack (https://slack.com).
MIT License
1.26k stars 394 forks source link

How to obtain Displayed channel and user names #122

Closed drislands closed 7 years ago

drislands commented 7 years ago

Not sure if this obviously doable or obviously not doable, but is there a method to convert the user/channel ID gotten from message.body['channel']/['user'] into the displayed name when the bot's response reaches Slack?

lukeconvertdigital commented 7 years ago
user    = message.channel._client.users[message.body['user']]
channel = message.channel._client.channels[message.body['channel']]

display_name = user['name']
first_name = user['first_name']

channel_name = channel['name']
lins05 commented 7 years ago

Answered by @helloitsluke