- Added Telegraf dependency to handle Telegram bot interactions. - Updated order lifecycle methods to send notifications upon order creation and updates. - Refactored datetime handling to use a consistent timezone. - Removed unused utility functions to streamline codebase.
14 lines
382 B
TypeScript
14 lines
382 B
TypeScript
// Универсальная функция для извлечения id из разных форматов входных данных
|
|
export function extractId(input) {
|
|
if (typeof input === 'number' || typeof input === 'string') {
|
|
return input;
|
|
}
|
|
if (input?.id) {
|
|
return input.id;
|
|
}
|
|
if (input?.set?.[0]?.id) {
|
|
return input.set[0].id;
|
|
}
|
|
return null;
|
|
}
|