Back to admin menu fix
This commit is contained in:
parent
d506d79367
commit
f504d5fb7b
@ -1,4 +1,3 @@
|
||||
import db from '../config/database.js';
|
||||
import config from '../config/config.js';
|
||||
|
||||
export default class AdminHandler {
|
||||
@ -32,4 +31,30 @@ export default class AdminHandler {
|
||||
await this.bot.sendMessage(chatId, 'Admin Panel:', keyboard);
|
||||
}
|
||||
|
||||
async handleAdminQueryCommand(callbackQuery) {
|
||||
if (!this.isAdmin(callbackQuery.from.id)) return;
|
||||
|
||||
const chatId = callbackQuery.message.chat.id;
|
||||
const messageId = callbackQuery.message.message_id;
|
||||
|
||||
const keyboard = {
|
||||
reply_markup: {
|
||||
keyboard: [
|
||||
['👥 Manage Users', '📦 Manage Products'],
|
||||
['💰 Manage Wallets', '📍 Manage Locations'],
|
||||
['💾 Database Backup']
|
||||
],
|
||||
resize_keyboard: true
|
||||
}
|
||||
};
|
||||
|
||||
await this.bot.editMessageText(
|
||||
`You we're returned to the admin menu`,
|
||||
{
|
||||
chat_id: chatId,
|
||||
message_id: messageId,
|
||||
reply_markup: keyboard
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
@ -214,7 +214,10 @@ bot.on('callback_query', async (callbackQuery) => {
|
||||
} else if (action.startsWith('confirm_delete_')) {
|
||||
logDebug(action, 'handleConfirmDelete');
|
||||
await adminLocationHandler.handleConfirmDelete(callbackQuery);
|
||||
} else if (action === 'admin_menu') {
|
||||
await adminHandler.handleAdminQueryCommand(callbackQuery);
|
||||
}
|
||||
|
||||
// Admin product management
|
||||
else if (action === 'manage_products') {
|
||||
logDebug(action, 'handleProductManagement');
|
||||
|
Loading…
Reference in New Issue
Block a user