feat: guild ban add/remove logging, store banned systems in database
This commit is contained in:
parent
ca99bdfb94
commit
8e030acaf3
12 changed files with 227 additions and 36 deletions
|
|
@ -150,15 +150,19 @@ public static class DiscordExtensions
|
|||
return filterByIds != null ? sorted.Where(r => filterByIds.Contains(r.ID)) : sorted;
|
||||
}
|
||||
|
||||
public static async Task<string> TryFormatModeratorAsync(
|
||||
public static async Task<string> TryFormatUserAsync(
|
||||
this UserCache userCache,
|
||||
AuditLogCache.ActionData actionData
|
||||
Snowflake userId,
|
||||
bool addMention = true
|
||||
)
|
||||
{
|
||||
var moderator = await userCache.GetUserAsync(actionData.ModeratorId);
|
||||
return moderator != null
|
||||
? $"{moderator.Tag()} <@{moderator.ID}>"
|
||||
: $"*(unknown user {actionData.ModeratorId}) <@{actionData.ModeratorId}>*";
|
||||
var user = await userCache.GetUserAsync(userId);
|
||||
if (addMention)
|
||||
return user != null
|
||||
? $"{user.Tag()} <@{user.ID}>"
|
||||
: $"*(unknown user {userId}) <@{userId}>*";
|
||||
|
||||
return user != null ? user.Tag() : $"*(unknown user {userId})*";
|
||||
}
|
||||
|
||||
public static int TextLength(this IEmbed embed)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue