Skip to content

Commit

Permalink
Improved versioning, Removed 'every' keyword in reminders
Browse files Browse the repository at this point in the history
  • Loading branch information
Veld committed Apr 20, 2019
1 parent 14a40ba commit 4271dbc
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 0 additions & 2 deletions Miki/Global.cs
Expand Up @@ -58,8 +58,6 @@ public static AmazonS3Client CdnClient
}
}

public const string Version = "2019.1";

private static Config config = null;
private static AmazonS3Client cdnClient;
}
Expand Down
1 change: 1 addition & 0 deletions Miki/Miki.csproj
Expand Up @@ -49,6 +49,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\MiScript\src\MiScript\MiScript.csproj" />
<ProjectReference Include="..\Miki.Api\Miki.Api.csproj" />
<ProjectReference Include="..\Miki.Bot.Models\Miki.Bot.Models.csproj" />
<ProjectReference Include="..\Miki.Framework\Miki.Framework\Miki.Framework.csproj" />
Expand Down
10 changes: 10 additions & 0 deletions Miki/Miki.sln
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
17 changes: 3 additions & 14 deletions Miki/Modules/FunModule.cs
Expand Up @@ -530,26 +530,15 @@ 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)
{
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()
Expand All @@ -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);
}
Expand Down
10 changes: 6 additions & 4 deletions Miki/Modules/GeneralModule.cs
Expand Up @@ -22,6 +22,7 @@
using Miki.Cache;
using Miki.Bot.Models;
using Miki.Dsl;
using System.Reflection;

namespace Miki.Modules
{
Expand Down Expand Up @@ -331,7 +332,7 @@ await helpListEmbed.ToEmbed()

EmbedBuilder embedBuilder = new EmbedBuilder();

foreach (Module m in e.EventSystem.GetCommandHandler<SimpleCommandHandler>().Modules.OrderBy(x => x.Name))
foreach (Miki.Framework.Events.Module m in e.EventSystem.GetCommandHandler<SimpleCommandHandler>().Modules.OrderBy(x => x.Name))
{
List<CommandEvent> events = m.Events
.Where(x => e.EventSystem.GetCommandHandler<SimpleCommandHandler>().GetUserAccessibility(e).Result >= x.Accessibility).ToList();
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 4271dbc

Please sign in to comment.