import axios from 'axios';

const handler = async (m, { conn, text }) => { let d = new Date(new Date() + 3600000); let locale = 'id'; let date = d.toLocaleDateString(locale, { day: 'numeric', month: 'long', year: 'numeric', });

if (!text) throw 'Example: .ai how to get a girlfriend';

conn.sendMessage(m.chat, { react: { text: '🕒', key: m.key, }, });

const payloads = { model: 'gpt-4', max_tokens: 4000, messages: [ { role: 'system', content: 'You are AI Assistant name Arss Daebotsu : 3. You can understand different languages, but you prefer to speak Indonesian language. Your personality: Fun, like making jokes, casual. You help people with any questions they ask. you were created by your owner Arss Daebotsu.', }, ], };

const question = text; payloads['messages'].push({ role: 'user', content: question, name: 'Arss Daebotsu', });

const { data } = await axios.request({ baseURL: 'https://api.itsrose.life', url: '/chatGPT/turbo', method: 'POST', params: { apikey: ${global.rose}, }, headers: { 'Content-Type': 'application/json', }, data: payloads, });

const { status, message, result } = data;

if (!status) { return m.reply(message); }

let ai = result.messages.content; conn.reply(m.chat, ai, m, { contextInfo: { externalAdReply: { title: 'OpenAi', body: date, thumbnailUrl: 'https://telegra.ph/file/4baf2abd1cccf464f5ec9.jpg', mediaType: 1, renderLargerThumbnail: true, }, }, }); };

handler.command = /^ai$/i; handler.help = ['ai ']; handler.tags = ['tools']; handler.register = true; handler.limit = true;

export default handler;

AI Chatbot dengan GPT-4 untuk WhatsApp

原文地址: https://www.cveoy.top/t/topic/o73n 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录