summaryrefslogtreecommitdiff
path: root/src/admin_bot.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/admin_bot.py')
-rwxr-xr-xsrc/admin_bot.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/admin_bot.py b/src/admin_bot.py
new file mode 100755
index 0000000..88e71e8
--- /dev/null
+++ b/src/admin_bot.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+from typing import Optional
+from telegram import ReplyKeyboardMarkup
+from telegram.ext import MessageHandler
+from home.config import config
+from home.bot import Wrapper, Context, text_filter
+
+
+def get_latest_logs(ctx: Context):
+ u = ctx.user
+ ctx.reply(ctx.lang('blbla'))
+
+
+class AdminBot(Wrapper):
+ def __init__(self):
+ super().__init__()
+
+ self.lang.ru(get_latest_logs="Смотреть последние логи")
+ self.lang.en(get_latest_logs="Get latest logs")
+
+ self.add_handler(MessageHandler(text_filter(self.lang('get_latest_logs')), self.wrap(get_latest_logs)))
+
+ def markup(self, ctx: Optional[Context]) -> Optional[ReplyKeyboardMarkup]:
+ buttons = [
+ [self.lang('get_latest_logs')]
+ ]
+ return ReplyKeyboardMarkup(buttons, one_time_keyboard=False)
+
+
+if __name__ == '__main__':
+ config.load('admin_bot')
+
+ bot = AdminBot()
+ # bot.enable_logging(BotType.ADMIN)
+ bot.run()