Spaces:
Sleeping
Sleeping
Captain Ezio
commited on
Commit
·
6d3c95d
1
Parent(s):
bc65355
Removed unused imports
Browse files- Powers/plugins/utils.py +2 -20
Powers/plugins/utils.py
CHANGED
@@ -4,21 +4,14 @@ import aiofiles
|
|
4 |
from Powers import *
|
5 |
from os import remove
|
6 |
from io import BytesIO
|
7 |
-
# from tswift import Song
|
8 |
from wikipedia import summary
|
9 |
-
from traceback import format_exc
|
10 |
from Powers.bot_class import Gojo
|
11 |
-
from aiohttp import ClientSession
|
12 |
from gpytranslate import Translator
|
13 |
from pyrogram import enums, filters
|
14 |
from Powers.utils.http_helper import *
|
15 |
from Powers.database.users_db import Users
|
16 |
-
from Powers.utils.chat_type import chattype
|
17 |
-
from Powers.utils.parser import mention_html
|
18 |
-
# from search_engine_parser import GoogleSearch
|
19 |
from Powers.utils.custom_filters import command
|
20 |
-
from
|
21 |
-
from pyrogram.errors import PeerIdInvalid, MessageTooLong
|
22 |
from Powers.utils.clean_file import remove_markdown_and_html
|
23 |
from wikipedia.exceptions import PageError, DisambiguationError
|
24 |
from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup
|
@@ -224,7 +217,7 @@ async def github(_, m: Message):
|
|
224 |
if bio:
|
225 |
REPLY += f"<b>Bio:</b> <code>{bio}</code>\n"
|
226 |
if url:
|
227 |
-
REPLY += f"<b>URL:</b> {url}
|
228 |
REPLY += f"<b>Public Repos:</b> {public_repos}\n"
|
229 |
REPLY += f"<b>Followers:</b> {followers}\n"
|
230 |
REPLY += f"<b>Following:</b> {following}\n"
|
@@ -246,20 +239,9 @@ async def github(_, m: Message):
|
|
246 |
|
247 |
|
248 |
# paste here
|
249 |
-
session = ClientSession()
|
250 |
pattern = re.compile(r"^text/|json$|yaml$|xml$|toml$|x-sh$|x-shellscript$")
|
251 |
BASE = "https://batbin.me/"
|
252 |
|
253 |
-
|
254 |
-
async def post(url: str, *args, **kwargs):
|
255 |
-
async with session.post(url, *args, **kwargs) as resp:
|
256 |
-
try:
|
257 |
-
data = await resp.json()
|
258 |
-
except Exception:
|
259 |
-
data = await resp.text()
|
260 |
-
return data
|
261 |
-
|
262 |
-
|
263 |
async def paste(content: str):
|
264 |
resp = await post(f"{BASE}api/v2/paste", data=content)
|
265 |
if not resp["success"]:
|
|
|
4 |
from Powers import *
|
5 |
from os import remove
|
6 |
from io import BytesIO
|
|
|
7 |
from wikipedia import summary
|
|
|
8 |
from Powers.bot_class import Gojo
|
|
|
9 |
from gpytranslate import Translator
|
10 |
from pyrogram import enums, filters
|
11 |
from Powers.utils.http_helper import *
|
12 |
from Powers.database.users_db import Users
|
|
|
|
|
|
|
13 |
from Powers.utils.custom_filters import command
|
14 |
+
from pyrogram.errors import MessageTooLong
|
|
|
15 |
from Powers.utils.clean_file import remove_markdown_and_html
|
16 |
from wikipedia.exceptions import PageError, DisambiguationError
|
17 |
from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup
|
|
|
217 |
if bio:
|
218 |
REPLY += f"<b>Bio:</b> <code>{bio}</code>\n"
|
219 |
if url:
|
220 |
+
REPLY += f"<b>URL:</b> <a href='{url}'>{name}</a>\n"
|
221 |
REPLY += f"<b>Public Repos:</b> {public_repos}\n"
|
222 |
REPLY += f"<b>Followers:</b> {followers}\n"
|
223 |
REPLY += f"<b>Following:</b> {following}\n"
|
|
|
239 |
|
240 |
|
241 |
# paste here
|
|
|
242 |
pattern = re.compile(r"^text/|json$|yaml$|xml$|toml$|x-sh$|x-shellscript$")
|
243 |
BASE = "https://batbin.me/"
|
244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
async def paste(content: str):
|
246 |
resp = await post(f"{BASE}api/v2/paste", data=content)
|
247 |
if not resp["success"]:
|