简体   繁体   中英

How do I pull a Discord ID and transferring it into a username using Discord.NET?

I'm working on an app in c# and I want it to be able to pull a Discord users ID and transfer it into their Username using Discord.NET so if anyone knows how to do it please respond!!

idk if this helps but there are apps on github that do this. Maybe checkout one of them then see if the code can be replicated in c#?

This should work:

var user = _client.GetUserAsync("ID").result;
var Username = user.Username + user.Discriminator ;

Hope this helped.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM