Expose sqlite db

watson
Talon 2021-04-05 17:49:04 +02:00
parent 62e3adf8a7
commit 860c793259
4 changed files with 2151 additions and 8 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules node_modules
voice_tmp voice_tmp
.env .env
*.db

View File

@ -4,19 +4,18 @@ const tts = require('google-tts-api');
const fetch = require('node-fetch'); const fetch = require('node-fetch');
const fs = require('fs'); const fs = require('fs');
const sha1 = require('sha1'); const sha1 = require('sha1');
const sqlite = require('sqlite3');
let joinedVoiceChannels = []; let joinedVoiceChannels = [];
let modules = []; let modules = [];
const bot = new Discord.Client(); const bot = new Discord.Client();
const db = new sqlite.Database(process.env.DB_FILE);
const api = { const api = {
db: db,
isInVoiceChannel: (channel) => { isInVoiceChannel: (channel) => {
return joinedVoiceChannels.includes(channel); return joinedVoiceChannels.includes(channel);
}, },

2144
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@
"google-tts-api": "^2.0.2", "google-tts-api": "^2.0.2",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"opusscript": "^0.0.8", "opusscript": "^0.0.8",
"sha1": "^1.1.1" "sha1": "^1.1.1",
"sqlite3": "^5.0.2"
} }
} }