Added skip command for JawaFM
parent
1c13db09c1
commit
5095a254aa
|
@ -22,3 +22,4 @@
|
||||||
**!giveaway prize**: Do a giveaway based on users reacting with the emoji you react with secretly. Use in private and replace prize with an actual prize!
|
**!giveaway prize**: Do a giveaway based on users reacting with the emoji you react with secretly. Use in private and replace prize with an actual prize!
|
||||||
**!np**: Posts currently playing info for ToukuFM.
|
**!np**: Posts currently playing info for ToukuFM.
|
||||||
**!roll**: Rolls any number of dice! Use like `!roll d20`, `!roll 2d6`, or `!roll 3d6 d20`
|
**!roll**: Rolls any number of dice! Use like `!roll d20`, `!roll 2d6`, or `!roll 3d6 d20`
|
||||||
|
**!fmskip station**: Tells LiquidSoap to skip the currently playing track on **station** on JawaFM.
|
13
pocketbot.py
13
pocketbot.py
|
@ -10,6 +10,7 @@ import os
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
import telnetlib
|
||||||
|
|
||||||
#Get script location
|
#Get script location
|
||||||
cwd = os.path.dirname(os.path.realpath(__file__))
|
cwd = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
@ -331,6 +332,18 @@ def on_message(message):
|
||||||
#Send output to chat
|
#Send output to chat
|
||||||
yield from client.send_message(message.channel, output)
|
yield from client.send_message(message.channel, output)
|
||||||
|
|
||||||
|
#Skip tracks/mixes on JawaFM
|
||||||
|
elif message.content.lower().startswith('!fmskip'):
|
||||||
|
args = message.content.partition(' ')[2]
|
||||||
|
station = args.partition(' ')[0]
|
||||||
|
if (station is ''):
|
||||||
|
yield from client.send_message(message.channel, 'Please provide a station to skip.')
|
||||||
|
else:
|
||||||
|
skipcommand = station + '(dot)ogg.skip\n'
|
||||||
|
tn = telnetlib.Telnet("localhost", 1234)
|
||||||
|
tn.write(skipcommand.encode('ascii'))
|
||||||
|
tn.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
client.loop.create_task(ups_check())
|
client.loop.create_task(ups_check())
|
||||||
|
|
Loading…
Reference in New Issue