@@ -170,6 +170,7 @@ function buildTelegramSendOptions(params: {
170170 threadId ?: string | number | null ;
171171 silent ?: boolean | null ;
172172 forceDocument ?: boolean | null ;
173+ parseMode ?: "HTML" | "MarkdownV2" | null ;
173174 gatewayClientScopes ?: readonly string [ ] | null ;
174175} ) : TelegramSendOptions {
175176 return {
@@ -182,6 +183,7 @@ function buildTelegramSendOptions(params: {
182183 accountId : params . accountId ?? undefined ,
183184 silent : params . silent ?? undefined ,
184185 forceDocument : params . forceDocument ?? undefined ,
186+ textMode : params . parseMode === "MarkdownV2" ? "markdown" : "html" ,
185187 ...( Array . isArray ( params . gatewayClientScopes )
186188 ? { gatewayClientScopes : [ ...params . gatewayClientScopes ] }
187189 : { } ) ,
@@ -199,6 +201,7 @@ async function sendTelegramOutbound(params: {
199201 replyToId ?: string | null ;
200202 threadId ?: string | number | null ;
201203 silent ?: boolean | null ;
204+ parseMode ?: "HTML" | "MarkdownV2" | null ;
202205 gatewayClientScopes ?: readonly string [ ] | null ;
203206} ) {
204207 const send = await resolveTelegramSend ( params . deps ) ;
@@ -213,6 +216,7 @@ async function sendTelegramOutbound(params: {
213216 replyToId : params . replyToId ,
214217 threadId : params . threadId ,
215218 silent : params . silent ,
219+ parseMode : params . parseMode ,
216220 gatewayClientScopes : params . gatewayClientScopes ,
217221 } ) ,
218222 ) ;
@@ -1098,6 +1102,7 @@ export const telegramPlugin = createChatChannelPlugin({
10981102 replyToId,
10991103 threadId,
11001104 silent,
1105+ formatting,
11011106 gatewayClientScopes,
11021107 } ) =>
11031108 await sendTelegramOutbound ( {
@@ -1109,6 +1114,7 @@ export const telegramPlugin = createChatChannelPlugin({
11091114 replyToId,
11101115 threadId,
11111116 silent,
1117+ parseMode : formatting ?. parseMode ,
11121118 gatewayClientScopes,
11131119 } ) ,
11141120 sendMedia : async ( {
@@ -1122,6 +1128,7 @@ export const telegramPlugin = createChatChannelPlugin({
11221128 replyToId,
11231129 threadId,
11241130 silent,
1131+ formatting,
11251132 gatewayClientScopes,
11261133 } ) =>
11271134 await sendTelegramOutbound ( {
@@ -1135,6 +1142,7 @@ export const telegramPlugin = createChatChannelPlugin({
11351142 replyToId,
11361143 threadId,
11371144 silent,
1145+ parseMode : formatting ?. parseMode ,
11381146 gatewayClientScopes,
11391147 } ) ,
11401148 sendPoll : async ( {
0 commit comments