MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / updateAutoBio

Function updateAutoBio

plugins/setbio.js:55–76  ·  view source on GitHub ↗
(sock)

Source from the content-addressed store, hash-verified

53 return quotes[Math.floor(Math.random() * quotes.length)];
54}
55async function updateAutoBio(sock) {
56 try {
57 const autoBioSettings = await store.getSetting('global', 'autoBio');
58 if (!autoBioSettings?.enabled)
59 return;
60 const quotes = await fetchQuotes();
61 const randomQuote = getRandomQuote(quotes);
62 let bio;
63 if (autoBioSettings.customBio) {
64 bio = autoBioSettings.customBio.replace('{quote}', randomQuote);
65 }
66 else {
67 bio = `${randomQuote}\n\n💎 MEGA-MD`;
68 }
69 if (bio.length > 139) {
70 bio = `${bio.substring(0, 136) }...`;
71 }
72 await sock.updateProfileStatus(bio);
73 }
74 catch (error) {
75 }
76}
77let autoBioInterval = null;
78export function startAutoBio(sock) {
79 if (autoBioInterval)

Callers 2

startAutoBioFunction · 0.85
handlerFunction · 0.85

Calls 2

fetchQuotesFunction · 0.85
getRandomQuoteFunction · 0.85

Tested by

no test coverage detected