• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

EN Read and write from a text file/JSON file

Status
Not open for further replies.

Infiniti

Member
Does anyone know if this is possible? It would enable me to do so many awesome things with the moderation and just user interaction in general.

Basically I want to be able to create a text file/JSON file in my bot directory, and then make commands that write/read data to/from said file.

For example like !setfavesong <song title> can store the song's title in a JSON object for whoever used the command, and then !favesong <user> can display a user's favorite song that they set.
 

irgendwr

no longer active, "retired" staff member
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
Nope, writing files is not possible (wouldn't really make sense) but you can use the following functions to store data:

697c

(Source: Webinterface > Help > Scripting)
 

Infiniti

Member
Ah okay, so these would just be variables/object variables that are stored in some file? Where would the global variables be stored? I'll most likely be working mostly with those.
 

Multivitamin

Well-Known Member
Tier III
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
These things are getting saved in a file Database, dont know the exact location but somewhere in the "data" folder
 
Status
Not open for further replies.
Top