MAPXOR12 / tip

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm install

Installation

npm i tip --save
yarn add tip

Usage

const tip = require('./tip.index');
const dbl = new vCodes("tip 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 tip = require('./tip.index.js);
const dbl = new vCodes("tip 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 tip.`)
})

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

Let's update bot data

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

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

Let's check if a user has voted.

dbl.on("ready", (bot) => {
    console.log(`Bot named ${bot.username} successfully finded on tip.`)
    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 tip."));
    */
})

// => Bot named Allegro successfully finded on tip.
// => 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.`)
})

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

// => mapxot voted Allegro.

About


Languages

Language:JavaScript 100.0%