fix message edit embed, ignore pk;edit triggers
This commit is contained in:
parent
8231c57bdf
commit
7ea945b427
6 changed files with 63 additions and 15 deletions
|
|
@ -26,7 +26,7 @@ public static class DiscordExtensions
|
|||
var avatarIndex = user.Discriminator == 0 ? (int)((user.ID.Value >> 22) % 6) : user.Discriminator % 5;
|
||||
return $"https://cdn.discordapp.com/embed/avatars/{avatarIndex}.png?size={size}";
|
||||
}
|
||||
|
||||
|
||||
public static string? IconUrl(this IGuild guild, int size = 256)
|
||||
{
|
||||
if (guild.Icon == null) return null;
|
||||
|
|
@ -44,6 +44,9 @@ public static class DiscordExtensions
|
|||
return snowflake.Value.Value;
|
||||
}
|
||||
|
||||
public static bool Is(this Optional<Snowflake> s1, Snowflake s2) => s1.IsDefined(out var value) && value == s2;
|
||||
public static bool Is(this Optional<Snowflake> s1, ulong s2) => s1.IsDefined(out var value) && value == s2;
|
||||
|
||||
public static T GetOrThrow<T>(this Result<T> result)
|
||||
{
|
||||
if (result.Error != null) throw new DiscordRestException(result.Error.Message);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue