Discord bot and external js commands

java

#1

Hi, im a bit confused about how glitch works, im trying to make my own discord bot, but here is my problem i was doing all the code in the server.js file but is a bit stresfull moving up and down the code to make some changes. then i try to create some external files like commands/hello_world.js commands/example.js and copy some secctions of the main file to there but i dont know how to import them into the bot or server.js, sorry if i dont know how to express me, and i asume that this is so easy but im a bit noob in js and glitch.
Thanks Renzo


#2

You can do this, for example, as in this guide:
https://anidiots.guide/first-bot/a-basic-command-handler