Fix a bug

This commit is contained in:
xtaodada 2022-03-25 10:38:01 +08:00
parent f0f14b9876
commit 0d03a08374
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 7 additions and 1 deletions

View File

@ -23,7 +23,9 @@ def gen_button(data: Vtuber) -> InlineKeyboardMarkup:
InlineKeyboardButton( InlineKeyboardButton(
"订阅", "订阅",
url=f"https://t.me/{me.username}?start={data.room_id}"), 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_) return InlineKeyboardMarkup(data_)

View File

@ -1,6 +1,7 @@
from pyrogram import Client, filters from pyrogram import Client, filters
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
from ci import me from ci import me
from plugins.info import info_command
from defs.source import from_name_to_v from defs.source import from_name_to_v
from defs.subs import add_to_subs, remove_from_subs 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) await message.reply(not_sub_msg.format(data.name), quote=True)
else: else:
await message.reply(not_found_msg.format(name), quote=True) await message.reply(not_found_msg.format(name), quote=True)
elif data.startswith("info-"):
message.command = ["info", data[5:]]
await info_command(_, message)
else: else:
# 订阅 # 订阅
name = data name = data