mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-29 02:29:55 +03:00
Send direct messages to banned/kicked users explaining what happened
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
e53bf8a374
commit
b7057d3447
7 changed files with 855 additions and 1225 deletions
|
@ -83,6 +83,22 @@ public static class Extensions {
|
|||
return builder.WithFooter(new EmbedFooter(guild.Name, iconUrl));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a title representing that the action happened in the <paramref name="guild" />.
|
||||
/// </summary>
|
||||
/// <param name="builder">The builder to add the title to.</param>
|
||||
/// <param name="guild">The guild whose name and icon to use.</param>
|
||||
/// <returns>The builder with the added title.</returns>
|
||||
public static EmbedBuilder WithGuildTitle(this EmbedBuilder builder, IGuild guild) {
|
||||
var iconUrlResult = CDN.GetGuildIconUrl(guild, imageSize: 256);
|
||||
var iconUrl = iconUrlResult.IsSuccess
|
||||
? iconUrlResult.Entity.AbsoluteUri
|
||||
: null;
|
||||
|
||||
builder.Author = new EmbedAuthorBuilder(guild.Name, iconUrl: iconUrl);
|
||||
return builder;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a scheduled event's cover image.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue