Skip to content
Advertisement

on_guild_join data doesn’t save on my database

I test-ran my code using on_guild_join to fetch data from a server it joined and save it in a specific db file, but when I checked that, it was empty, no data was saved in it. I checked that on_guild_join part was working, and gave all intents. Here’s the code:

JavaScript

class for command ‘execute’, ‘multiexec’:

JavaScript

Advertisement

Answer

In Sqlite3 you need to call commit() to save your changes to the database or they will not be visible from other database connections, and hence, lost.

In your case you will need to add cxn.commit(). I would suggest to also close the database connection when you are done with it, for that use cxn.close().

References:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement