Merged branch master into master
This commit is contained in:
@@ -38,7 +38,8 @@ class SongThread(threading.Thread):
|
|||||||
|
|
||||||
#Navigate to song start
|
#Navigate to song start
|
||||||
if not playing:
|
if not playing:
|
||||||
if m = patterns['start'].match(line):
|
m = patterns['start'].match(line)
|
||||||
|
if m:
|
||||||
if m.group(1) == this.song_name:
|
if m.group(1) == this.song_name:
|
||||||
playing = True
|
playing = True
|
||||||
continue
|
continue
|
||||||
@@ -46,21 +47,25 @@ class SongThread(threading.Thread):
|
|||||||
#Play loop
|
#Play loop
|
||||||
else:
|
else:
|
||||||
#Config
|
#Config
|
||||||
if m = patterns['time'].match(line):
|
m = patterns['time'].match(line)
|
||||||
|
if m:
|
||||||
this.delay = int(m.group(1))
|
this.delay = int(m.group(1))
|
||||||
|
continue
|
||||||
|
|
||||||
#Rest line
|
#Rest line
|
||||||
elif m = patterns['rest'].match(line):
|
m = patterns['rest'].match(line)
|
||||||
|
if m:
|
||||||
sleep(this.delay / 1000)
|
sleep(this.delay / 1000)
|
||||||
|
continue
|
||||||
|
|
||||||
#End song
|
#End song
|
||||||
elif m = patterns['end'].match(line):
|
m = patterns['end'].match(line)
|
||||||
|
if m:
|
||||||
return
|
return
|
||||||
|
|
||||||
#"sing" line
|
#"sing" line
|
||||||
else:
|
replycallback(line)
|
||||||
replycallback(line)
|
sleep(this.delay / 1000)
|
||||||
sleep(this.delay / 1000)
|
|
||||||
|
|
||||||
if not playing:
|
if not playing:
|
||||||
replycallback("Could not find song")
|
replycallback("Could not find song")
|
||||||
@@ -101,4 +106,4 @@ def handleKongMsg(slack, msg):
|
|||||||
response = "Invoke as kong <songtitle:list>"
|
response = "Invoke as kong <songtitle:list>"
|
||||||
reply_callback(response)
|
reply_callback(response)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user