Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to set the user icon for a bot? #11

Open
BenFrantzDale opened this issue Jul 2, 2015 · 5 comments
Open

Is there a way to set the user icon for a bot? #11

BenFrantzDale opened this issue Jul 2, 2015 · 5 comments

Comments

@BenFrantzDale
Copy link

Here's the Hello World example. How would I change it so mybot has a user icon/photo?

import slack
import slack.chat
slack.api_token = 'your_token'
slack.chat.post_message('#eng', 'Hello slackers!', username='mybot')
@chadgh
Copy link

chadgh commented Dec 15, 2015

slack.chat.post_message('#eng', 'Hello slackers!', username='mybot', icon_emoji=':some_emoji_in_slack:') OR slack.chat.post_message('#eng', 'Hello slackers!', username='mybot', icon_url='some url to an image')

@BenFrantzDale
Copy link
Author

So if I want to provide a custom image, I have to upload it first? How do I do that? I see slack.files.upload but I don't see docs.

@chadgh
Copy link

chadgh commented Dec 17, 2015

I think the icon_url can just be any old web accessible url.

@averwhy
Copy link

averwhy commented Nov 30, 2018

Exception has occurred: NameError name 'slack' is not defined
I know that this issue is 3 years old but is there a fix?

@oliverpolden
Copy link

oliverpolden commented May 27, 2020

pip3 install slackclient
or
pip install slackclient if you're still on Python < 3

This appears to be the definitive guide and worked for me: https://www.fullstackpython.com/blog/build-first-slack-bot-python.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants