Added cores flag for Startup
This commit is contained in:
11
Music-Bot.py
11
Music-Bot.py
@@ -28,8 +28,16 @@ cache_dir = "cache"
|
|||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-t", "--token", help="Bot TOKEN")
|
parser.add_argument("-t", "--token", help="Bot TOKEN")
|
||||||
|
parser.add_argument("-c", "--cores", help="Number of Cores for ffmpeg (Standard 2)")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
if args.cores == None:
|
||||||
|
threads = 2
|
||||||
|
else:
|
||||||
|
threads = int(args.cores)
|
||||||
|
|
||||||
|
|
||||||
if args.token == None:
|
if args.token == None:
|
||||||
print(f"{banner}\n\nPLEASE PROVIDE BOT A TOKEN BY RUNNING LIKE THE FOLLOWING:")
|
print(f"{banner}\n\nPLEASE PROVIDE BOT A TOKEN BY RUNNING LIKE THE FOLLOWING:")
|
||||||
print("\n")
|
print("\n")
|
||||||
@@ -85,7 +93,7 @@ else:
|
|||||||
|
|
||||||
filename = data["url"] if stream else ytdl.prepare_filename(data)
|
filename = data["url"] if stream else ytdl.prepare_filename(data)
|
||||||
return cls(discord.FFmpegPCMAudio(source=filename, executable="ffmpeg", pipe=False, stderr=False,
|
return cls(discord.FFmpegPCMAudio(source=filename, executable="ffmpeg", pipe=False, stderr=False,
|
||||||
before_options="-threads 2", options=ffmpeg_options), data=data)
|
before_options=f"-threads {threads}", options=ffmpeg_options), data=data)
|
||||||
|
|
||||||
|
|
||||||
async def youtube_search(search: str):
|
async def youtube_search(search: str):
|
||||||
@@ -115,6 +123,7 @@ else:
|
|||||||
print(banner)
|
print(banner)
|
||||||
print(f"Bot Version: {version} ({branch})")
|
print(f"Bot Version: {version} ({branch})")
|
||||||
print(f"Bot: {bot.user} (ID: {bot.user.id})")
|
print(f"Bot: {bot.user} (ID: {bot.user.id})")
|
||||||
|
print(f"Threads for ffmpeg: {threads}")
|
||||||
print(
|
print(
|
||||||
f"Invitation LINK: https://discord.com/api/oauth2/authorize?client_id={bot.user.id}&permissions=968552344896&scope=bot%20applications.commands")
|
f"Invitation LINK: https://discord.com/api/oauth2/authorize?client_id={bot.user.id}&permissions=968552344896&scope=bot%20applications.commands")
|
||||||
print("------")
|
print("------")
|
||||||
|
|||||||
Reference in New Issue
Block a user