From 97c80d97d8308a09be0935d1006c4a8247d59452 Mon Sep 17 00:00:00 2001 From: Alastair Holland Date: Thu, 14 May 2020 00:22:54 +0100 Subject: [PATCH] Added update function --- deploy.sh | 1 + lib/developer.py | 14 ++++++++++++-- run.py | 3 +++ start.sh | 1 + 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/deploy.sh b/deploy.sh index a07176a..ae8c226 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,2 +1,3 @@ +sleep 2 git pull ./start.sh \ No newline at end of file diff --git a/lib/developer.py b/lib/developer.py index 0251aa6..83036b1 100755 --- a/lib/developer.py +++ b/lib/developer.py @@ -1,13 +1,19 @@ import database import os +import time def developer_modify(message): msg = "" command = message[1] if command == "deploy": - deploy = True + os.system("./deploy.sh") + exit() elif command == "start": start = True + return "This is WIP and currently doesn't work" + elif command == "restart": + os.system("./start.sh") + exit() if len(message) >= 2: if command == "data": if message[2] == "*": @@ -47,7 +53,7 @@ def developer_modify(message): def check_message(message, author, guild_id): message = message.split() if len(message) == 1: - return "Please specify a command" + return "Please specify a command, use {}prefix for help"(database.read_database("command_prefix", guild_id)) if message[1] == "help": dev_help = { "restart" : "Restart all bots", @@ -59,7 +65,11 @@ def check_message(message, author, guild_id): } msg = "" for i in dev_help: + fw = i.split() + if fw[0] in message: + return "{}{} - {}".format(database.read_database("command_prefix", guild_id), i, dev_help[i]) msg = "{} - {}developers {}\n".format(msg, database.read_database("command_prefix", guild_id), i) + msg = "{}You can use {}developers help [developer command] to get more information on that command".format(msg, database.read_database("command_prefix", guild_id)) return msg if database.permission_check(message[1], author): return developer_modify(message) diff --git a/run.py b/run.py index a316d72..7e8dc8e 100755 --- a/run.py +++ b/run.py @@ -2,9 +2,12 @@ def run(): from lib import librarySetup from lib import databaseSetup + from lib import shell librarySetup.checkLibraries() #Check and install libraries databaseSetup.main() #Create database + shell.permissions() + from lib import setup #from lib import online import os diff --git a/start.sh b/start.sh index 64d2ef0..cc3e49d 100755 --- a/start.sh +++ b/start.sh @@ -1 +1,2 @@ +sleep 5 python3 run.py \ No newline at end of file