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

Method saveRandomTexts

autochangename/autochangename.ts:221–231  ·  view source on GitHub ↗
(texts: string[])

Source from the content-addressed store, hash-verified

219
220 static async saveRandomTexts(texts: string[]): Promise<boolean> {
221 await this.init();
222 try {
223 this.db!.data.random_texts = texts.slice(0, 100)
224 .filter((t): t is string => Boolean(t) && typeof t === 'string')
225 .map(t => t.trim())
226 .filter(t => t.length > 0 && t.length <= 50);
227 await this.db!.write();
228 return true;
229 } catch { return false; }
230 }
231
232 static async getAllEnabledUsers(): Promise<number[]> {
233 await this.init();
234 const users = this.db?.data?.users ?? {};

Callers 1

handleTextMethod · 0.80

Calls 2

initMethod · 0.95
writeMethod · 0.80

Tested by

no test coverage detected