diff --git a/misskaty/plugins/dev.py b/misskaty/plugins/dev.py index 0bf348c7..3650b47b 100644 --- a/misskaty/plugins/dev.py +++ b/misskaty/plugins/dev.py @@ -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)) @use_chat_lang() 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"{out}") - except Exception as e: - return await ctx.reply_msg(str(e)) msg = await ctx.reply_msg(strings("up_and_rest")) + await shell_exec("python3 update.py") with open("restart.pickle", "wb") as status: pickle.dump([ctx.chat.id, msg.id], status) os.execvp(sys.executable, [sys.executable, "-m", "misskaty"]) diff --git a/misskaty/plugins/fun.py b/misskaty/plugins/fun.py index a053aea0..3f40f260 100644 --- a/misskaty/plugins/fun.py +++ b/misskaty/plugins/fun.py @@ -29,7 +29,7 @@ async def draw_meme_text(image_path, text): current_h, pad = 10, 5 if upper_text: 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( xy=(((i_width - u_width) / 2) - 1, int((current_h / 640) * i_width)), text=u_text, @@ -72,7 +72,7 @@ async def draw_meme_text(image_path, text): current_h += u_height + pad if lower_text: 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( xy=(