DiscordClient class

Constructors

DiscordClient({required String clientId, required String clientSecret, required String redirectUri, required DiscordHttpClient discordHttpClient, DiscordToken? token})
If you need it, you can get the DiscordDioProvider from the discord_api_dio_provider package. Otherwise, you'll have to implement discordHttpClient yourself.

Properties

cdn DiscordCdnHelper
Contains all methods necessary to build elements from Discord's CDN endpoints.
final
clientId String
final
clientSecret String
final
discordHttpClient DiscordHttpClient
final
hashCode int
The hash code for this object.
no setterinherited
redirectUri String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

authorizeUri(List<DiscordApiScope> scopes) Uri
Return the authorization Uri for the Discord API.
createDM(String recipientId) Future<DiscordChannel>
getAccessToken(String code) Future<void>
getCurrentAuthorizationInformation() Future<DiscordAuthorizationInformation>
getCurrentUser() Future<DiscordUser>
getCurrentUserConnections() Future<List<DiscordConnection>>
getCurrentUserGuildMember(String guildId) Future<DiscordGuildMember>
getCurrentUserGuilds({String? beforeId, String? afterId, int limit = 200}) Future<List<DiscordGuild>>
getGuild(String guildId, {bool withCounts = false}) Future<DiscordGuild>
getGuildPreview(String guildId) Future<DiscordGuildPreview>
getUser(String userId) Future<DiscordUser>
initializeToken(DiscordToken discordToken) → void
leaveGuild(String guildId) Future<void>
modifyCurrentUser({String? username, String? imageData}) Future<DiscordUser>
imageData must be a data URI scheme
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshAccessToken() Future<void>
revokeRefreshToken() Future<void>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

baseUrl Uri
final
revokeUri Uri
no setter
tokenUri Uri
no setter

Constants

apiPath → const String
apiVersion → const String
authPath → const String
oauth2Path → const String
revokePath → const String
tokenPath → const String
versionPath → const String