Adding Entity guides, flowcharts, better sample system. (#2054)
* initial * Interaction glossary entry * Sharded Interaction sample * Renames into solution * Debugging samples * Modify target location for webhookclient * Finalizing docs work, resolving docfx errors. * Adding threaduser to user chart * Add branch info to readme. * Edits to user chart * Resolve format for glossary entries * Patch sln target * Issue with file naming fixed * Patch 1/x for builds * Appending suggestions
This commit is contained in:
8
docs/guides/entities/samples/restentities.cs
Normal file
8
docs/guides/entities/samples/restentities.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
// RestUser entities expose the accent color and banner of a user.
|
||||
// This being one of the few use-cases for requesting a RestUser instead of depending on the Socket counterpart.
|
||||
public static EmbedBuilder WithUserColor(this EmbedBuilder builder, IUser user)
|
||||
{
|
||||
var restUser = await _client.Rest.GetUserAsync(user.Id);
|
||||
return builder.WithColor(restUser.AccentColor ?? Color.Blue);
|
||||
// The accent color can still be null, so a check for this needs to be done to prevent an exception to be thrown.
|
||||
}
|
||||
Reference in New Issue
Block a user