-
-
Save willeccles/c813f4e79f54a7facd0d9df8907d6e0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// first create a client | |
client = new DiscordClient(bottoken, isbot); | |
// define events for the bot | |
// when the client connects... | |
client.Connected += (sender, e) => { ... }; | |
// when a channel message has been recieved... | |
client.MessageReceived += (sender, e) => { ... }; | |
// try to connect to the server | |
try | |
{ | |
consolePrint("Attempting to connect to Discord..."); | |
client.SendLoginRequest(); | |
client.Connect(); | |
consolePrint("Connected to Discord."); | |
} catch (Exception e) | |
{ | |
consoleError(string.Format("Something went wrong while connecting to the server:\n{0}", e.Message)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment