How can i make my bots name chance every minute with code ?

Hello everyone i want to make my bot chance his name like every minute or two, can you please help me? this is the code i have written for now - const {Client} = require("discord.js"); const {token} = require("./confic.json") const client = new Client({intents: []}); client.login(token);
37 Replies
d.js toolkit
d.js toolkit2w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Kiɾʌ Kenjiɾø
You aren't able to change the application name via programing, but you are able to change the nickname
Unholy
UnholyOP2w ago
the the nickname i mean i wanna change the nickname mb
Kiɾʌ Kenjiɾø
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Kiɾʌ Kenjiɾø
and, obviously the time in-between, just run a routine using something like node-scheduler
Unholy
UnholyOP2w ago
got it, and i have last question, how i can target the bot and not a guild member ?
chewie
chewie2w ago
guild.members.me returns the bots guildmember
Kiɾʌ Kenjiɾø
:catYep:
felix2336
felix23362w ago
You can change the Bot's username through code if it's not verified
Retro
Retro2w ago
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Unholy
UnholyOP2w ago
it gives me this error ReferenceError: guild is not defined
felix2336
felix23362w ago
ye ik that
Kiɾʌ Kenjiɾø
It's.. bad practice to do something like that, so I'd recommend doing it via guild usernames
Retro
Retro2w ago
-# it was just for additional info for the context you have to change the code to match what youre doing
Unholy
UnholyOP2w ago
i am so lost i tried adding "export class GuildMember extends Base" so i reference the guild property
felix2336
felix23362w ago
-# That's right. But you said that you are not able to change that, what is wrong
Retro
Retro2w ago
then you need to learn more about javascript. #resources
Unholy
UnholyOP2w ago
i just want to make the bot chance his nickname i know c# but not java i really don't have the time to learn java
Mark
Mark2w ago
Then why not use a library in c# Also, this isn't java
felix2336
felix23362w ago
this is not java btw. Between java and javascript is a difference :)
Unholy
UnholyOP2w ago
ye i know that there a diffrence, but i dont even know in which language i am coding i thought that was python
Kiɾʌ Kenjiɾø
You are correct but it's really not relevant much past V12 d.js and where on.. 14??
Unholy
UnholyOP2w ago
XD
Kiɾʌ Kenjiɾø
yeh 14 actualy it's not not -relivant it was removed i think
felix2336
felix23362w ago
what do you mean was removed?
Retro
Retro2w ago
guys, take this to #general maybe?
Kiɾʌ Kenjiɾø
Ah yeah sorry!
Unholy
UnholyOP2w ago
guys this is my code pls help
const {Client} = require("discord.js");
const {token} = require("./confic.json")
export class GuildMember extends Base

const client = new Client({intents: []});

guild.members.me.setNickname('cool nickname', 'Needed a new nickname')
.then(member => console.log(`Set nickname of ${member.user.username}`))
.catch(console.error);


client.login(token);
const {Client} = require("discord.js");
const {token} = require("./confic.json")
export class GuildMember extends Base

const client = new Client({intents: []});

guild.members.me.setNickname('cool nickname', 'Needed a new nickname')
.then(member => console.log(`Set nickname of ${member.user.username}`))
.catch(console.error);


client.login(token);
i am really sorry that i want from u to make me the whole code but i really dont have the time to learn javascript or java
Mark
Mark2w ago
Please refer to the #rules , we expect you to have a solid understanding of js Your unwillingness to learn the language is not our problem
Retro
Retro2w ago
like mark said, you can use C# if you dont want to learn javascript i heard Discord.NET is a good lib
Unholy
UnholyOP2w ago
i dont think i can, currently i am using online host that is called reptl.it replit that is 100% true, i know what i ask for and its kinda jack ass move from me but i just want to have a discord bot that chances his nickname and thats it
Mark
Mark2w ago
We do not spoon-feed code here. We ask that you respect the rules and act accordingly. You can use a language you're familiar with if you want something quicker Also, repl.it is not meant as a bot host, and that doesn't even come into play in the issue at hand
felix2336
felix23362w ago
-# Yep. Discord.NET is good. I worked with it before
Kiɾʌ Kenjiɾø
Yipee
felix2336
felix23362w ago
But the docs are not that good (my opinion xD)
Kiɾʌ Kenjiɾø
I'm not proficient in C so, i'll stick to js :cat_peek: It's..... okay -# ish
Want results from more Discord servers?
Add your server