diff --git a/src/NadekoBot/Resources/ResponseStrings.Designer.cs b/src/NadekoBot/Resources/ResponseStrings.Designer.cs
index e13d8513..ce51f8f4 100644
--- a/src/NadekoBot/Resources/ResponseStrings.Designer.cs
+++ b/src/NadekoBot/Resources/ResponseStrings.Designer.cs
@@ -6053,7 +6053,7 @@ namespace NadekoBot.Resources {
}
///
- /// Looks up a localized string similar to Your discord account might not be connected to Patreon.. If you are unsure what that means, or don't know how to connect it - you have to go to [Patreon account settings page](https://patreon.com/settings/account) and click 'Connect to discord' button..
+ /// Looks up a localized string similar to Your discord account might not be connected to Patreon. If you are unsure what that means, or don't know how to connect it - you have to go to [Patreon account settings page](https://patreon.com/settings/account) and click 'Connect to discord' button..
///
public static string utility_clpa_fail_conn {
get {
diff --git a/src/NadekoBot/Resources/ResponseStrings.resx b/src/NadekoBot/Resources/ResponseStrings.resx
index 83d701f3..42a22f42 100644
--- a/src/NadekoBot/Resources/ResponseStrings.resx
+++ b/src/NadekoBot/Resources/ResponseStrings.resx
@@ -2379,7 +2379,7 @@ Owner ID: {2}
Already rewarded
- Your discord account might not be connected to Patreon.. If you are unsure what that means, or don't know how to connect it - you have to go to [Patreon account settings page](https://patreon.com/settings/account) and click 'Connect to discord' button.
+ Your discord account might not be connected to Patreon. If you are unsure what that means, or don't know how to connect it - you have to go to [Patreon account settings page](https://patreon.com/settings/account) and click 'Connect to discord' button.
Discord account not connected
diff --git a/src/NadekoBot/Services/CommandHandler.cs b/src/NadekoBot/Services/CommandHandler.cs
index 31f30932..f47e45d5 100644
--- a/src/NadekoBot/Services/CommandHandler.cs
+++ b/src/NadekoBot/Services/CommandHandler.cs
@@ -342,10 +342,22 @@ namespace NadekoBot.Services
ConcurrentDictionary maps;
if (Modules.Utility.Utility.CommandMapCommands.AliasMaps.TryGetValue(guild.Id, out maps))
{
- string newMessageContent;
- if (maps.TryGetValue(messageContent.Trim().ToLowerInvariant(), out newMessageContent))
+
+ var keys = maps.Keys
+ .OrderByDescending(x => x.Length);
+
+ var lowerMessageContent = messageContent.ToLowerInvariant();
+ foreach (var k in keys)
{
- _log.Info(@"--Mapping Command--
+ string newMessageContent;
+ if (lowerMessageContent.StartsWith(k + " "))
+ newMessageContent = maps[k] + messageContent.Substring(k.Length, messageContent.Length - k.Length);
+ else if (lowerMessageContent == k)
+ newMessageContent = maps[k];
+ else
+ continue;
+
+ _log.Info(@"--Mapping Command--
GuildId: {0}
Trigger: {1}
Mapping: {2}", guild.Id, messageContent, newMessageContent);
@@ -353,6 +365,7 @@ namespace NadekoBot.Services
messageContent = newMessageContent;
try { await usrMsg.Channel.SendConfirmAsync($"{oldMessageContent} => {newMessageContent}").ConfigureAwait(false); } catch { }
+ break;
}
}
}