28 lines
931 B
Python
28 lines
931 B
Python
|
from pyrogram import Client, filters
|
|||
|
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
|
|||
|
from ci import me
|
|||
|
|
|||
|
des = """
|
|||
|
你好!{} 我是 [{}]({}),一个为 Grasscutter CN 用户打造的机器人!
|
|||
|
|
|||
|
加入 [我的频道](https://t.me/Grasscutter_CN)
|
|||
|
"""
|
|||
|
|
|||
|
|
|||
|
def gen_help_button() -> InlineKeyboardMarkup:
|
|||
|
data_ = [[InlineKeyboardButton("📢 官方频道", url="https://t.me/Grasscutter_CN")]]
|
|||
|
return InlineKeyboardMarkup(data_)
|
|||
|
|
|||
|
|
|||
|
@Client.on_message(filters.incoming & filters.private &
|
|||
|
filters.command(["start"]))
|
|||
|
async def start_command(_: Client, message: Message):
|
|||
|
"""
|
|||
|
回应消息
|
|||
|
"""
|
|||
|
await message.reply(des.format(message.from_user.mention(),
|
|||
|
me.name,
|
|||
|
f"https://t.me/{me.username}"),
|
|||
|
reply_markup=gen_help_button(),
|
|||
|
quote=True, )
|