fixed some logcommand errors
This commit is contained in:
parent
e10b19e533
commit
0e4ae5d1bb
@ -87,12 +87,12 @@ namespace NadekoBot.Modules.Administration.Commands
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (e.Server == null || e.Channel.IsPrivate || e.User.Id == NadekoBot.Client.CurrentUser.Id)
|
if (e.Server == null || e.Channel.IsPrivate || e.User?.Id == NadekoBot.Client.CurrentUser.Id)
|
||||||
return;
|
return;
|
||||||
Channel ch;
|
Channel ch;
|
||||||
if (!logs.TryGetValue(e.Server, out ch) || e.Channel == ch)
|
if (!logs.TryGetValue(e.Server, out ch) || e.Channel == ch)
|
||||||
return;
|
return;
|
||||||
await ch.SendMessage($"`Type:` **Message deleted** `Time:` **{DateTime.Now}** `Channel:` **{e.Channel.Name}**\n`{e.User}:` {e.Message.Text}").ConfigureAwait(false);
|
await ch.SendMessage($"`Type:` **Message deleted** `Time:` **{DateTime.Now}** `Channel:` **{e.Channel.Name}**\n`{e.User?.ToString() ?? ("NULL") }:` {e.Message.Text}").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
@ -100,12 +100,12 @@ namespace NadekoBot.Modules.Administration.Commands
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (e.Server == null || e.Channel.IsPrivate || e.User.Id == NadekoBot.Client.CurrentUser.Id)
|
if (e.Server == null || e.Channel.IsPrivate || e.User?.Id == NadekoBot.Client.CurrentUser.Id)
|
||||||
return;
|
return;
|
||||||
Channel ch;
|
Channel ch;
|
||||||
if (!logs.TryGetValue(e.Server, out ch) || e.Channel == ch)
|
if (!logs.TryGetValue(e.Server, out ch) || e.Channel == ch)
|
||||||
return;
|
return;
|
||||||
await ch.SendMessage($"`Type:` **Message updated** `Time:` **{DateTime.Now}** `Channel:` **{e.Channel.Name}**\n**BEFORE**: `{e.User}:` {e.Before.Text}\n---------------\n**AFTER**: `{e.User}:` {e.After.Text}").ConfigureAwait(false);
|
await ch.SendMessage($"`Type:` **Message updated** `Time:` **{DateTime.Now}** `Channel:` **{e.Channel.Name}**\n**BEFORE**: `{e.User?.ToString() ?? ("NULL")}:` {e.Before.Text}\n---------------\n**AFTER**: `{e.User}:` {e.After.Text}").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user