Coder Social home page Coder Social logo

ddfffff's Introduction

npm install
Do you need my help? Visit our Discord server.

Installation

npm i vcodes.js --save
yarn add vcodes.js

Usage

const vCodes = require('./vcodes.index');
const dbl = new vCodes("vCodes Bot Token");


dbl.on("ready", (bot) => {
    console.log(`Bot named ${bot.username} successfully finded on vCodes.`)
    dbl.checkVote("714451348212678658").then(value => console.log("Vote Control: "+ value))

    /*
        let guildCount = 1234;
        let shardCount = 5;
        dbl.stats(guildCount, shardCount, () => console.log("Stats updated on vCodes."));
    */
})


/*
    Get with Bot: 
    dbl.on("vote", ({ user, bot }) => {
        console.log(`${user.username} voted ${bot.username}`)
    })
*/
dbl.on("vote", ({ user }) => {
    console.log(`${user.username} voted.`)
})

Detailed

Define Module

const vCodes = require('./vcodes.index');
const dbl = new vCodes("vCodes Bot Token");

Let's add an event to see if it works.

dbl.on("ready", (bot) => {
    console.log(`Bot named ${bot.username} successfully finded on vCodes.`)
})

// => Bot named Allegro successfully finded on vCodes.

Let's update bot data

dbl.on("ready", (bot) => {
    console.log(`Bot named ${bot.username} successfully finded on vCodes.`)
    let guildCount = 1234;
    let shardCount = 5;
    dbl.stats(guildCount, shardCount, () => console.log("Stats updated on vCodes."));
})

// => Bot named Allegro successfully finded on vCodes.
// => Stats updated on vCodes.

Let's check if a user has voted.

dbl.on("ready", (bot) => {
    console.log(`Bot named ${bot.username} successfully finded on vCodes.`)
    dbl.checkVote("714451348212678658").then(value => console.log("Vote Control: "+ value))

    /*
        let guildCount = 1234;
        let shardCount = 5;
        dbl.stats(guildCount, shardCount, () => console.log("Stats updated on vCodes."));
    */
})

// => Bot named Allegro successfully finded on vCodes.
// => Vote Control: false

Let's check if there is a user who voted for our bot instantly.

dbl.on("vote", ({ user }) => {
    console.log(`${user.username} voted.`)
})

// => clqu voted.
// WITH BOT
dbl.on("vote", ({ user, bot }) => {
    console.log(`${user.username} voted ${bot.username}`)
})

// => clqu voted Allegro.

Developed with ❤️ by Void Development

ddfffff's People

Contributors

clqu avatar

Watchers

MapXoor Dev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.