[irc] remove "room" argument for !play and !pause
This commit is contained in:
parent
0bfb6d117b
commit
dff203f436
@ -19,10 +19,10 @@ class Bot(object):
|
|||||||
# channel - channel to autojoin and interact with
|
# channel - channel to autojoin and interact with
|
||||||
# channelPassword - if channel is +k
|
# channelPassword - if channel is +k
|
||||||
# functions - list/tuple of functions that can be used from the bot:
|
# functions - list/tuple of functions that can be used from the bot:
|
||||||
# * pause(setBy, room, state=bool)
|
# * pause(setBy, state=bool)
|
||||||
# * getRooms() -> list
|
# * getRooms() -> list
|
||||||
# * getPosition(room) -> int
|
# * getPosition(room) -> int
|
||||||
# * setPosition(setBy, room, seconds)
|
# * setPosition(setBy, seconds)
|
||||||
# * getUsers(room) -> list of {'nick': str, 'file': str, 'length': int}
|
# * getUsers(room) -> list of {'nick': str, 'file': str, 'length': int}
|
||||||
# * isPaused(room) -> bool
|
# * isPaused(room) -> bool
|
||||||
|
|
||||||
@ -132,41 +132,29 @@ class Bot(object):
|
|||||||
else:
|
else:
|
||||||
self.msg(to, chr(2) + 'Usage:' + chr(15) + ' !roominfo [room]')
|
self.msg(to, chr(2) + 'Usage:' + chr(15) + ' !roominfo [room]')
|
||||||
elif split[0].lower() == '!pause':
|
elif split[0].lower() == '!pause':
|
||||||
if len(split) >= 2:
|
rooms = self.functions[1]()
|
||||||
rooms = self.functions[1]()
|
|
||||||
for room in split[1:]:
|
|
||||||
if (room in rooms) == False:
|
|
||||||
self.msg(to, chr(3) + '5Error!' + chr(15) + ' Room does not exists (' + room + ')')
|
|
||||||
else:
|
|
||||||
users = self.functions[4](room)
|
|
||||||
for u in users:
|
|
||||||
if u['nick'] == nickFrom:
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
self.msg(to, chr(3) + '5Error!' + chr(15) + ' Your nick is not in the specified room')
|
|
||||||
continue
|
|
||||||
|
|
||||||
self.functions[6](nickFrom, room, True)
|
for room in rooms:
|
||||||
else:
|
users = self.functions[4](room)
|
||||||
self.msg(to, chr(2) + 'Usage:' + chr(15) + ' !pause [room]')
|
for u in users:
|
||||||
|
if u['nick'] == nickFrom:
|
||||||
|
self.functions[6](nickFrom, True)
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
self.msg(to, chr(3) + '5Error!' + chr(15) + ' Your nick was not found on the server')
|
||||||
|
return
|
||||||
elif split[0].lower() == '!play':
|
elif split[0].lower() == '!play':
|
||||||
if len(split) >= 2:
|
rooms = self.functions[1]()
|
||||||
rooms = self.functions[1]()
|
|
||||||
for room in split[1:]:
|
|
||||||
if (room in rooms) == False:
|
|
||||||
self.msg(to, chr(3) + '5Error!' + chr(15) + ' Room does not exists (' + room + ')')
|
|
||||||
else:
|
|
||||||
users = self.functions[4](room)
|
|
||||||
for u in users:
|
|
||||||
if u['nick'] == nickFrom:
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
self.msg(to, chr(3) + '5Error!' + chr(15) + ' Your nick is not in the specified room')
|
|
||||||
continue
|
|
||||||
|
|
||||||
self.functions[6](room, False)
|
for room in rooms:
|
||||||
else:
|
users = self.functions[4](room)
|
||||||
self.msg(to, chr(2) + 'Usage:' + chr(15) + ' !play [room]')
|
for u in users:
|
||||||
|
if u['nick'] == nickFrom:
|
||||||
|
self.functions[6](nickFrom, False)
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
self.msg(to, chr(3) + '5Error!' + chr(15) + ' Your nick was not found on the server')
|
||||||
|
return
|
||||||
elif split[0].lower() == '!help':
|
elif split[0].lower() == '!help':
|
||||||
self.msg(to, chr(2) + 'Available commands:' + chr(15) + ' !rooms / !roominfo [room] / !pause / !play')
|
self.msg(to, chr(2) + 'Available commands:' + chr(15) + ' !rooms / !roominfo [room] / !pause / !play')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user