feat: llama3 bot

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
yihong0618
2024-04-19 16:22:43 +08:00
parent cd2185c7d6
commit 450c08ba54
7 changed files with 282 additions and 87 deletions

View File

@ -134,12 +134,14 @@ def yi_photo_handler(message: Message, bot: TeleBot) -> None:
bot_reply_markdown(reply_id, who, "answer wrong", bot)
def register(bot: TeleBot) -> None:
bot.register_message_handler(yi_handler, commands=["yi"], pass_bot=True)
bot.register_message_handler(yi_handler, regexp="^yi:", pass_bot=True)
bot.register_message_handler(
yi_photo_handler,
content_types=["photo"],
func=lambda m: m.caption and m.caption.startswith(("yi:", "/yi")),
pass_bot=True,
)
if YI_API_KEY and YI_BASE_URL:
def register(bot: TeleBot) -> None:
bot.register_message_handler(yi_handler, commands=["yi"], pass_bot=True)
bot.register_message_handler(yi_handler, regexp="^yi:", pass_bot=True)
bot.register_message_handler(
yi_photo_handler,
content_types=["photo"],
func=lambda m: m.caption and m.caption.startswith(("yi:", "/yi")),
pass_bot=True,
)