slack-starterbot
slack-starterbot copied to clipboard
slack_client.api_call -> slackclient.api_call
this
slack_client.api_call("chat.postMessage", channel=channel,
text=response, as_user=True)
should be
slackclient.api_call("chat.postMessage", channel=channel,
text=response, as_user=True)
right?
@dopatraman Technically No, using slackclient.api_call is not correct for this case. If you look at line 14 we set the slack_client variable to SlackClient(os.environ.get('SLACK_BOT_TOKEN')) So then when we call that variable you would use slack_client.api_call because that is the variable name we assigned on line 14. As you probably know you can assign almost any name to a variable, so if you had set the variable name to sc you would call that variable using sc.
sc.api_call("chat.postMessage", channel=channel,
text=response, as_user=True)```