Skip to content

Instantly share code, notes, and snippets.

@RFS-ADRENO
Last active February 15, 2022 08:28
Show Gist options
  • Save RFS-ADRENO/b8d27a8e7aa4b9ecac76fcbbdccd0217 to your computer and use it in GitHub Desktop.
Save RFS-ADRENO/b8d27a8e7aa4b9ecac76fcbbdccd0217 to your computer and use it in GitHub Desktop.
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