Closed DoubleBoba closed 8 years ago
The example bots I build are using MySql, I don't think the queries can be used in sqlite directly.
If you want to use a different database, you should update the queries in "DatabaseManager.java".
The database is needed because it is used to store user state for each bot and also users preferences. In addition, I use it to store last received update so, in case of restart, bot can continue fetching the updates correctly using getUpdates method.
In any case, it is possible to fully remove the database, but it isn't easy:
I don`t know, is it good practice. I remove all DB using by commenting two lines of code in UpdatesThread. All work fine. And i remove all example code from library. My UpdatesThread class: https://gist.github.com/kingofsystem/40f65577a16bef2a87db
I suggest you to store, somewhere, the last received updateId, that way you will avoid answering twice same message if, for any reason, your bot need to be restarted.
@kingofsystem You can now use this without any kind of database just fetch it from https://jitpack.io/#rubenlagus/TelegramBots/v1.0 or download the jar from https://github.com/rubenlagus/TelegramBots/releases/tag/v1.0
Hopefully should work.
Can I disable database using, or use sqlite? If i simply change driver, it blow up on syntax problems in hardcoded queries.