diff --git a/defs/msg.py b/defs/msg.py index 0fe231a..1453c9f 100644 --- a/defs/msg.py +++ b/defs/msg.py @@ -23,7 +23,9 @@ def gen_button(data: Vtuber) -> InlineKeyboardMarkup: InlineKeyboardButton( "订阅", url=f"https://t.me/{me.username}?start={data.room_id}"), - InlineKeyboardButton("分享", switch_inline_query=data.name), ] + InlineKeyboardButton( + "分享", + url=f"https://t.me/{me.username}?start=info-{data.room_id}"), ] ] return InlineKeyboardMarkup(data_) diff --git a/plugins/start.py b/plugins/start.py index cb8ea2c..e0d1da7 100644 --- a/plugins/start.py +++ b/plugins/start.py @@ -1,6 +1,7 @@ from pyrogram import Client, filters from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton from ci import me +from plugins.info import info_command from defs.source import from_name_to_v from defs.subs import add_to_subs, remove_from_subs @@ -62,6 +63,9 @@ async def start_command(_: Client, message: Message): await message.reply(not_sub_msg.format(data.name), quote=True) else: await message.reply(not_found_msg.format(name), quote=True) + elif data.startswith("info-"): + message.command = ["info", data[5:]] + await info_command(_, message) else: # 订阅 name = data