diff --git a/Catalogger.Backend/Bot/Commands/InviteCommands.cs b/Catalogger.Backend/Bot/Commands/InviteCommands.cs index 57c6752..a0bfe4e 100644 --- a/Catalogger.Backend/Bot/Commands/InviteCommands.cs +++ b/Catalogger.Backend/Bot/Commands/InviteCommands.cs @@ -53,6 +53,8 @@ public class InviteCommands( .Select(i => new PartialNamedInvite( i.Code, dbInvites.FirstOrDefault(dbI => dbI.Code == i.Code)?.Name, + i.Uses, + i.Channel, i.Inviter, i.CreatedAt )) @@ -64,20 +66,29 @@ public class InviteCommands( Value: $""" **Name:** {i.Name ?? "*(unnamed)*"} **Created at:** + **Uses:** {i.Uses} + **Channel:** {(i.Channel != null ? $"<#{i.Channel.ID.Value}>" : "*(unknown)*")} **Created by:** {i.CreatedBy.OrDefault()?.Tag() ?? "*(unknown)*"} """, - IsInline: true - )); + IsInline: false + )) + .ToList(); return await feedbackService.SendContextualPaginatedMessageAsync( userId, - DiscordUtils.PaginateFields(fields, title: $"Invites for {guild.Name}") + DiscordUtils.PaginateFields( + fields, + title: $"Invites for {guild.Name} ({fields.Count})", + fieldsPerPage: 5 + ) ); } private record struct PartialNamedInvite( string Code, string? Name, + int Uses, + IPartialChannel? Channel, Optional CreatedBy, DateTimeOffset CreatedAt ); @@ -88,7 +99,7 @@ public class InviteCommands( [Description("The channel to create the invite in")] [ChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)] IChannel channel, - [Description("What to name the new invite")] [Optional] string? name + [Description("What to name the new invite")] string? name = null ) { var (userId, guildId) = contextInjection.GetUserAndGuild(); @@ -141,7 +152,7 @@ public class InviteCommands( [Description("The invite to rename")] [AutocompleteProvider("autocomplete:invite-provider")] string invite, - [Description("The invite's new name")] [Optional] string? name + [Description("The invite's new name")] string? name = null ) { var (_, guildId) = contextInjection.GetUserAndGuild();