Mohammed Foud
commited on
Commit
·
fa5fcba
1
Parent(s):
41011f5
all
Browse files
src/bots/utils/{5sim_products_meta.json → 5sim_products.json}
RENAMED
|
File without changes
|
src/bots/utils/keyboardUtils.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { countryData } from "./country";
|
|
| 3 |
import { formatPrice } from "./priceUtils";
|
| 4 |
import { BotContext } from "../types/botTypes";
|
| 5 |
import { messageManager } from "./messageManager";
|
|
|
|
| 6 |
|
| 7 |
export const getMainMenuKeyboard = () => {
|
| 8 |
return Markup.inlineKeyboard([
|
|
@@ -15,38 +16,43 @@ export const getMainMenuKeyboard = () => {
|
|
| 15 |
};
|
| 16 |
|
| 17 |
export const getLoggedInMenuKeyboard = () => {
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
| 49 |
]);
|
|
|
|
|
|
|
| 50 |
};
|
| 51 |
|
| 52 |
export const getBackToMainMenuButton = () => {
|
|
|
|
| 3 |
import { formatPrice } from "./priceUtils";
|
| 4 |
import { BotContext } from "../types/botTypes";
|
| 5 |
import { messageManager } from "./messageManager";
|
| 6 |
+
import fiveSimProducts from "./5sim_products.json";
|
| 7 |
|
| 8 |
export const getMainMenuKeyboard = () => {
|
| 9 |
return Markup.inlineKeyboard([
|
|
|
|
| 16 |
};
|
| 17 |
|
| 18 |
export const getLoggedInMenuKeyboard = () => {
|
| 19 |
+
const buttons = [];
|
| 20 |
+
const services = Object.entries(fiveSimProducts);
|
| 21 |
+
const rowSize = 2; // 2 buttons per row
|
| 22 |
+
|
| 23 |
+
// Generate service buttons in pairs
|
| 24 |
+
for (let i = 0; i < services.length; i += rowSize) {
|
| 25 |
+
const row = [];
|
| 26 |
+
for (let j = 0; j < rowSize && i + j < services.length; j++) {
|
| 27 |
+
const [serviceId, serviceData] = services[i + j];
|
| 28 |
+
row.push(
|
| 29 |
+
Markup.button.callback(
|
| 30 |
+
`${serviceData.icon} ${messageManager.getMessage(`btn_service_${serviceId}`)}`,
|
| 31 |
+
`service_${serviceId}`
|
| 32 |
+
)
|
| 33 |
+
);
|
| 34 |
+
}
|
| 35 |
+
buttons.push(row);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
// Add profile and language buttons
|
| 39 |
+
buttons.push([
|
| 40 |
+
Markup.button.callback(messageManager.getMessage('btn_profile'), 'profile'),
|
| 41 |
+
Markup.button.callback(messageManager.getMessage('btn_change_language'), 'change_language')
|
| 42 |
+
]);
|
| 43 |
+
|
| 44 |
+
// Add top up and history buttons
|
| 45 |
+
buttons.push([
|
| 46 |
+
Markup.button.callback(messageManager.getMessage('btn_top_up'), 'top_up_balance'),
|
| 47 |
+
Markup.button.callback(messageManager.getMessage('btn_history'), 'history')
|
| 48 |
+
]);
|
| 49 |
+
|
| 50 |
+
// Add back button
|
| 51 |
+
buttons.push([
|
| 52 |
+
Markup.button.callback(messageManager.getMessage('btn_back'), 'main_menu')
|
| 53 |
]);
|
| 54 |
+
|
| 55 |
+
return Markup.inlineKeyboard(buttons);
|
| 56 |
};
|
| 57 |
|
| 58 |
export const getBackToMainMenuButton = () => {
|
src/index.ts
CHANGED
|
@@ -32,4 +32,4 @@ async function startServer() {
|
|
| 32 |
|
| 33 |
startServer();
|
| 34 |
|
| 35 |
-
|
|
|
|
| 32 |
|
| 33 |
startServer();
|
| 34 |
|
| 35 |
+
handleAddTelegrafBot("049a92c4-7654-43f6-8e6f-7ff5cce78995")
|