diff --git a/.idea/.idea.SethDiscordBot/.idea/.gitignore b/.idea/.idea.SethDiscordBot/.idea/.gitignore new file mode 100644 index 0000000..7fa1cfe --- /dev/null +++ b/.idea/.idea.SethDiscordBot/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/projectSettingsUpdater.xml +/contentModel.xml +/.idea.SethDiscordBot.iml +/modules.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.SethDiscordBot/.idea/.name b/.idea/.idea.SethDiscordBot/.idea/.name new file mode 100644 index 0000000..ac07819 --- /dev/null +++ b/.idea/.idea.SethDiscordBot/.idea/.name @@ -0,0 +1 @@ +SethDiscordBot \ No newline at end of file diff --git a/.idea/.idea.SethDiscordBot/.idea/encodings.xml b/.idea/.idea.SethDiscordBot/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.SethDiscordBot/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.SethDiscordBot/.idea/indexLayout.xml b/.idea/.idea.SethDiscordBot/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.SethDiscordBot/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.SethDiscordBot/.idea/vcs.xml b/.idea/.idea.SethDiscordBot/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.SethDiscordBot/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BUILDS/net6.0/CMD_Utils.dll b/BUILDS/net6.0/CMD_Utils.dll index d30bcd7..d0b729a 100644 Binary files a/BUILDS/net6.0/CMD_Utils.dll and b/BUILDS/net6.0/CMD_Utils.dll differ diff --git a/BUILDS/net6.0/Music Commands.dll b/BUILDS/net6.0/Music Commands.dll index 509f1db..2341731 100644 Binary files a/BUILDS/net6.0/Music Commands.dll and b/BUILDS/net6.0/Music Commands.dll differ diff --git a/BUILDS/net6.0/PluginManager.dll b/BUILDS/net6.0/PluginManager.dll index 9671e1e..b035aeb 100644 Binary files a/BUILDS/net6.0/PluginManager.dll and b/BUILDS/net6.0/PluginManager.dll differ diff --git a/CMD_LevelingSystem/Level.cs b/CMD_LevelingSystem/Level.cs index e11fd3f..ba66498 100644 --- a/CMD_LevelingSystem/Level.cs +++ b/CMD_LevelingSystem/Level.cs @@ -11,6 +11,8 @@ internal class Level : DBCommand { public string Command => "level"; + public List Aliases => new() { "lvl" }; + public string Description => "Display tour current level"; public string Usage => "level"; diff --git a/CMD_Utils/Echo.cs b/CMD_Utils/Echo.cs index 83ec899..68e5ab2 100644 --- a/CMD_Utils/Echo.cs +++ b/CMD_Utils/Echo.cs @@ -1,11 +1,14 @@ using Discord.Commands; using Discord.WebSocket; using PluginManager.Interfaces; +using System.Collections.Generic; internal class Echo : DBCommand { public string Command => "echo"; + public List Aliases => null; + public string Description => "Replay with the same message"; public string Usage => "echo [message]"; diff --git a/CMD_Utils/FlipCoin.cs b/CMD_Utils/FlipCoin.cs index 0057f33..2ec361e 100644 --- a/CMD_Utils/FlipCoin.cs +++ b/CMD_Utils/FlipCoin.cs @@ -1,6 +1,7 @@ using Discord.Commands; using Discord.WebSocket; using PluginManager.Interfaces; +using System.Collections.Generic; namespace CMD_Utils; @@ -8,6 +9,8 @@ internal class FlipCoin : DBCommand { public string Command => "flip"; + public List Aliases => null; + public string Description => "Flip a coin"; public string Usage => "flip"; diff --git a/CMD_Utils/Poll.cs b/CMD_Utils/Poll.cs index c3624c6..3093e8b 100644 --- a/CMD_Utils/Poll.cs +++ b/CMD_Utils/Poll.cs @@ -11,6 +11,8 @@ public class Poll : DBCommand { public string Command => "poll"; + public List Aliases => null; + public string Description => "Create a poll with options"; public string Usage => "poll [This-is-question] [This-is-answer-1] [This-is-answer-2] ... "; diff --git a/CMD_Utils/Random.cs b/CMD_Utils/Random.cs index 7a93e0d..b69fc04 100644 --- a/CMD_Utils/Random.cs +++ b/CMD_Utils/Random.cs @@ -1,4 +1,5 @@ -using Discord.Commands; +using System.Collections.Generic; +using Discord.Commands; using Discord.WebSocket; using PluginManager.Interfaces; @@ -6,6 +7,8 @@ public class Random : DBCommand { public string Command => "random"; + public List Aliases => new() { "rnd" }; + public string Description => "random number between number1 and number2"; public string Usage => "random [number1] [number2]"; diff --git a/DiscordBot/Discord/Commands/Help.cs b/DiscordBot/Discord/Commands/Help.cs index 11fb0f9..570dd05 100644 --- a/DiscordBot/Discord/Commands/Help.cs +++ b/DiscordBot/Discord/Commands/Help.cs @@ -1,4 +1,6 @@ -using Discord; +using System.Collections.Generic; +using System.Linq; +using Discord; using Discord.Commands; using Discord.WebSocket; using PluginManager.Interfaces; @@ -17,15 +19,17 @@ internal class Help : DBCommand /// public string Command => "help"; + public List Aliases => null; + /// /// Command Description /// - public string Description => "This command allows you to check all loadded commands"; + public string Description => "This command allows you to check all loaded commands"; /// /// Command usage /// - public string Usage => "help"; + public string Usage => "help "; /// /// Check if the command can be used /> @@ -57,10 +61,10 @@ internal class Help : DBCommand foreach (var item in args) { var e = GenerateHelpCommand(item); - if (e != null) - context.Channel.SendMessageAsync(embed: e.Build()); - else + if (e is null) context.Channel.SendMessageAsync("Unknown Command " + item); + else + context.Channel.SendMessageAsync(embed: e.Build()); } return; @@ -74,10 +78,12 @@ internal class Help : DBCommand foreach (var cmd in PluginLoader.Commands!) { - if (cmd.canUseDM) DMCommands += cmd.Command + " "; + if (cmd.canUseDM) + DMCommands += cmd.Command + " "; if (cmd.requireAdmin) - adminCommands += cmd.Command + " "; - else if (cmd.canUseServer) normalCommands += cmd.Command + " "; + adminCommands += cmd.Command + " "; + if (cmd.canUseServer) + normalCommands += cmd.Command + " "; } embedBuilder.AddField("Admin Commands", adminCommands); @@ -89,11 +95,14 @@ internal class Help : DBCommand private EmbedBuilder GenerateHelpCommand(string command) { var embedBuilder = new EmbedBuilder(); - var cmd = PluginLoader.Commands.Find(p => p.Command == command); + var cmd = PluginLoader.Commands!.Find(p => p.Command == command || (p.Aliases is not null && p.Aliases.Contains(command))); if (cmd == null) return null; embedBuilder.AddField("Usage", cmd.Usage); embedBuilder.AddField("Description", cmd.Description); + if (cmd.Aliases is null) + return embedBuilder; + embedBuilder.AddField("Alias", cmd.Aliases.Count == 0 ? "-" : string.Join(", ", cmd.Aliases)); return embedBuilder; } diff --git a/DiscordBot/Discord/Commands/Restart.cs b/DiscordBot/Discord/Commands/Restart.cs index a567783..d9a7019 100644 --- a/DiscordBot/Discord/Commands/Restart.cs +++ b/DiscordBot/Discord/Commands/Restart.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using Discord.WebSocket; using PluginManager.Interfaces; @@ -17,6 +18,8 @@ internal class Restart : DBCommand /// public string Command => "restart"; + public List Aliases => null; + /// /// Command Description /// diff --git a/DiscordBot/Discord/Commands/Settings.cs b/DiscordBot/Discord/Commands/Settings.cs index 044a2fd..866a91f 100644 --- a/DiscordBot/Discord/Commands/Settings.cs +++ b/DiscordBot/Discord/Commands/Settings.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Discord; using Discord.Commands; using Discord.WebSocket; @@ -14,6 +15,8 @@ internal class Settings : DBCommand /// public string Command => "set"; + public List Aliases => null; + /// /// Command Description /// diff --git a/DiscordBot/Discord/Core/Boot.cs b/DiscordBot/Discord/Core/Boot.cs index 2c6e9f7..e32a198 100644 --- a/DiscordBot/Discord/Core/Boot.cs +++ b/DiscordBot/Discord/Core/Boot.cs @@ -60,7 +60,9 @@ internal class Boot /// Task public async Task Awake() { - client = new DiscordSocketClient(); + DiscordSocketConfig config = new DiscordSocketConfig { AlwaysDownloadUsers = true }; + + client = new DiscordSocketClient(config); service = new CommandService(); CommonTasks(); diff --git a/DiscordBot/Discord/Core/CommandHandler.cs b/DiscordBot/Discord/Core/CommandHandler.cs index 3a87dbc..c89d84b 100644 --- a/DiscordBot/Discord/Core/CommandHandler.cs +++ b/DiscordBot/Discord/Core/CommandHandler.cs @@ -47,13 +47,16 @@ internal class CommandHandler { try { - if (Message as SocketUserMessage == null) return; + if (Message as SocketUserMessage == null) + return; var message = Message as SocketUserMessage; - if (message == null) return; + if (message == null) + return; - if (!message.Content.StartsWith(botPrefix)) return; + if (!message.Content.StartsWith(botPrefix)) + return; var argPos = 0; @@ -63,17 +66,14 @@ internal class CommandHandler return; } - if (message.Author.IsBot) return; + if (message.Author.IsBot) + return; var context = new SocketCommandContext(client, message); - await commandService.ExecuteAsync( - context, - argPos, - null - ); + await commandService.ExecuteAsync(context, argPos, null); - var plugin = PluginLoader.Commands!.Where(p => p.Command == message.Content.Split(' ')[0].Substring(botPrefix.Length)).FirstOrDefault(); + var plugin = PluginLoader.Commands!.Where(p => p.Command == message.Content.Split(' ')[0].Substring(botPrefix.Length) || (p.Aliases is not null && p.Aliases.Contains(message.Content.Split(' ')[0].Substring(botPrefix.Length)))).FirstOrDefault(); if (plugin != null) diff --git a/DiscordBot/DiscordBot.csproj b/DiscordBot/DiscordBot.csproj index da11f94..fdfaf9e 100644 --- a/DiscordBot/DiscordBot.csproj +++ b/DiscordBot/DiscordBot.csproj @@ -8,7 +8,7 @@ False True - 1.0.0.1 + 1.0.0.2 diff --git a/DiscordBot/Program.cs b/DiscordBot/Program.cs index 94bac8c..7a72639 100644 --- a/DiscordBot/Program.cs +++ b/DiscordBot/Program.cs @@ -34,6 +34,38 @@ public class Program Directory.CreateDirectory("./Data/Plugins/Events"); PreLoadComponents().Wait(); + if (!Config.ContainsKey("ServerID")) + { + do + { + Console.Clear(); + Console.WriteLine("Please enter the server ID: "); + Console_Utilities.WriteColorText("You can find it in the Server Settings at &r\"Widget\"&c section"); + Console.WriteLine("Example: 1234567890123456789"); + + Console.WriteLine("This is not required, but is recommended. If you refuse to provide the ID, just press enter.\nThe server id is required to make easier for the bot to interact with the server.\nRemember: this bot is for one server ONLY."); + Console.Write("User Input > "); + ConsoleKeyInfo key = Console.ReadKey(); + if (key.Key == ConsoleKey.Enter) + Config.AddValueToVariables("ServerID", "null", false); + else + { + string SID = key.KeyChar + Console.ReadLine(); + if (SID.Length != 18) + { + Console.WriteLine("Your server ID is not 18 characters long. Please try again."); + continue; + } + + + Config.AddValueToVariables("ServerID", SID, false); + + } + break; + } while (true); + + } + if (!Config.ContainsKey("token") || Config.GetValue("token") == null || Config.GetValue("token")?.Length != 70) { Console.WriteLine("Please insert your token"); @@ -75,9 +107,13 @@ public class Program private static void NoGUI(Boot discordbooter) { var consoleCommandsHandler = new ConsoleCommandsHandler(discordbooter.client); +#if DEBUG + Console.WriteLine(); + consoleCommandsHandler.HandleCommand("lp"); +#else if (loadPluginsOnStartup) consoleCommandsHandler.HandleCommand("lp"); if (listPluginsAtStartup) consoleCommandsHandler.HandleCommand("listplugs"); - +#endif Config.SaveConfig(); while (true) @@ -264,9 +300,9 @@ public class Program Config.PluginConfig.Load(); if (!Config.ContainsKey("Version")) - Config.AddValueToVariables("Version", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(), false); + Config.AddValueToVariables("Version", Assembly.GetExecutingAssembly().GetName().Version.ToString(), false); else - Config.SetValue("Version", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); + Config.SetValue("Version", Assembly.GetExecutingAssembly().GetName().Version.ToString()); foreach (var key in OnlineDefaultKeys) { @@ -311,7 +347,7 @@ public class Program Console.WriteLine("\n\n"); await Task.Delay(1000); - int waitTime = 20; //wait time to proceed + int waitTime = 10; //wait time to proceed Console.Write($"The bot will start in {waitTime} seconds"); while (waitTime > 0) diff --git a/MusicCommands/Leave.cs b/MusicCommands/Leave.cs index 3ee6975..79979e8 100644 --- a/MusicCommands/Leave.cs +++ b/MusicCommands/Leave.cs @@ -1,4 +1,5 @@ -using Discord.Commands; +using System.Collections.Generic; +using Discord.Commands; using Discord.WebSocket; using PluginManager.Interfaces; @@ -8,6 +9,8 @@ internal class Leave : DBCommand { public string Command => "leave"; + public List Aliases => null; + public string Description => "Leave the voice channel"; public string Usage => "leave"; diff --git a/MusicCommands/MusicPlayer.cs b/MusicCommands/MusicPlayer.cs index 5b5ae17..e1c974a 100644 --- a/MusicCommands/MusicPlayer.cs +++ b/MusicCommands/MusicPlayer.cs @@ -5,7 +5,8 @@ namespace MusicCommands; internal class MusicPlayer { - private Stream outputStream { get; } + private Stream outputStream { get; } + internal AudioFile NowPlaying = null; internal bool isPlaying, isPaused; @@ -14,9 +15,10 @@ internal class MusicPlayer outputStream = outputChannel; } - public async Task Play(Stream source, int byteSize) + public async Task Play(Stream source, int byteSize, AudioFile songPlaying) { - isPlaying = true; + isPlaying = true; + NowPlaying = songPlaying; while (isPlaying) { if (isPaused) diff --git a/MusicCommands/Pause.cs b/MusicCommands/Pause.cs index 5b16b37..065a02a 100644 --- a/MusicCommands/Pause.cs +++ b/MusicCommands/Pause.cs @@ -1,4 +1,5 @@ -using Discord.Commands; +using System.Collections.Generic; +using Discord.Commands; using Discord.WebSocket; using PluginManager.Interfaces; @@ -8,6 +9,8 @@ internal class Pause : DBCommand { public string Command => "pause"; + public List Aliases => null; + public string Description => "Pause/Unpause the music that is currently running"; public string Usage => "pause"; diff --git a/MusicCommands/Play.cs b/MusicCommands/Play.cs index 68333b9..9b46e7f 100644 --- a/MusicCommands/Play.cs +++ b/MusicCommands/Play.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using Discord; @@ -14,6 +15,8 @@ internal class Play : DBCommand { public string Command => "play"; + public List Aliases => new() { "p" }; + public string Description => "Play music from a file"; public string Usage => "play [name/url]"; @@ -69,11 +72,11 @@ internal class Play : DBCommand if (Data.MusicPlayer is not null) { - await context.Channel.SendMessageAsync("Enqueued your request"); + await context.Channel.SendMessageAsync("Queued your request: " + splitted.MergeStrings(1)); return; } } - while (false); + while (false); // run only one time ! Data.voiceChannel = (context.User as IGuildUser)?.VoiceChannel; @@ -93,15 +96,14 @@ internal class Play : DBCommand using (var discordChanneAudioOutStream = Data.audioClient.CreatePCMStream(AudioApplication.Mixed)) { - if (Data.MusicPlayer is null) - Data.MusicPlayer = new MusicPlayer(discordChanneAudioOutStream); + Data.MusicPlayer ??= new MusicPlayer(discordChanneAudioOutStream); while (Data.Playlist.Count > 0) { var nowPlaying = Data.Playlist.GetNextSong; using (var ffmpeg = CreateStream(nowPlaying.Name)) using (var ffmpegOutputBaseStream = ffmpeg.StandardOutput.BaseStream) { - await Data.MusicPlayer.Play(ffmpegOutputBaseStream, 1024); + await Data.MusicPlayer.Play(ffmpegOutputBaseStream, 1024, nowPlaying); Console.WriteLine("Finished playing from " + nowPlaying.Url); } } @@ -110,7 +112,7 @@ internal class Play : DBCommand } } - private Process CreateStream(string path) + private static Process CreateStream(string path) { return Process.Start(new ProcessStartInfo { FileName = "ffmpeg", Arguments = $"-hide_banner -loglevel panic -i \"{path}\" -ac 2 -f s16le -ar 48000 pipe:1", UseShellExecute = false, RedirectStandardOutput = true }); } diff --git a/MusicCommands/Skip.cs b/MusicCommands/Skip.cs index 583363c..0ca23b3 100644 --- a/MusicCommands/Skip.cs +++ b/MusicCommands/Skip.cs @@ -13,6 +13,8 @@ namespace MusicCommands { public string Command => "skip"; + public List Aliases => null; + public string Description => "skip the music that is currently running"; public string Usage => "skip"; @@ -25,7 +27,16 @@ namespace MusicCommands public void Execute(SocketCommandContext context, SocketMessage message, DiscordSocketClient client, bool isDM) { + var loadedSong = Data.MusicPlayer.NowPlaying; + + if (loadedSong is null || Data.MusicPlayer.isPlaying == false) + { + message.Channel.SendMessageAsync("There is no music playing"); + return; + } + Data.MusicPlayer.isPlaying = false; + message.Channel.SendMessageAsync($"You have skipped {loadedSong.Name}"); } } } diff --git a/MusicCommands/queue.cs b/MusicCommands/queue.cs index a6c762d..d918f30 100644 --- a/MusicCommands/queue.cs +++ b/MusicCommands/queue.cs @@ -11,7 +11,8 @@ namespace MusicCommands { public class queue : DBCommand { - public string Command => "queue"; + public string Command => "queue"; + public List Aliases => new() { "q" }; public string Description => "check queue"; diff --git a/PluginManager/Config.cs b/PluginManager/Config.cs index f20434a..644b085 100644 --- a/PluginManager/Config.cs +++ b/PluginManager/Config.cs @@ -67,9 +67,9 @@ namespace PluginManager public static PluginType GetPluginType(string pluginName) { foreach (var tuple in InstalledPlugins) - { - if (tuple.Item1 == pluginName) return tuple.Item2; - } + if (tuple.Item1 == pluginName) + return tuple.Item2; + return PluginType.Unknown; } diff --git a/PluginManager/Interfaces/DBCommand.cs b/PluginManager/Interfaces/DBCommand.cs index 4095427..7dc759d 100644 --- a/PluginManager/Interfaces/DBCommand.cs +++ b/PluginManager/Interfaces/DBCommand.cs @@ -1,4 +1,5 @@ -using Discord.Commands; +using System.Collections.Generic; +using Discord.Commands; using Discord.WebSocket; namespace PluginManager.Interfaces; @@ -11,6 +12,11 @@ public interface DBCommand /// string Command { get; } + /// + /// Command aliases. Users may use this to execute the command + /// + List? Aliases { get; } + /// /// Command description /// @@ -44,8 +50,5 @@ public interface DBCommand /// The message that the user types /// The discord client of the bot /// true if the message was sent from DM, otherwise false. It is always false if canUseDM is false - void Execute(SocketCommandContext context, - SocketMessage message, - DiscordSocketClient client, - bool isDM); + void Execute(SocketCommandContext context, SocketMessage message, DiscordSocketClient client, bool isDM); } diff --git a/PluginManager/Items/Command.cs b/PluginManager/Items/Command.cs index 22cd36a..d6b4ded 100644 --- a/PluginManager/Items/Command.cs +++ b/PluginManager/Items/Command.cs @@ -44,8 +44,8 @@ public class Command public class ConsoleCommand { - public string CommandName { get; set; } - public string Description { get; set; } - public string Usage { get; set; } - public Action Action { get; set; } + public string CommandName { get; init; } + public string Description { get; init; } + public string Usage { get; init; } + public Action Action { get; init; } } \ No newline at end of file diff --git a/PluginManager/Items/ConsoleCommandsHandler.cs b/PluginManager/Items/ConsoleCommandsHandler.cs index 351d295..bf08bae 100644 --- a/PluginManager/Items/ConsoleCommandsHandler.cs +++ b/PluginManager/Items/ConsoleCommandsHandler.cs @@ -233,15 +233,15 @@ public class ConsoleCommandsHandler } ); - AddCommand("sd", "Shuts down the discord bot", async () => + AddCommand("sd", "Shuts down the discord bot", () => { if (client is null) return; - await client.StopAsync(); - await client.DisposeAsync(); + client.StopAsync(); + client.DisposeAsync(); Config.SaveConfig(); Console.WriteLine("Bot is closing in 2 seconds ! Please wait to save data !"); - await Task.Delay(2000); + Thread.Sleep(2000); Environment.Exit(0); } ); @@ -268,7 +268,7 @@ public class ConsoleCommandsHandler public static bool CommandExists(string command) { - return !(GetCommand(command) is null); + return GetCommand(command) is not null; } public static ConsoleCommand? GetCommand(string command) diff --git a/PluginManager/Others/Functions.cs b/PluginManager/Others/Functions.cs index 360b7c8..35d29c5 100644 --- a/PluginManager/Others/Functions.cs +++ b/PluginManager/Others/Functions.cs @@ -57,7 +57,7 @@ namespace PluginManager.Others if (!File.Exists(archFile)) throw new FileNotFoundException("Failed to load file !"); using ZipArchive archive = ZipFile.OpenRead(archFile); - ZipArchiveEntry? entry = archive.GetEntry(FileName); + ZipArchiveEntry? entry = archive.GetEntry(FileName); return entry?.Open(); } @@ -91,8 +91,8 @@ namespace PluginManager.Others /// A string built based on the array public static string MergeStrings(this string[] s, int indexToStart) { - string r = ""; - int len = s.Length; + string r = ""; + int len = s.Length; if (len <= indexToStart) return ""; for (int i = indexToStart; i < len - 1; ++i) { @@ -142,9 +142,9 @@ namespace PluginManager.Others if (!stream.CanRead) throw new InvalidOperationException("The stream is not readable."); if (!destination.CanWrite) throw new ArgumentException("Destination stream is not writable", nameof(destination)); - byte[] buffer = new byte[bufferSize]; - long totalBytesRead = 0; - int bytesRead; + byte[] buffer = new byte[bufferSize]; + long totalBytesRead = 0; + int bytesRead; while ((bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false)) != 0) { await destination.WriteAsync(buffer, 0, bytesRead, cancellationToken).ConfigureAwait(false); @@ -171,11 +171,11 @@ namespace PluginManager.Others { if (type == UnzipProgressType.PercentageFromNumberOfFiles) { - int totalZIPFiles = archive.Entries.Count(); + int totalZIPFiles = archive.Entries.Count(); int currentZIPFile = 0; foreach (ZipArchiveEntry entry in archive.Entries) { - if (entry.FullName.EndsWith("/")) + if (entry.FullName.EndsWith("/")) // it is a folder Directory.CreateDirectory(Path.Combine(folder, entry.FullName)); else @@ -335,7 +335,7 @@ namespace PluginManager.Others using (MD5 md5 = MD5.Create()) { byte[] inputBytes = Encoding.ASCII.GetBytes(input); - byte[] hashBytes = md5.ComputeHash(inputBytes); + byte[] hashBytes = md5.ComputeHash(inputBytes); return Convert.ToHexString(hashBytes); } } diff --git a/SethDiscordBot.sln b/SethDiscordBot.sln index bccffb6..9fa99c8 100644 --- a/SethDiscordBot.sln +++ b/SethDiscordBot.sln @@ -21,6 +21,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EVE_LevelingSystem", "EVE_L EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMD_LevelingSystem", "CMD_LevelingSystem\CMD_LevelingSystem.csproj", "{1A4E49FF-9A0A-4C54-AF35-CFFBA64353D9}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Roles", "Roles\Roles.csproj", "{954F2AA9-6624-4554-946D-0F17B84487C3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -51,6 +53,10 @@ Global {1A4E49FF-9A0A-4C54-AF35-CFFBA64353D9}.Debug|Any CPU.Build.0 = Debug|Any CPU {1A4E49FF-9A0A-4C54-AF35-CFFBA64353D9}.Release|Any CPU.ActiveCfg = Release|Any CPU {1A4E49FF-9A0A-4C54-AF35-CFFBA64353D9}.Release|Any CPU.Build.0 = Release|Any CPU + {954F2AA9-6624-4554-946D-0F17B84487C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {954F2AA9-6624-4554-946D-0F17B84487C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {954F2AA9-6624-4554-946D-0F17B84487C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {954F2AA9-6624-4554-946D-0F17B84487C3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -62,6 +68,7 @@ Global {B1B4976E-5112-4217-B57B-3A03C5207B6E} = {449FA364-0B72-43FF-B3A3-806E2916200E} {EEC445DC-0C4B-43EA-8694-606BA0390B77} = {A290C028-77C4-4D1D-AB43-DDFE6ABD9012} {1A4E49FF-9A0A-4C54-AF35-CFFBA64353D9} = {449FA364-0B72-43FF-B3A3-806E2916200E} + {954F2AA9-6624-4554-946D-0F17B84487C3} = {449FA364-0B72-43FF-B3A3-806E2916200E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3FB3C5DE-ED21-4D2E-ABDD-3A00EE4A2FFF}