Readfile is always undefined


PhantomBot Version: stable
OS Version: Windows 7
Java Version: latest 64bit
Browser and Version (for Panel Support): Chrome latest
Stock PhantomBot: Yes

Let us know what help you need:
I’m trying to add a command to read the .txt generated by the AIMP Plugin ‘Current Track Info Into File’. This plugin generates a text-file with information about the music I’m playing in AIMP.
I added the following command: !addcom !song (readfile ./addons/CurrentTrackInfo.txt)
Sadly this doesn’t work, the response is always “undefined”, even when there’s something in the text-file.



By default the bot will only read in the addons folder, adding ./addons again will force the bot to read in ./addons/./addons, which doesn’t exist. Try removing that part and only leaving your file name.


I got that from the readme
../addons/CurrentTrackInfo.txt worked fine, so I guess all I needed was the actual filename?


I will update that guide, sorry for the confusion. Only the file name is needed since the bot will automatically read in the addons folder.


This topic was automatically closed after 30 days. New replies are no longer allowed.