From 904c2b0209b36fd527175a6f00aa10ce21d54988 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Wed, 16 Dec 2020 15:57:07 +0530 Subject: now the help message is a different file and can be changed on the fly --- bot.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bot.py') diff --git a/bot.py b/bot.py index 2c43283..b234774 100644 --- a/bot.py +++ b/bot.py @@ -12,9 +12,15 @@ def get_info(): bad_words = ['fuck', 'shit', 'bitch', 'cunt', 'sex']#, '', '', '', '', '', '', '', '', '', '', '', '') +# z!help +def show_help(): + help = open('help_message.txt', 'r') + help_message = help.read() + return help_message CALL = "z!" + HELP_MESSAGE = '```Every command should be prefixed with "' + CALL + '".\n\nsay repeats your previous message\ninfo displays info about the bot and the creator\nhelp shows this message```' @@ -34,7 +40,6 @@ HELP_MESSAGE = '```Every command should be prefixed with "' + CALL + '".\n\nsay load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') -PASSWORD = os.getenv('ADMIN_PASSWORD') # this can prove to be insecure af # frontend stuff client = discord.Client() @@ -75,7 +80,7 @@ async def on_message(message): # send help message if message.content == CALL + 'help': - response = HELP_MESSAGE + response = show_help() await message.channel.send(response) # cultured stuff -- cgit v1.2.3