Refreshing, so files get updated


#1

So I know that it doesnt show the change of the file. But It seems to doesnt work for my bot too. Only when I refresh he uses the new data. Can I use a refresh command in my Node script?


#2

You can use the refresh command in console of your project to manually refresh
I also use it to refresh after adding new / editing files.


#3

I know that command, so iam asking to use it in Node or make it auto, due Iam not 24/7 at my pc to refresh whenever a discord user has changed the settings


#4

If you mean restart the bot, then you can use
process.exit();
it will instantly restart / refresh.


#5

The filesystem is writable, any changes you make to files are saved and available straight away. You only need to refresh to sync the latest updates in the editor. If you’re not seeing this behaviour, let us know the project name and we’ll take a look. If your project is private, either make it public temporarily or DM me a join link so we can view the code. Thanks.


#6

Hey, Iam not a pro in js, but when I host my bot on my computer, it all wors like I want. but If i host on glitch, the canges dont take place, only after a restart. Also how can I dm?


#7

“How can I dm” is not related to Glitch, and therefore we can’t provide help about it; you may want to check the according documentation to your bot’s library :
Discord.js
Discord.io
Eris

and about restarting, if you want it to be automatic, you can use the following code under the ready event of your bot :
setTimeout(function () { process.exit(); }, 900000)
where the 900000 is 15 minutes in milliseconds.


#8

You can click on my name on this forum to DM me, but if you don’t see the option because you’re a new user then feel free to email it to me instead: gwilson@fogcreek.com