feat(bot): use button for cv2 cards dashboard link

This commit is contained in:
Iris System 2025-08-25 14:39:16 +12:00
parent 5b0e29b446
commit 8ae3b29064

View file

@ -141,7 +141,7 @@ public class EmbedService
new MessageComponent() new MessageComponent()
{ {
Type = ComponentType.Text, Type = ComponentType.Text,
Content = $"## [{systemName ?? $"`{system.DisplayHid(cctx.Config)}`"}](https://dash.pluralkit.me/profile/s/{system.Hid}){premiumText}", Content = $"## {systemName ?? $"`{system.DisplayHid(cctx.Config)}`"}{premiumText}",
}, },
]; ];
@ -180,11 +180,24 @@ public class EmbedService
AccentColor = system.Color?.ToDiscordColor(), AccentColor = system.Color?.ToDiscordColor(),
Components = [ ..header, ..switchComponent, linkedAccounts, ..descComponents ], Components = [ ..header, ..switchComponent, linkedAccounts, ..descComponents ],
}, },
new MessageComponent()
{
Type = ComponentType.Section,
Components = [
new MessageComponent() new MessageComponent()
{ {
Type = ComponentType.Text, Type = ComponentType.Text,
Content = $"-# System ID: `{system.DisplayHid(cctx.Config)}`\n-# Created: {system.Created.FormatZoned(cctx.Zone)}", Content = $"-# System ID: `{system.DisplayHid(cctx.Config)}`\n-# Created: {system.Created.FormatZoned(cctx.Zone)}",
}, },
],
Accessory = new MessageComponent()
{
Type = ComponentType.Button,
Style = ButtonStyle.Link,
Label = "View on dashboard",
Url = $"https://dash.pluralkit.me/profile/s/{system.Hid}",
},
},
]; ];
} }
@ -410,7 +423,7 @@ public class EmbedService
new MessageComponent() new MessageComponent()
{ {
Type = ComponentType.Text, Type = ComponentType.Text,
Content = $"## [{name}](https://dash.pluralkit.me/profile/m/{member.Hid}){(systemName != null ? $" ({systemName})" : "")}", Content = $"## {name}{(systemName != null ? $" ({systemName})" : "")}",
}, },
]; ];
@ -442,11 +455,24 @@ public class EmbedService
AccentColor = member.Color?.ToDiscordColor(), AccentColor = member.Color?.ToDiscordColor(),
Components = [ ..header, ..extraData, ..descComponents ], Components = [ ..header, ..extraData, ..descComponents ],
}, },
new MessageComponent()
{
Type = ComponentType.Section,
Components = [
new MessageComponent() new MessageComponent()
{ {
Type = ComponentType.Text, Type = ComponentType.Text,
Content = $"-# System ID: `{system.DisplayHid(ccfg)}` \u2219 Member ID: `{member.DisplayHid(ccfg)}`{(member.MetadataPrivacy.CanAccess(ctx) ? $"\n-# Created: {member.Created.FormatZoned(zone)}" : "")}", Content = $"-# System ID: `{system.DisplayHid(ccfg)}` \u2219 Member ID: `{member.DisplayHid(ccfg)}`{(member.MetadataPrivacy.CanAccess(ctx) ? $"\n-# Created: {member.Created.FormatZoned(zone)}" : "")}",
}, },
],
Accessory = new MessageComponent()
{
Type = ComponentType.Button,
Style = ButtonStyle.Link,
Label = "View on dashboard",
Url = $"https://dash.pluralkit.me/profile/m/{member.Hid}",
},
},
]; ];
} }
@ -584,7 +610,7 @@ public class EmbedService
new MessageComponent() new MessageComponent()
{ {
Type = ComponentType.Text, Type = ComponentType.Text,
Content = $"## [{name}](https://dash.pluralkit.me/profile/g/{target.Hid}){(systemName != null ? $" ({systemName})" : "")}", Content = $"## {name}{(systemName != null ? $" ({systemName})" : "")}",
}, },
]; ];
@ -616,11 +642,24 @@ public class EmbedService
AccentColor = target.Color?.ToDiscordColor(), AccentColor = target.Color?.ToDiscordColor(),
Components = [ ..header, ..descComponents ], Components = [ ..header, ..descComponents ],
}, },
new MessageComponent()
{
Type = ComponentType.Section,
Components = [
new MessageComponent() new MessageComponent()
{ {
Type = ComponentType.Text, Type = ComponentType.Text,
Content = $"-# System ID: `{system.DisplayHid(ctx.Config)}` \u2219 Group ID: `{target.DisplayHid(ctx.Config)}`{(target.MetadataPrivacy.CanAccess(pctx) ? $"\n-# Created: {target.Created.FormatZoned(ctx.Zone)}" : "")}", Content = $"-# System ID: `{system.DisplayHid(ctx.Config)}` \u2219 Group ID: `{target.DisplayHid(ctx.Config)}`{(target.MetadataPrivacy.CanAccess(pctx) ? $"\n-# Created: {target.Created.FormatZoned(ctx.Zone)}" : "")}",
}, },
],
Accessory = new MessageComponent()
{
Type = ComponentType.Button,
Style = ButtonStyle.Link,
Label = "View on dashboard",
Url = $"https://dash.pluralkit.me/profile/g/{target.Hid}",
},
},
]; ];
} }