mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Fixed .feed related commands and updated an example to a working one. Updated packages
This commit is contained in:
@@ -39,13 +39,18 @@ public abstract class GamblingModule<TService> : NadekoModule<TService>
|
||||
return true;
|
||||
}
|
||||
|
||||
protected string N<T>(T cur)
|
||||
where T : INumber<T>
|
||||
protected string N(long cur)
|
||||
=> cur.ToString("C0", GetFlowersCiInternal());
|
||||
|
||||
protected string N(decimal cur)
|
||||
=> cur.ToString("C0", GetFlowersCiInternal());
|
||||
|
||||
private IFormatProvider GetFlowersCiInternal()
|
||||
{
|
||||
var flowersCi = (CultureInfo)Culture.Clone();
|
||||
flowersCi.NumberFormat.CurrencySymbol = CurrencySign;
|
||||
flowersCi.NumberFormat.CurrencyNegativePattern = 5;
|
||||
return cur.ToString("C0", flowersCi);
|
||||
return flowersCi;
|
||||
}
|
||||
|
||||
protected Task<bool> CheckBetMandatory(long amount)
|
||||
|
@@ -155,7 +155,7 @@ public class FeedsService : INService
|
||||
public List<FeedSub> GetFeeds(ulong guildId)
|
||||
{
|
||||
using var uow = _db.GetDbContext();
|
||||
return uow.GuildConfigsForId(guildId, set => set.Include(x => x.FeedSubs).ThenInclude(x => x.GuildConfig))
|
||||
return uow.GuildConfigsForId(guildId, set => set.Include(x => x.FeedSubs))
|
||||
.FeedSubs.OrderBy(x => x.Id)
|
||||
.ToList();
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public class FeedsService : INService
|
||||
};
|
||||
|
||||
using var uow = _db.GetDbContext();
|
||||
var gc = uow.GuildConfigsForId(guildId, set => set.Include(x => x.FeedSubs).ThenInclude(x => x.GuildConfig));
|
||||
var gc = uow.GuildConfigsForId(guildId, set => set.Include(x => x.FeedSubs));
|
||||
|
||||
if (gc.FeedSubs.Any(x => x.Url.ToLower() == fs.Url.ToLower()))
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user