mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(bot): make links in help/stats embeds clickable
This commit is contained in:
parent
2be3fe6a00
commit
71e8cf960c
2 changed files with 8 additions and 6 deletions
|
|
@ -12,10 +12,11 @@ public class Help
|
||||||
"If PluralKit is useful to you, please consider donating on [Patreon](https://patreon.com/pluralkit) or [Buy Me A Coffee](https://buymeacoffee.com/pluralkit).\n" +
|
"If PluralKit is useful to you, please consider donating on [Patreon](https://patreon.com/pluralkit) or [Buy Me A Coffee](https://buymeacoffee.com/pluralkit).\n" +
|
||||||
"## Use the buttons below to see more info!";
|
"## Use the buttons below to see more info!";
|
||||||
|
|
||||||
|
public static string EmbedFooter = "-# PluralKit by @ske and contributors | Myriad design by @layl, icon by @tedkalashnikov, banner by @fulmine | GitHub: https://github.com/PluralKit/PluralKit/ | Website: https://pluralkit.me/";
|
||||||
|
|
||||||
public static Embed helpEmbed = new()
|
public static Embed helpEmbed = new()
|
||||||
{
|
{
|
||||||
Title = "PluralKit",
|
Title = "PluralKit",
|
||||||
Footer = new("PluralKit by @ske and contributors | Myriad design by @layl, icon by @tedkalashnikov, banner by @fulmine | GitHub: https://github.com/PluralKit/PluralKit/ | Website: https://pluralkit.me/"),
|
|
||||||
Color = DiscordUtils.Blue,
|
Color = DiscordUtils.Blue,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -142,7 +143,7 @@ public class Help
|
||||||
=> ctx.Rest.CreateMessage(ctx.Channel.Id, new MessageRequest
|
=> ctx.Rest.CreateMessage(ctx.Channel.Id, new MessageRequest
|
||||||
{
|
{
|
||||||
Content = $"{Emojis.Warn} If you cannot see the rest of this message see [the FAQ](<https://pluralkit.me/faq/#why-do-most-of-pluralkit-s-messages-look-blank-or-empty>)",
|
Content = $"{Emojis.Warn} If you cannot see the rest of this message see [the FAQ](<https://pluralkit.me/faq/#why-do-most-of-pluralkit-s-messages-look-blank-or-empty>)",
|
||||||
Embeds = new[] { helpEmbed with { Description = Help.Description.Replace("{prefix}", ctx.DefaultPrefix) } },
|
Embeds = new[] { helpEmbed with { Description = Help.Description.Replace("{prefix}", ctx.DefaultPrefix), Fields = new Embed.Field[] { new("", EmbedFooter) } } },
|
||||||
Components = new[] { helpPageButtons(ctx.Author.Id) },
|
Components = new[] { helpPageButtons(ctx.Author.Id) },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -156,7 +157,7 @@ public class Help
|
||||||
if (ctx.Event.Message.Components.First().Components.Where(x => x.CustomId == ctx.CustomId).First().Style == ButtonStyle.Primary)
|
if (ctx.Event.Message.Components.First().Components.Where(x => x.CustomId == ctx.CustomId).First().Style == ButtonStyle.Primary)
|
||||||
return ctx.Respond(InteractionResponse.ResponseType.UpdateMessage, new()
|
return ctx.Respond(InteractionResponse.ResponseType.UpdateMessage, new()
|
||||||
{
|
{
|
||||||
Embeds = new[] { helpEmbed with { Description = Help.Description.Replace("{prefix}", prefix) } },
|
Embeds = new[] { helpEmbed with { Description = Help.Description.Replace("{prefix}", prefix), Fields = new Embed.Field[] { new("", EmbedFooter) } } },
|
||||||
Components = new[] { buttons }
|
Components = new[] { buttons }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -164,8 +165,9 @@ public class Help
|
||||||
|
|
||||||
return ctx.Respond(InteractionResponse.ResponseType.UpdateMessage, new()
|
return ctx.Respond(InteractionResponse.ResponseType.UpdateMessage, new()
|
||||||
{
|
{
|
||||||
Embeds = new[] { helpEmbed with { Fields = helpEmbedPages.GetValueOrDefault(ctx.CustomId.Split("-")[2]).Select((item, index) =>
|
Embeds = new[] { helpEmbed with { Fields = helpEmbedPages.GetValueOrDefault(ctx.CustomId.Split("-")[2]).Select(
|
||||||
new Embed.Field(item.Name.Replace("{prefix}", prefix), item.Value.Replace("{prefix}", prefix))).ToArray() } },
|
(item, index) => new Embed.Field(item.Name.Replace("{prefix}", prefix), item.Value.Replace("{prefix}", prefix))
|
||||||
|
).Append(new("", EmbedFooter)).ToArray() } },
|
||||||
Components = new[] { buttons }
|
Components = new[] { buttons }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ public class Misc
|
||||||
+ $"**{stats.db.switches:N0}** switches, **{stats.db.messages:N0}** messages\n" +
|
+ $"**{stats.db.switches:N0}** switches, **{stats.db.messages:N0}** messages\n" +
|
||||||
$"**{stats.db.guilds:N0}** servers with **{stats.db.channels:N0}** channels"));
|
$"**{stats.db.guilds:N0}** servers with **{stats.db.channels:N0}** channels"));
|
||||||
|
|
||||||
embed.Footer(Help.helpEmbed.Footer);
|
embed.Field(new("", Help.EmbedFooter));
|
||||||
|
|
||||||
var uptime = ((DateTimeOffset)process.StartTime).ToUnixTimeSeconds();
|
var uptime = ((DateTimeOffset)process.StartTime).ToUnixTimeSeconds();
|
||||||
embed.Description($"### PluralKit [{BuildInfoService.Version}](https://github.com/pluralkit/pluralkit/commit/{BuildInfoService.FullVersion})\n" +
|
embed.Description($"### PluralKit [{BuildInfoService.Version}](https://github.com/pluralkit/pluralkit/commit/{BuildInfoService.FullVersion})\n" +
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue