mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
style: reformat
This commit is contained in:
@@ -4,19 +4,19 @@ import { version } from '../src/version'
|
||||
|
||||
const manifestPath = path.join(__dirname, '../manifest.json')
|
||||
|
||||
function readManifest (): any {
|
||||
if (fs.existsSync(manifestPath)) {
|
||||
return JSON.parse(fs.readFileSync(manifestPath, 'utf-8'))
|
||||
}
|
||||
function readManifest(): any {
|
||||
if (fs.existsSync(manifestPath)) {
|
||||
return JSON.parse(fs.readFileSync(manifestPath, 'utf-8'))
|
||||
}
|
||||
}
|
||||
|
||||
function writeManifest (manifest: any) {
|
||||
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2))
|
||||
function writeManifest(manifest: any) {
|
||||
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2))
|
||||
}
|
||||
|
||||
const manifest = readManifest()
|
||||
if (version !== manifest.version) {
|
||||
manifest.version = version
|
||||
manifest.name = `LLOneBot v${version}`
|
||||
writeManifest(manifest)
|
||||
manifest.version = version
|
||||
manifest.name = `LLOneBot v${version}`
|
||||
writeManifest(manifest)
|
||||
}
|
||||
|
@@ -1,17 +1,17 @@
|
||||
import {Level} from "level"
|
||||
import { Level } from 'level'
|
||||
|
||||
const db = new Level(process.env["level_db_path"], {valueEncoding: 'json'});
|
||||
const db = new Level(process.env['level_db_path'], { valueEncoding: 'json' })
|
||||
|
||||
async function getGroupNotify() {
|
||||
let keys = await db.keys().all();
|
||||
let result = []
|
||||
for (const key of keys) {
|
||||
// console.log(key)
|
||||
if (key.startsWith("group_notify_")) {
|
||||
result.push(key)
|
||||
}
|
||||
let keys = await db.keys().all()
|
||||
let result = []
|
||||
for (const key of keys) {
|
||||
// console.log(key)
|
||||
if (key.startsWith('group_notify_')) {
|
||||
result.push(key)
|
||||
}
|
||||
return result
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
getGroupNotify().then(console.log)
|
||||
getGroupNotify().then(console.log)
|
||||
|
Reference in New Issue
Block a user