瀏覽代碼

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

Idel Gataullin 3 年之前
父節點
當前提交
f31e6ff955
共有 1 個文件被更改,包括 2 次插入2 次删除
  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;