from pyrogram import Client, filters
from pyrogram.types import Message
API_ID = 12345
API_HASH = "alskdjoihuyg76t5tyu21ijnuhycg"
app = Client("session", api_id=API_ID, api_hash=API_HASH)
DELETE_MSG_CNT = 100
@app.on_message(filters.me & filters.text)
async def main(client: Client, message: Message):
text = message.text
if text.startswith("$"):
cmd = text[1:]
chat_id = message.chat.id
print(f"cmd {cmd} from {chat_id}")
if cmd == "rm":
await message.delete()
msgs = []
async for msg in app.get_chat_history(chat_id):
if msg.outgoing:
print(msg.text)
msgs.append(msg.id)
if len(msgs) >= DELETE_MSG_CNT:
print(f"Deleting {DELETE_MSG_CNT} messages...")
await client.delete_messages(chat_id, msgs, revoke=True)
msgs.clear()
if msgs:
await client.delete_messages(chat_id, msgs, revoke=True)
app.run()
👍3
шо я могу оставить вам на память, единственная полезная вещь сделанная мной за последние 5 лет
🤝2
<?php
function generate_uuid_v4() {
$data = random_bytes(16);
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}
$host = $_SERVER['HTTP_HOST'];
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http';
$uri = generate_uuid_v4();
$url = $protocol . '://' . $host . '/' . $uri;
$response = "";
if (function_exists('curl_init')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
} else {
$response = file_get_contents($url);
}
http_response_code(404);
if (!$response){
$server = strtolower($_SERVER['SERVER_SOFTWARE']);
if(str_contains($server, "nginx")){
echo "<html><head><title>404 Not Found</title></head><body><center><h1>404 Not Found</h1></center><hr><center>nginx</center></body></html>";
}
elseif (str_contains($server, "apache")){
echo "<html><head><title>Object Not Found!</title></head><body><header><h1>404 Error: Object Not Found!</h1></header><main><p>The requested URL was not found on this server.</p><strong>If you reached this page from another site:</strong><br>The link on the <a href='#' id='referring-link'>reffered link</a> seems to be broken or outdated.Please inform the author of <a href='#' id='referring-link-2'>that page</a> about the error.</p><p><strong>If you entered the URL manually:</strong><br>Please check the spelling and try again.</p></main></body></html>";
}
else{
echo "404 NOT FOUND";
}
}
else{
echo $response;
}
?>
типа па беспалу
Please open Telegram to view this post
VIEW IN TELEGRAM
😁6👍1
