slack-starterbot icon indicating copy to clipboard operation
slack-starterbot copied to clipboard

slack_client.api_call -> slackclient.api_call

Open dopatraman opened this issue 9 years ago • 1 comments

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 avatar Dec 05 '16 19:12 dopatraman

@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)```

SteveChristian70 avatar Dec 12 '16 16:12 SteveChristian70