-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c35691
commit 79c5622
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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} ") |