im programming a Discord bot and I would like to get Discord usernames from user IDs so I know who voted for my bot ive I've tried that using Google to find the answer but it doesn't really show me
You need to collect the user from your client.
const Discord = require("discord.js");
const client = new Discord.Client();
//This return the username of the specified user ID.
const user = client.users.cache.get("USERID");
if (!user) return console.log("Couldn't find the user");
console.log(user.username)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments