1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-14 01:36:08 +03:00

Add /guildinfo

Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
This commit is contained in:
Macintxsh 2023-10-05 15:26:12 +03:00
parent 6f1e543edb
commit 83dcdb8cd7
Signed by: mctaylors
GPG key ID: 361D326747B61E65
6 changed files with 241 additions and 9 deletions

View file

@ -64,7 +64,7 @@ public static class Extensions
/// <param name="builder">The builder to add the thumbnail to.</param>
/// <param name="avatarSource">The user whose avatar to use in the thumbnail field.</param>
/// <returns>The builder with the added avatar in the thumbnail field.</returns>
public static EmbedBuilder WithLargeAvatar(
public static EmbedBuilder WithLargeUserAvatar(
this EmbedBuilder builder, IUser avatarSource)
{
var avatarUrlResult = CDN.GetUserAvatarUrl(avatarSource, imageSize: 256);
@ -75,6 +75,32 @@ public static class Extensions
return builder.WithThumbnailUrl(avatarUrl.AbsoluteUri);
}
/// <summary>
/// Adds a guild icon in the thumbnail field.
/// </summary>
/// <param name="builder">The builder to add the thumbnail to.</param>
/// <param name="iconSource">The guild whose icon to use in the thumbnail field.</param>
/// <returns>The builder with the added icon in the thumbnail field.</returns>
public static EmbedBuilder WithLargeGuildIcon(
this EmbedBuilder builder, IGuild iconSource)
{
return builder.WithThumbnailUrl(CDN.GetGuildIconUrl(iconSource, imageSize: 256).Entity.AbsoluteUri);
}
/// <summary>
/// Adds a guild banner in the image field.
/// </summary>
/// <param name="builder">The builder to add the image to.</param>
/// <param name="bannerSource">The guild whose banner to use in the image field.</param>
/// <returns>The builder with the added banner in the image field.</returns>
public static EmbedBuilder WithGuildBanner(
this EmbedBuilder builder, IGuild bannerSource)
{
return bannerSource.Banner is not null
? builder.WithImageUrl(CDN.GetGuildBannerUrl(bannerSource).Entity.AbsoluteUri)
: builder;
}
/// <summary>
/// Adds a footer representing that the action was performed in the <paramref name="guild" />.
/// </summary>