Skip to content

Instantly share code, notes, and snippets.

@Reyz2902
Created December 15, 2025 07:27
Show Gist options
  • Select an option

  • Save Reyz2902/1bc99ba4a0dbca3a5043c5fc2d446b1a to your computer and use it in GitHub Desktop.

Select an option

Save Reyz2902/1bc99ba4a0dbca3a5043c5fc2d446b1a to your computer and use it in GitHub Desktop.
Uploaded via Bot WhatsApp
import axios from 'axios'
const handler = async (m, { text, conn }) => {
if (!text) return m.reply('Masukkan percakapanmu, contoh: Hai theresa, apa kabar?')
if (text.includes('~')) {
return m.reply('Karakter "~" tidak diperbolehkan.')
}
try {
const url = `https://theresapisv3.vercel.app/ai/theresa?ask=${encodeURIComponent(text)}`
const res = await axios.get(url)
const data = res.data
if (!data.status || !data.result) {
return m.reply(data.message || 'Tidak ada hasil ditemukan.')
}
let hasil = String(data.result).trim()
hasil = hasil.replace(/~/g, '')
await conn.sendMessage(m.chat, {
text: hasil
}, { quoted: m })
} catch (error) {
await conn.sendMessage(m.chat, {
text: `Terjadi kesalahan: ${error.response?.data?.message || error.message}`
}, { quoted: m })
}
}
handler.help = ['theresa <text>']
handler.tags = ['ai']
handler.command = /^(theresa)$/i
handler.limit = false
export default handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment