Users - not-ilinked/Anarchy GitHub Wiki

Users are at the very heart of Discord. You interact with other users from your own, join guilds full of them, and so on. In Anarchy, users are represented by DiscordUser objects. What's commonly referred to as a "tag" (the 4 digits after the #) are called "discriminators" in the API.

The client's user

The special DiscordClientUser object represents the current client's own user, which has more data and actions available, and is stored as the DiscordClient's User property. The User property is set whenever the client's Token property is modified.

Settings vs. profiles

The DiscordClientUser object has the methods ChangeProfile() and ChangeSettings(), which might seem confusing since everything is called "User Settings" in the UI, but it's split up this way in the API. Things like your username and email are part of your profile, while things like your theme and who can add you are settings.

Profiles

Discord "profiles" consist of things like:

  • How long they've been a Nitro subscriber for
  • Their connected accounts
  • Mutual guilds between you and them

They are requested seperately from the rest of the user by using the DiscordClient's method GetProfile().

Relationships

"Relationship" is the technical term for your relation to another user, a list of which can be found here. Relationships are a purely user account feature, and is an example of Anarchy's features being more exhaustive than libraries like Discord.Net.

You can get a list of your relationships by calling GetRelationships() or in the OnLoggedIn event of a DiscordSocketClient.

Friend requests are sent through the method SendFriendRequest() and blocking users is done through BlockUser(). Cancelling a friend request, denying one or unblocking a user is all done through the method RemoveRelationship().