Skip to content

Changing Client Account Information

Mike Santiago edited this page Oct 1, 2015 · 2 revisions

DiscordSharp allows you to change various aspects of your account's information via the API.

Changing Bot Display Name

First, you must get an instance of your client's DiscordUserInformation like this.

DiscordUserInformation userInfo = client.ClientPrivateInformation.Copy();

Second, just change the username value to what you want the new username to be

newUserInfo.username = "clever bot name here"

Finally, pass it into the client.ChangeBotInformation method.

client.ChangeBotInformation(newUserInfo);

Email updating is currently not tested, password updating works now, just change the DiscordUserInformation.password field and the client will know and change this!

Changing Bot Profile Picture

(special thanks to Voltana, Discord.Net developer for helping me with this)

Assuming you already have a Bitmap loaded into memory, you can just pass this Bitmap into the client.ChangeBotPicture method.

client.ChangeBotPicture(newBotImage);

DiscordSharp handles all necessary conversion for you, so long as you pass in a Bitmap image.

Should you want to pass in an Image (System.Drawing.Image), you can use the Bitmap class to perform the necessary conversions.

client.ChangeBotPicture(new Bitmap(newBotImageAsImage));