R
Railway9mo ago
dan

File Creations

I have a function that checks for a file that holds specific data for every guild my bot is on. I'm implementing a function where if the file isn't found it'll be automatically created upon the guildCreate event being emitted. Does railway allow this? What I mean by allow is if the app has permission to create files in the "working directory" it runs on.
Solution:
although keep in mind, if you want this file to be persistent then you'll want to store it in a volume
Jump to solution
12 Replies
Percy
Percy9mo ago
Project ID: bdf52ca3-6199-4fdc-b415-bc60d97ba135
dan
danOP9mo ago
bdf52ca3-6199-4fdc-b415-bc60d97ba135
Fragly
Fragly9mo ago
Your app should be able to create files inside of the container it runs on
Solution
Fragly
Fragly9mo ago
although keep in mind, if you want this file to be persistent then you'll want to store it in a volume
dan
danOP9mo ago
Right, I see Normally my bot is meant to be run on a linux vps but compatibility is always a good thing
Adam
Adam9mo ago
or use a database rather than a file that would make it even more widely compatible with more setups
dan
danOP9mo ago
I would do that but I'm making a bot that relies on yaml for configurations. It's meant to be for private guilds, and with how many configurations options I've added managing all those through a database & command would be way too painful I tried to keep the idea of the config system as simple as I could and that's why i went with yaml
Brody
Brody9mo ago
not as painful as managing configuration through yaml files
dan
danOP9mo ago
Yeah I honestly don't have the patience for almost 100 configuration options, cuz everything is customizable, even the responses n stuff So yaml seemed like the better choice for a private bot + with the docs I've made to back it up even a child should be able to configure things to their liking
Brody
Brody9mo ago
fair enough, but Adam didn't mean store config in database, he just meant to store the data in the database
dan
danOP9mo ago
Oh, I see I'm still messing around w the system so idk Also I cache the data upon message create so I don't think it's gonna be that much of a difference
Brody
Brody9mo ago
gotcha
Want results from more Discord servers?
Add your server