Giter VIP home page Giter VIP logo

jarvis's Introduction

Jarvis

Jarvis

Javascript Discord Lib For Interacting With The Discord API!

Issues Issues GitHub pull requests

NPM

This Is Not Fully Working! Please Do Not Donwload and Complain Because This Is a Work In Progress! PR Welcomed!

Table of Contents

Requirements

  • Node.JS => 14.0.0

Installation

NPM (recommended)

# Stable
npm i --save jarvis.djs

# Nightly Builds
npm i --save jarvis.djs@nightly

Yarn

# Stable
yarn add jarvis.djs

# Nightly Builds
yarn add jarvis.djs@nightly

Usage

Import the lib via ES6 or commonJS modules

// ES6
import * as discord from "jarvis.djs";
// or commonJS
const discord = require("jarvis.djs");

Client

const discord = require('jarvis.djs');
const client = new discord.Client({
    guild_subscriptions: false,
    intents: 32509,  // https://ziad87.net/intents/
    presence: "online",
    status: {
        text: "Status Text",
        type: 0 // Types: 0 = Playing, 1 = Streaming, 2 = Listening
    },
    ws: {
      large_threshold: 250,
      compress: false
    }
});

// Add This Before Anything Else
client.login("TOKEN");

client.on("ready", async() => {
    console.log("Ready!")
});

client.on("message", async (message) => {
    console.log(message.content);
});

Client Methods

Destroy Client:

client.destroy(); // Will destroy the client along with the discord connection

Ready Timestamp:

client.readyAt();

Manual REST Request:

client.manualREST("https://discordapp.com/api/v8/gateway", "GET", {
    'Content-Type': 'application/json',
    'authorization': 'Bot <TOKEN>'
});

Fetch Guild:

client.fetchGuild("ID").then(res => {
    console.log(res);
});

Create Guild:

client.createGuild(name, region, icon).then(res => {
    console.log(res);
});

Events

Ready Event:

ready - When Client Is Ready
warn - Warnings
error - When There Is An Error

Discord Gateway

This is the connection between the client and discord api servers.

License

FOSSA Status

jarvis's People

Contributors

fossabot avatar maximking1 avatar snyk-bot avatar windowscmd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.