Compare commits

...
3 Commits
Author SHA1 Message Date
YoursFunny ca9064a1b7 bump version 2024-11-10 18:19:29 +08:00
YoursFunny d58fd7cd46 add clear edit message command 2024-11-10 18:17:51 +08:00
YoursFunny 9aa7aa1c36 fix external bsky media (disable) 2024-11-10 18:17:15 +08:00
3 changed files with 17 additions and 9 deletions
+7
View File
@@ -237,6 +237,12 @@ async def cmd_user_dict(update: Update, context: CustomContext) -> None:
await update.effective_message.reply_text(html.escape(str(context.chat_data)), disable_web_page_preview=True)
@send_action(ChatAction.TYPING)
async def cmd_clear_edit_message(update: Update, context: CustomContext) -> None:
context.chat_data.edit_message.clear()
await update.effective_message.reply_text("Edit message cleared.")
async def post_init(application: Application) -> None:
# commands = [
# BotCommand('start', CMD_START),
@@ -291,6 +297,7 @@ def main():
CallbackQueryHandler(query_forward_message, pattern="forward"),
CallbackQueryHandler(query_template, pattern=r"^template\|"),
CommandHandler("bot_dict", cmd_user_dict),
CommandHandler("clear_edit_message", cmd_clear_edit_message),
]
application.add_handlers(handlers)
+1 -1
View File
@@ -1,4 +1,4 @@
python-telegram-bot[webhooks]~=21.6
python-telegram-bot[webhooks]~=21.7
httpx[http2]~=0.27
uvloop~=0.19.0; sys_platform != 'win32'
async-pixiv @ git+https://github.com/TheFunny/async-pixiv@main
+9 -8
View File
@@ -258,14 +258,15 @@ class TelegramBsky:
# )
yield
elif bsky_media.type == "external":
yield InlineQueryResultVideo(
id=str(uuid4()),
video_url=bsky_media.url,
mime_type="image/gif",
thumbnail_url=bsky_media.thumb,
title=bsky.text,
caption=self.message_text
)
# yield InlineQueryResultVideo(
# id=str(uuid4()),
# video_url=bsky_media.url,
# mime_type="image/gif",
# thumbnail_url=bsky_media.thumb,
# title=bsky.text,
# caption=self.message_text
# )
yield
def message_media_generator(self) -> Generator[TypeMessageMediaResult, None, None]:
bsky = self._bsky