You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

restentities.cs 509 B

12345678
  1. // RestUser entities expose the accent color and banner of a user.
  2. // This being one of the few use-cases for requesting a RestUser instead of depending on the Socket counterpart.
  3. public static EmbedBuilder WithUserColor(this EmbedBuilder builder, IUser user)
  4. {
  5. var restUser = await _client.Rest.GetUserAsync(user.Id);
  6. return builder.WithColor(restUser.AccentColor ?? Color.Blue);
  7. // The accent color can still be null, so a check for this needs to be done to prevent an exception to be thrown.
  8. }