show trigger regex for profanity determent plugin
This commit is contained in:
@ -592,5 +592,22 @@ namespace SharedLibraryCore.Services
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// retrieves the number of time the given client id has been reported
|
||||
/// </summary>
|
||||
/// <param name="clientId">client id to search for report counts of</param>
|
||||
/// <returns></returns>
|
||||
public async Task<int> GetClientReportCount(int clientId)
|
||||
{
|
||||
using (var ctx = new DatabaseContext(true))
|
||||
{
|
||||
return await ctx.Penalties
|
||||
.Where(_penalty => _penalty.Active)
|
||||
.Where(_penalty => _penalty.OffenderId == clientId)
|
||||
.Where(_penalty => _penalty.Type == EFPenalty.PenaltyType.Report)
|
||||
.CountAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ namespace SharedLibraryCore.Services
|
||||
Expires = newEntity.Expires,
|
||||
Offense = newEntity.Offense,
|
||||
When = DateTime.UtcNow,
|
||||
AutomatedOffense = newEntity.AutomatedOffense,
|
||||
AutomatedOffense = newEntity.AutomatedOffense ?? newEntity.Punisher.AdministeredPenalties?.FirstOrDefault()?.AutomatedOffense,
|
||||
IsEvadedOffense = newEntity.IsEvadedOffense
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user