Users
Client users
Profile vs. settings
Discord splits the user's profile and settings in 2, which is even visible from the UI. The profile is basically the user's name, email, etc., whilst settings are things like message scanning, who can add you, and so on.
Modifying profiles
"Discriminator" is the technical term for the 4 digit number after the #.
Modifying settings
The UserSettingsProperties class isn't complete, although it contains the most common settings.
Badges
Badges are calculated through bitwise operations, much like permissions are. Badges however, cannot just be modified like permissions are. Anarchy's DiscordBadge wraps the numerical values used.
Hypesquad
Hypesquad badges are, in fact, the only badges that you can just go out of your way modify.
The Hypesquad badges also exist within DiscordBadge; it's mostly for convenience.
Presences
Presences are users' statuses and activities. They're only available for Gateway clients.
Activity classes
Discord has different types of activities, all with their own special data. These are the Anarchy classes for those.
Properties (for setting your own)
ActivityProperties: Universal properties class. Cannot be used for ActivityType.Streaming.
GameActivityProperties: Allows for extra detail like how much time has elapsed and the game's state.
StreamActivityProperties: For .Streaming. .Url must be set to a Twitch channel.
From other users
DiscordActivity: Universal class.
DiscordGameActivity: For .Game.
DiscordListeningActivity: For .Listening (for example Spotify).
CustomStatusActivity: For .CustomStatus.
Updating your presence
The methods .SetStatus() and .SetActivity() are also available.
Receiving presences
Anarchy does not cache presences, meaning that the only way to receive presences from other users is the OnUserPresenceUpdated event.
If DiscordPresence.IsGuild is true, DiscordPresence can be casted to a DiscordGuildPresence to reveal more information.
DiscordClientUserDiscordBadgeDiscordActivityDiscordGameActivityDiscordListeningActivityCustomStatusActivityVoice states
Like presences, voice states are only available through gateway clients. Anarchy provides several methods to serve you voice states through the cache, although the OnVoiceStateUpdated event is also available.
Through cache
DiscordVoiceStateContainer
This class exists because bots can be connected to multiple channels at the same time and users can be muted even tho they're not connected to the channel. It's a way of neatly packing everything together.
Through events
As said previously, the OnVoiceStateUpdated event can be used to detect voice state updates. Here's an example of how a listener could look.
Modifying your own
Modifying your own voice state through Anarchy is actually rather simple. Consider the following example.
Setting GuildId is not necessary if you have caching enabled. If you're on a bot account and want to disconnect from a voice channel, make sure to specify the GuildId as ChannelId will be null.
This plays a role in connecting to voice channels, which you can read about below.
DiscordVoiceStateContainerGuildsChannelsRelationships
Relationships the term used for friends and blocked users.
Adding relationships
Passing a user who's sent you a friend request to .SendFriendRequest() will accept their request.
Removing relationships
Anarchy has a single method for removing all types of relationships.
Last updated
Was this helpful?