mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
Update 21 09 2023 (#285)
* debug new logs * debug * mm * typo * coba * dd * mm * s * typo * cek * Fixed * mm * dd * kkk
This commit is contained in:
parent
90c6e8af8c
commit
ec2f0d4bc8
11 changed files with 63 additions and 39 deletions
|
|
@ -188,7 +188,7 @@ PERINGATAN: Menjual Kode Kepada Orang Lain Demi Uang *Dilarang Keras*. Tuhan sel
|
||||||
[readme-ko-url]: README.md
|
[readme-ko-url]: README.md
|
||||||
[kofi-url]: https://ko-fi.com/yasirarism
|
[kofi-url]: https://ko-fi.com/yasirarism
|
||||||
[paypal-url]: https://paypal.me/yasirarism
|
[paypal-url]: https://paypal.me/yasirarism
|
||||||
[qris-url]: https://telegra.ph/file/2acf7698f300ef3d9138f.jpg
|
[qris-url]: https://telegraph.yasirweb.eu.org/file/2acf7698f300ef3d9138f.jpg
|
||||||
[sociabuzz-url]: https://sociabuzz.com/yasirarism/tribe
|
[sociabuzz-url]: https://sociabuzz.com/yasirarism/tribe
|
||||||
[saweria-url]: https://saweria.co/yasirarism
|
[saweria-url]: https://saweria.co/yasirarism
|
||||||
[trakteer-url]: https://trakteer.id/yasir-aris-sp7cn
|
[trakteer-url]: https://trakteer.id/yasir-aris-sp7cn
|
||||||
|
|
@ -188,7 +188,7 @@ WARNING: Selling The Codes To Other People For Money Is *Strictly Prohibited*. G
|
||||||
[readme-ko-url]: README.id.md
|
[readme-ko-url]: README.id.md
|
||||||
[kofi-url]: https://ko-fi.com/yasirarism
|
[kofi-url]: https://ko-fi.com/yasirarism
|
||||||
[paypal-url]: https://paypal.me/yasirarism
|
[paypal-url]: https://paypal.me/yasirarism
|
||||||
[qris-url]: https://telegra.ph/file/9427d61d6968b8ee4fb2f.jpg
|
[qris-url]: https://telegraph.yasirweb.eu.org/file/9427d61d6968b8ee4fb2f.jpg
|
||||||
[sociabuzz-url]: https://sociabuzz.com/yasirarism/tribe
|
[sociabuzz-url]: https://sociabuzz.com/yasirarism/tribe
|
||||||
[saweria-url]: https://saweria.co/yasirarism
|
[saweria-url]: https://saweria.co/yasirarism
|
||||||
[trakteer-url]: https://trakteer.id/yasir-aris-sp7cn
|
[trakteer-url]: https://trakteer.id/yasir-aris-sp7cn
|
||||||
|
|
@ -59,7 +59,7 @@ async def handle_error(
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(Exception):
|
||||||
try:
|
try:
|
||||||
await m.reply_photo(
|
await m.reply_photo(
|
||||||
"https://telegra.ph/file/3c9162b242567ae25d5af.jpg",
|
"https://telegraph.yasirweb.eu.org/file/3c9162b242567ae25d5af.jpg",
|
||||||
caption="An Internal Error Occurred while Processing your Command, the Logs have been sent to the Owners of this Bot. Sorry for Inconvenience",
|
caption="An Internal Error Occurred while Processing your Command, the Logs have been sent to the Owners of this Bot. Sorry for Inconvenience",
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
|
|
@ -76,7 +76,7 @@ async def handle_error(
|
||||||
await m.message.delete()
|
await m.message.delete()
|
||||||
try:
|
try:
|
||||||
await m.reply_photo(
|
await m.reply_photo(
|
||||||
"https://telegra.ph/file/3c9162b242567ae25d5af.jpg",
|
"https://telegraph.yasirweb.eu.org/file/3c9162b242567ae25d5af.jpg",
|
||||||
caption="An Internal Error Occurred while Processing your Command, the Logs have been sent to the Owners of this Bot. Sorry for Inconvenience",
|
caption="An Internal Error Occurred while Processing your Command, the Logs have been sent to the Owners of this Bot. Sorry for Inconvenience",
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ async def post_to_telegraph(is_media: bool, title=None, content=None, media=None
|
||||||
if is_media:
|
if is_media:
|
||||||
# Create a Telegram Post Foto/Video
|
# Create a Telegram Post Foto/Video
|
||||||
response = await telegraph.upload_file(media)
|
response = await telegraph.upload_file(media)
|
||||||
return f"https://telegra.ph{response[0]['src']}"
|
return f"https://telegraph.yasirweb.eu.org{response[0]['src']}"
|
||||||
# Create a Telegram Post using HTML Content
|
# Create a Telegram Post using HTML Content
|
||||||
response = await telegraph.create_page(
|
response = await telegraph.create_page(
|
||||||
title,
|
title,
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import pickle
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
from datetime import datetime
|
from datetime import datetime, timedelta
|
||||||
from inspect import getfullargspec
|
from inspect import getfullargspec
|
||||||
from shutil import disk_usage
|
from shutil import disk_usage
|
||||||
from time import time
|
from time import time
|
||||||
|
|
@ -19,6 +19,7 @@ import cloudscraper
|
||||||
import requests
|
import requests
|
||||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
from logging import getLogger
|
||||||
from PIL import Image, ImageDraw, ImageFont
|
from PIL import Image, ImageDraw, ImageFont
|
||||||
from psutil import Process, boot_time, cpu_count, cpu_percent
|
from psutil import Process, boot_time, cpu_count, cpu_percent
|
||||||
from psutil import disk_usage as disk_usage_percent
|
from psutil import disk_usage as disk_usage_percent
|
||||||
|
|
@ -26,7 +27,7 @@ from psutil import net_io_counters, virtual_memory
|
||||||
from pyrogram import Client
|
from pyrogram import Client
|
||||||
from pyrogram import __version__ as pyrover
|
from pyrogram import __version__ as pyrover
|
||||||
from pyrogram import enums, filters
|
from pyrogram import enums, filters
|
||||||
from pyrogram.errors import FloodWait, PeerIdInvalid
|
from pyrogram.errors import FloodWait, MessageTooLong, PeerIdInvalid
|
||||||
from pyrogram.raw.types import UpdateBotStopped
|
from pyrogram.raw.types import UpdateBotStopped
|
||||||
from pyrogram.types import (
|
from pyrogram.types import (
|
||||||
InlineKeyboardButton,
|
InlineKeyboardButton,
|
||||||
|
|
@ -68,6 +69,7 @@ __HELP__ = """
|
||||||
|
|
||||||
var = {}
|
var = {}
|
||||||
teskode = {}
|
teskode = {}
|
||||||
|
LOGGER = getLogger("MissKaty")
|
||||||
|
|
||||||
|
|
||||||
async def edit_or_reply(msg, **kwargs):
|
async def edit_or_reply(msg, **kwargs):
|
||||||
|
|
@ -80,27 +82,47 @@ async def edit_or_reply(msg, **kwargs):
|
||||||
@use_chat_lang()
|
@use_chat_lang()
|
||||||
async def log_file(_, ctx: Message, strings):
|
async def log_file(_, ctx: Message, strings):
|
||||||
"""Send log file"""
|
"""Send log file"""
|
||||||
msg = await ctx.reply_msg("<b>Reading bot logs ...</b>")
|
msg = await ctx.reply_msg("<b>Reading bot logs ...</b>", quote=True)
|
||||||
if len(ctx.command) == 1:
|
if len(ctx.command) == 1:
|
||||||
await ctx.reply_document(
|
try:
|
||||||
"MissKatyLogs.txt",
|
with open("MissKatyLogs.txt", "r") as file:
|
||||||
caption="Log Bot MissKatyPyro",
|
content = file.read()
|
||||||
reply_markup=InlineKeyboardMarkup(
|
current_utc_datetime = datetime.utcnow()
|
||||||
[
|
exp_datetime = current_utc_datetime + timedelta(days=7)
|
||||||
|
data = {
|
||||||
|
"content": content,
|
||||||
|
"expire_dt": str(exp_datetime),
|
||||||
|
"title": "MissKatyLogs",
|
||||||
|
"highlighter-name": "python"
|
||||||
|
}
|
||||||
|
pastelog = (await fetch.post("https://paste.yasirapi.eu.org/api/pastes", json=data)).json()
|
||||||
|
await msg.edit_msg(f"<a href='https://paste.yasirapi.eu.org/{pastelog.get('paste_id')}'>Here the Logs</a>\nlog size: {get_readable_file_size(os.path.getsize('MissKatyLogs.txt'))}")
|
||||||
|
except Exception:
|
||||||
|
await ctx.reply_document(
|
||||||
|
"MissKatyLogs.txt",
|
||||||
|
caption="Log Bot MissKatyPyro",
|
||||||
|
reply_markup=InlineKeyboardMarkup(
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(
|
[
|
||||||
strings("cl_btn"),
|
InlineKeyboardButton(
|
||||||
f"close#{ctx.from_user.id}",
|
strings("cl_btn"),
|
||||||
)
|
f"close#{ctx.from_user.id}",
|
||||||
|
)
|
||||||
|
]
|
||||||
]
|
]
|
||||||
]
|
),
|
||||||
),
|
)
|
||||||
)
|
await msg.delete_msg()
|
||||||
await msg.delete_msg()
|
|
||||||
elif len(ctx.command) == 2:
|
elif len(ctx.command) == 2:
|
||||||
val = ctx.text.split()
|
val = ctx.text.split()
|
||||||
tail = await shell_exec(f"tail -n {val[1]} -v MissKatyLogs.txt")
|
tail = await shell_exec(f"tail -n {val[1]} -v MissKatyLogs.txt")
|
||||||
await msg.edit_msg(f"<pre language='bash'>{html.escape(tail[0])}</pre>")
|
try:
|
||||||
|
await msg.edit_msg(f"<pre language='bash'>{html.escape(tail[0])}</pre>")
|
||||||
|
except MessageTooLong:
|
||||||
|
with io.BytesIO(str.encode(tail[0])) as s:
|
||||||
|
s.name = "MissKatyLog-Tail.txt"
|
||||||
|
await ctx.reply_document(s)
|
||||||
|
await msg.delete()
|
||||||
else:
|
else:
|
||||||
await msg.edit_msg("Unsupported parameter")
|
await msg.edit_msg("Unsupported parameter")
|
||||||
|
|
||||||
|
|
@ -108,7 +130,7 @@ async def log_file(_, ctx: Message, strings):
|
||||||
@app.on_message(filters.command(["donate"], COMMAND_HANDLER))
|
@app.on_message(filters.command(["donate"], COMMAND_HANDLER))
|
||||||
async def donate(_, ctx: Message):
|
async def donate(_, ctx: Message):
|
||||||
await ctx.reply_photo(
|
await ctx.reply_photo(
|
||||||
"https://telegra.ph/file/9427d61d6968b8ee4fb2f.jpg",
|
"https://telegraph.yasirweb.eu.org/file/9427d61d6968b8ee4fb2f.jpg",
|
||||||
caption=f"Hai {ctx.from_user.mention}, jika kamu merasa bot ini berguna kamu bisa melakukan donasi dengan scan QR menggunakan merchant yang support QRIS ya. Karena server bot ini menggunakan VPS dan tidaklah gratis. Terimakasih..\n\nHi {ctx.from_user.mention}, if you feel this bot is useful, you can make a donation via Paypal for international payment : https://paypal.me/yasirarism. Because this bot server is hosted in VPS and not free. Thank you..",
|
caption=f"Hai {ctx.from_user.mention}, jika kamu merasa bot ini berguna kamu bisa melakukan donasi dengan scan QR menggunakan merchant yang support QRIS ya. Karena server bot ini menggunakan VPS dan tidaklah gratis. Terimakasih..\n\nHi {ctx.from_user.mention}, if you feel this bot is useful, you can make a donation via Paypal for international payment : https://paypal.me/yasirarism. Because this bot server is hosted in VPS and not free. Thank you..",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ async def genss(self: Client, ctx: Message, strings):
|
||||||
download_file_path = os.path.join("downloads/", file_name)
|
download_file_path = os.path.join("downloads/", file_name)
|
||||||
downloader = SmartDL(url, download_file_path, progress_bar=False, timeout=10, verify=False)
|
downloader = SmartDL(url, download_file_path, progress_bar=False, timeout=10, verify=False)
|
||||||
try:
|
try:
|
||||||
downloader.start(blocking=False)
|
downloader.start(blocking=False, verify=False)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
return await pesan.edit(str(err))
|
return await pesan.edit(str(err))
|
||||||
c_time = time.time()
|
c_time = time.time()
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ async def imdb_choose(_, ctx: Message):
|
||||||
buttons.row(InlineButton("🚩 Set Default Language", f"imdbset#{ctx.from_user.id}"))
|
buttons.row(InlineButton("🚩 Set Default Language", f"imdbset#{ctx.from_user.id}"))
|
||||||
buttons.row(InlineButton("❌ Close", f"close#{ctx.from_user.id}"))
|
buttons.row(InlineButton("❌ Close", f"close#{ctx.from_user.id}"))
|
||||||
await ctx.reply_photo(
|
await ctx.reply_photo(
|
||||||
"https://telegra.ph/file/270955ef0d1a8a16831a9.jpg",
|
"https://telegraph.yasirweb.eu.org/file/270955ef0d1a8a16831a9.jpg",
|
||||||
caption=f"Hi {ctx.from_user.mention}, Please select the language you want to use on IMDB Search. If you want use default lang for every user, click third button. So no need click select lang if use CMD.",
|
caption=f"Hi {ctx.from_user.mention}, Please select the language you want to use on IMDB Search. If you want use default lang for every user, click third button. So no need click select lang if use CMD.",
|
||||||
reply_markup=buttons,
|
reply_markup=buttons,
|
||||||
quote=True,
|
quote=True,
|
||||||
|
|
@ -128,7 +128,7 @@ async def imdbsetlang(_, query: CallbackQuery):
|
||||||
async def imdb_search_id(kueri, message):
|
async def imdb_search_id(kueri, message):
|
||||||
BTN = []
|
BTN = []
|
||||||
k = await message.reply_photo(
|
k = await message.reply_photo(
|
||||||
"https://telegra.ph/file/270955ef0d1a8a16831a9.jpg",
|
"https://telegraph.yasirweb.eu.org/file/270955ef0d1a8a16831a9.jpg",
|
||||||
caption=f"🔎 Menelusuri <code>{kueri}</code> di database IMDb ...",
|
caption=f"🔎 Menelusuri <code>{kueri}</code> di database IMDb ...",
|
||||||
quote=True,
|
quote=True,
|
||||||
)
|
)
|
||||||
|
|
@ -186,7 +186,7 @@ async def imdb_search_id(kueri, message):
|
||||||
async def imdb_search_en(kueri, message):
|
async def imdb_search_en(kueri, message):
|
||||||
BTN = []
|
BTN = []
|
||||||
k = await message.reply_photo(
|
k = await message.reply_photo(
|
||||||
"https://telegra.ph/file/270955ef0d1a8a16831a9.jpg",
|
"https://telegraph.yasirweb.eu.org/file/270955ef0d1a8a16831a9.jpg",
|
||||||
caption=f"🔎 Searching <code>{kueri}</code> in IMDb Database...",
|
caption=f"🔎 Searching <code>{kueri}</code> in IMDb Database...",
|
||||||
quote=True,
|
quote=True,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ To use this feature, just type bot username with following args below.
|
||||||
~ info [user id/username] - Check info about a user.
|
~ info [user id/username] - Check info about a user.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
keywords_list = ["imdb", "pypi", "git", "google", "calc", "secretmsg", "info", "botapi"]
|
keywords_list = ["imdb", "pypi", "git", "google", "secretmsg", "info", "botapi"]
|
||||||
|
|
||||||
PRVT_MSGS = {}
|
PRVT_MSGS = {}
|
||||||
LOGGER = getLogger("MissKaty")
|
LOGGER = getLogger("MissKaty")
|
||||||
|
|
@ -406,12 +406,12 @@ async def inline_menu(self, inline_query: InlineQuery):
|
||||||
srch_results = json.loads(search_results.text)
|
srch_results = json.loads(search_results.text)
|
||||||
item = srch_results.get("items")
|
item = srch_results.get("items")
|
||||||
data = []
|
data = []
|
||||||
for sraeo in item:
|
for result in item:
|
||||||
title = sraeo.get("full_name")
|
title = result.get("full_name")
|
||||||
link = sraeo.get("html_url")
|
link = result.get("html_url")
|
||||||
deskripsi = sraeo.get("description")
|
deskripsi = result.get("description")[:25] if len(result.get("description")) > 25 else result.get("description")
|
||||||
lang = sraeo.get("language")
|
lang = result.get("language")
|
||||||
message_text = f"🔗: {sraeo.get('html_url')}\n│\n└─🍴Forks: {sraeo.get('forks')} ┃┃ 🌟Stars: {sraeo.get('stargazers_count')}\n\n"
|
message_text = f"🔗: {result.get('html_url')}\n│\n└─🍴Forks: {result.get('forks')} ┃┃ 🌟Stars: {sraeo.get('stargazers_count')}\n\n"
|
||||||
message_text += f"<b>Description:</b> {deskripsi}\n"
|
message_text += f"<b>Description:</b> {deskripsi}\n"
|
||||||
message_text += f"<b>Language:</b> {lang}"
|
message_text += f"<b>Language:</b> {lang}"
|
||||||
data.append(
|
data.append(
|
||||||
|
|
|
||||||
|
|
@ -81,10 +81,12 @@ async def current_chat_permissions(chat_id):
|
||||||
except FloodWait as e:
|
except FloodWait as e:
|
||||||
await asyncio.sleep(e.value)
|
await asyncio.sleep(e.value)
|
||||||
perm = (await app.get_chat(chat_id)).permissions
|
perm = (await app.get_chat(chat_id)).permissions
|
||||||
|
try:
|
||||||
|
perm.can_send_messages
|
||||||
|
except:
|
||||||
|
LOGGER.error(f"Got error in chat: {chat_id}, perm: {perm}") # For debug
|
||||||
if perm.can_send_messages:
|
if perm.can_send_messages:
|
||||||
perms.append("can_send_messages")
|
perms.append("can_send_messages")
|
||||||
else:
|
|
||||||
LOGGER.info(f"debug perm: {perm}") # Temporary debug, idk why give error no object
|
|
||||||
if perm.can_send_media_messages:
|
if perm.can_send_media_messages:
|
||||||
perms.append("can_send_media_messages")
|
perms.append("can_send_media_messages")
|
||||||
if perm.can_send_audios:
|
if perm.can_send_audios:
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ async def ocr(_, ctx: Message, strings):
|
||||||
f"ocr_{ctx.from_user.id if ctx.from_user else ctx.sender_chat.id}.jpg"
|
f"ocr_{ctx.from_user.id if ctx.from_user else ctx.sender_chat.id}.jpg"
|
||||||
)
|
)
|
||||||
response = await Telegraph().upload_file(file_path)
|
response = await Telegraph().upload_file(file_path)
|
||||||
url = f"https://telegra.ph{response[0]['src']}"
|
url = f"https://telegraph.yasirweb.eu.org{response[0]['src']}"
|
||||||
req = (
|
req = (
|
||||||
await fetch.get(
|
await fetch.get(
|
||||||
f"https://script.google.com/macros/s/AKfycbwURISN0wjazeJTMHTPAtxkrZTWTpsWIef5kxqVGoXqnrzdLdIQIfLO7jsR5OQ5GO16/exec?url={url}",
|
f"https://script.google.com/macros/s/AKfycbwURISN0wjazeJTMHTPAtxkrZTWTpsWIef5kxqVGoXqnrzdLdIQIfLO7jsR5OQ5GO16/exec?url={url}",
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ async def start(_, ctx: Message, strings):
|
||||||
nama = ctx.from_user.mention if ctx.from_user else ctx.sender_chat.title
|
nama = ctx.from_user.mention if ctx.from_user else ctx.sender_chat.title
|
||||||
try:
|
try:
|
||||||
return await ctx.reply_photo(
|
return await ctx.reply_photo(
|
||||||
photo="https://telegra.ph/file/90e9a448bc2f8b055b762.jpg",
|
photo="https://telegraph.yasirweb.eu.org/file/90e9a448bc2f8b055b762.jpg",
|
||||||
caption=strings("start_msg").format(kamuh=nama),
|
caption=strings("start_msg").format(kamuh=nama),
|
||||||
reply_markup=keyboard,
|
reply_markup=keyboard,
|
||||||
)
|
)
|
||||||
|
|
@ -97,7 +97,7 @@ async def start(_, ctx: Message, strings):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
await ctx.reply_photo(
|
await ctx.reply_photo(
|
||||||
photo="https://telegra.ph/file/90e9a448bc2f8b055b762.jpg",
|
photo="https://telegraph.yasirweb.eu.org/file/90e9a448bc2f8b055b762.jpg",
|
||||||
caption=home_text_pm,
|
caption=home_text_pm,
|
||||||
reply_markup=home_keyboard_pm,
|
reply_markup=home_keyboard_pm,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue