Merge pull request #18 from Kwoth/dev
Aliased commands now do take extra parameters while aliased
This commit is contained in:
commit
c214eb0faf
@ -6053,7 +6053,7 @@ namespace NadekoBot.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 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..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string utility_clpa_fail_conn {
|
public static string utility_clpa_fail_conn {
|
||||||
get {
|
get {
|
||||||
|
@ -2382,7 +2382,7 @@ Owner ID: {2}</value>
|
|||||||
<value>Already rewarded</value>
|
<value>Already rewarded</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="utility_clpa_fail_conn" xml:space="preserve">
|
<data name="utility_clpa_fail_conn" xml:space="preserve">
|
||||||
<value>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.</value>
|
<value>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.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="utility_clpa_fail_conn_title" xml:space="preserve">
|
<data name="utility_clpa_fail_conn_title" xml:space="preserve">
|
||||||
<value>Discord account not connected</value>
|
<value>Discord account not connected</value>
|
||||||
|
@ -342,9 +342,21 @@ namespace NadekoBot.Services
|
|||||||
ConcurrentDictionary<string, string> maps;
|
ConcurrentDictionary<string, string> maps;
|
||||||
if (Modules.Utility.Utility.CommandMapCommands.AliasMaps.TryGetValue(guild.Id, out 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)
|
||||||
{
|
{
|
||||||
|
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--
|
_log.Info(@"--Mapping Command--
|
||||||
GuildId: {0}
|
GuildId: {0}
|
||||||
Trigger: {1}
|
Trigger: {1}
|
||||||
@ -353,6 +365,7 @@ namespace NadekoBot.Services
|
|||||||
messageContent = newMessageContent;
|
messageContent = newMessageContent;
|
||||||
|
|
||||||
try { await usrMsg.Channel.SendConfirmAsync($"{oldMessageContent} => {newMessageContent}").ConfigureAwait(false); } catch { }
|
try { await usrMsg.Channel.SendConfirmAsync($"{oldMessageContent} => {newMessageContent}").ConfigureAwait(false); } catch { }
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user