mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
.boost should now us the correct channel, and it should send a message for users boosting the same server more than once
This commit is contained in:
@@ -54,7 +54,12 @@ namespace NadekoBot.Services
|
||||
|
||||
private Task ClientOnGuildMemberUpdated(SocketGuildUser oldUser, SocketGuildUser newUser)
|
||||
{
|
||||
if (oldUser is { PremiumSince: null } && newUser is { PremiumSince: not null })
|
||||
// if user is a new booster
|
||||
// or boosted again the same server
|
||||
if ((oldUser is { PremiumSince: null } && newUser is { PremiumSince: not null })
|
||||
|| (oldUser.PremiumSince is DateTimeOffset oldDate
|
||||
&& newUser.PremiumSince is DateTimeOffset newDate
|
||||
&& newDate > oldDate))
|
||||
{
|
||||
var conf = GetOrAddSettingsForGuild(newUser.Guild.Id);
|
||||
if (!conf.SendBoostMessage) return Task.CompletedTask;
|
||||
@@ -603,6 +608,7 @@ namespace NadekoBot.Services
|
||||
using var uow = _db.GetDbContext();
|
||||
var conf = uow.GuildConfigsForId(guildId, set => set);
|
||||
conf.SendBoostMessage = !conf.SendBoostMessage;
|
||||
conf.BoostMessageChannelId = channelId;
|
||||
await uow.SaveChangesAsync();
|
||||
|
||||
var toAdd = GreetSettings.Create(conf);
|
||||
|
@@ -19,7 +19,7 @@ namespace NadekoBot.Services
|
||||
private readonly IBotCredentials _creds;
|
||||
private readonly DateTime _started;
|
||||
|
||||
public const string BotVersion = "3.0.1";
|
||||
public const string BotVersion = "3.0.2";
|
||||
public string Author => "Kwoth#2452";
|
||||
public string Library => "Discord.Net";
|
||||
|
||||
|
Reference in New Issue
Block a user