[termux] testing support for termux v11
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import pkg from "whatsapp-web.js";
|
||||
const { MessageMedia } = pkg;
|
||||
import sharp from "sharp";
|
||||
import sharp from "../utils/sharp-loader.js";
|
||||
import fs from "fs";
|
||||
import { botMsg } from "../utils/botMsg.js";
|
||||
import { client } from "../client/whatsappClient.js"
|
||||
|
||||
9
src/utils/sharp-loader.js
Normal file
9
src/utils/sharp-loader.js
Normal file
@@ -0,0 +1,9 @@
|
||||
let sharp;
|
||||
|
||||
try {
|
||||
sharp = (await import("sharp")).default;
|
||||
} catch {
|
||||
sharp = (await import("@img/sharp-wasm")).default;
|
||||
}
|
||||
|
||||
export default sharp;
|
||||
Reference in New Issue
Block a user