This commit is contained in:
2022-05-26 19:24:18 +03:00
parent 363c85d0b3
commit 16c06c8319
13 changed files with 160 additions and 70 deletions

View File

@@ -27,6 +27,7 @@ namespace DiscordBot
private static bool listLanguagAtStartup = false;
private static bool PluginsLoaded = false;
private static bool ShowStartupMessage = true;
/// <summary>
/// The main entry point for the application.
@@ -411,10 +412,15 @@ namespace DiscordBot
Console.ForegroundColor = ConsoleColor.DarkYellow;
Console.WriteLine("Discord BOT for Cross Platform");
Console.WriteLine("Created by: Wizzy\nDiscord: Wizzy#9181");
if (ShowStartupMessage)
try
{
Console.WriteLine("Connecting to server ...");
List<string> text = await ServerCom.ReadTextFromFile("https://sethdiscordbot.000webhostapp.com/Storage/Discord%20Bot/StartupMessage");
foreach (var t in text) Console_Utilities.WriteColorText(t);
List<string> text = await ServerCom.ReadTextFromFile("https://sethdiscordbot.000webhostapp.com/Storage/Discord%20Bot/StartupMessage");
foreach (var t in text) Console_Utilities.WriteColorText(t);
}
catch { Console.WriteLine("Failed to connect to server."); }
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("============================ Discord BOT - Cross Platform ============================");
string token = Functions.readCodeFromFile(Functions.dataFolder + "DiscordBotCore.data", "BOT_TOKEN", '=');
@@ -449,23 +455,22 @@ namespace DiscordBot
private static async Task HandleInput(string[] args)
{
if (args.Length > 0)
if (args[0] == "progress")
{
Console_Utilities.ProgressBar bar = new Console_Utilities.ProgressBar(100, "Download");
for (int i = 0; i <= 100; i++)
{
bar.Update(i);
await Task.Delay(10);
}
return;
}
else if (args[0] == "test")
{
return;
}
/* if (args.Length > 0)
if (args[0] == "progress")
{
Console_Utilities.ProgressBar bar = new Console_Utilities.ProgressBar(100, "Download");
for (int i = 0; i <= 100; i++)
{
bar.Update(i);
await Task.Delay(10);
}
return;
}
else if (args[0] == "test")
{
return;
}*/
if (args.Length == 0)
{
@@ -498,7 +503,7 @@ namespace DiscordBot
return;
}
if (len > 0 && (args.Contains("--cmd") || args.Contains("--args")))
if (len > 0 && (args.Contains("--cmd") || args.Contains("--args") || args.Contains("--nomessage")))
{
if (args.Contains("lp") || args.Contains("loadplugins"))
loadPluginsOnStartup = true;
@@ -506,12 +511,14 @@ namespace DiscordBot
listPluginsAtStartup = true;
if (args.Contains("listlang"))
listLanguagAtStartup = true;
if (args.Contains("--nomessage"))
ShowStartupMessage = false;
len = 0;
}
if (len == 0 || args[0] != "--exec" && args[0] != "--execute")
{
Boot b = await StartNoGUI();