mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-04 19:24:51 +00:00
okkk
This commit is contained in:
parent
49ae5798ed
commit
220a7ed493
2 changed files with 3 additions and 9 deletions
|
|
@ -496,14 +496,8 @@ async def cmd_eval(self: Client, ctx: Message, strings) -> Optional[str]:
|
||||||
@app.on_message(filters.command(["update"], COMMAND_HANDLER) & filters.user(SUDO))
|
@app.on_message(filters.command(["update"], COMMAND_HANDLER) & filters.user(SUDO))
|
||||||
@use_chat_lang()
|
@use_chat_lang()
|
||||||
async def update_restart(self: Client, ctx: Message, strings) -> "Message":
|
async def update_restart(self: Client, ctx: Message, strings) -> "Message":
|
||||||
try:
|
|
||||||
out = (await shell_exec("git pull"))[0]
|
|
||||||
if "Already up to date." in str(out):
|
|
||||||
return await ctx.reply_msg(strings("already_up"))
|
|
||||||
await ctx.reply_msg(f"<code>{out}</code>")
|
|
||||||
except Exception as e:
|
|
||||||
return await ctx.reply_msg(str(e))
|
|
||||||
msg = await ctx.reply_msg(strings("up_and_rest"))
|
msg = await ctx.reply_msg(strings("up_and_rest"))
|
||||||
|
await shell_exec("python3 update.py")
|
||||||
with open("restart.pickle", "wb") as status:
|
with open("restart.pickle", "wb") as status:
|
||||||
pickle.dump([ctx.chat.id, msg.id], status)
|
pickle.dump([ctx.chat.id, msg.id], status)
|
||||||
os.execvp(sys.executable, [sys.executable, "-m", "misskaty"])
|
os.execvp(sys.executable, [sys.executable, "-m", "misskaty"])
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ async def draw_meme_text(image_path, text):
|
||||||
current_h, pad = 10, 5
|
current_h, pad = 10, 5
|
||||||
if upper_text:
|
if upper_text:
|
||||||
for u_text in textwrap.wrap(upper_text, width=15):
|
for u_text in textwrap.wrap(upper_text, width=15):
|
||||||
u_width, u_height = draw.textlength(text=u_text, font=m_font).split(".")
|
u_width, u_height = str(draw.textlength(text=u_text, font=m_font)).split(".")
|
||||||
draw.text(
|
draw.text(
|
||||||
xy=(((i_width - u_width) / 2) - 1, int((current_h / 640) * i_width)),
|
xy=(((i_width - u_width) / 2) - 1, int((current_h / 640) * i_width)),
|
||||||
text=u_text,
|
text=u_text,
|
||||||
|
|
@ -72,7 +72,7 @@ async def draw_meme_text(image_path, text):
|
||||||
current_h += u_height + pad
|
current_h += u_height + pad
|
||||||
if lower_text:
|
if lower_text:
|
||||||
for l_text in textwrap.wrap(lower_text, width=15):
|
for l_text in textwrap.wrap(lower_text, width=15):
|
||||||
u_width, u_height = draw.textlength(text=l_text, font=m_font).split(".")
|
u_width, u_height = str(draw.textlength(text=l_text, font=m_font)).split(".")
|
||||||
|
|
||||||
draw.text(
|
draw.text(
|
||||||
xy=(
|
xy=(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue