From 4271dbc1a61cffcae269ab7d228888415b9ced2d Mon Sep 17 00:00:00 2001 From: Veld Date: Sat, 20 Apr 2019 18:45:22 +0200 Subject: [PATCH] Improved versioning, Removed 'every' keyword in reminders --- Miki/Global.cs | 2 -- Miki/Miki.csproj | 1 + Miki/Miki.sln | 10 ++++++++++ Miki/Modules/FunModule.cs | 17 +++-------------- Miki/Modules/GeneralModule.cs | 10 ++++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Miki/Global.cs b/Miki/Global.cs index 643ce8ef..630edb4a 100644 --- a/Miki/Global.cs +++ b/Miki/Global.cs @@ -58,8 +58,6 @@ public static AmazonS3Client CdnClient } } - public const string Version = "2019.1"; - private static Config config = null; private static AmazonS3Client cdnClient; } diff --git a/Miki/Miki.csproj b/Miki/Miki.csproj index 7477dc90..cf86b212 100644 --- a/Miki/Miki.csproj +++ b/Miki/Miki.csproj @@ -49,6 +49,7 @@ + diff --git a/Miki/Miki.sln b/Miki/Miki.sln index cd83ebc7..40bbac87 100644 --- a/Miki/Miki.sln +++ b/Miki/Miki.sln @@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Miki", "Miki.csproj", "{154 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Miki.Framework.Arguments", "..\Miki.Framework\Miki.Framework.Arguments\Miki.Framework.Arguments.csproj", "{09A3A767-E8C2-46AC-89C3-384F7495050B}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MiScript", "..\..\MiScript\src\MiScript\MiScript.csproj", "{77E6A25C-ECA5-4726-BB33-28408C985ABB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Production|Any CPU = Debug Production|Any CPU @@ -61,6 +63,14 @@ Global {09A3A767-E8C2-46AC-89C3-384F7495050B}.Prod|Any CPU.Build.0 = Debug|Any CPU {09A3A767-E8C2-46AC-89C3-384F7495050B}.Release|Any CPU.ActiveCfg = Release|Any CPU {09A3A767-E8C2-46AC-89C3-384F7495050B}.Release|Any CPU.Build.0 = Release|Any CPU + {77E6A25C-ECA5-4726-BB33-28408C985ABB}.Debug Production|Any CPU.ActiveCfg = Debug|Any CPU + {77E6A25C-ECA5-4726-BB33-28408C985ABB}.Debug Production|Any CPU.Build.0 = Debug|Any CPU + {77E6A25C-ECA5-4726-BB33-28408C985ABB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77E6A25C-ECA5-4726-BB33-28408C985ABB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77E6A25C-ECA5-4726-BB33-28408C985ABB}.Prod|Any CPU.ActiveCfg = Debug|Any CPU + {77E6A25C-ECA5-4726-BB33-28408C985ABB}.Prod|Any CPU.Build.0 = Debug|Any CPU + {77E6A25C-ECA5-4726-BB33-28408C985ABB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77E6A25C-ECA5-4726-BB33-28408C985ABB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Miki/Modules/FunModule.cs b/Miki/Modules/FunModule.cs index 26d399f2..a2de60f0 100644 --- a/Miki/Modules/FunModule.cs +++ b/Miki/Modules/FunModule.cs @@ -530,14 +530,8 @@ public async Task RemindAsync(ICommandContext e) private async Task PlaceReminderAsync(ICommandContext e, string args) { - int inIndex = args.ToLower().LastIndexOf(" in "); - int everyIndex = args.ToLower().LastIndexOf(" every "); - + int splitIndex = args.ToLower().LastIndexOf(" in "); // TODO: still a bit hacky - bool isIn = (inIndex > everyIndex); - bool repeated = false; - - int splitIndex = isIn ? inIndex : everyIndex; if (splitIndex == -1) { @@ -545,11 +539,6 @@ await e.ErrorEmbed(e.Locale.GetString("error_argument_null", "time")) .ToEmbed().QueueToChannelAsync(e.Channel); } - if (!isIn) - { - repeated = true; - } - string reminderText = new string(args .Take(splitIndex) .ToArray() @@ -567,11 +556,11 @@ await e.ErrorEmbed(e.Locale.GetString("error_argument_null", "time")) .AppendText(context) .BuildWithBlockCode()) .ToEmbed().QueueToChannelAsync(e.Author.GetDMChannelAsync().Result); - }, reminderText, timeUntilReminder, repeated); + }, reminderText, timeUntilReminder); await new EmbedBuilder() .SetTitle($"👌 {e.Locale.GetString("term_ok")}") - .SetDescription($"I'll remind you to **{reminderText}** {(repeated ? "every" : "in")} **{timeUntilReminder.ToTimeString(e.Locale)}**\nYour reminder code is `{id}`") + .SetDescription($"I'll remind you to **{reminderText}** in **{timeUntilReminder.ToTimeString(e.Locale)}**\nYour reminder code is `{id}`") .SetColor(255, 220, 93) .ToEmbed().QueueToChannelAsync(e.Channel); } diff --git a/Miki/Modules/GeneralModule.cs b/Miki/Modules/GeneralModule.cs index bb7c325c..4d081b1a 100644 --- a/Miki/Modules/GeneralModule.cs +++ b/Miki/Modules/GeneralModule.cs @@ -22,6 +22,7 @@ using Miki.Cache; using Miki.Bot.Models; using Miki.Dsl; +using System.Reflection; namespace Miki.Modules { @@ -331,7 +332,7 @@ await helpListEmbed.ToEmbed() EmbedBuilder embedBuilder = new EmbedBuilder(); - foreach (Module m in e.EventSystem.GetCommandHandler().Modules.OrderBy(x => x.Name)) + foreach (Miki.Framework.Events.Module m in e.EventSystem.GetCommandHandler().Modules.OrderBy(x => x.Name)) { List events = m.Events .Where(x => e.EventSystem.GetCommandHandler().GetUserAccessibility(e).Result >= x.Accessibility).ToList(); @@ -362,10 +363,11 @@ public async Task DonateAsync(CommandContext e) [Command(Name = "info", Aliases = new string[] { "about" })] public async Task InfoAsync(CommandContext e) { - EmbedBuilder embed = new EmbedBuilder(); + Version v = Assembly.GetEntryAssembly().GetName().Version; - embed.SetAuthor("Miki " + Global.Version, "", ""); - embed.Color = new Color(0.6f, 0.6f, 1.0f); + EmbedBuilder embed = new EmbedBuilder() + .SetAuthor($"Miki {v}") + .SetColor(0.6f, 0.6f, 1.0f); embed.AddField(e.Locale.GetString("miki_module_general_info_made_by_header"), e.Locale.GetString("miki_module_general_info_made_by_description") + " Fuzen, IA, Rappy, Tal, Vallode, GrammarJew");