30 lines
859 B
JavaScript
30 lines
859 B
JavaScript
import config from '../../config/config.js';
|
|
import bot from "../../context/bot.js";
|
|
|
|
export default class AdminHandler {
|
|
static isAdmin(userId) {
|
|
return config.ADMIN_IDS.includes(userId.toString());
|
|
}
|
|
|
|
static async handleAdminCommand(msg) {
|
|
const chatId = msg.chat.id;
|
|
|
|
if (!this.isAdmin(msg.from.id)) {
|
|
await bot.sendMessage(chatId, 'Unauthorized access.');
|
|
return;
|
|
}
|
|
|
|
const keyboard = {
|
|
reply_markup: {
|
|
keyboard: [
|
|
['👥 Manage Users', '📦 Manage Products'],
|
|
['💰 Manage Wallets', '📍 Manage Locations'],
|
|
['💾 Database Backup']
|
|
],
|
|
resize_keyboard: true
|
|
}
|
|
};
|
|
|
|
await bot.sendMessage(chatId, 'Admin Panel:', keyboard);
|
|
}
|
|
} |