Skip to content

Commit

Permalink
add reactivation instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
th0mk committed Apr 16, 2024
1 parent 081784c commit 5227d2d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/FMBot.Bot/Services/SupporterService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public bool ShowSupporterPromotionalMessage(UserType userType, ulong? guildId)
return true;
}

public static async Task SendSupporterWelcomeMessage(IUser discordUser, bool hasDiscogs, Supporter supporter)
public static async Task SendSupporterWelcomeMessage(IUser discordUser, bool hasDiscogs, Supporter supporter, bool reactivation = false)
{
var thankYouEmbed = new EmbedBuilder();
thankYouEmbed.WithColor(DiscordConstants.InformationColorBlue);
Expand Down Expand Up @@ -196,7 +196,20 @@ public static async Task SendSupporterWelcomeMessage(IUser discordUser, bool has
}

thankYouEmbed.WithDescription(thankYouMessage.ToString());
await discordUser.SendMessageAsync(embed: thankYouEmbed.Build());

if (reactivation)
{
var reactivateEmbed = new EmbedBuilder();
reactivateEmbed.WithDescription(
"Welcome back. Please use the `/import manage` command to re-activate the import feature if you've used it previously.");
reactivateEmbed.WithColor(DiscordConstants.InformationColorBlue);
await discordUser.SendMessageAsync(embeds: [thankYouEmbed.Build(), reactivateEmbed.Build()]);
}
else
{
await discordUser.SendMessageAsync(embed: thankYouEmbed.Build());
}

}

public static async Task SendSupporterGoodbyeMessage(IUser discordUser, bool openCollective = true, bool hadImported = false)
Expand Down Expand Up @@ -860,7 +873,7 @@ public async Task UpdateDiscordSupporters(List<DiscordEntitlement> discordSuppor
var user = await this._client.Rest.GetUserAsync(discordSupporter.DiscordUserId);
if (user != null)
{
await SendSupporterWelcomeMessage(user, false, reActivatedSupporter);
await SendSupporterWelcomeMessage(user, false, reActivatedSupporter, true);
}

var supporterAuditLogChannel = new DiscordWebhookClient(this._botSettings.Bot.SupporterAuditLogWebhookUrl);
Expand Down

0 comments on commit 5227d2d

Please sign in to comment.