This question gets answered with preferences far more often than with reasons. Both ecosystems are mature, both are widely used, and the honest differences are smaller than the arguments about them — but they are not zero.
The real differences
| Python | JavaScript / Node | |
|---|---|---|
| Getting started | Slightly gentler if you have never programmed | Slightly gentler if you have done any web work |
| Dependency file | requirements.txt | package.json |
| Async model | async/await, explicit event loop | async/await, the runtime is the event loop |
| Memory at rest | Comparable for a small bot | Comparable for a small bot |
| Audio and media | Needs external tools; workable | Needs external tools; workable |
| Community examples | Very many | Very many |
What actually decides it
Which one you already know, or which one the tutorial you are following uses. A bot you can debug at midnight in a language you are comfortable with beats a technically superior one you have to look everything up for.
The second factor is what else the bot must do. If it needs a library that only exists well in one language — a specific game API, a data or machine-learning tool, a scraping stack — that decides it, and it decides it more firmly than any preference.
The most common performance bug in either language is the same: a slow operation inside an event handler that stops everything else. time.sleep in Python and a synchronous file read in Node both freeze your bot. The language does not protect you from this; understanding the event loop does.
Whichever you choose
- Pin your dependency versions
^ranges in Node and unpinned pip requirements are both how a bot that worked yesterday stops working after a restart. - Match the runtime version to what your code needs
Some libraries require a recent Python or Node. The startup error names the version it wanted, which is more helpful than most errors.
- Keep the token out of the code
Environment variable or a
.envfile, in both languages, always. - Test locally before uploading
Identical in both. A bot that does not run on your machine will not run on the server either.
It is the most tempting and least rewarding project available to you. A rewrite costs weeks and produces the same features with a new set of bugs. Change language when starting something new, not when maintaining something that works.