mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 23:49:40 +02:00
- Add CreditService with balance checking and consumption - Add GiftService for gift code creation and redemption - Add i18n support for credit/gift messages (DE/EN) - Add Matrix bot mixins for credit and gift commands
83 lines
1.7 KiB
TypeScript
83 lines
1.7 KiB
TypeScript
/**
|
|
* @manacore/matrix-bot-common
|
|
*
|
|
* Shared utilities and base classes for Matrix bots.
|
|
* Reduces code duplication across 19 Matrix bots.
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* import {
|
|
* BaseMatrixService,
|
|
* HealthController,
|
|
* MatrixMessageService,
|
|
* KeywordCommandDetector,
|
|
* markdownToHtml,
|
|
* SessionHelper,
|
|
* UserListMapper,
|
|
* } from '@manacore/matrix-bot-common';
|
|
* ```
|
|
*/
|
|
|
|
// Base Matrix Service
|
|
export {
|
|
BaseMatrixService,
|
|
type IConfigService,
|
|
type MatrixBotConfig,
|
|
type MatrixRoomEvent,
|
|
type MatrixMessageEvent,
|
|
isTextMessage,
|
|
isAudioMessage,
|
|
isImageMessage,
|
|
isFileMessage,
|
|
} from './base/index.js';
|
|
|
|
// Health Controller
|
|
export {
|
|
HealthController,
|
|
HEALTH_SERVICE_NAME,
|
|
createHealthProvider,
|
|
type HealthResponse,
|
|
} from './health/index.js';
|
|
|
|
// Message Service
|
|
export {
|
|
MatrixMessageService,
|
|
type MatrixMessageContent,
|
|
type SendMessageOptions,
|
|
} from './message/index.js';
|
|
|
|
// Markdown Utilities
|
|
export { markdownToHtml, escapeHtml, formatNumberedList, formatBulletList } from './markdown/index.js';
|
|
|
|
// Keyword Detection
|
|
export {
|
|
KeywordCommandDetector,
|
|
COMMON_KEYWORDS,
|
|
type KeywordCommand,
|
|
type KeywordDetectorOptions,
|
|
} from './keywords/index.js';
|
|
|
|
// Session Helper
|
|
export { SessionHelper, createSessionHelper } from './session/index.js';
|
|
|
|
// List Mapper
|
|
export { UserListMapper, UserIdListMapper } from './list-mapper/index.js';
|
|
|
|
// Credit Commands
|
|
export {
|
|
handleCreditCommand,
|
|
sendPaymentSuccessNotification,
|
|
isCreditCommand,
|
|
CREDIT_COMMANDS,
|
|
type CreditCommand,
|
|
type CreditCommandsHost,
|
|
} from './credit/index.js';
|
|
|
|
// Gift Commands
|
|
export {
|
|
handleGiftCommand,
|
|
isGiftCommand,
|
|
GIFT_COMMANDS,
|
|
type GiftCommand,
|
|
type GiftCommandsHost,
|
|
} from './gift/index.js';
|