(sock)
| 53 | return quotes[Math.floor(Math.random() * quotes.length)]; |
| 54 | } |
| 55 | async 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 | } |
| 77 | let autoBioInterval = null; |
| 78 | export function startAutoBio(sock) { |
| 79 | if (autoBioInterval) |
no test coverage detected