Skip to content

Commit

Permalink
[ Jessi-md 4.8.4 ⏱️ ]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaweeshachamodx authored Jan 28, 2024
1 parent 3da0acf commit 227ee5a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
18 changes: 18 additions & 0 deletions plugins/tools-apkinfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import moment from 'moment-timezone'
import gplay from 'google-play-scraper'

let handler = async (m, { conn, text, usedPrefix, command }) => {
let [url, appId] = text.match(/([a-zA-Z]+(\.[a-zA-Z]+)+)/g) || []
if (url !== 'play.google.com') throw `Ex: ${usedPrefix + command} https://play.google.com/store/apps/details?id=com.whatsapp`
// if (!appId) throw 'App ID not found'
let res = await gplay.app({ appId })
let { title, summary, installs, scoreText, priceText, size, androidVersionText, developer, icon, screenshots, released, updated, version } = res
let str = `*Title:* ${title}\n ${summary}\n*Installs:* ${installs}\n*Score:* ${scoreText}\n*Price:* ${priceText}\n`
+ `*Size:* ${size}\n*Android Ver:* ${androidVersionText}\n*Dev:* ${developer}\n*Released:* ${released}\n`
+ `*Updated:* ${moment(updated).locale('en').format('MMM D, Y')}\n*Version:* ${version}`
let opt = { contextInfo: { externalAdReply: { title, body: summary, thumbnail: (await conn.getFile(icon)).data, sourceUrl: res.url }}}
conn.sendMessage(m.chat, { image: { url: screenshots.getRandom() }, caption: str, ...opt }, { quoted: m })
}
handler.command = /^(apk(info|detail))$/i

export default handler
15 changes: 15 additions & 0 deletions plugins/tools-apksearch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import gplay from 'google-play-scraper'

let handler = async (m, { conn, text }) => {
if (!text) throw 'Input Query'
let res = await gplay.search({ term: text })
if (!res.length) throw `Query "${text}" not found :/`
let opt = { contextInfo: { externalAdReply: { title: res[0].title, body: res[0].summary, thumbnail: (await conn.getFile(res[0].icon)).data, sourceUrl: res[0].url }}}
res = res.map((v) => `*Title:* ${v.title}\n*Dev:* ${v.developer}\n*Price:* ${v.priceText}\n*Score:* ${v.scoreText}\n*Link:* ${v.url}`).join`\n\n`
m.reply(res, null, opt)
}
handler.help = ['apksearch']
handler.tags = ['tools']
handler.command = /^(apksearch)$/i

export default handler

0 comments on commit 227ee5a

Please sign in to comment.