Create whsiper.py
Browse files- Akeno/plugins/whsiper.py +58 -0
Akeno/plugins/whsiper.py
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
# Copyright 2020-2024 (c) Randy W @xtdevs, @xtsea
|
4 |
+
#
|
5 |
+
# from : https://github.com/TeamKillerX
|
6 |
+
# Channel : @RendyProjects
|
7 |
+
# This program is free software: you can redistribute it and/or modify
|
8 |
+
# it under the terms of the GNU Affero General Public License as published by
|
9 |
+
# the Free Software Foundation, either version 3 of the License, or
|
10 |
+
# (at your option) any later version.
|
11 |
+
#
|
12 |
+
# This program is distributed in the hope that it will be useful,
|
13 |
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
+
# GNU Affero General Public License for more details.
|
16 |
+
#
|
17 |
+
# You should have received a copy of the GNU Affero General Public License
|
18 |
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19 |
+
|
20 |
+
import requests
|
21 |
+
from pyrogram import *
|
22 |
+
from pyrogram import Client, filters
|
23 |
+
from pyrogram.types import *
|
24 |
+
|
25 |
+
from Akeno.utils.handler import Akeno
|
26 |
+
from Akeno.utils.logger import LOGS
|
27 |
+
from config import CMD_HANDLER
|
28 |
+
|
29 |
+
async def whsiperhack(file_path):
|
30 |
+
url = "https://randydev-ryuzaki-api.hf.space/api/v1/akeno/whsiper"
|
31 |
+
files = {"file": open(file_path, "rb")}
|
32 |
+
response = requests.post(url, files=files)
|
33 |
+
if response.status_code != 200:
|
34 |
+
LOGS.error(f"Error response: {response.status_code}")
|
35 |
+
return None
|
36 |
+
return response.json()
|
37 |
+
|
38 |
+
@Akeno(
|
39 |
+
filters.command(["whsiper"], CMD_HANDLER)
|
40 |
+
& filters.me
|
41 |
+
& ~filters.forwarded
|
42 |
+
)
|
43 |
+
async def whsiperto(client: Client, message: Message):
|
44 |
+
if not message.reply_to_message:
|
45 |
+
return await message.reply_text("Please reply to message voice.")
|
46 |
+
try:
|
47 |
+
reply_message = message.reply_to_message
|
48 |
+
if not reply_message.voice:
|
49 |
+
return await message.reply_text("Why dick?.")
|
50 |
+
file_lol = await reply_message.download()
|
51 |
+
response = await whsiperhack(file_lol)
|
52 |
+
if response is None:
|
53 |
+
return await message.reply_text("Failed to whsiper.")
|
54 |
+
pro = await message.reply_text("Whsiper, please wait...")
|
55 |
+
ok = await pro.edit_text(response.get("message"))
|
56 |
+
except Exception as e:
|
57 |
+
LOGS.error(str(e))
|
58 |
+
await message.edit_text(str(e))
|