npm i clashofclans.js
- Node.js v14 or newer is required.
const { Client } = require('clashofclans.js');
const client = new Client();
(async function () {
await client.login({ email: '[email protected]', password: '***' });
const clan = await client.getClan('#2PP');
console.log(`${clan.name} (${clan.tag})`);
})();
const { Client, BatchThrottler } = require('clashofclans.js');
const client = new Client({
cache: true,
retryLimit: 1,
restRequestTimeout: 5000,
throttler: new BatchThrottler(20)
});
client.events.addClans(['#8QU8J9LP', '#8P2QG08P']);
client.events.setClanEvent({
name: 'clanDescriptionChange',
filter: (oldClan, newClan) => {
return oldClan.description !== newClan.description;
}
});
client.on('clanDescriptionChange', (oldClan, newClan) => {
console.log(oldClan.description, newClan.description);
});
(async function () {
await client.login({ email: '[email protected]', password: '***' });
await client.events.init();
})();
This content is not affiliated with, endorsed, sponsored, or specifically approved by Supercell and Supercell is not responsible for it. For more information see Supercell's Fan Content Policy.