Last active
February 15, 2022 08:28
-
-
Save RFS-ADRENO/b8d27a8e7aa4b9ecac76fcbbdccd0217 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function config(){ | |
return{ | |
"name": "Anime", | |
"main": "Anime.js", | |
"commandMap": { | |
"loli": { | |
"more": "", | |
"des": "Request ảnh loli", | |
"func": "loli" | |
}, | |
"wallpaper": { | |
"more": "", | |
"des": "Request ảnh nền anime", | |
"func": "wallpaper" | |
} | |
}, | |
"nodeDepends":{ | |
"axios" : "" | |
}, | |
"author": "DungUwU", | |
"version": "1.0.0" | |
} | |
} | |
const getImg = async ( event, api, type ) => { | |
const axios = require("axios"); | |
await axios.get(`https://adreno-api.rootandroid.repl.co/${type}`).then(async (res) => { | |
await axios.get(res.data.url, { responseType: "stream"}).then(ress => { | |
api.sendMessage({body: res.data.url, attachment: ress.data}, event.threadID); | |
}).catch(ee => api.sendMessage(ee, event.threadID)) | |
}).catch(e => api.sendMessage(e, event.threadID)) | |
} | |
const loli = (event, api) => getImg( event, api, "loli" ); | |
const wallpaper = (event, api) => getImg( event, api, "wallpaper" ); | |
module.exports = { | |
wallpaper, | |
loli, | |
config | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment