You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromslackclientimportSlackClientdefsearch(dict_list, key, value):
foritemindict_list:
ifitem[key] ==value:
returnitemSLACK_DEBUG_KEY="YOUR-BRAND-NEW-SLACK-DEBUG-KEY-HERE"sc=SlackClient(SLACK_DEBUG_KEY)
sc.rtm_connect()
users=sc.api_call('users.list')['members']
user=search(users, 'name', 'your-slack-username-here')
dm=sc.api_call('im.open', user=user['id'])['channel']['id']
sc.rtm_send_message(dm, 'this should be a message you receive')
Expected:
A message from the bot whose key you used on the first time.
Actual:
This error the first time:
Traceback:
File "~/pycharmprojects/python-slackclient/slackclient/_client.py", line 40, in rtm_send_message
return self.server.channels.find(channel).send_message(message)
AttributeError: 'NoneType' object has no attribute 'send_message'
Works as expected the second time.
Notes:
rtm_send_message depends on the cached set of channels. Fix will be in rtm_send_message definition, probably by inserting or creating a channel object if not there. But it's four in the morning here and I'm gonna get some sleep first.
The text was updated successfully, but these errors were encountered:
I've posted #74, which fixes both this and #47. Could someone from Slack ( @l12s ?) take a look at this? I know I've posted a lot of PRs this weekend, but #74 is an important one.
Replication:
Expected:
A message from the bot whose key you used on the first time.
Actual:
This error the first time:
Works as expected the second time.
Notes:
rtm_send_message depends on the cached set of channels. Fix will be in rtm_send_message definition, probably by inserting or creating a channel object if not there. But it's four in the morning here and I'm gonna get some sleep first.
The text was updated successfully, but these errors were encountered: