.prefix bugfix, #1524
This commit is contained in:
parent
919c81d385
commit
e5609a0708
@ -43,6 +43,7 @@ namespace NadekoBot.Services
|
|||||||
|
|
||||||
public event Func<IUserMessage, CommandInfo, Task> CommandExecuted = delegate { return Task.CompletedTask; };
|
public event Func<IUserMessage, CommandInfo, Task> CommandExecuted = delegate { return Task.CompletedTask; };
|
||||||
public event Func<CommandInfo, ITextChannel, string, Task> CommandErrored = delegate { return Task.CompletedTask; };
|
public event Func<CommandInfo, ITextChannel, string, Task> CommandErrored = delegate { return Task.CompletedTask; };
|
||||||
|
public event Func<IUserMessage, Task> OnMessageNoTrigger = delegate { return Task.CompletedTask; };
|
||||||
|
|
||||||
//userid/msg count
|
//userid/msg count
|
||||||
public ConcurrentDictionary<ulong, uint> UserMessagesSent { get; } = new ConcurrentDictionary<ulong, uint>();
|
public ConcurrentDictionary<ulong, uint> UserMessagesSent { get; } = new ConcurrentDictionary<ulong, uint>();
|
||||||
@ -261,7 +262,7 @@ namespace NadekoBot.Services
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var prefix = GetPrefix(guild?.Id);
|
var prefix = GetPrefix(guild?.Id);
|
||||||
var isPrefixCommand = messageContent == ".prefix";
|
var isPrefixCommand = messageContent.StartsWith(".prefix");
|
||||||
// execute the command and measure the time it took
|
// execute the command and measure the time it took
|
||||||
if (messageContent.StartsWith(prefix) || isPrefixCommand)
|
if (messageContent.StartsWith(prefix) || isPrefixCommand)
|
||||||
{
|
{
|
||||||
@ -280,7 +281,10 @@ namespace NadekoBot.Services
|
|||||||
if (guild != null)
|
if (guild != null)
|
||||||
await CommandErrored(result.Info, channel as ITextChannel, result.Error);
|
await CommandErrored(result.Info, channel as ITextChannel, result.Error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await OnMessageNoTrigger(usrMsg).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var svc in _services)
|
foreach (var svc in _services)
|
||||||
|
Loading…
Reference in New Issue
Block a user