github.com/meowstercatel/discordgo@v0.0.0-20250615204139-29b43d676735/examples/avatar/README.md (about) 1 <img align="right" alt="DiscordGo logo" src="/docs/img/discordgo.svg" width="200"> 2 3 ## DiscordGo Avatar Example 4 5 This example demonstrates how to utilize DiscordGo to change the avatar for 6 a Discord account. This example works both with a local file or the URL of 7 an image. 8 9 **Join [Discord Gophers](https://discord.gg/0f1SbxBZjYoCtNPP) 10 Discord chat channel for support.** 11 12 ### Build 13 14 This assumes you already have a working Go environment setup and that 15 DiscordGo is correctly installed on your system. 16 17 From within the avatar example folder, run the below command to compile the 18 example. 19 20 ```sh 21 go build 22 ``` 23 24 ### Usage 25 26 This example uses bot tokens for authentication only. While email/password is 27 supported by DiscordGo, it is not recommended to use them. 28 29 ``` 30 ./avatar --help 31 Usage of ./avatar: 32 -f string 33 Avatar File Name 34 -t string 35 Bot Token 36 -u string 37 URL to the avatar image 38 ``` 39 40 The below example shows how to set your Avatar from a local file. 41 42 ```sh 43 ./avatar -t TOKEN -f avatar.png 44 ``` 45 The below example shows how to set your Avatar from a URL. 46 47 ```sh 48 ./avatar -t TOKEN -u https://raw.githubusercontent.com/bwmarrin/discordgo/master/docs/img/discordgo.svg 49 ```