Files
pawhub-telegram-bot/direct_message_commands.py
T
2025-12-24 02:06:17 +01:00

26 lines
1.0 KiB
Python

import traceback
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
from telegram.ext import ContextTypes
from config import config
import user_permissions
import log
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
if not user_permissions.is_user_admin(update.effective_user.id):
log.warning(chat_id=update.effective_chat.id, message=f"Unauthorized direct message access attempt by user {update.effective_user.id}\n{traceback.format_exc()}")
await update.message.reply_text("You are not authorized to use this bot in this chat.")
return
keyboard = [
[InlineKeyboardButton("Eventmanagement", callback_data='list_event_actions')],
]
await update.message.reply_text(
f"""Willkommen beim {config.BOT_NAME} Admin Interface!
Hier kannst du verschiedene Verwaltungsaufgaben durchführen. Nutze die verfügbaren Befehle, um loszulegen.
(c) SinusFox.dev 2025
""",
reply_markup=InlineKeyboardMarkup(keyboard)
)