added captcha option for .fish in fish.yml

This commit is contained in:
Toastie 2025-03-23 14:25:41 +13:00
parent 2d3c7de8e7
commit a1bf03ad40
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7
6 changed files with 95 additions and 100 deletions

View file

@ -24,7 +24,10 @@ public partial class Games
var cRes = await cache.GetAsync(FishingWhitelistKey(ctx.User.Id)); var cRes = await cache.GetAsync(FishingWhitelistKey(ctx.User.Id));
if (cRes.TryPickT1(out _, out _)) if (cRes.TryPickT1(out _, out _))
{ {
var password = await captchaService.GetUserCaptcha(ctx.User.Id); string? password = null;
if (fcs.Data.RequireCaptcha)
password = await captchaService.GetUserCaptcha(ctx.User.Id);
if (password is not null) if (password is not null)
{ {
var img = captchaService.GetPasswordImage(password); var img = captchaService.GetPasswordImage(password);

View file

@ -7,9 +7,10 @@ namespace EllieBot.Modules.Games;
public sealed partial class FishConfig : ICloneable<FishConfig> public sealed partial class FishConfig : ICloneable<FishConfig>
{ {
[Comment("DO NOT CHANGE")] [Comment("DO NOT CHANGE")]
public int Version { get; set; } = 1; public int Version { get; set; } = 2;
public string WeatherSeed { get; set; } = string.Empty; public string WeatherSeed { get; set; } = string.Empty;
public bool RequireCaptcha { get; set; } = true;
public List<string> StarEmojis { get; set; } = new(); public List<string> StarEmojis { get; set; } = new();
public List<string> SpotEmojis { get; set; } = new(); public List<string> SpotEmojis { get; set; } = new();
public FishChance Chance { get; set; } = new FishChance(); public FishChance Chance { get; set; } = new FishChance();

View file

@ -15,5 +15,15 @@ public sealed class FishConfigService : ConfigServiceBase<FishConfig>
IPubSub pubSub) IPubSub pubSub)
: base(FILE_PATH, serializer, pubSub, _changeKey) : base(FILE_PATH, serializer, pubSub, _changeKey)
{ {
Migrate();
}
private void Migrate()
{
ModifyConfig(c =>
{
c.Version = 2;
c.RequireCaptcha = true;
});
} }
} }

View file

@ -8258,20 +8258,6 @@
], ],
"Requirements": [] "Requirements": []
}, },
{
"Aliases": [
".xpgleaderboard",
".xpglb"
],
"Description": "Shows the global xp leaderboard.",
"Usage": [
".xpgleaderboard"
],
"Submodule": "Xp",
"Module": "Xp",
"Options": null,
"Requirements": []
},
{ {
"Aliases": [ "Aliases": [
".xplevelset" ".xplevelset"

View file

@ -1,10 +1,7 @@
# DO NOT CHANGE # DO NOT CHANGE
version: 1 version: 2
weatherSeed: "w%29';^eGE)9oWHM(aI9I;%1[.r^z2ZS7ShV,l')o(e%#\"hVzb>oxQq^`.&/7srh" weatherSeed: w%29';^eGE)9oWHM(aI9I;%1[.r^z2ZS7ShV,l')o(e%#"hVzb>oxQq^`.&/7srh
chance: requireCaptcha: true
fish: 80
trash: 15
nothing: 5
starEmojis: starEmojis:
- <:emptystar:1326838565786877962> - <:emptystar:1326838565786877962>
- <:onestar:1326838456739168361> - <:onestar:1326838456739168361>
@ -17,9 +14,13 @@ spotEmojis:
- <:lake:1328315260561788989> - <:lake:1328315260561788989>
- <:swamp:1328519766083633224> - <:swamp:1328519766083633224>
- <:reef:1328519744646545421> - <:reef:1328519744646545421>
chance:
fish: 80
trash: 15
nothing: 5
fish: fish:
- name: Bass - id: 0
id: 0 name: Bass
weather: weather:
spot: spot:
time: time:
@ -28,16 +29,16 @@ fish:
fluff: Very common. fluff: Very common.
condition: condition:
image: https://cdn.nadeko.bot/fish/bass.png image: https://cdn.nadeko.bot/fish/bass.png
emoji: "<:bass:1328520376892002386>" emoji: <:bass:1328520376892002386>
trash: trash:
- name: Plastic Bag - id: 1002
id: 1002 name: Plastic Bag
weather: weather:
spot: spot:
time: time:
chance: 50 chance: 50
stars: 4 stars: 4
fluff: "Trophy of your contribution to the environment." fluff: Trophy of your contribution to the environment.
condition: condition:
image: https://cdn.nadeko.bot/fish/plasticbag.png image: https://cdn.nadeko.bot/fish/plasticbag.png
emoji: "<:plasticbag:1328520895454515211>" emoji: <:plasticbag:1328520895454515211>

View file

@ -1,5 +1,5 @@
# DO NOT CHANGE # DO NOT CHANGE
version: 10 version: 11
# How much XP will the users receive per message # How much XP will the users receive per message
textXpPerMessage: 3 textXpPerMessage: 3
# How often can the users receive XP, in seconds # How often can the users receive XP, in seconds
@ -7,19 +7,13 @@ textXpCooldown: 300
# Amount of xp users gain from posting an image # Amount of xp users gain from posting an image
textXpFromImage: 3 textXpFromImage: 3
# Average amount of xp earned per minute in VC # Average amount of xp earned per minute in VC
voiceXpPerMinute: 0 voiceXpPerMinute: 3
# Xp Shop config # Xp Shop config
shop: shop:
# Whether the xp shop is enabled # Whether the xp shop is enabled
# True -> Users can access the xp shop using .xpshop command # True -> Users can access the xp shop using .xpshop command
# False -> Users can't access the xp shop # False -> Users can't access the xp shop
isEnabled: false isEnabled: false
# Which patron tier do users need in order to use the .xpshop bgs command
# Leave at 'None' if patron system is disabled or you don't want any restrictions
bgsTierRequirement: None
# Which patron tier do users need in order to use the .xpshop frames command
# Leave at 'None' if patron system is disabled or you don't want any restrictions
framesTierRequirement: None
# Frames available for sale. Keys are unique IDs. # Frames available for sale. Keys are unique IDs.
# Do not change keys as they are not publicly visible. Only change properties (name, price, id) # Do not change keys as they are not publicly visible. Only change properties (name, price, id)
# Removing a key which previously existed means that all previous purchases will also be unusable. # Removing a key which previously existed means that all previous purchases will also be unusable.