mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-29 02:57:22 +00:00
693cd774d3
* 重构插件传入 `service` 方式 重构插件传入 `service` 方式 将 `create_handlers`函数的修饰符改为 `classmethod`
45 lines
1.6 KiB
Python
45 lines
1.6 KiB
Python
from telegram import Update, ReplyKeyboardRemove
|
||
from telegram.ext import CallbackContext
|
||
from telegram.helpers import escape_markdown
|
||
|
||
from plugins.base import restricts
|
||
|
||
|
||
@restricts()
|
||
async def start(update: Update, context: CallbackContext) -> None:
|
||
user = update.effective_user
|
||
message = update.message
|
||
args = context.args
|
||
if args is not None:
|
||
if len(args) >= 1:
|
||
if args[0] == "inline_message":
|
||
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('!我是派蒙 !')}")
|
||
|
||
|
||
@restricts()
|
||
async def help_command(update: Update, _: CallbackContext) -> None:
|
||
await update.message.reply_text("前面的区域,以后再来探索吧!")
|
||
|
||
|
||
@restricts()
|
||
async def unknown_command(update: Update, _: CallbackContext) -> None:
|
||
await update.message.reply_text("前面的区域,以后再来探索吧!")
|
||
|
||
|
||
@restricts()
|
||
async def emergency_food(update: Update, _: CallbackContext) -> None:
|
||
await update.message.reply_text("派蒙才不是应急食品!")
|
||
|
||
|
||
@restricts()
|
||
async def ping(update: Update, _: CallbackContext) -> None:
|
||
await update.message.reply_text("online! ヾ(✿゚▽゚)ノ")
|
||
|
||
|
||
@restricts()
|
||
async def reply_keyboard_remove(update: Update, _: CallbackContext) -> None:
|
||
await update.message.reply_text("移除远程键盘成功", reply_markup=ReplyKeyboardRemove())
|