Skip to content

Commit c214f55

Browse files
Update imagine.py
1 parent aee0419 commit c214f55

File tree

1 file changed

+21
-63
lines changed

1 file changed

+21
-63
lines changed

plugins/lucy/imagine.py

+21-63
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,33 @@
1-
"""MIT License
2-
3-
Copyright (c) 2023-24 Erotixe
4-
5-
GITHUB: Erotixe
6-
TELEGRAM: @VeldXd
7-
8-
Permission is hereby granted, free of charge, to any person obtaining a copy
9-
of this software and associated documentation files (the "Software"), to deal
10-
in the Software without restriction, including without limitation the rights
11-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12-
copies of the Software, and to permit persons to whom the Software is
13-
furnished to do so, subject to the following conditions:
14-
15-
The above copyright notice and this permission notice shall be included in all
16-
copies or substantial portions of the Software.
17-
18-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24-
SOFTWARE."""
25-
from pyrogram import filters
1+
from pyrogram import Client, filters
262
from pyrogram.types import Message
27-
from pyrogram.enums import ChatAction
283
from pyrogram.types import InputMediaPhoto
29-
from pyrogram import Client, filters, enums
30-
from info import BOT_USERNAME
31-
import requests
4+
from MukeshAPI import api
5+
from pyrogram.enums import ChatAction,ParseMode
326

337
@Client.on_message(filters.command("imagine"))
348
async def imagine_(b, message: Message):
359
if message.reply_to_message:
3610
text = message.reply_to_message.text
3711
else:
38-
text =message.text.split(None, 1)[1]
39-
m =await message.reply_text( "Please wait...,\n\nGenerating prompt .. ...")
40-
results= requests.get(f"https://mukesh-api.vercel.app/imagine/{text}").json()["results"]
4112

42-
caption = f"""
43-
sᴜᴄᴇssғᴜʟʟʏ Gᴇɴᴇʀᴀᴛᴇᴅ 💘
44-
✨ Gᴇɴᴇʀᴀᴛᴇᴅ ʙʏ : @{BOT_USERNAME}
45-
🥀 ʀᴇǫᴜᴇsᴛᴇᴅ ʙʏ : {message.from_user.mention}
46-
"""
47-
await m.delete()
48-
photos=[]
49-
for i in range(5):
50-
photos.append(InputMediaPhoto(results[i]))
51-
photos.append(InputMediaPhoto(results[5], caption=caption))
52-
await b.send_media_group(message.chat.id, media=photos)
13+
text =message.text.split(None, 1)[1]
14+
Lucy=await message.reply_text( "`ᴘʟᴇᴀsᴇ ᴡᴀɪᴛ ʙʀᴏ...\n\nɢᴇɴᴇʀᴀᴛɪɴɢ ɪᴍᴀɢe...`")
15+
try:
16+
await b.send_chat_action(message.chat.id, ChatAction.UPLOAD_PHOTO)
17+
x=api.ai_image(text)
18+
with open("lucy.jpg", 'wb') as f:
19+
f.write(x)
20+
caption = f"""
21+
⌯ sᴜᴄᴇssғᴜʟʟʏ ɢᴇɴᴇʀᴀᴛᴇᴅ : {text}
22+
⌯ ɢᴇɴᴇʀᴀᴛᴇᴅ ʙʏ : @lucy_filter_bot
23+
"""
24+
await Lucy.delete()
25+
await message.reply_photo("lucy.jpg",caption=caption,quote=True)
26+
except Exception as e:
27+
await Lucy.edit_text(f"error {e}")
5328

54-
# -----------CREDITS -----------
55-
# telegram : @VeldXd
56-
# github : Erotixe
57-
mod_name = "Aɪ ɪᴍᴀɢᴇ"
58-
help = """
29+
30+
__mod_name__ = "Aɪ ɪᴍᴀɢᴇ"
31+
__help__ = """
5932
➻ /imagine : ɢᴇɴᴇʀᴀᴛᴇ Aɪ ɪᴍᴀɢᴇ ғʀᴏᴍ ᴛᴇxᴛ
60-
➻ /mahadev : ɢᴇɴᴇʀᴀᴛᴇ Mᴀʜᴀᴅᴇᴠ ɪᴍᴀɢᴇ
6133
"""
62-
63-
# ɪ ᴀᴍ ɴᴏᴛ ɪɴᴛᴇʀᴇsᴛᴇᴅ ɪɴ ʙᴇɪɴɢ ʏᴏᴜʀ sᴇᴄᴏɴᴅ ғᴀᴛʜᴇʀ ... sᴏ ᴅᴏɴ'ᴛ ʀᴇᴍᴏᴠᴇ ᴍʏ ᴄʀᴇᴅɪᴛ...
64-
65-
#⋗ ᴛᴇʟᴇɢʀᴀᴍ - @Codeflix_bots
66-
67-
#ᴛʜɪs ʟɪɴᴇ ɪs ғᴏʀ ᴄᴏᴘʏ-ᴘᴀsᴛᴇʀs...
68-
#...ᴡʜɪʟᴇ ʏᴏᴜ ᴀʀᴇ ʀᴇᴍᴏᴠɪɴɢ ᴍʏ ᴄʀᴇᴅɪᴛ ᴀɴᴅ ᴄᴀʟʟɪɴɢ ʏᴏᴜʀsᴇʟғ ᴀ ᴅᴇᴠᴇʟᴏᴘᴇʀʀ...
69-
# _____ ᴊᴜsᴛ ɪᴍᴀɢɪɴᴇ, Aᴛ ᴛʜᴀᴛ ᴛɪᴍᴇ ɪ ᴀᴍ ғᴜᴄᴋɪɴɢ ʏᴏᴜʀ ᴍᴏᴍ ᴀɴᴅ sɪs ᴀᴛ sᴀᴍᴇ ᴛɪᴍᴇ, ʜᴀʀᴅᴇʀ & ᴛᴏᴏ ʜᴀʀᴅᴇʀ...
70-
71-
#- ᴄʀᴇᴅɪᴛ - Github - @Codeflix-bots , @erotixe
72-
#- ᴘʟᴇᴀsᴇ ᴅᴏɴ'ᴛ ʀᴇᴍᴏᴠᴇ ᴄʀᴇᴅɪᴛ..
73-
#- ᴛʜᴀɴᴋ ʏᴏᴜ ᴄᴏᴅᴇғʟɪx ʙᴏᴛs ғᴏʀ ʜᴇʟᴘɪɴɢ ᴜs ɪɴ ᴛʜɪs ᴊᴏᴜʀɴᴇʏ
74-
#- ᴛʜᴀɴᴋ ʏᴏᴜ ғᴏʀ ɢɪᴠɪɴɢ ᴍᴇ ᴄʀᴇᴅɪᴛ @Codeflix-bots
75-
#- ғᴏʀ ᴀɴʏ ᴇʀʀᴏʀ ᴘʟᴇᴀsᴇ ᴄᴏɴᴛᴀᴄᴛ ᴍᴇ -> ᴛᴇʟᴇɢʀᴀᴍ @codeflix_bots Community @Otakflix_Network </b>

0 commit comments

Comments
 (0)