logs now show user was banned. ref #114
This commit is contained in:
parent
bc301c1c49
commit
35a3cacc58
@ -22,6 +22,7 @@ namespace NadekoBot.Commands {
|
||||
NadekoBot.Client.MessageDeleted += MsgDltd;
|
||||
NadekoBot.Client.MessageUpdated += MsgUpdtd;
|
||||
NadekoBot.Client.UserUpdated += UsrUpdtd;
|
||||
NadekoBot.Client.UserBanned += UsrBanned;
|
||||
|
||||
|
||||
NadekoBot.Client.MessageReceived += async (s, e) => {
|
||||
@ -41,6 +42,15 @@ namespace NadekoBot.Commands {
|
||||
};
|
||||
}
|
||||
|
||||
private async void UsrBanned(object sender, UserEventArgs e) {
|
||||
try {
|
||||
Channel ch;
|
||||
if (!logs.TryGetValue(e.Server, out ch))
|
||||
return;
|
||||
await ch.SendMessage($"`User banned:` **{e.User.Name}** ({e.User.Id})");
|
||||
} catch { }
|
||||
}
|
||||
|
||||
public Func<CommandEventArgs, Task> DoFunc() => async e => {
|
||||
Channel ch;
|
||||
if (!logs.TryRemove(e.Server, out ch)) {
|
||||
|
@ -154,7 +154,7 @@ namespace NadekoBot.Commands {
|
||||
|
||||
private Func<CommandEventArgs, Task> TrackStream(StreamNotificationConfig.StreamType type) =>
|
||||
async e => {
|
||||
var username = e.GetArg("username");
|
||||
var username = e.GetArg("username")?.ToLowerInvariant();
|
||||
if (string.IsNullOrWhiteSpace(username))
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user