GramCore/plugin/_funcs.py

23 lines
633 B
Python
Raw Permalink Normal View History

2023-12-16 09:36:19 +00:00
from telegram import ReplyKeyboardRemove, Update
from telegram.ext import ConversationHandler
from gram_core.plugin._handler import conversation, handler
2023-12-16 09:36:19 +00:00
from gram_core.plugin.methods import PluginFuncMethods
__all__ = (
"PluginFuncs",
"ConversationFuncs",
)
2023-12-16 09:36:19 +00:00
class PluginFuncs(PluginFuncMethods):
"""插件方法"""
class ConversationFuncs:
@conversation.fallback
@handler.command(command="cancel", block=False)
async def cancel(self, update: Update, _) -> int:
await update.effective_message.reply_text("退出命令", reply_markup=ReplyKeyboardRemove())
return ConversationHandler.END