mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-14 01:36:08 +03:00
Add /showinfo (#122)
Signed-off-by: Macintosh II <mctaylxrs@outlook.com> Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com> Co-authored-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
4e4e60f845
commit
0f916d46de
7 changed files with 460 additions and 1 deletions
|
@ -74,6 +74,23 @@ public static class Extensions
|
|||
return builder;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a user avatar in the thumbnail field.
|
||||
/// </summary>
|
||||
/// <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(
|
||||
this EmbedBuilder builder, IUser avatarSource)
|
||||
{
|
||||
var avatarUrlResult = CDN.GetUserAvatarUrl(avatarSource, imageSize: 256);
|
||||
var avatarUrl = avatarUrlResult.IsSuccess
|
||||
? avatarUrlResult.Entity
|
||||
: CDN.GetDefaultUserAvatarUrl(avatarSource, imageSize: 256).Entity;
|
||||
|
||||
return builder.WithThumbnailUrl(avatarUrl.AbsoluteUri);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a footer representing that the action was performed in the <paramref name="guild" />.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue