Add fm set username command

Beginning of the command. Can't do anything other than setting and
updating your lastfm username.
This commit is contained in:
SileNce5k 2024-03-04 12:01:11 +01:00
parent bdc08b3153
commit 8c02dc5517
No known key found for this signature in database
GPG key ID: 961132EB78C8915F
4 changed files with 109 additions and 0 deletions

View file

@ -0,0 +1,21 @@
const sqlite3 = require('sqlite3').verbose();
module.exports = async function () {
const db = new sqlite3.Database('data/database.db');
return new Promise ((resolve, reject)=>{
db.run(
`CREATE TABLE IF NOT EXISTS lastfm (
userID INTEGER PRIMARY KEY,
lastfmUsername TEXT)`,
(err) => {
if (err) {
console.error(`Error while creating table 'lastfm': ${err}`);
reject(err);
} else {
console.log("Table 'lastfm' created successfully.");
resolve();
}
db.close();
}
);
})
}