logs now show user was banned. ref #114

This commit is contained in:
Master Kwoth 2016-03-23 04:11:02 +01:00
parent bc301c1c49
commit 35a3cacc58
2 changed files with 11 additions and 1 deletions

View File

@ -22,6 +22,7 @@ namespace NadekoBot.Commands {
NadekoBot.Client.MessageDeleted += MsgDltd; NadekoBot.Client.MessageDeleted += MsgDltd;
NadekoBot.Client.MessageUpdated += MsgUpdtd; NadekoBot.Client.MessageUpdated += MsgUpdtd;
NadekoBot.Client.UserUpdated += UsrUpdtd; NadekoBot.Client.UserUpdated += UsrUpdtd;
NadekoBot.Client.UserBanned += UsrBanned;
NadekoBot.Client.MessageReceived += async (s, e) => { 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 => { public Func<CommandEventArgs, Task> DoFunc() => async e => {
Channel ch; Channel ch;
if (!logs.TryRemove(e.Server, out ch)) { if (!logs.TryRemove(e.Server, out ch)) {

View File

@ -154,7 +154,7 @@ namespace NadekoBot.Commands {
private Func<CommandEventArgs, Task> TrackStream(StreamNotificationConfig.StreamType type) => private Func<CommandEventArgs, Task> TrackStream(StreamNotificationConfig.StreamType type) =>
async e => { async e => {
var username = e.GetArg("username"); var username = e.GetArg("username")?.ToLowerInvariant();
if (string.IsNullOrWhiteSpace(username)) if (string.IsNullOrWhiteSpace(username))
return; return;