mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 15:36:44 +00:00
8f424bf0d4
♻️ 重构插件系统 ⚙️ 重写插件 🎨 改进代码结构 📝 完善文档 Co-authored-by: zhxy-CN <admin@owo.cab> Co-authored-by: 洛水居室 <luoshuijs@outlook.com> Co-authored-by: xtaodada <xtao@xtaolink.cn> Co-authored-by: Li Chuangbo <im@chuangbo.li>
22 lines
764 B
Python
22 lines
764 B
Python
from telegram import Update
|
||
from telegram.ext import CommandHandler, CallbackContext
|
||
|
||
from core.plugin import Plugin, handler
|
||
from core.wiki.services import WikiService
|
||
from utils.decorators.admins import bot_admins_rights_check
|
||
|
||
|
||
class Wiki(Plugin):
|
||
"""有关WIKI操作"""
|
||
|
||
def __init__(self, wiki_service: WikiService = None):
|
||
self.wiki_service = wiki_service
|
||
|
||
@handler(CommandHandler, command="refresh_wiki", block=False)
|
||
@bot_admins_rights_check
|
||
async def refresh_wiki(self, update: Update, _: CallbackContext):
|
||
message = update.effective_message
|
||
await message.reply_text("正在刷新Wiki缓存,请稍等")
|
||
await self.wiki_service.refresh_wiki()
|
||
await message.reply_text("刷新Wiki缓存成功")
|