logserver now shows image uploads

This commit is contained in:
Master Kwoth 2016-05-30 19:47:35 +02:00
parent 7aca34a1fc
commit 55a056d96f

View File

@ -166,9 +166,19 @@ namespace NadekoBot.Modules.Administration.Commands
Channel ch;
if (!logs.TryGetValue(e.Server, out ch) || e.Channel == ch)
return;
if (!string.IsNullOrWhiteSpace(e.Message.Text))
{
await ch.SendMessage(
$@"🕔`{prettyCurrentTime}` **New Message** `#{e.Channel.Name}`
👤`{e.User?.ToString() ?? ("NULL")}` {e.Message.Text.Unmention()}").ConfigureAwait(false);
}
else
{
await ch.SendMessage(
$@"🕔`{prettyCurrentTime}` **File Uploaded** `#{e.Channel.Name}`
👤`{e.User?.ToString() ?? ("NULL")}` {e.Message.Attachments.FirstOrDefault()?.ProxyUrl}").ConfigureAwait(false);
}
}
catch { }
}
@ -181,10 +191,19 @@ $@"🕔`{prettyCurrentTime}` **New Message** `#{e.Channel.Name}`
Channel ch;
if (!logs.TryGetValue(e.Server, out ch) || e.Channel == ch)
return;
if (!string.IsNullOrWhiteSpace(e.Message.Text))
{
await ch.SendMessage(
$@"🕔`{prettyCurrentTime}` **Message** 🚮 `#{e.Channel.Name}`
👤`{e.User?.ToString() ?? ("NULL")}` {e.Message.Text.Unmention()}").ConfigureAwait(false);
}
else
{
await ch.SendMessage(
$@"🕔`{prettyCurrentTime}` **File Deleted** `#{e.Channel.Name}`
👤`{e.User?.ToString() ?? ("NULL")}` {e.Message.Attachments.FirstOrDefault()?.ProxyUrl}").ConfigureAwait(false);
}
}
catch { }
}
private async void MsgUpdtd(object sender, MessageUpdatedEventArgs e)