Created
December 15, 2025 07:27
-
-
Save Reyz2902/1bc99ba4a0dbca3a5043c5fc2d446b1a to your computer and use it in GitHub Desktop.
Uploaded via Bot WhatsApp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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