feat(telegram-remote): ship lib/ code, add voice transcription, chat pagination, stream photos
- Add lib/ (plain-ESM plugin code, no build step) so the published tarball actually contains the plugin; un-ignore lib/ for this package - Sync README: voice/audio transcription via home-lab Whishper (default large-v2, device cuda, language auto), /chats pagination and subagent hiding, whisper* config keys, updated security note
This commit is contained in:
57
packages/telegram-remote/lib/ui.js
Normal file
57
packages/telegram-remote/lib/ui.js
Normal file
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Tiny UI kit: consistent, pretty Telegram message composition.
|
||||
* All helpers return HTML-safe strings (callers escape user data).
|
||||
*/
|
||||
|
||||
/** Soft horizontal divider. */
|
||||
export const DIVIDER = "─────── ⋆⋅☆⋅⋆ ───────";
|
||||
/** Slim divider for tight layouts. */
|
||||
export const SLIM = "────────────";
|
||||
|
||||
/** Section heading with a leading emoji. */
|
||||
export function heading(emoji, title) {
|
||||
return "<b>" + emoji + " " + title + "</b>";
|
||||
}
|
||||
|
||||
/** Hero header for welcome/start pages. */
|
||||
export function hero(title, subtitle) {
|
||||
return "✨ <b>" + title + "</b>" + (subtitle ? "\n<i>" + subtitle + "</i>" : "");
|
||||
}
|
||||
|
||||
/** One feature/fact row: emoji + label + detail. */
|
||||
export function row(emoji, label, detail) {
|
||||
return emoji + " <b>" + label + "</b>" + (detail ? " — " + detail : "");
|
||||
}
|
||||
|
||||
/** Bullet line with an optional muted hint. */
|
||||
export function bullet(text, hint) {
|
||||
return "• " + text + (hint ? " <i>(" + hint + ")</i>" : "");
|
||||
}
|
||||
|
||||
/** Command line: /cmd + short hint, monospace. */
|
||||
export function command(cmd, hint) {
|
||||
return "<code>" + cmd + "</code>" + (hint ? " — " + hint : "");
|
||||
}
|
||||
|
||||
/** Muted small print. */
|
||||
export function small(text) {
|
||||
return "<i>" + text + "</i>";
|
||||
}
|
||||
|
||||
/** Status chip: colored dot + word. */
|
||||
export function chip(dot, word) {
|
||||
return "<b>" + dot + "</b> " + word;
|
||||
}
|
||||
|
||||
/** Numbered list item with title + meta line. */
|
||||
export function numbered(index, title, meta) {
|
||||
return (index + 1) + ". <b>" + title + "</b>" + (meta ? "\n <i>" + meta + "</i>" : "");
|
||||
}
|
||||
|
||||
/** Keyboard: rows of buttons. */
|
||||
export function inlineKeyboard(rows) {
|
||||
return { inline_keyboard: rows.map((rowButtons) => rowButtons.map((b) => ({
|
||||
text: b.text,
|
||||
callback_data: b.data ?? b.text,
|
||||
}))) };
|
||||
}
|
||||
Reference in New Issue
Block a user