# Vote Check

### An Example Command

```javascript
const Discord = require("discord.js"); //This is an example voted check command
const client = new Discord.Client();
const cybralist = require("cybralist.js");
const dbl = new cybralist("TOKEN-HERE", client); // This is not your bot token, this token can be found from our website: https://cybralist.com/bots/your_bot_id

client.on("ready", async () => {
  console.log(`Logged in as ${client.user.tag}`)
})

client.on("message", async (message) => {
  if (!message.guild) return;
  if (message.author.bot) return;
  
  const prefix = "!";
  const args = message.content.slice(prefix.length).split(" ");
  const command = args.shift().toLowerCase();
    
  if (command === "check") {
    const vote = await dbl.hasVoted(message.author.id);
    
    if (vote === true) { // checking whether the author has voted or not!
      message.channel.send(`You have voted for ${client.user.tag} recently. You can vote every 12 hours.`)
      
    } else {
      message.channel.send(`You have not voted for ${client.user.tag}. Please vote :)\nhttps://cybralist.com/bots/${client.user.id}/vote`)
    }
    
  }
})

client.login("token")
```

```javascript
let hasVote = await dbl.hasVoted("USER ID");

if(hasVote === true) {

  console.log("Voted")

} else {

  console.log("Vote please.")

}
```

```javascript
{ // this is the method of getting informations from the api

  "voted": "true/false"

}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cybralist.com/npm-module/votecheck.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
