Move parse_mode statements
parent
5896a3db3f
commit
55672d5b55
10
cli.ts
10
cli.ts
|
@ -19,6 +19,9 @@ async function makeTelegramRequest(
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case "sendMessage": {
|
case "sendMessage": {
|
||||||
formData.append("text", additionalParam.text);
|
formData.append("text", additionalParam.text);
|
||||||
|
if (additionalParam.parse_mode) {
|
||||||
|
formData.append("parse_mode", additionalParam.parse_mode);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "sendMediaGroup": {
|
case "sendMediaGroup": {
|
||||||
|
@ -57,6 +60,9 @@ async function makeTelegramRequest(
|
||||||
if (additionalParam.caption) {
|
if (additionalParam.caption) {
|
||||||
formData.append("caption", additionalParam.caption);
|
formData.append("caption", additionalParam.caption);
|
||||||
}
|
}
|
||||||
|
if (additionalParam.parse_mode) {
|
||||||
|
formData.append("parse_mode", additionalParam.parse_mode);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "deleteMessage": {
|
case "deleteMessage": {
|
||||||
|
@ -69,10 +75,6 @@ async function makeTelegramRequest(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalParam.parse_mode && command != "sendMediaGroup") {
|
|
||||||
formData.append("parse_mode", additionalParam.parse_mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData,
|
body: formData,
|
||||||
|
|
Loading…
Reference in New Issue