PaiGram/plugins/start.py

45 lines
1.6 KiB
Python
Raw Normal View History

2022-04-21 12:18:26 +00:00
from telegram import Update, ReplyKeyboardRemove
2022-04-14 07:18:45 +00:00
from telegram.ext import CallbackContext
from telegram.helpers import escape_markdown
2022-06-22 13:33:07 +00:00
from plugins.base import restricts
2022-04-14 07:18:45 +00:00
2022-06-22 13:33:07 +00:00
@restricts()
async def start(update: Update, context: CallbackContext) -> None:
2022-05-28 08:42:53 +00:00
user = update.effective_user
message = update.message
2022-06-24 11:46:07 +00:00
args = context.args
if args is not None:
if len(args) >= 1:
if args[0] == "inline_message":
2022-06-24 11:46:07 +00:00
await message.reply_markdown_v2(f"你好 {user.mention_markdown_v2()} {escape_markdown('!我是派蒙 ')}\n"
f"{escape_markdown('发送 /help 命令即可查看命令帮助')}")
return
await update.message.reply_markdown_v2(f"你好 {user.mention_markdown_v2()} {escape_markdown('!我是派蒙 ')}")
2022-04-14 07:18:45 +00:00
2022-06-22 13:33:07 +00:00
@restricts()
2022-04-14 07:18:45 +00:00
async def help_command(update: Update, _: CallbackContext) -> None:
2022-05-28 08:42:53 +00:00
await update.message.reply_text("前面的区域,以后再来探索吧!")
2022-04-14 07:18:45 +00:00
2022-06-22 13:33:07 +00:00
@restricts()
2022-04-14 07:18:45 +00:00
async def unknown_command(update: Update, _: CallbackContext) -> None:
2022-05-28 08:42:53 +00:00
await update.message.reply_text("前面的区域,以后再来探索吧!")
2022-04-14 07:18:45 +00:00
2022-06-22 13:33:07 +00:00
@restricts()
2022-04-14 07:18:45 +00:00
async def emergency_food(update: Update, _: CallbackContext) -> None:
2022-05-28 08:42:53 +00:00
await update.message.reply_text("派蒙才不是应急食品!")
2022-04-14 07:18:45 +00:00
2022-06-22 13:33:07 +00:00
@restricts()
2022-04-14 07:18:45 +00:00
async def ping(update: Update, _: CallbackContext) -> None:
await update.message.reply_text("online! ヾ(✿゚▽゚)")
2022-04-21 12:18:26 +00:00
2022-06-22 13:33:07 +00:00
@restricts()
async def reply_keyboard_remove(update: Update, _: CallbackContext) -> None:
2022-04-21 12:18:26 +00:00
await update.message.reply_text("移除远程键盘成功", reply_markup=ReplyKeyboardRemove())