MCPcopy Create free account
hub / github.com/Maccoder3/MAC-MD / processTxtAndSaveCredentials

Function processTxtAndSaveCredentials

lib/makesession.js:8–23  ·  view source on GitHub ↗
(txt)

Source from the content-addressed store, hash-verified

6let pastebin = new PastebinAPI('bR1GcMw175fegaIFV2PfignYVtF0b_Bl')
7
8async function processTxtAndSaveCredentials(txt) {
9 const __filename = fileURLToPath(import.meta.url)
10 const __dirname = path.dirname(__filename)
11
12 const pasteId = txt.replace('GuruBot~', '')
13
14 let decodedData = await pastebin.getPaste(pasteId)
15
16 try {
17 const credsPath = path.join(__dirname, '..', 'session', 'creds.json')
18 writeFileSync(credsPath, decodedData.toString())
19 console.log('Saved credentials to', credsPath)
20 } catch (jsonError) {
21 console.error('Error parsing JSON:', jsonError)
22 }
23}
24
25export default processTxtAndSaveCredentials

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected