diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-19 12:02:21 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-19 12:02:21 +0200 |
| commit | 65da4cba0053bc6ee6f5442a45022bf5b4198e70 (patch) | |
| tree | 009923749461351b397cf26672b00b663bef0f63 /api.js | |
| parent | a0cb47ddcfcafc8a254de6b7574838d61a593bdd (diff) | |
| download | discordbot-65da4cba0053bc6ee6f5442a45022bf5b4198e70.tar.gz discordbot-65da4cba0053bc6ee6f5442a45022bf5b4198e70.zip | |
rotate IGNs in playing status
Diffstat (limited to 'api.js')
| -rw-r--r-- | api.js | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -74,13 +74,20 @@ async function getMappings() { } ); return mapping; - }); + }, { ttl: 60 * 30 }); } module.exports.mapGameMode = async function(id) { return (await getMappings())["gamemode"][id]; } +// return a set of IGN of supporters +module.exports.getGamers = async function() { + return await cache.wrap("gamers", async () => { + return (await getFE("/gamer")).map((gamer) => gamer.name); + }, { ttl: 60 * 30 }); +} + // be an async iterator // next() returns promises that are awaited until there is an update module.exports.subscribeUpdates = function(name, timeout=UPDATE_TIMEOUT) { |
