Comments (21)
Regarding the P.S., the unofficial Discord API server is effectively the support server for all APIs, discord.js included.
from discord.js.
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.
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.
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.
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.
Or give them the false hope that they can understand it without prior knowledge :/
from discord.js.
Technic has robbed me of my eagerness to see the best in people.
from discord.js.
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.
Same with Technic, but 64-Bit Java, needing patience, and "you just don't have a good enough computer".
from discord.js.
additional voice documentation would be nice.
from discord.js.
That's implied by "improve docs"
from discord.js.
Voice documentation has been done in commits 5a5316d to 7c0476a.
from discord.js.
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.
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:
- There's a new blog entry.
- WordPress sends a HTTP request to the bot (hosted at Heroku).
- 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.
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.
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.
No, no queue. Just a basic if(!ready){ return }
, if it's not ready, it should ignore.
from discord.js.
But that would still bloat up functions, every single "action" function would need a check that just unnecessarily rejects.
from discord.js.
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.
..... I'm well aware that I can do that in my own code, I already do it....
from discord.js.
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)
- Nextjs + @discordjs/core - Module not found: Can't resolve 'zlib-sync' HOT 5
- Cannot read properties of undefined (reading 'cache') on Channel Update HOT 1
- [@Dev][TS] getChannel<const T...> not valid typescript HOT 2
- What permissions are needed to trigger `interactionCreate` Event HOT 10
- getVoiceConnection sometimes return wrong channel HOT 3
- Thread members are not handled correctly HOT 1
- [Uncaught Rejection]: Error: Authentication failed HOT 7
- TypeError: Cannot read properties of undefined (reading 'send') HOT 6
- `GuildMember` and `GuildChannel` permission-based methods do not reflect permission changes on timeouts HOT 3
- # There is an error in ModalSubmitInteraction.js HOT 5
- `ButtonComponentData` fails type guard field check
- Bug: Message fetch causing whole app crash when wrapped in try/catch HOT 5
- Don't include dom types HOT 1
- Async cache functions (filter/keepOverLimit)
- setName method for updating channel name does not consistently resolve promises HOT 1
- Client.destroy fails with error HOT 1
- Major: discordjs/rest crashing on Node v16.9.1 HOT 14
- components: this.components.map((component) => component.toJSON()) HOT 1
- Nickname is always null, bot has right permissions and intents HOT 5
- feat(create-discord-bot): automatically update versions in templates
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord.js.