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:
parent
bdc08b3153
commit
8c02dc5517
4 changed files with 109 additions and 0 deletions
21
server/createLastfmTable.js
Normal file
21
server/createLastfmTable.js
Normal 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();
|
||||
}
|
||||
);
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue