timely fixes
This commit is contained in:
parent
9f44d6a854
commit
c5aeb43046
3 changed files with 21 additions and 10 deletions
|
@ -215,6 +215,7 @@ public partial class Gambling : GamblingModule<GamblingService>
|
||||||
});
|
});
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task Timely()
|
public async Task Timely()
|
||||||
{
|
{
|
||||||
var val = Config.Timely.Amount;
|
var val = Config.Timely.Amount;
|
||||||
|
@ -259,10 +260,24 @@ public partial class Gambling : GamblingModule<GamblingService>
|
||||||
|
|
||||||
var val = Config.Timely.Amount;
|
var val = Config.Timely.Amount;
|
||||||
|
|
||||||
var guildUsers = await (Config.BoostBonus
|
var boostGuilds = Config.BoostBonus.GuildIds ?? new();
|
||||||
.GuildIds
|
var guildUsers = await boostGuilds
|
||||||
?? new())
|
.Select(async gid =>
|
||||||
.Select(x => ((IGuild)_client.GetGuild(x))?.GetUserAsync(ctx.User.Id))
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var guild = await ((IDiscordClient)_client).GetGuildAsync(gid);
|
||||||
|
if (guild is null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var user = await guild.GetUserAsync(ctx.User.Id);
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
})
|
||||||
.WhenAll();
|
.WhenAll();
|
||||||
|
|
||||||
var boostGuildUser = guildUsers.FirstOrDefault(x => x?.PremiumSince is not null);
|
var boostGuildUser = guildUsers.FirstOrDefault(x => x?.PremiumSince is not null);
|
||||||
|
|
|
@ -425,10 +425,7 @@ public sealed partial class BotCutConfig
|
||||||
public sealed partial class BoostBonusConfig
|
public sealed partial class BoostBonusConfig
|
||||||
{
|
{
|
||||||
[Comment("Users will receive a bonus if they boost any of these servers")]
|
[Comment("Users will receive a bonus if they boost any of these servers")]
|
||||||
public List<ulong> GuildIds { get; set; } =
|
public List<ulong> GuildIds { get; set; } = new();
|
||||||
[
|
|
||||||
117523346618318850
|
|
||||||
];
|
|
||||||
|
|
||||||
[Comment("This bonus will be added before any other multiplier is applied to the .timely command")]
|
[Comment("This bonus will be added before any other multiplier is applied to the .timely command")]
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,6 @@ slots:
|
||||||
# Bonus config for server boosts
|
# Bonus config for server boosts
|
||||||
boostBonus:
|
boostBonus:
|
||||||
# Users will receive a bonus if they boost any of these servers
|
# Users will receive a bonus if they boost any of these servers
|
||||||
guildIds:
|
guildIds: []
|
||||||
- 117523346618318850
|
|
||||||
# This bonus will be added before any other multiplier is applied to the .timely command
|
# This bonus will be added before any other multiplier is applied to the .timely command
|
||||||
baseTimelyBonus: 50
|
baseTimelyBonus: 50
|
||||||
|
|
Loading…
Reference in a new issue