Install and select the green `Run` button to run the script. Updated once every hour.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let sleep = async (ms) => {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
};
const count = await getCount();
await lib.discord.users['@0.1.4'].me.status.update({
activity_name: `with ${count} server`,
activity_type: 'GAME',
status: 'ONLINE',
});
async function getCount(id = null) {
await sleep(1000);
let result = await lib.discord.guilds['@0.1.0'].list({
limit: 100,
after: id,
});
let count = result.length;
if (result.length % 100 === 0) count += await getCount(result[99].id);
return count;
}