Python Solve Problems | python tools | ملفات php | بوتات php | كورس python | ملفات python | بوتات python | حل مشاكل بايثون
712 subscribers
17 photos
54 videos
80 files
30 links
القناة ليست فُندق لتغادر حينما تسوء الخدمة
𝐈𝐓 𝐂𝐎𝐍𝐓𝐀𝐈𝐍𝐒𓂃𓂃 python or php
ᴏᴡɴᴇʀ 𓂃 @N0040
ᴏᴡɴᴇʀ 𓂃 @

—–––––––––––—
Download Telegram
Forwarded from PyCrazy
PyCrazy
Photo
from pyrogram.types import Message
from pyrogram import filters, Client
from io import BytesIO

from aiohttp import ClientSession
import sys
import traceback
from functools import wraps

from pyrogram.errors.exceptions.forbidden_403 import ChatWriteForbidden

OWNER_ID = 5565674333

def split_limits(text):
if len(text) < 2048:
return [text]

lines = text.splitlines(True)
small_msg = ""
result = []
for line in lines:
if len(small_msg) + len(line) < 2048:
small_msg += line
else:
result.append(small_msg)
small_msg = line

result.append(small_msg)

return result

def capture_err(func):
@wraps(func)
async def capture(client, message, *args, **kwargs):
try:
return await func(client, message, *args, **kwargs)
except ChatWriteForbidden:
return
except Exception as err:
exc_type, exc_obj, exc_tb = sys.exc_info()
errors = traceback.format_exception(
exc_type,
value=exc_obj,
tb=exc_tb,
)
error_feedback = split_limits(
"ERROR | {} | {}\n\n
{}
\n\n
{}
\n".format(
0 if not message.from_user else message.from_user.id,
0 if not message.chat else message.chat.id,
message.text or message.caption,
"".join(errors),
),
)
for x in error_feedback:
await Client.send_message(OWNER_ID, x)
raise err

return capture


async def make_carbon(code):
url = "https://carbonara.solopov.dev/api/cook"
async with ClientSession().post(url, json={"code": code}) as resp:
image = BytesIO(await resp.read())
image.name = "carbon.png"
return image




@Client.on_message(filters.command("carbon"))
@capture_err
async def carbon_func(c:Client, message):
if message.reply_to_message:
if message.reply_to_message.text:
txt = message.reply_to_message.text
else:
return await message.reply_text("ʀᴇᴘʟʏ ᴛᴏ ᴀ ᴍᴇssᴀɢᴇ ᴏʀ ɢɪᴠᴇ sᴏᴍᴇ ᴛᴇxᴛ.")
else:
try:
txt = message.text.split(None, 1)[1]
except IndexError:
return await message.reply_text("ʀᴇᴘʟʏ ᴛᴏ ᴀ ᴍᴇssᴀɢᴇ ᴏʀ ɢɪᴠᴇ sᴏᴍᴇ ᴛᴇxᴛ.")
m = await message.reply_text("ɢᴇɴᴇʀᴀᴛɪɴɢ ᴄᴀʀʙᴏɴ...")
carbon = await make_carbon(txt)
await m.edit_text("ᴜᴩʟᴏᴀᴅɪɴɢ ɢᴇɴᴇʀᴀᴛᴇᴅ ᴄᴀʀʙᴏɴ...")
await c.send_photo(
message.chat.id,
photo=carbon,
caption=f"» ʀᴇᴏ‌ᴜᴇsᴛᴇᴅ ʙʏ : {message.from_user.mention}",
)
await m.delete()
carbon.close()


📄⭐️By : Dev Mohamed ⭐️
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
Forwarded from PyCrazy
TshakeV2-main.zip
65.4 KB
😀 سورس تشاكي

🤗-Source Protection Python

-سورس حمايه بالغه python👼
Please open Telegram to view this post
VIEW IN TELEGRAM
❤2
Forwarded from PyCrazy
الاسرع.py
3.3 KB
Word order code
language python

𝙥𝙞𝙥 ⇲ :

pip install pyrogram ==2.0.106

python projects
Dev
👍3
Forwarded from PyCrazy
from pyrogram import Client, filters
from pyrogram.types import Message

app = Client("B3KKK", api_id = 14170449, api_hash = "03488b3c030fe095667e7ca22fe34954", bot_token = "6189018608:")

@app.on_message(filters.video_chat_started)
async def StartCall(c:Client,m:Message):
await m.reply("> تم بدأ مكالمة فيديو ")


@app.on_message(filters.video_chat_ended)
async def EndCall(c:Client,m:Message):
await m.reply("> تم انهاء مكالمة الفيديو")


@app.on_message(filters.video_chat_members_invited)
async def CallTag(c:Client,m:Message):
text = f"¦> قام {m.from_user.mention}\n - بدعوة : "
x = 0
for Name in m.video_chat_members_invited.users:
try:
text += f"[{Name.first_name}](tg://user?id={Name.id}) "
x += 1
except Exception as e:
await m.reply(str(e) +
"\n حدث خطأ!!",quote =True)
return
try:
await m.reply(f"{text}")
except Exception as e:
await m.reply(str(e) +
"\n حدث خطأ!!",quote =True)
return


