Browse Source

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

Idel Gataullin 3 năm trước cách đây
mục cha
commit
f31e6ff955
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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;