Discord.Net icon indicating copy to clipboard operation
Discord.Net copied to clipboard

DiscordClient.Connect

Open jack-douglas opened this issue 10 years ago • 4 comments

When i put the code supplied on the documentation it give me "No overload for method 'connect' takes 1 arguments" and then suggests that i change Connect to Disconnect untitled

jack-douglas avatar Sep 09 '16 23:09 jack-douglas

Connect(string token, TokenType tokenType)

use intellisense to look at the other overloads

foxbot avatar Sep 09 '16 23:09 foxbot

Im new to C# programming im not really sure what you mean

jack-douglas avatar Sep 09 '16 23:09 jack-douglas

With the connect you can either connect with just an email and password or with a token provided to you by Discord.

Intellisense shows that there are two signatures: Connect(string email, string password); which will let you use Discord.Net with just a normal account if you don't want to mess with the Discord API and getting a token, etc and Connect(string token, TokenType tokenType); for cases where you have a proper token. There are two token types which are TokenType.Bot and TokenType.User. You're most likely going to be using a Bot token type.

So to fix your example, you'd be doing:

await _client.Connect("THIS-IS-THE-API-TOKEN-DISCORD-PROVIDED-YOU", TokenType.Bot);

darvell avatar Sep 10 '16 23:09 darvell

@Jackdouglas99 this is, by far, not a beginner's library. You should take a look at the tutorials on the .Net Core website https://www.microsoft.com/net/learn

khionu avatar Sep 11 '16 17:09 khionu