PamGram/plugins/admin/wiki.py
2023-03-14 14:09:18 +08:00

20 lines
663 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from telegram import Update
from telegram.ext import CallbackContext
from core.plugin import Plugin, handler
from core.services.wiki.services import WikiService
class WikiPlugin(Plugin):
"""有关WIKI操作"""
def __init__(self, wiki_service: WikiService):
self.wiki_service = wiki_service
@handler.command("refresh_wiki", block=False, admin=True)
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缓存成功")