From 116e7e6d15ca1876a7515eefcfb3a1a1883ffd2c Mon Sep 17 00:00:00 2001 From: Lukas Blacha Date: Wed, 8 Feb 2023 17:57:28 +0100 Subject: [PATCH] Added prefix flag for Startup (Standard "<") --- Music-Bot.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Music-Bot.py b/Music-Bot.py index 2464e4b..46ecf9b 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -29,6 +29,7 @@ logging.basicConfig(level=logging.INFO) parser = argparse.ArgumentParser() parser.add_argument("-t", "--token", help="Bot TOKEN") parser.add_argument("-c", "--cores", help="Number of Cores for ffmpeg (Standard 2)") +parser.add_argument("-p", "--prefix", help="Provides the Prefix for the bot (Standard <)") args = parser.parse_args() @@ -38,7 +39,13 @@ else: threads = int(args.cores) -if args.token == None: +if args.prefix == None + b_prefix = "<" +else: + b_prefix = str(args.prefix) + + +if args.token is None: print(f"{banner}\n\nPLEASE PROVIDE BOT A TOKEN BY RUNNING LIKE THE FOLLOWING:") print("\n") print(">>> python3 Music-Bot.py -t TOKEN <<<") @@ -112,7 +119,7 @@ else: intents.message_content = True bot = commands.Bot( - command_prefix=commands.when_mentioned_or("!"), + command_prefix=commands.when_mentioned_or(b_prefix), description="Relatively simple music bot example", intents=intents, help_command=None ) @@ -124,6 +131,7 @@ else: print(f"Bot Version: {version} ({branch})") print(f"Bot: {bot.user} (ID: {bot.user.id})") print(f"Threads for ffmpeg: {threads}") + print(f"Prefix: {b_prefix}") print( f"Invitation LINK: https://discord.com/api/oauth2/authorize?client_id={bot.user.id}&permissions=968552344896&scope=bot%20applications.commands") print("------")