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

Redesign embeds (#123)

TODO before merging:

- [x] /about
- [x] /ban
- [x] /unban
- [x] /kick
- [x] /mute
- [x] /unmute
- [x] /remind
- [x] /listremind
- [x] MessageEditedResponder
- [x] MessageDeletedResponder

---------

Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
This commit is contained in:
Macintxsh 2023-09-29 18:36:16 +03:00 committed by GitHub
parent d5c4340210
commit 04897cab20
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1054 additions and 1010 deletions

View file

@ -17,22 +17,6 @@ namespace Boyfriend;
public static class Extensions
{
/// <summary>
/// Adds a footer with the <paramref name="user" />'s avatar and tag (@username or username#0000).
/// </summary>
/// <param name="builder">The builder to add the footer to.</param>
/// <param name="user">The user whose tag and avatar to add.</param>
/// <returns>The builder with the added footer.</returns>
public static EmbedBuilder WithUserFooter(this EmbedBuilder builder, IUser user)
{
var avatarUrlResult = CDN.GetUserAvatarUrl(user, imageSize: 256);
var avatarUrl = avatarUrlResult.IsSuccess
? avatarUrlResult.Entity.AbsoluteUri
: CDN.GetDefaultUserAvatarUrl(user, imageSize: 256).Entity.AbsoluteUri;
return builder.WithFooter(new EmbedFooter(user.GetTag(), avatarUrl));
}
/// <summary>
/// Adds a footer representing that an action was performed by a <paramref name="user" />.
/// </summary>