MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / initDB

Method initDB

pangu/pangu.ts:208–227  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206 const defaultConfig: PanguConfig = {
207 version: "1.0.0",
208 chats: {},
209 whitelist: [],
210 blacklist: [],
211 globalMode: false,
212 stats: {
213 formattedMessages: 0,
214 lastFormatted: null,
215 enabledChats: 0
216 }
217 };
218
219 this.db = await JSONFilePreset<PanguConfig>(dbPath, defaultConfig);
220 this.updateStats();
221 }
222
223 // 获取会话ID
224 private getChatId(msg: Api.Message): string {
225 return msg.peerId.toString();
226 }
227
228 // 获取会话模式
229 private getChatMode(chatId: string): boolean | null {
230 return this.db.data.chats.hasOwnProperty(chatId) ?

Callers 1

setupMethod · 0.95

Calls 1

updateStatsMethod · 0.95

Tested by

no test coverage detected