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
- 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!You aren't able to change the application name via programing, but you are able to change the nickname
the the nickname i mean
i wanna change the nickname mb
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.
and, obviously the time in-between, just run a routine using something like node-scheduler
got it, and i have last question, how i can target the bot and not a guild member ?
guild.members.me returns the bots guildmember
:catYep:
You can change the Bot's username through code if it's not verified
here are the docs for that btw https://discord.js.org/docs/packages/discord.js/14.16.3/ClientUser:Class#setUsername
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.
it gives me this error ReferenceError: guild is not defined
ye ik that
It's.. bad practice to do something like that, so I'd recommend doing it via guild usernames
-# it was just for additional info for the context
you have to change the code to match what youre doing
i am so lost
i tried adding "export class GuildMember extends Base" so i reference the guild property
-# That's right. But you said that you are not able to change that, what is wrong
then you need to learn more about javascript. #resources
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
Then why not use a library in c#
Also, this isn't java
this is not java btw. Between java and javascript is a difference :)
ye i know that there a diffrence, but i dont even know in which language i am coding
i thought that was python
You are correct but it's really not relevant much past V12 d.js and where on.. 14??
XD
yeh 14
actualy it's not not -relivant it was removed i think
what do you mean was removed?
guys, take this to #general maybe?
Ah yeah sorry!
guys this is my code pls help
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
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
like mark said, you can use C# if you dont want to learn javascript
i heard Discord.NET is a good lib
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
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
-# Yep. Discord.NET is good. I worked with it before
https://docs.discordnet.dev
As retro said
Discord.Net Docs
Home | Discord.Net Documentation
Yipee
But the docs are not that good (my opinion xD)
I'm not proficient in C so, i'll stick to js :cat_peek:
It's..... okay
-# ish