Update index.js
Browse files
index.js
CHANGED
|
@@ -59,9 +59,9 @@ const post = async (url, form, headers = {}) => {
|
|
| 59 |
async function bimg(query) {
|
| 60 |
const { BingApi } = await import("bing-nodejs");
|
| 61 |
const bing = new BingApi({
|
| 62 |
-
cookie: process.env.BING_IMAGE_COOKIE
|
| 63 |
});
|
| 64 |
-
let data = await bing.createImage(
|
| 65 |
return res.urls; // string[]
|
| 66 |
});
|
| 67 |
|
|
@@ -71,7 +71,7 @@ const bing = new BingApi({
|
|
| 71 |
}
|
| 72 |
async function bingChat(text) {
|
| 73 |
const api = new BingChat({
|
| 74 |
-
cookie: process.env.BING_IMAGE_COOKIE
|
| 75 |
})
|
| 76 |
const res = await api.sendMessage(text, { variant: 'Precise' })
|
| 77 |
return res?.text
|
|
|
|
| 59 |
async function bimg(query) {
|
| 60 |
const { BingApi } = await import("bing-nodejs");
|
| 61 |
const bing = new BingApi({
|
| 62 |
+
cookie: process.env.BING_IMAGE_COOKIE
|
| 63 |
});
|
| 64 |
+
let data = await bing.createImage(query).then((res) => {
|
| 65 |
return res.urls; // string[]
|
| 66 |
});
|
| 67 |
|
|
|
|
| 71 |
}
|
| 72 |
async function bingChat(text) {
|
| 73 |
const api = new BingChat({
|
| 74 |
+
cookie: process.env.BING_IMAGE_COOKIE
|
| 75 |
})
|
| 76 |
const res = await api.sendMessage(text, { variant: 'Precise' })
|
| 77 |
return res?.text
|