print("انتظر.........")
app.run()
print("تم التشغيل")

#عارف_انو_سهل
#لكن_فيه_ناس_بتبيعوا

كود تنبيه بفتح الكول و قفلها
كود تنبيه بدعوه شخص للكول

By : Dev Mohamed 🇪🇬🇪🇬

Pyrogram : Link
👍3
Forwarded from PyCrazy
@b3kkk.on_message(filters.command('say'))
def echo_(bot, m):
text = m.text.split(None,1)[1]
m.reply(text)


Example:

You:
/say السلام عليكم

Bot:
السلام عليكم


Channel : @B3KKK
❤1
Forwarded from PyCrazy
@b3kkk.on_message(filters.text)
def delete2_text(bot, m):
word =["احا","احتين"]
if m.text in word:
bot.delete_messages(m.chat.id,m_ids=m.message_id)



المثال ده :

لو قولت احا
البوت يمسح الرساله

فكرته منع الكلمات المسيئه

Channel : @B3KKK
Forwarded from PyCrazy
@B3KkK.on_message(filters.command('leave'))
def leave(bot,m):
m.reply('I Will leave Now')
bot.leave_chat(m.chat.id)



مغادره البوت من الجروب

Channel : @B3KKK
Forwarded from PyCrazy
from pyrogram import Client,filters



@B3KkK.on_message(filters.voice)
def anything(bot, m):
m.reply(m.voice.file_id)


☝️هذا الكود اي ريكورد او بصمه تبعتها بطلع الك رابط الريكورد او البصمه اي كان حجمها اي


@B3kkk.on_message(filters.command('s'))
def anything_(bot, m):
m.reply_voice("")



☝️هذا الكود تحط فيه اي رابط ريكود او بصمه
بين الاقواس. " " و اكتب /s ينرسل البصمه او الريكورد

Channel : @B3KKK
👍2
Forwarded from PyCrazy
...قولوا افكار الي اعملها بعد ما اخلص امتحانات...... 🦋
Please open Telegram to view this post
VIEW IN TELEGRAM
Forwarded from PyCrazy
اللي بستخدم ريدز

و عاوز كود يحفظ الايديهات و يقول كام ايدي

و يجيب الأعضاء و يعمل اذاعه
و يقفل مثلا الرسايل في الجروب يعمل لايك و بكره انزله


امثله بسيطه و مشروحه و هتفهموها
Forwarded from PyCrazy
from pyrogram import *
from pyrogram.types import *
from os import *
from asyncio import *


app = Client(
"Idd",20993785,"a5378e174b86b9fc3cf1ef284e2767b4",
"6245753453:")


@app.on_message(filters.command('ايدي',''))
async def idd(c:Client,m:Message):
user_id = m.from_user.id
msg = await m.reply('جاري جلب معلومات الحساب...')
user = await c.get_users(user_id)
username = "@"+user.username if user.username else "-"
first_name = user.first_name
last_name = user.last_name if user.last_name else "-"
name = user.first_name+" "+user.last_name if user.last_name else user.first_name
b = (await c.get_chat(user_id)).bio
bio = b if b else '-'
status = str(user.status).replace('UserStatus.','')
dcid = user.dc_id if user.dc_id else '-'
txt = f"""
◈<u> معلومات الحساب </u>◈


- user id : {user_id} ✓
- first name : {first_name} ✓
- last name : {last_name} ✓
- usernane : {username} ✓
- dc id : {dcid} ✓
- is bot : {user.is_bot} ✓
- is scam : {user.is_scam} ✓
- premium : {user.is_premium} ✓
- bio : {bio} ✓
- last seen : {status} ✓
- profile link : <a href='tg://user?id={user_id}'>{name}</a>
"""
ph = user.photo.big_file_id if user.photo else None
if ph:
ph2 = await c.download_media(ph)
await gather(
msg.delete(),
c.send_photo(
m.chat.id,
ph2,
caption=txt)
)
remove(ph2)
else:
await msg.edit(txt)

app.run()



🦋DEV @DevEbnMasr

Channel : @B3KKK
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
Forwarded from PyCrazy
from pyrogram import Client, filters
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
from youtube_search import YoutubeSearch as B3KKK
import requests
import yt_dlp
import os


app = Client("Test11", 14170449,"03488b3c030fe095667e7ca22fe34954", bot_token = "6189018608")




@app.on_message(filters.command("يوت", [""]))
async def search(app,m:Message):
AssId = m.from_user.id
Msg = m.text.split(None, 1)[1]
B3 = B3KKK(Msg, max_results=4).to_dict()
buttons = []
for i in B3:
buttons.append([
InlineKeyboardButton(
i["title"],callback_data=f"{AssId}Down{i['id']}"
)])
await m.reply(f"-› نتائج بحثك عن {Msg}:",disable_web_page_preview=True,reply_markup=InlineKeyboardMarkup(buttons))

