mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
change: MessageXpCooldown is not in seconds
This commit is contained in:
@@ -10,13 +10,13 @@ namespace NadekoBot.Modules.Xp;
|
||||
public sealed partial class XpConfig : ICloneable<XpConfig>
|
||||
{
|
||||
[Comment("""DO NOT CHANGE""")]
|
||||
public int Version { get; set; } = 5;
|
||||
public int Version { get; set; } = 7;
|
||||
|
||||
[Comment("""How much XP will the users receive per message""")]
|
||||
public int XpPerMessage { get; set; } = 3;
|
||||
|
||||
[Comment("""How often can the users receive XP in minutes""")]
|
||||
public int MessageXpCooldown { get; set; } = 5;
|
||||
[Comment("""How often can the users receive XP, in seconds""")]
|
||||
public int MessageXpCooldown { get; set; } = 300;
|
||||
|
||||
[Comment("""Amount of xp users gain from posting an image""")]
|
||||
public int XpFromImage { get; set; } = 0;
|
||||
|
@@ -52,11 +52,12 @@ public sealed class XpConfigService : ConfigServiceBase<XpConfig>
|
||||
});
|
||||
}
|
||||
|
||||
if (data.Version < 6)
|
||||
if (data.Version < 7)
|
||||
{
|
||||
ModifyConfig(c =>
|
||||
{
|
||||
c.Version = 6;
|
||||
c.Version = 7;
|
||||
c.MessageXpCooldown *= 60;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -933,7 +933,7 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
|
||||
private async Task<bool> SetUserRewardedAsync(ulong userId)
|
||||
=> await _c.AddAsync(GetUserRewKey(userId),
|
||||
true,
|
||||
expiry: TimeSpan.FromMinutes(_xpConfig.Data.MessageXpCooldown),
|
||||
expiry: TimeSpan.FromSeconds(_xpConfig.Data.MessageXpCooldown),
|
||||
overwrite: false);
|
||||
|
||||
public async Task<FullUserStats> GetUserStatsAsync(IGuildUser user)
|
||||
|
Reference in New Issue
Block a user