mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 00:33:20 +08:00
24 lines
620 B
JavaScript
24 lines
620 B
JavaScript
import {
|
|
deriveTokenBotIdentity,
|
|
maskPlatformId,
|
|
TokenBotConfigStore,
|
|
} from '../shared/token-config-store.mjs';
|
|
|
|
const IDENTITY_OPTIONS = Object.freeze({
|
|
botPrefix: 'telegram',
|
|
tokenRefPrefix: 'DSH_TELEGRAM_BOT_TOKEN',
|
|
});
|
|
|
|
export function deriveTelegramBotIdentity(platformId) {
|
|
return deriveTokenBotIdentity(platformId, IDENTITY_OPTIONS);
|
|
}
|
|
|
|
export function maskTelegramBotId(platformId) {
|
|
return maskPlatformId(platformId, 'Telegram机器人');
|
|
}
|
|
|
|
export class TelegramConfigStore extends TokenBotConfigStore {
|
|
constructor(path) {
|
|
super(path, { channel: 'Telegram', ...IDENTITY_OPTIONS });
|
|
}
|
|
}
|