OverviewFilesCommitsIssuesDocsReleasesPeers

apds commits / 1fd476c

add a getLatest and getPubkeys
1fd476ca1f96898d2fb57947c6e5cd8ec844a918
by Ev Bogue <ev@evbogue.com> · 2025-04-05T01:42:59.000Z

Changed files (2) +15 -4

bogbot.js +15 -0
……@@ -222,6 +222,21 @@ bogbot.query = async (query) => {
222222 }
223223}
224224
225bogbot.getPubkeys = async () => {
226 const arr = await bogbot.query()
227 const newSet = new Set()
228 for (const msg of arr) {
229 newSet.add(msg.author)
230 }
231 const newArr = [...newSet]
232 return newArr
233}
234
235bogbot.getLatest = async (pubkey) => {
236 const q = openedLog.filter(msg => msg.author === pubkey)
237 return q[q.length -1]
238}
239
225240bogbot.human = async (ts) => {
226241 return await human(new Date(parseInt(ts)))
227242}
example.js +0 -4
……@@ -23,7 +23,3 @@ const log = await bogbot.query()
2323log.forEach(async (obj) => {
2424 await render.hash(obj.hash, scroller)
2525})
26
27const search = await bogbot.query('?hello world')
28
29console.log(search)