Compare commits

..

1 Commits
4.2.6 ... 4.2.3

Author SHA1 Message Date
Kwoth
caf9409192 Upped version to 4.2.3 2022-06-17 04:42:19 +02:00
8 changed files with 30 additions and 42 deletions

View File

@@ -113,7 +113,6 @@ docker-build:
# Use the official docker image.
image: docker:latest
stage: build
allow_failure: true
services:
- docker:dind
before_script:

View File

@@ -3,18 +3,6 @@
Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o
## [4.2.6] - 22.06.2022
### Fixed
- Patron system should now properly by disabled on selfhosts by default.
## [4.2.5] - 18.06.2022
### Fixed
- Fixed `.crypto`, you will still need coinmarketcapApiKey in `creds.yml` in order to make it run consistently as the key is shared
## [4.2.3] - 17.06.2022
### Fixed

View File

@@ -16,11 +16,11 @@ public class CmcQuote
[JsonPropertyName("volume_24h")]
public double Volume24h { get; set; }
// [JsonPropertyName("volume_change_24h")]
// public double VolumeChange24h { get; set; }
//
// [JsonPropertyName("percent_change_1h")]
// public double PercentChange1h { get; set; }
[JsonPropertyName("volume_change_24h")]
public double VolumeChange24h { get; set; }
[JsonPropertyName("percent_change_1h")]
public double PercentChange1h { get; set; }
[JsonPropertyName("percent_change_24h")]
public double PercentChange24h { get; set; }
@@ -33,6 +33,12 @@ public class CmcQuote
[JsonPropertyName("market_cap_dominance")]
public double MarketCapDominance { get; set; }
[JsonPropertyName("fully_diluted_market_cap")]
public double FullyDilutedMarketCap { get; set; }
[JsonPropertyName("last_updated")]
public DateTime LastUpdated { get; set; }
}
public class CmcResponseData
@@ -52,6 +58,9 @@ public class CmcResponseData
[JsonPropertyName("cmc_rank")]
public int CmcRank { get; set; }
[JsonPropertyName("num_market_pairs")]
public int NumMarketPairs { get; set; }
[JsonPropertyName("circulating_supply")]
public double? CirculatingSupply { get; set; }
@@ -61,6 +70,15 @@ public class CmcResponseData
[JsonPropertyName("max_supply")]
public double? MaxSupply { get; set; }
[JsonPropertyName("last_updated")]
public DateTime LastUpdated { get; set; }
[JsonPropertyName("date_added")]
public DateTime DateAdded { get; set; }
[JsonPropertyName("tags")]
public List<string> Tags { get; set; }
[JsonPropertyName("quote")]
public Dictionary<string, CmcQuote> Quote { get; set; }
}

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Modules.Utility.Patronage;
public partial class PatronConfigData : ICloneable<PatronConfigData>
{
[Comment("DO NOT CHANGE")]
public int Version { get; set; } = 2;
public int Version { get; set; } = 1;
[Comment("Whether the patronage feature is enabled")]
public bool IsEnabled { get; set; }

View File

@@ -18,19 +18,5 @@ public class PatronageConfig : ConfigServiceBase<PatronConfigData>
x => x.IsEnabled,
bool.TryParse,
ConfigPrinters.ToString);
Migrate();
}
private void Migrate()
{
ModifyConfig(c =>
{
if (c.Version == 1)
{
c.Version = 2;
c.IsEnabled = false;
}
});
}
}

View File

@@ -3,7 +3,6 @@ using LinqToDB.EntityFrameworkCore;
using NadekoBot.Common.ModuleBehaviors;
using NadekoBot.Db.Models;
using OneOf;
using OneOf.Types;
using StackExchange.Redis;
using CommandInfo = Discord.Commands.CommandInfo;
@@ -501,8 +500,8 @@ public sealed class PatronageService
if (!confData.IsEnabled)
return default;
// if (_creds.IsOwner(userId))
// return default;
if (_creds.IsOwner(userId))
return default;
// get user tier
var patron = await GetPatronAsync(userId);
@@ -559,9 +558,7 @@ public sealed class PatronageService
data.TryGetValue(QuotaPer.PerMonth, out var monthly) ? monthly : null
);
return quotaCheckResult.Match<OneOf<Success, InsufficientTier, QuotaLimit>>(
_ => new Success(),
x => x);
return quotaCheckResult.Match(_ => default, x => x);
}
private bool TryGetTierDataOrLower<T>(

View File

@@ -7,7 +7,7 @@ namespace NadekoBot.Services;
public sealed class StatsService : IStatsService, IReadyExecutor, INService
{
public const string BOT_VERSION = "4.2.6";
public const string BOT_VERSION = "4.2.3";
public string Author
=> "Kwoth#2452";

View File

@@ -1,7 +1,7 @@
# DO NOT CHANGE
version: 2
version: 1
# Whether the patronage feature is enabled
isEnabled: false
isEnabled: true
# List of patron only features and relevant quota data
quotas:
# Dictionary of feature names with their respective limits. Set to null for unlimited