Fixed !reload and !getplaylist

!reload now works and !getplaylist splits the message in multiple parts
This commit is contained in:
Twentysix 2016-01-04 04:37:04 +01:00
parent cf5e07851b
commit 1e8b9ab681
2 changed files with 10 additions and 4 deletions

8
red.py
View File

@ -230,7 +230,7 @@ async def on_message(message):
elif message.content == "!talk": #prevents !talk custom command elif message.content == "!talk": #prevents !talk custom command
pass pass
elif message.content == "!reload": elif message.content == "!reload":
reloadSettings(message) await reloadSettings(message)
elif message.content.startswith("!name"): elif message.content.startswith("!name"):
await changeName(message) await changeName(message)
elif message.content.startswith("!cleanup"): elif message.content.startswith("!cleanup"):
@ -941,6 +941,11 @@ async def sendPlaylist(message):
for track in currentPlaylist.playlist: for track in currentPlaylist.playlist:
msg += track msg += track
msg += "\n" msg += "\n"
if len(msg) >= 1900:
msg += "```"
await client.send_message(message.author, msg)
msg = "```"
if msg != "```":
msg += "```" msg += "```"
await client.send_message(message.author, msg) await client.send_message(message.author, msg)
@ -1082,6 +1087,7 @@ async def removeRegex(message):
async def reloadSettings(message): async def reloadSettings(message):
if isMemberAdmin(message): if isMemberAdmin(message):
loadDataFromFiles(True) loadDataFromFiles(True)
await client.send_message(message.channel, "`Settings and files reloaded.`")
else: else:
await client.send_message(message.channel, "`I don't take orders from you.`") await client.send_message(message.channel, "`I don't take orders from you.`")

View File

@ -1 +1 @@
{"TRIVIA_ADMIN_ONLY": false, "EDIT_CC_ADMIN_ONLY": false, "PASSWORD": "PASSWORDHERE", "FILTER": true, "CUSTOMCOMMANDS": true, "TRIVIAMAXSCORE": 10, "TRIVIADELAY": 15, "NAME": "Red", "LOGGING": true, "EMAIL": "EMAILHERE", "ADMINROLE": "Transistor"} {"CUSTOMCOMMANDS": true, "EMAIL": "EMAILHERE", "TRIVIA_ADMIN_ONLY": false, "EDIT_CC_ADMIN_ONLY": false, "TRIVIAMAXSCORE": 10, "TRIVIADELAY": 15, "PASSWORD": "PASSWORDHERE", "LOGGING": true, "ADMINROLE": "Transistor", "FILTER": true}