How to set Presence I put code but not working is presence removed


@Edd

Please learn javascript before you make a discord bot

1 Like

I learned but Why presence not working?? There is no error

I know that can you tell me wheres is mine mistake

Javascript and the docs can tell you that

2 Likes

Means??? (20characters)

Ok, please read the discord.js docs.

Why was my post flagged?

Check you messages. It should tell you.

probably because of off-topic

How is that off topic

I didn’t flag it. I am only guessing.

@anon43649539 I’m guessing someone might have that post to be a bit rude…? :man_shrugging:

Hi @Yashraj- I’m not too familiar with the discord.js library, but in the discord.js docs (https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=setPresence) it appears you may need to pass in an object parameter and not just the string ‘DND’ for setPresence.

If you don’t have the answer to the question, @anon43649539, you don’t have to respond. If you think the post is inappropriate, you should email [email protected].

Glitch is a friendly and welcoming community, in the editor and here in the forum. We welcome users of all different backgrounds of coding, beginner through expert.

3 Likes

yes i agree with that but this user has been coming here for a couple of days asking simple things and obviously copying code from google, if the user wanted to continue learning js i would happily help but this person obviously doesnt want to do such.

2 Likes

The user wants an answer to their question, and this is something we guide users to do (https://glitch.happyfox.com/kb/article/81-how-do-i-get-help-when-i-m-stuck/). You are under to obligation to reply to questions in the forum, but we do ask that you are friendly whether you do or not.

3 Likes

We love to help, but if a user is showing no intention to learn, spoon feeding is not going to help. It might work for the next 1 hour, then they’ll be back even more confused unable to do simple things.

However I do agree that @anon43649539’s post could have included a link to documentation/a video to help learn JS.

1 Like

Even if this were a totally fair assessment of the OP’s intentions, it would be more friendly and productive all around to simply not respond, then. Everyone has different learning styles, and sometimes they hit a plateau where “spoon feeding” actually is a helpful push for them in the right direction on their journey of creating.

1 Like

We really do appreciate how helpful everyone here in the forum is. As the community grows, we’re going to encounter more learning styles and coding challenges. This is exciting, but I also appreciate that it’s an adjustment for everyone here. <3

3 Likes

@jenn Again, I am not against not helping people, but people asking for code when tutorials about the same subject are available for free online need to understand to check Google first. And your’s and @tasha’s views on spoon-feeding seem to contradict. She says you should tell them to ask specific questions, not ask for code:

(sent via email)
Whereas you say spoon-feeding is OK:

While in the case of this post, they were asking a question, others don’t. I usually don’t answer and try not to get involved. In my opinion, you and @anon43649539 are both right. We should help if they are asking a question, but users should check Google and not ask to be spoon-fed but instead ask questions

1 Like

ok time to finish this up you’ve confused one function with another on the last few lines of your code. If you switch the places the code should works. To find out which I’ll show you where in the discordjs docs you can find which function should be used for what.

1 Like

I think Tasha and I have the same views here actually, but it’s the use of spoon-feeding that is relative. The original user did not ask anyone to code for them, which I consider to be spoon-feeding. They asked why they had an error, so they wanted to be pointed in the right direction.

At the end of the day, telling someone to learn JavaScript or sending them a lmgtfy link is not helpful. Instead of saying “Google it” maybe suggest “Google [suggested query]”. :slight_smile:

4 Likes

Yes. That’s right. Here there’s a question. If there isn’t a question and instead them asking for you to magic up some code, that they could learn from a tutorial, that’s asking to be spoon-fed and in that case we should link them to a tutorial or relevant documentation
Glad that could be cleared up :slight_smile:

1 Like

@Yashraj,

You seem to have two ready events and one should be quite enough. According to the screenshot, you can

  1. Ctrl + X the code from line 36 to 39

  2. Delete the lines 15 to 17.

  3. Paste the code (which you just cut) at line 15.

Also, instead of client.user.setPresence(), you can use

client.user.setStatus('dnd')