managarten/packages/matrix-bot-common/src/index.ts
Till-JS 962b942e2a feat(bot-services): add credit and gift services for Matrix bots
- 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
2026-02-13 23:29:21 +01:00

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';