feat: premium ID changes
Some checks failed
Build and push Docker image / .net docker build (push) Has been cancelled
.net checks / run .net tests (push) Has been cancelled
.net checks / dotnet-format (push) Has been cancelled
Build and push Rust service Docker images / rust docker build (push) Has been cancelled
rust checks / cargo fmt (push) Has been cancelled

This commit is contained in:
Iris System 2025-12-28 00:06:51 +13:00
parent 41f8beb2aa
commit 24b6b0d455
16 changed files with 306 additions and 3 deletions

View file

@ -54,7 +54,57 @@ public class Misc
}
}
await ctx.Reply(message + $"\n\nManage your subscription at <{_botConfig.PremiumDashboardUrl}>");
List<MessageComponent> components = [
new MessageComponent()
{
Type = ComponentType.Text,
Content = message,
},
];
if (ctx.Premium)
{
var hidChangesLeftToday = Limits.PremiumDailyHidChanges - await ctx.Repository.GetHidChangelogCountForDate(ctx.System.Id, SystemClock.Instance.GetCurrentInstant().InUtc().Date);
var limitMessage = $"You have **{ctx.Config.PremiumIdChangesRemaining}** ID changes available, of which you can use **{hidChangesLeftToday}** today.";
components.Add(new()
{
Type = ComponentType.Separator,
});
components.Add(new()
{
Type = ComponentType.Text,
Content = limitMessage,
});
}
await ctx.Reply(components: [
new()
{
Type = ComponentType.Container,
Components = [
new()
{
Type = ComponentType.Text,
Content = $"## {(_botConfig.PremiumSubscriberEmoji != null ? $"<:premium_subscriber:{_botConfig.PremiumSubscriberEmoji}>" : "\u2729")} PluralKit Premium",
},
..components,
],
},
new()
{
Type = ComponentType.ActionRow,
Components = [
new()
{
Type = ComponentType.Button,
Style = ButtonStyle.Link,
Label = "Manage your subscription",
Url = _botConfig.PremiumDashboardUrl,
},
],
},
]);
}
public async Task Invite(Context ctx)