From 1e8b9ab681fa8f9c56a875574cd65ce5e7a9eb5e Mon Sep 17 00:00:00 2001 From: Twentysix Date: Mon, 4 Jan 2016 04:37:04 +0100 Subject: [PATCH] Fixed !reload and !getplaylist !reload now works and !getplaylist splits the message in multiple parts --- red.py | 12 +++++++++--- settings.json | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/red.py b/red.py index 765139f6c..1e6046e85 100644 --- a/red.py +++ b/red.py @@ -230,7 +230,7 @@ async def on_message(message): elif message.content == "!talk": #prevents !talk custom command pass elif message.content == "!reload": - reloadSettings(message) + await reloadSettings(message) elif message.content.startswith("!name"): await changeName(message) elif message.content.startswith("!cleanup"): @@ -941,8 +941,13 @@ async def sendPlaylist(message): for track in currentPlaylist.playlist: msg += track msg += "\n" - msg += "```" - await client.send_message(message.author, msg) + if len(msg) >= 1900: + msg += "```" + await client.send_message(message.author, msg) + msg = "```" + if msg != "```": + msg += "```" + await client.send_message(message.author, msg) ############## ADMIN COMMANDS ################### @@ -1082,6 +1087,7 @@ async def removeRegex(message): async def reloadSettings(message): if isMemberAdmin(message): loadDataFromFiles(True) + await client.send_message(message.channel, "`Settings and files reloaded.`") else: await client.send_message(message.channel, "`I don't take orders from you.`") diff --git a/settings.json b/settings.json index 4222d13e4..303b062c3 100644 --- a/settings.json +++ b/settings.json @@ -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"} \ No newline at end of file +{"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} \ No newline at end of file