@app.on_callback_query(filters.regex("Down"))
async def get_info(app, query: CallbackQuery):
AssId = query.data.split("Down")[0]
IdVi = query.data.split("Down")[1]
if not query.from_user.id == int(AssId):
return await query.answer("هذا الأمر لا يخصك ", show_alert=True)
await query.message.delete()
B3 = B3KKK(f'https://youtu.be/{IdVi}', max_results=1).to_dict()
title = B3[0]['title']
url = f'https://youtu.be/{IdVi}'
await app.send_message(
query.message.chat.id,
f"[{title}]({url})",
disable_web_page_preview=True,
reply_markup=InlineKeyboardMarkup([[
InlineKeyboardButton ("صوت", callback_data=f'{AssId}MuAu{IdVi}'),],[
InlineKeyboardButton("🧚‍♀", user_id=5565674333),],]))




@app.on_callback_query(filters.regex("MuAu"))
async def get_audii(Mohamed, query: CallbackQuery):
IdVi = query.data.split("MuAu")[1]
AssId = query.data.split("MuAu")[0]

if not query.from_user.id == int(AssId):
return await query.answer("هذا الأمر لا يخصك ", show_alert=True)

url = f'https://youtu.be/{IdVi}'
await query.edit_message_text("⏳ جاري التحميل ..", reply_markup=InlineKeyboardMarkup ([[InlineKeyboardButton("⏳",callback_data='none')]]))

ydl_ops = {"format": "bestaudio[ext=m4a]"}
with yt_dlp.YoutubeDL(ydl_ops) as ydl:
info_dict = ydl.extract_info(url, download=False)

if int(info_dict['duration']) > 3605:
return await query.edit_message_text("حد التحميل ساعة فقط",reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("⚠️",callback_data='none')]]))

audio_file = ydl.prepare_filename(info_dict)
ydl.process_info(info_dict)
await query.edit_message_text("جاري الإرسال ..", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("🚀",callback_data='none')]]))

response= requests.get(info_dict['thumbnail'])
with open(f"{IdVi}.png", "wb") as file:
file.write(response.content)

user = await app.get_users(int(AssId))
await query.message.reply_audio(audio_file,title=info_dict['title'],duration=int(info_dict['duration']),performer=info_dict['channel'],caption=f'• من طلب -› {user.mention}',thumb=f"{IdVi}.png")

await query.edit_message_text(f"🔗 [{info_dict['title']}]({url})", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("Owner",user_id=int(5565674333))]]),disable_web_page_preview=True)
Thu = f"{IdVi}.png"
os.remove(Thu)
os.remove(audio_file)


app.run()
👌3❤2
Forwarded from PyCrazy
from pyrogram import Client, filters
from getids import get_date_as_string as B3KKK

app = Client("Test11", 14170449,"03488b3c030fe095667e7ca22fe34954", bot_token = "6189018608")

def B3KKK(id: int) -> str:
if str(id)[0] == '5' and str(id)[1] == '9':
return '01/2023'
if len(str(id)) == 10:
if str(id)[0] == '5':
if not str(id)[1] == '0':
return '0{}/2022'.format(str(id).replace("0","")[2])
else:
return '0{}/2022'.format(str(id)[2])
elif str(id)[0] == '1' and str(id)[1] == '0':
if '11' in str(id):
return '11/2020'
if '12' in str(id):
return '12/2020'
else:
return '0{}/2020'.format(str(id).replace("0","")[2])
else:
if '11' in str(id):
return '11/2021'
if '12' in str(id):
return '12/2021'
if '10' in str(id):
return '10/2021'
else:
return '0{}/2021'.format(str(id).replace("0","")[1])
if len(str(id)) == 9:
if str(id)[0] == '9':
return '0{}/2020'.format(str(id).replace("0","")[0])
else:
return B3KKK(id)[1]
else:
return B3KKK(id)[1]


@app.on_message(filters.text)
def TexTMsg(app, message):
chat_id = message.chat.id
text = message.text

if (text == "الانشاء" or text == "انشاء"):
if message.reply_to_message:
id = message.reply_to_message.from_user.id
date = B3KKK(id)
message.reply(f"الانشاء : {date}")
else:
id = message.from_user.id
date = B3KKK(id)
message.reply(f"الانشاء : {date}")



Dev : @N0040
Channel : @B3KKK

كود بيظهر ليك انشاء حسابك
❤2
Forwarded from PyCrazy
Getids.py
2.9 KB
⭐️ كود ايدي

يجلب معرف الشخص، معرف المجموعه، معرف القناه : من خلال عمل /id على الرساله

/info + يوزر، ايدي



⭐️Dev : @N0040
⭐️Channel : @B3KKK
Please open Telegram to view this post
VIEW IN TELEGRAM
❤1👍1
PyCrazy
Getids.py
ملحوظه
ضيف في الملف

Client = Client("B3KKK",api_id=#api_idالخاص بك, api_hash="#api_hash الخاص بك",bot_token="#bot_token الخاص بك")



في آخر الملف

Client.run()