@bytesbrains/pi-telegram-bridge 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/helpers.ts +2 -1
- package/src/index.ts +1 -1
- package/src/templates.ts +555 -652
package/package.json
CHANGED
package/src/helpers.ts
CHANGED
|
@@ -40,11 +40,12 @@ export async function telegramApi(
|
|
|
40
40
|
export async function sendMsg(
|
|
41
41
|
text: string,
|
|
42
42
|
replyMarkup?: object,
|
|
43
|
+
parseMode: "Markdown" | "HTML" = "Markdown",
|
|
43
44
|
): Promise<number> {
|
|
44
45
|
const body: Record<string, unknown> = {
|
|
45
46
|
chat_id: getChatId(),
|
|
46
47
|
text,
|
|
47
|
-
parse_mode:
|
|
48
|
+
parse_mode: parseMode,
|
|
48
49
|
};
|
|
49
50
|
if (replyMarkup) body.reply_markup = JSON.stringify(replyMarkup);
|
|
50
51
|
const r = (await telegramApi("sendMessage", body)) as {
|
package/src/index.ts
CHANGED
|
@@ -381,7 +381,7 @@ export default function telegramBridge(pi: ExtensionAPI) {
|
|
|
381
381
|
const message = buildNotification(
|
|
382
382
|
params as unknown as import("./templates").NotifyInput,
|
|
383
383
|
);
|
|
384
|
-
const mid = await sendMsg(message);
|
|
384
|
+
const mid = await sendMsg(message, undefined, "HTML");
|
|
385
385
|
return {
|
|
386
386
|
content: [{ type: "text", text: `Notification sent (id:${mid})` }],
|
|
387
387
|
details: {},
|