Skip to content

Instantly share code, notes, and snippets.

@ionutale
Created June 20, 2020 05:24
Show Gist options
  • Save ionutale/e6c947f7d8afc47f958e7a78284ad5fd to your computer and use it in GitHub Desktop.
Save ionutale/e6c947f7d8afc47f958e7a78284ad5fd to your computer and use it in GitHub Desktop.
const clashApi = require('clash-of-clans-api')
let client = clashApi({
token: COC_API_TOKEN // Optional, can also use COC_API_TOKEN env variable
});
async function showPlayerInfo(tag) {
try {
const playerInfo = await client.playerByTag(tag)
console.log("this is the player info:", playerInfo)
} catch (error) {
console.error(error)
}
}
showPlayerInfo('#GQJC0UCG')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment