Javascript Discord Lib For Interacting With The Discord API!
This Is Not Fully Working! Please Do Not Donwload and Complain Because This Is a Work In Progress! PR Welcomed!
- Node.JS => 14.0.0
# Stablenpmi--savejarvis.djs
# NightlyBuildsnpmi--savejarvis.djs@nightly# Stableyarnaddjarvis.djs
# NightlyBuildsyarnaddjarvis.djs@nightly// ES6import*asdiscordfrom"jarvis.djs";// or commonJSconstdiscord=require("jarvis.djs");constdiscord=require('jarvis.djs');constclient=newdiscord.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 Elseclient.login("TOKEN");client.on("ready",async()=>{console.log("Ready!")});client.on("message",async(message)=>{console.log(message.content);});Destroy Client:
client.destroy();// Will destroy the client along with the discord connectionReady 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);});Ready Event:
ready-WhenClientIsReadywarn-Warningserror-WhenThereIsAnErrorThis is the connection between the client and discord api servers.
