mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-03 16:24:27 -05:00 
			
		
		
		
	Made .timely use timestamp tags and fixed a bug
This commit is contained in:
		@@ -126,13 +126,15 @@ public partial class Gambling : GamblingModule<GamblingService>
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (_cache.AddTimelyClaim(ctx.User.Id, period) is { } rem)
 | 
					        if (_cache.AddTimelyClaim(ctx.User.Id, period) is { } rem)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            await ReplyErrorLocalizedAsync(strs.timely_already_claimed(rem.ToString(@"dd\d\ hh\h\ mm\m\ ss\s")));
 | 
					            var now = DateTime.UtcNow;
 | 
				
			||||||
 | 
					            var relativeTag = TimestampTag.FromDateTime(now.Add(rem), TimestampTagStyles.Relative);
 | 
				
			||||||
 | 
					            await ReplyErrorLocalizedAsync(strs.timely_already_claimed(relativeTag));
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var result = await _ps.TryGetFeatureLimitAsync(_timelyKey, ctx.User.Id, 0);
 | 
					        var result = await _ps.TryGetFeatureLimitAsync(_timelyKey, ctx.User.Id, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        val = (int)(val * (1 + (result.Quota * 0.01f)));
 | 
					        val = (int)(val * (1 + (result.Quota! * 0.01f)));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        await _cs.AddAsync(ctx.User.Id, val, new("timely", "claim"));
 | 
					        await _cs.AddAsync(ctx.User.Id, val, new("timely", "claim"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -697,7 +697,7 @@ public sealed class PatronageService
 | 
				
			|||||||
            return new()
 | 
					            return new()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Name = key.PrettyName,
 | 
					                Name = key.PrettyName,
 | 
				
			||||||
                Quota = default,
 | 
					                Quota = defaultValue,
 | 
				
			||||||
                IsPatronLimit = false
 | 
					                IsPatronLimit = false
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -878,7 +878,7 @@
 | 
				
			|||||||
  "autodc_enable": "I will disconnect from the voice channel when there are no more tracks to play.",
 | 
					  "autodc_enable": "I will disconnect from the voice channel when there are no more tracks to play.",
 | 
				
			||||||
  "autodc_disable": "I will no longer disconnect from the voice channel when there are no more tracks to play.",
 | 
					  "autodc_disable": "I will no longer disconnect from the voice channel when there are no more tracks to play.",
 | 
				
			||||||
  "timely_none": "Bot owner didn't specify a timely reward.",
 | 
					  "timely_none": "Bot owner didn't specify a timely reward.",
 | 
				
			||||||
  "timely_already_claimed": "You've already claimed your timely reward. You can get it again in {0}.",
 | 
					  "timely_already_claimed": "You've already claimed your timely reward. You can get it again {0}.",
 | 
				
			||||||
  "timely": "You've claimed your {0}. You can claim again in {1}h",
 | 
					  "timely": "You've claimed your {0}. You can claim again in {1}h",
 | 
				
			||||||
  "timely_set": "Users will be able to claim {0} every {1}h",
 | 
					  "timely_set": "Users will be able to claim {0} every {1}h",
 | 
				
			||||||
  "timely_set_none": "Users will not be able to claim any timely currency.",
 | 
					  "timely_set_none": "Users will not be able to claim any timely currency.",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user