I feel like I've tried everything. My bot's name is currently "TestApp" and I would like to change it to something else. Do I have to remove it completely, create a whole new app inside of https://discordapp.com/developers/, assign it a proper name, then add a bot inside there? Then obviously change the token inside my Discord.js application and re-invite the bot to the channel.
I've tried:
msg.guild.members.get(bot.user.id).setNickname("NEWNAMEHERE")
Discord.Client.setUsername("NEWNAMEHERE")
Let me know if you can actually change the username/nickname of a Discord bot, without removing it and starting over with the configuration. I can't seem to find this answer anywhere.
With Discord's new Dashboard, it's actually really easy to change the username using ANY language! On your applications page, if you go to the "Bot" tab, you can change both the user avatar as well as the username there. After you hit "save changes" it will apply the new username and avatar to Discord. Like before, you won't notice the change immediately, but it will happen.
OLD ANSWER:
As of Discord.js v11.2, When you create a new bot client using Discord.js, you can use .setUsername on the new client to change the name instead of sending a request to the API. You will not notice the change immediately, but it will happen. To rename the application on the developers page, you just need to click on the application itself.
Here's an example login method to change the name, as stated in the documentation.
const Discord = require('discord.js');
const bot = new Discord.Client();
bot.on('ready', function() {
bot.user.setUsername("MyNewUsername");
}
bot.login("token");
Or, if you have an eval command, you can simply run the below. If your bot client is named something other than "bot", use that instead.
bot.user.setUsername("MyNewUsername");
Well who knew, you can send a PATCH request to their server with your new information in it (you can also change avatar like this):
curl -H 'Authorization: Bot TOKEN_GOES_HERE' -H "Content-Type: application/json" -X PATCH -d '{"username": "NEWNAMEHERE"}' https://discordapp.com/api/users/@me
Found this in their documentation here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With