Confirmed 100%, This bot is broken
I recommend not wasting your time trying to use it
It does not save any memory, so once you spend some time adjusting it, then in an hour or 2, the memory is deleted and it becomes brand new as if you didn't' add anything to it.
Sadly, it was a good bot, RIP.
I realise I have been quiet on these issues for some time.
I am running multiple test servers and have not been able to replicate the described issues.
I have verified the code. The configuration is written to disk when you make a change. In addition, the configuration is written to disk both on an hourly schedule and can also happen when various regular processes occur. If the bot is restarted then the configuration is read from the disk.
I have also introduced some logging which confirms that these processes of saving and retrieving the configurations are being followed correctly.
In these logs I have identified some unhandled errors:
Some errors where messages could not be sent - this is due to the bot missing 'SEND MESSAGE' permissions. This error is now caught and logged, though did not crash the bot.
Some functions to remove alerts being called more often than necessary.
Neither of these problems are suspected to have impacted the reported problems.
The only reasons for configuration to be removed:
If a user has sent commands to remove that configuration.
If the configuration files are being restored to an earlier date.
There has been no restoration of previous files to my knowledge, and only I have access to do this.
I am now logging the commands sent by users to the bot - as I suspect this to be the reason why. Note that only users with Manage Message permissions can remove configuration.
If you observe these issues happening, run !config and message it to me on discord (dr.lameos#4911) . Let me know what items are unexpectedly missing from your configuration. I will then check the log to see what commands and configuration activities have been performed on your channel.
I am aware that sometimes the bot does not edit an existing message and posts a new one. This happens by design if the bot receives an error from the discord api when trying to edit the existing message. I can't think of any better way of handling this - again this is logged.
EDIT: I have now observed these issues occurring on my test server. I will investigate further.
As you may know it uses a json config file to store the channel configurations. This worked well as it's a pretty basic dataset that isn't particularly transactional. I wanted to keep it pretty simple and not be running additional software.
The good news, and what caused some confusion, is that the code was doing exactly what it was meant to and working perfectly.
The bad news, when I moved Pobbot from my old work servers to free cloud hosting (replit), I wasn't aware that the cloud hosting did not support changes made to files made via code. This means that it did revert it randomly to the last version which I had manually updated in the backend.
I've moved the json config file to jsonbin.io, from which it is read and updated via API calls. The upside of this is that the bot is now working again as intended. The downsides are that the free account has a credit of 10,000 requests (can top this up to 100,000 for $3) and it's supported by only one person. I estimate the credit to last for about 6 months - as api calls are only made when the bot restarts, when a config item is changed and on an hourly schedule - so should be less than 50 requests per day.
During these 6 months I may move the config to a database, it'd be good for me to figure out that process anyway. There may be some minor tweaking over the next few weeks also so there may be some outages.
Contact me on discord if you have any feature requests, bugs or queries (dr.lameos#4911).