mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-21 16:55:03 +00:00
Add semicolons to code where missing
This commit is contained in:
parent
6f0d248599
commit
3f6eea7468
1 changed files with 18 additions and 18 deletions
|
@ -8,30 +8,30 @@ export let connection: Connection;
|
||||||
export function connect() {
|
export function connect() {
|
||||||
if (!connectionPromise) {
|
if (!connectionPromise) {
|
||||||
connectionPromise = createConnection().then(async (newConnection) => {
|
connectionPromise = createConnection().then(async (newConnection) => {
|
||||||
if (process.argv.includes('init')) {
|
|
||||||
const staff = (process.env.STAFF ?? "").split(',');
|
|
||||||
// Build the global config
|
|
||||||
const config = {
|
|
||||||
"prefix": "!",
|
|
||||||
"plugins": {
|
|
||||||
"utility": {}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
staff.map(id => config["owners"][id] = 100)
|
|
||||||
|
|
||||||
await newConnection.query(`
|
|
||||||
INSERT IGNORE INTO configs (id, \`key\`, config, is_active, edited_by)
|
|
||||||
VALUES (1, "global", ?, true, 106391128718245888)
|
|
||||||
`, [JSON.stringify(config)])
|
|
||||||
}
|
|
||||||
// Verify the DB timezone is set to UTC
|
// Verify the DB timezone is set to UTC
|
||||||
const r = await newConnection.query("SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP) AS tz")
|
const r = await newConnection.query("SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP) AS tz")
|
||||||
if (r[0].tz !== "00:00:00") {
|
if (r[0].tz !== "00:00:00") {
|
||||||
throw new SimpleError(`Database timezone must be UTC (detected ${r[0].tz})`);
|
throw new SimpleError(`Database timezone must be UTC (detected ${r[0].tz})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
connection = newConnection
|
if (process.argv.includes('init')) {
|
||||||
return newConnection
|
const staff = (process.env.STAFF ?? "").split(',');
|
||||||
|
// Build the global config
|
||||||
|
const config = {
|
||||||
|
"prefix": "!",
|
||||||
|
"owners": staff,
|
||||||
|
"plugins": {
|
||||||
|
"utility": {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
await newConnection.query(`
|
||||||
|
INSERT IGNORE INTO configs (id, \`key\`, config, is_active, edited_by)
|
||||||
|
VALUES (1, "global", ?, true, 106391128718245888)
|
||||||
|
`, [JSON.stringify(config)]);
|
||||||
|
}
|
||||||
|
connection = newConnection;
|
||||||
|
return newConnection;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue