https://github.com/maximking1/jarvis
Jarvis.djs is a JavaScript discord lib used for connecting with the discord api.
https://github.com/maximking1/jarvis
discord discord-api discord-api-wrapper
Last synced: about 1 year ago
JSON representation
Jarvis.djs is a JavaScript discord lib used for connecting with the discord api.
- Host: GitHub
- URL: https://github.com/maximking1/jarvis
- Owner: MaximKing1
- Created: 2021-03-01T18:30:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-18T06:29:13.000Z (almost 2 years ago)
- Last Synced: 2025-06-15T16:17:03.613Z (about 1 year ago)
- Topics: discord, discord-api, discord-api-wrapper
- Language: JavaScript
- Homepage:
- Size: 130 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- Security: SECURITY.md
Awesome Lists containing this project
README
Jarvis
Javascript Discord Lib For Interacting With The Discord API!
[](https://nodei.co/npm/jarvis.djs/)
## This Is Not Fully Working! Please Do Not Donwload and Complain Because This Is a Work In Progress! PR Welcomed!
# Table of Contents
- [Support Server](https://discord.gg/NybFm5ct)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Events](#events)
- [Discord Gateway](#discord-gateway)
## Requirements
- Node.JS => 14.0.0
# Installation
## NPM (recommended)
```js
# Stable
npm i --save jarvis.djs
# Nightly Builds
npm i --save jarvis.djs@nightly
```
## Yarn
```js
# Stable
yarn add jarvis.djs
# Nightly Builds
yarn add jarvis.djs@nightly
```
# Usage
### Import the lib via ES6 or commonJS modules
```js
// ES6
import * as discord from "jarvis.djs";
// or commonJS
const discord = require("jarvis.djs");
```
### Client
```js
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:**
```js
client.destroy(); // Will destroy the client along with the discord connection
```
**Ready Timestamp:**
```js
client.readyAt();
```
**Manual REST Request:**
```js
client.manualREST("https://discordapp.com/api/v8/gateway", "GET", {
'Content-Type': 'application/json',
'authorization': 'Bot '
});
```
**Fetch Guild:**
```js
client.fetchGuild("ID").then(res => {
console.log(res);
});
```
**Create Guild:**
```js
client.createGuild(name, region, icon).then(res => {
console.log(res);
});
```
# Events
**Ready Event:**
```js
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
[](https://app.fossa.com/projects/git%2Bgithub.com%2FJarvisDJS%2FJarvis?ref=badge_large)