Parcourir la source

Added check on schedule property if message edits (#313)

Idel Gataullin il y a 3 ans
Parent
commit
f31e6ff955
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      gramjs/client/messages.ts

+ 2 - 2
gramjs/client/messages.ts

@@ -896,8 +896,8 @@ export async function editMessage(
         schedule,
     }: EditMessageParams
 ) {
-    if (typeof message === "number" && typeof text === "undefined" && !file) {
-        throw Error("You have to provide either file and text property.");
+    if (typeof message === "number" && typeof text === "undefined" && !file && !schedule) {
+        throw Error("You have to provide either file or text or schedule property.");
     }
     entity = await client.getInputEntity(entity);
     let id: number | undefined;