get channel id from slack for test bot

in case i accidentally delete the bot conf file again and don’t want to
look up the channel id
This commit is contained in:
Jack 2016-02-26 11:20:31 -05:00
parent a18f3bf08a
commit 8f04d3418a

View file

@ -7,9 +7,8 @@ from slackclient import SlackClient
def get_conf():
f = open('testbot.conf', 'r')
token = f.readline().replace('\n', '')
channel = f.readline().replace('\n', '')
f.close()
return token, channel
return token
def test_lbrynet(lbry, slack, channel):
logfile = open('lbrynet_test_log.txt', 'a')
@ -48,10 +47,11 @@ def test_lbrynet(lbry, slack, channel):
lbry.delete_lbry_file('test.jpg')
logfile.close()
token, channel = get_conf()
token = get_conf()
sc = SlackClient(token)
sc.rtm_connect()
channel = [c['id'] for c in json.loads(sc.api_call('channels.list'))['channels'] if c['name'] == 'tech'][0]
print 'Connected to slack'
daemon = xmlrpclib.ServerProxy("http://localhost:7080")