mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
Added ban reason to .log userbanned (and if you used nadeko to ban someone, it will also show the mod who did the ban because nadeko adds it to the reason)
This commit is contained in:
@@ -945,11 +945,25 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor
|
||||
ITextChannel? logChannel;
|
||||
if ((logChannel = await TryGetLogChannel(guild, logSetting, LogType.UserBanned)) == null)
|
||||
return;
|
||||
|
||||
|
||||
string? reason = null;
|
||||
try
|
||||
{
|
||||
var ban = await guild.GetBanAsync(usr);
|
||||
reason = ban?.Reason;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
var embed = _eb.Create()
|
||||
.WithOkColor()
|
||||
.WithTitle("🚫 " + GetText(logChannel.Guild, strs.user_banned))
|
||||
.WithDescription(usr.ToString()!)
|
||||
.AddField("Id", usr.Id.ToString())
|
||||
.AddField("Reason", string.IsNullOrWhiteSpace(reason) ? "-" : reason)
|
||||
.WithFooter(CurrentTime(guild));
|
||||
|
||||
var avatarUrl = usr.GetAvatarUrl();
|
||||
|
Reference in New Issue
Block a user