mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Do not store rate limits for the GetRandomImage command unless a real key is specified
This commit is contained in:
@@ -151,7 +151,11 @@ public class GetRandomImage : ICommand
|
|||||||
await using var db = new ApplicationDbContext();
|
await using var db = new ApplicationDbContext();
|
||||||
var key = arguments["key"].Value.ToLower();
|
var key = arguments["key"].Value.ToLower();
|
||||||
var images = db.Images.Where(i => i.Key == key);
|
var images = db.Images.Where(i => i.Key == key);
|
||||||
if (!await images.AnyAsync(ctx)) return;
|
if (!await images.AnyAsync(ctx))
|
||||||
|
{
|
||||||
|
RateLimitService.RemoveMostRecentEntry(user, this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
var settings = await SettingsProvider.GetMultipleValuesAsync([
|
var settings = await SettingsProvider.GetMultipleValuesAsync([
|
||||||
BuiltIn.Keys.BotImageRandomSliceDivideBy, BuiltIn.Keys.BotImagePigCubeSelfDestruct,
|
BuiltIn.Keys.BotImageRandomSliceDivideBy, BuiltIn.Keys.BotImagePigCubeSelfDestruct,
|
||||||
BuiltIn.Keys.BotImageInvertedCubeUrl, BuiltIn.Keys.BotImagePigCubeSelfDestructMin,
|
BuiltIn.Keys.BotImageInvertedCubeUrl, BuiltIn.Keys.BotImagePigCubeSelfDestructMin,
|
||||||
|
|||||||
Reference in New Issue
Block a user