Code Monkey home page Code Monkey logo

bfdapi.js's Introduction

This is a module for interacting with Bots For Discord's api.

You must have a bot listed on Bots For Discord, and have an api key to use this module.

This module does not have auto posting features.

This module does not have a way to handle vote webhooks (this is your job to handle, not ours!).

You cannot provide a Discord.JS/Eris client in replacment of your client id.

examples:

Posting Server Count

const BFDAPI = require("bfdapi.js");
const bfd = new BFDAPI("client id","api token");

bfd.postServerCount(5).then((res) => console.log(res));
// if successful: { message: 'Server count successfully updated.', success: true }
// if failed, it will throw an error

Get Bot Votes

const BFDAPI = require("bfdapi.js");
const bfd = new BFDAPI("client id","api token");

bfd.getBotVotes().then((res) => console.log(res));
// this will be different quite often
// if successful: { hasVoted: [], hasVoted24: [], votes: 0, votes24: 0, votesMonth: 0}
// if failed, it will throw an error

Get Bot

const BFDAPI = require("bfdapi.js");
const bfd = new BFDAPI("client id","api token");

bfd.getBot("bot id").then((res) => console.log(res));
// this will be different for every bot
// if successful: <too large to put here>
// if failed, it will throw an error

Get User

const BFDAPI = require("bfdapi.js");
const bfd = new BFDAPI("client id","api token");

bfd.getUser("user id").then((res) => console.log(res));
// this will be different for every bot
// if successful: <too large to put here>
// if failed, it will throw an error

Get User Bots

const BFDAPI = require("bfdapi.js");
const bfd = new BFDAPI("client id","api token");

bfd.getBot("bot id").then((res) => console.log(res));
// this will be different for every user
// if successful: array of Bots
// if failed, it will throw an error

Get Bot Widget

const BFDAPI = require("bfdapi.js");
const bfd = new BFDAPI("client id","api token");

bfd.getBotWidget().then((res) => console.log(res));
// if successful: bot widget string
// if failed, it will throw an error

bfdapi.js's People

Contributors

donovandmc avatar advaith1 avatar habchy avatar

Stargazers

Thomas avatar Ali avatar Brody Jagoe avatar

Watchers

James Cloos 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.