mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-05 03:34:51 +00:00
tes pake alpine
This commit is contained in:
parent
3f7c8a1d18
commit
a7137a6857
13 changed files with 37 additions and 27 deletions
|
|
@ -3,14 +3,14 @@
|
|||
# * @projectName MissKatyPyro
|
||||
# * Copyright ©YasirPedia All rights reserved
|
||||
|
||||
# Base Docker Using Debian 12 (BookWorm), Python 3.11.4 and Built In Pip
|
||||
# Base Docker Using Alpine 3.18, Python 3.11.4 and Built In Pip
|
||||
## With Built in Pip Package
|
||||
FROM yasirarism/misskaty-docker:latest
|
||||
FROM yasirarism/misskaty-docker:alpine
|
||||
## Without Built in Pip Package
|
||||
# FROM yasirarism/misskaty-docker:free
|
||||
|
||||
# Set Hostname
|
||||
ENV HOSTNAME misskaty
|
||||
ENV HOSTNAME yasir-server
|
||||
# Copy Files
|
||||
COPY . .
|
||||
# Instal pip package
|
||||
|
|
|
|||
|
|
@ -101,7 +101,8 @@ pip3 install -r requirements.txt
|
|||
```
|
||||
*Python 3.11*
|
||||
```
|
||||
pip3 install -r requirements.txt --break-system-packages
|
||||
Install venv dari terminal server kamu
|
||||
pip3 install -r requirements.txt
|
||||
```
|
||||
- Atur config environment saat menjalankan bot dan jangan lupa isi semua value yang wajib di isi.
|
||||
- Jalankan Bot
|
||||
|
|
|
|||
|
|
@ -101,7 +101,8 @@ pip3 install -r requirements.txt
|
|||
```
|
||||
*Python 3.11*
|
||||
```
|
||||
pip3 install -r requirements.txt --break-system-packages
|
||||
Install venv from your terminal and activate it
|
||||
pip3 install -r requirements.txt
|
||||
```
|
||||
- Setting your config.env or via environment and dont forget fill all required value.
|
||||
- Run Bot
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
SUDO=617426792
|
||||
# Required Vars
|
||||
API_HASH=
|
||||
API_ID=
|
||||
BOT_TOKEN=
|
||||
DATABASE_NAME=MissKatyDB
|
||||
DATABASE_URI=mongodb+srv://
|
||||
LOG_CHANNEL=
|
||||
|
||||
# Optional Vars
|
||||
SUDO=617426792
|
||||
DATABASE_NAME=MissKatyDB
|
||||
SUPPORT_CHAT=YasirPediaChannel
|
||||
COMMAND_HANDLER=
|
||||
USER_SESSION=
|
||||
OPENAI_API=
|
||||
CURRENCY_API=
|
||||
CURRENCY_API=
|
||||
|
|
@ -40,7 +40,7 @@ MOD_NOLOAD = ["subscene_dl"]
|
|||
HELPABLE = {}
|
||||
cleanmode = {}
|
||||
botStartTime = time.time()
|
||||
misskaty_version = "v2.10.1 - Stable"
|
||||
misskaty_version = "v2.10.2 - Stable"
|
||||
|
||||
# Pyrogram Bot Client
|
||||
app = Client(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
"""
|
||||
* @author yasir <yasiramunandar@gmail.com>
|
||||
* @date 2022-12-01 09:12:27
|
||||
* @lastModified 2022-12-01 09:33:16
|
||||
* @projectName MissKatyPyro
|
||||
* Copyright @YasirPedia All rights reserved
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
"""
|
||||
* @author yasir <yasiramunandar@gmail.com>
|
||||
* @date 2022-12-01 09:12:27
|
||||
* @lastModified 2022-12-01 09:27:31
|
||||
* @projectName MissKatyPyro
|
||||
* Copyright ©YasirPedia All rights reserved
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ from misskaty.helper.eval_helper import format_exception, meval
|
|||
from misskaty.helper.functions import extract_user, extract_user_and_reason
|
||||
from misskaty.helper.http import http
|
||||
from misskaty.helper.human_read import get_readable_file_size, get_readable_time
|
||||
from misskaty.core.decorator import new_task
|
||||
from misskaty.helper.localization import use_chat_lang
|
||||
from misskaty.vars import COMMAND_HANDLER, LOG_CHANNEL, SUDO
|
||||
|
||||
|
|
@ -119,6 +120,7 @@ async def balas(self: Client, ctx: Message) -> "str":
|
|||
|
||||
|
||||
@app.on_message(filters.command(["stats"], COMMAND_HANDLER))
|
||||
@new_task
|
||||
async def server_stats(self: Client, ctx: Message) -> "Message":
|
||||
"""
|
||||
Give system stats of the server.
|
||||
|
|
@ -158,7 +160,9 @@ async def server_stats(self: Client, ctx: Message) -> "Message":
|
|||
disk_used = get_readable_file_size(used)
|
||||
disk_free = get_readable_file_size(free)
|
||||
|
||||
caption = f"<b>{BOT_NAME} {misskaty_version} is Up and Running successfully.</b>\n\n**OS Uptime:** <code>{osuptime}</code>\n<b>Bot Uptime:</b> <code>{currentTime}</code>\n**Bot Usage:** <code>{botusage}</code>\n\n**Total Space:** <code>{disk_total}</code>\n**Free Space:** <code>{disk_free}</code>\n\n**Download:** <code>{download}</code>\n**Upload:** <code>{upload}</code>\n\n<b>Pyrogram Version</b>: <code>{pyrover}</code>\n<b>Python Version</b>: <code>{sys.version_info[0]}.{sys.version_info[1]}.{sys.version_info[2]} {sys.version_info[3].title()}</code>"
|
||||
neofetch = (await shell_exec("neofetch --stdout"))[0]
|
||||
|
||||
caption = f"<b>{BOT_NAME} {misskaty_version} is Up and Running successfully.</b>\n\n<code>{neofetch}</code>\n\n**OS Uptime:** <code>{osuptime}</code>\n<b>Bot Uptime:</b> <code>{currentTime}</code>\n**Bot Usage:** <code>{botusage}</code>\n\n**Total Space:** <code>{disk_total}</code>\n**Free Space:** <code>{disk_free}</code>\n\n**Download:** <code>{download}</code>\n**Upload:** <code>{upload}</code>\n\n<b>Pyrogram Version</b>: <code>{pyrover}</code>\n<b>Python Version</b>: <code>{sys.version_info[0]}.{sys.version_info[1]}.{sys.version_info[2]} {sys.version_info[3].title()}</code>"
|
||||
|
||||
start = datetime.now()
|
||||
msg = await ctx.reply_photo(
|
||||
|
|
@ -364,6 +368,7 @@ async def shell(self: Client, ctx: Message, strings) -> "Message":
|
|||
)
|
||||
@user.on_message(filters.command(["ev", "run", "myeval"], ".") & filters.me)
|
||||
@use_chat_lang()
|
||||
@new_task
|
||||
async def cmd_eval(self: Client, ctx: Message, strings) -> Optional[str]:
|
||||
if (ctx.command and len(ctx.command) == 1) or ctx.text == "app.run()":
|
||||
return await edit_or_reply(ctx, text=strings("no_eval"))
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ __HELP__ = """"
|
|||
"""
|
||||
|
||||
|
||||
@app.on_message(filters.command(["genss"], COMMAND_HANDLER))
|
||||
@app.on_cmd("genss")
|
||||
@ratelimiter
|
||||
@new_task
|
||||
@use_chat_lang()
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
import os
|
||||
|
||||
from pyrogram import filters
|
||||
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
||||
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
|
||||
|
||||
from misskaty import app
|
||||
from misskaty.core.decorator.ratelimiter import ratelimiter
|
||||
|
|
@ -16,9 +16,9 @@ from misskaty.vars import COMMAND_HANDLER
|
|||
|
||||
|
||||
# View Structure Telegram Message As JSON
|
||||
@app.on_message(filters.command(["json"], COMMAND_HANDLER))
|
||||
@app.on_cmd("json")
|
||||
@ratelimiter
|
||||
async def jsonify(_, message):
|
||||
async def jsonify(_, message: Message):
|
||||
the_real_message = None
|
||||
reply_to_id = None
|
||||
|
||||
|
|
@ -38,13 +38,13 @@ async def jsonify(_, message):
|
|||
),
|
||||
)
|
||||
except Exception as e:
|
||||
with open("json.text", "w+", encoding="utf8") as out_file:
|
||||
with open("json.txt", "w+", encoding="utf8") as out_file:
|
||||
out_file.write(str(the_real_message))
|
||||
await message.reply_document(
|
||||
document="json.text",
|
||||
document="json.txt",
|
||||
caption=f"<code>{str(e)}</code>",
|
||||
disable_notification=True,
|
||||
reply_to_message_id=reply_to_id,
|
||||
thumb="assets/thumb.jpg",
|
||||
)
|
||||
os.remove("json.text")
|
||||
os.remove("json.txt")
|
||||
|
|
|
|||
|
|
@ -254,4 +254,7 @@ async def help_button(self: Client, query: CallbackQuery, strings):
|
|||
disable_web_page_preview=True,
|
||||
)
|
||||
|
||||
await self.answer_callback_query(query.id)
|
||||
try:
|
||||
await self.answer_callback_query(query.id)
|
||||
except:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -5,15 +5,13 @@
|
|||
import os
|
||||
from asyncio import gather
|
||||
|
||||
from pyrogram import Client, filters
|
||||
from pyrogram.types import Message
|
||||
from pySmartDL import SmartDL
|
||||
|
||||
from misskaty import app
|
||||
from misskaty.core.decorator.errors import capture_err
|
||||
from misskaty.core.decorator import capture_err, new_task
|
||||
from misskaty.core.decorator.ratelimiter import ratelimiter
|
||||
from misskaty.helper.localization import use_chat_lang
|
||||
from misskaty.vars import COMMAND_HANDLER
|
||||
|
||||
__MODULE__ = "WebSS"
|
||||
__HELP__ = """
|
||||
|
|
@ -21,11 +19,11 @@ __HELP__ = """
|
|||
"""
|
||||
|
||||
|
||||
@app.on_message(filters.command(["webss"], COMMAND_HANDLER))
|
||||
@capture_err
|
||||
@app.on_cmd("webss")
|
||||
@ratelimiter
|
||||
@new_task
|
||||
@use_chat_lang()
|
||||
async def take_ss(self: Client, ctx: Message, strings):
|
||||
async def take_ss(_, ctx: Message, strings):
|
||||
if len(ctx.command) == 1:
|
||||
return await ctx.reply_msg(strings("no_url"), del_in=6)
|
||||
url = (
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ async def ytdl_extractinfo_callback(self: Client, cq: CallbackQuery, strings):
|
|||
@ratelimiter
|
||||
@use_chat_lang()
|
||||
async def ytdl_gendl_callback(self: Client, cq: CallbackQuery, strings):
|
||||
if not cq.message.reply_to_message.from_user:
|
||||
if not (cq.message.reply_to_message and cq.message.reply_to_message.from_user):
|
||||
return
|
||||
match = cq.data.split("|")
|
||||
if cq.from_user.id != cq.message.reply_to_message.from_user.id:
|
||||
|
|
|
|||
Loading…
Reference in a new issue