Skip to content

Commit

Permalink
Create Chatgpt.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Badhacker98 authored Oct 11, 2024
1 parent 5c35691 commit 79c5622
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions shizuchat/modules/Chatgpt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import os
import random
import time
from shizuchat import shizuchat
from config import OWNER_USERNAME
import requests
from pyrogram.types import Message
from pyrogram import Client, filters
from pyrogram.types import InputMediaPhoto
from BadAPI import api
from pyrogram.enums import ChatAction, ParseMode
from pyrogram import filters


@shizuchat.on_cmd(
filters.command(
["chatgpt", "ai", "ask", "gpt", "solve"],
prefixes=["+", ".", "/", "-", "", "$", "#", "&"],
)
)
async def chat_gpt(bot, message):

try:
await bot.send_chat_action(message.chat.id, ChatAction.TYPING)
if len(message.command) < 2:
await message.reply_text(
"Example:**\n\n/chatgpt Where is golden temple?")
else:
a = message.text.split(' ', 1)[1]
r=api.gemini(a)["results"]
await message.reply_text(f" {r} \n\n🌸 ᴍᴀᴅᴇ ᴡɪᴛʜ ❣️ ʙʏ [ʙᴀᴅ ᴍᴜɴᴅᴀ](https://t.me/{OWNER_USERNAME}) ||</b>", parse_mode=ParseMode.MARKDOWN)
except Exception as e:
await message.reply_text(f"**ᴇʀʀᴏʀ: {e} ")

0 comments on commit 79c5622

Please sign in to comment.