Move parse_mode statements
parent
5896a3db3f
commit
55672d5b55
10
cli.ts
10
cli.ts
|
@ -19,6 +19,9 @@ async function makeTelegramRequest(
|
|||
switch (command) {
|
||||
case "sendMessage": {
|
||||
formData.append("text", additionalParam.text);
|
||||
if (additionalParam.parse_mode) {
|
||||
formData.append("parse_mode", additionalParam.parse_mode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "sendMediaGroup": {
|
||||
|
@ -57,6 +60,9 @@ async function makeTelegramRequest(
|
|||
if (additionalParam.caption) {
|
||||
formData.append("caption", additionalParam.caption);
|
||||
}
|
||||
if (additionalParam.parse_mode) {
|
||||
formData.append("parse_mode", additionalParam.parse_mode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
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, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
|
|
Loading…
Reference in New Issue