added captcha option for .fish in fish.yml
This commit is contained in:
parent
2d3c7de8e7
commit
a1bf03ad40
6 changed files with 95 additions and 100 deletions
src/EllieBot
Modules/Games/Fish
data
|
@ -24,7 +24,10 @@ public partial class Games
|
|||
var cRes = await cache.GetAsync(FishingWhitelistKey(ctx.User.Id));
|
||||
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)
|
||||
{
|
||||
var img = captchaService.GetPasswordImage(password);
|
||||
|
|
|
@ -7,9 +7,10 @@ namespace EllieBot.Modules.Games;
|
|||
public sealed partial class FishConfig : ICloneable<FishConfig>
|
||||
{
|
||||
[Comment("DO NOT CHANGE")]
|
||||
public int Version { get; set; } = 1;
|
||||
public int Version { get; set; } = 2;
|
||||
|
||||
public string WeatherSeed { get; set; } = string.Empty;
|
||||
public bool RequireCaptcha { get; set; } = true;
|
||||
public List<string> StarEmojis { get; set; } = new();
|
||||
public List<string> SpotEmojis { get; set; } = new();
|
||||
public FishChance Chance { get; set; } = new FishChance();
|
||||
|
|
|
@ -15,5 +15,15 @@ public sealed class FishConfigService : ConfigServiceBase<FishConfig>
|
|||
IPubSub pubSub)
|
||||
: base(FILE_PATH, serializer, pubSub, _changeKey)
|
||||
{
|
||||
Migrate();
|
||||
}
|
||||
|
||||
private void Migrate()
|
||||
{
|
||||
ModifyConfig(c =>
|
||||
{
|
||||
c.Version = 2;
|
||||
c.RequireCaptcha = true;
|
||||
});
|
||||
}
|
||||
}
|
|
@ -8258,20 +8258,6 @@
|
|||
],
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".xpgleaderboard",
|
||||
".xpglb"
|
||||
],
|
||||
"Description": "Shows the global xp leaderboard.",
|
||||
"Usage": [
|
||||
".xpgleaderboard"
|
||||
],
|
||||
"Submodule": "Xp",
|
||||
"Module": "Xp",
|
||||
"Options": null,
|
||||
"Requirements": []
|
||||
},
|
||||
{
|
||||
"Aliases": [
|
||||
".xplevelset"
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
# DO NOT CHANGE
|
||||
version: 1
|
||||
weatherSeed: "w%29';^eGE)9oWHM(aI9I;%1[.r^z2ZS7ShV,l')o(e%#\"hVzb>oxQq^`.&/7srh"
|
||||
chance:
|
||||
fish: 80
|
||||
trash: 15
|
||||
nothing: 5
|
||||
# DO NOT CHANGE
|
||||
version: 2
|
||||
weatherSeed: w%29';^eGE)9oWHM(aI9I;%1[.r^z2ZS7ShV,l')o(e%#"hVzb>oxQq^`.&/7srh
|
||||
requireCaptcha: true
|
||||
starEmojis:
|
||||
- <:emptystar:1326838565786877962>
|
||||
- <:onestar:1326838456739168361>
|
||||
|
@ -17,9 +14,13 @@ spotEmojis:
|
|||
- <:lake:1328315260561788989>
|
||||
- <:swamp:1328519766083633224>
|
||||
- <:reef:1328519744646545421>
|
||||
chance:
|
||||
fish: 80
|
||||
trash: 15
|
||||
nothing: 5
|
||||
fish:
|
||||
- name: Bass
|
||||
id: 0
|
||||
- id: 0
|
||||
name: Bass
|
||||
weather:
|
||||
spot:
|
||||
time:
|
||||
|
@ -28,16 +29,16 @@ fish:
|
|||
fluff: Very common.
|
||||
condition:
|
||||
image: https://cdn.nadeko.bot/fish/bass.png
|
||||
emoji: "<:bass:1328520376892002386>"
|
||||
emoji: <:bass:1328520376892002386>
|
||||
trash:
|
||||
- name: Plastic Bag
|
||||
id: 1002
|
||||
- id: 1002
|
||||
name: Plastic Bag
|
||||
weather:
|
||||
spot:
|
||||
time:
|
||||
chance: 50
|
||||
stars: 4
|
||||
fluff: "Trophy of your contribution to the environment."
|
||||
fluff: Trophy of your contribution to the environment.
|
||||
condition:
|
||||
image: https://cdn.nadeko.bot/fish/plasticbag.png
|
||||
emoji: "<:plasticbag:1328520895454515211>"
|
||||
emoji: <:plasticbag:1328520895454515211>
|
|
@ -1,5 +1,5 @@
|
|||
# DO NOT CHANGE
|
||||
version: 10
|
||||
version: 11
|
||||
# How much XP will the users receive per message
|
||||
textXpPerMessage: 3
|
||||
# How often can the users receive XP, in seconds
|
||||
|
@ -7,19 +7,13 @@ textXpCooldown: 300
|
|||
# Amount of xp users gain from posting an image
|
||||
textXpFromImage: 3
|
||||
# Average amount of xp earned per minute in VC
|
||||
voiceXpPerMinute: 0
|
||||
voiceXpPerMinute: 3
|
||||
# Xp Shop config
|
||||
shop:
|
||||
# Whether the xp shop is enabled
|
||||
# True -> Users can access the xp shop using .xpshop command
|
||||
# False -> Users can't access the xp shop
|
||||
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.
|
||||
# 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.
|
||||
|
|
Loading…
Add table
Reference in a new issue