| … | … | @@ -222,6 +222,21 @@ bogbot.query = async (query) => { |
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | bogbot.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 | ||
| 235 | bogbot.getLatest = async (pubkey) => { | |
| 236 | const q = openedLog.filter(msg => msg.author === pubkey) | |
| 237 | return q[q.length -1] | |
| 238 | } | |
| 239 | ||
| 225 | 240 | bogbot.human = async (ts) => { |
| 226 | 241 | return await human(new Date(parseInt(ts))) |
| 227 | 242 | } |
| … | … | @@ -23,7 +23,3 @@ const log = await bogbot.query() |
| 23 | 23 | log.forEach(async (obj) => { |
| 24 | 24 | await render.hash(obj.hash, scroller) |
| 25 | 25 | }) |
| 26 | ||
| 27 | const search = await bogbot.query('?hello world') | |
| 28 | ||
| 29 | console.log(search) |