Giter Club home page Giter Club logo

Comments (21)

meew0 avatar meew0 commented on August 23, 2024

Regarding the P.S., the unofficial Discord API server is effectively the support server for all APIs, discord.js included.

from discord.js.

khionu avatar khionu commented on August 23, 2024

I would like to point out that people should learn to program before trying to program. If by "noobs" you mean people who have no experience in programming, they need to learn how to before attempting a project meant to be live and used.

Also, the docs are very good, even if lacking in a few areas. Hydra puts a lot of effort into Discord.JS, as we see from the discussions on their channel in the aforementioned Discord Server.

from discord.js.

TehSeph avatar TehSeph commented on August 23, 2024

The docs definitely could use an upgrade, and I agree with the OP in that it would be nice to see the process made easier for people just starting to use the library. A detailed walk-through of the simple ping-pong example would be a great way to explain how the library is designed to be used, while still requiring basic understanding of the core javascript concepts.

from discord.js.

khionu avatar khionu commented on August 23, 2024

I think a Ping Pong tutorial would only serve as a streamlined way to learn Discord.JS. I was extremely rusty at programming when I started using it, and I was past that quickly.

from discord.js.

TehSeph avatar TehSeph commented on August 23, 2024

Exactly my point. It would let those who understand javascript know how the library is used, while letting anyone who doesn't understand javascript know that they should start elsewhere before using the library (or more likely send them to the api channel where we will most likely tell them that lol.)

from discord.js.

khionu avatar khionu commented on August 23, 2024

Or give them the false hope that they can understand it without prior knowledge :/

from discord.js.

khionu avatar khionu commented on August 23, 2024

Technic has robbed me of my eagerness to see the best in people.

from discord.js.

abalabahaha avatar abalabahaha commented on August 23, 2024

Looking at the chat for this library's channel in Discord API (Unofficial) has made me lose my faith in people.

From what I've seen, most common errors are actually common Javascript mistakes (easily corrected by Google + StackOverflow), troubles with installation (opus/ffmpeg/node), and the wrong version of NodeJS.

from discord.js.

khionu avatar khionu commented on August 23, 2024

Same with Technic, but 64-Bit Java, needing patience, and "you just don't have a good enough computer".

from discord.js.

macdja38 avatar macdja38 commented on August 23, 2024

additional voice documentation would be nice.

from discord.js.

abalabahaha avatar abalabahaha commented on August 23, 2024

That's implied by "improve docs"

from discord.js.

meew0 avatar meew0 commented on August 23, 2024

Voice documentation has been done in commits 5a5316d to 7c0476a.

from discord.js.

meew0 avatar meew0 commented on August 23, 2024

As discussed on Discord, we're going to unlink this issue from the milestone, as the voice docs are done, and keep it open for future doc improvements.

from discord.js.

 avatar commented on August 23, 2024

The only gotcha I've found so far is that the bot isn't ready when the login callback is called. I was like 30 minutes trying to figure out why a certain channel couldn't be resolved.

In my case, the bot is a web hook for WordPress. It goes like:

  1. There's a new blog entry.
  2. WordPress sends a HTTP request to the bot (hosted at Heroku).
  3. The bot logs in to Discord, sends a message, and then logs out.

As you can see, it isn't a long-running process. It would be ideal to be able to do this:

bot.login(email, pass, function(err) {
  if (err) {
    throw err;
  }

  // Send message.

  bot.logout();
});

That's how I was trying to do it at first. It's easier to read, and it looks like it might work, but it doesn't. Instead, I had to change it to something like this:

bot.once('ready', function() {
  // Send message.

  bot.logout();
});

bot.login(email, pass, function(err) {
  if (err) {
    throw err;
  }
});

Although I admit it was my mistake for assuming it worked in a certain way, it would be nice if you could add a note about this in the docs for the login function. It would have saved me some time.

Thanks.

from discord.js.

khionu avatar khionu commented on August 23, 2024

I actually have to agree with Pixy. A number of people don't wait for the onReady event, and it throws them off. Personally, I think it should be implemented into the Library that the events that are related to the Discord Platform itself should wait for the onReady. It's someone everyone should be doing to prevent issues, and there's no reason why they would need to not wait.

I mentioned this in chat before, to have onMessage, onPresence, etc, wait for onReady before firing.

from discord.js.

amishshah avatar amishshah commented on August 23, 2024

Do you mean to queue actions until ready is emitted? If so, that's a pretty bad idea in general because it would just bloat up the internals even more. Also, docs are being updated as we speak

from discord.js.

khionu avatar khionu commented on August 23, 2024

No, no queue. Just a basic if(!ready){ return }, if it's not ready, it should ignore.

from discord.js.

amishshah avatar amishshah commented on August 23, 2024

But that would still bloat up functions, every single "action" function would need a check that just unnecessarily rejects.

from discord.js.

 avatar commented on August 23, 2024

FTR, I have no problem with using the current pattern. I just want a note to be added to the docs, since it wasn't obvious for me at first.

@khionu, you can perfectly do that in your code.

from discord.js.

khionu avatar khionu commented on August 23, 2024

..... I'm well aware that I can do that in my own code, I already do it....

from discord.js.

 avatar commented on August 23, 2024

The documentation link is still being rewritten to the newest verison, as people have to do other things in life they can not always get it done right that minute/second.

from discord.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.