🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

setar.js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

setar.js

a lite lib to interact with discord api [using v6 Connection]

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

Setar.js

a Module to interact with discord api, Creating discord bots!

Examples

for making sure that you installed package right you can run npm test and see setar.js Version on your console!

Sending Message to Channel

const Discord = require("../src/index"); // or 'setar.js'
const client = new Discord.Client();
client.Auth('<YOUR_BOT_TOKEN>');

const Routes = Discord.Routes;
client.Request('POST', Routes.Channel('<CHANNEL_ID>') + '/messages', { content: '<YOUR_MESSAGE>' });

Message Event and other Events

in setar.js, we have to force and make connection to the discord gateway by Connect function and this is what makes our bot/lib faster and better! by default, the connection is only connected to the interaction that you know as Slash Commands

const Discord = require("../src/index"); // or 'setar.js'
const client = new Discord.Client();
client.Auth('<YOUR_BOT_TOKEN>');

//Start Listening to Message Event
client.Connect(Discord.Intents.GUILD_MESSAGES); 

// Listen for intent packets
client.on('packet', packet => {
    // packet.t: intent type
    // packet.d: intent data
    if(packet.t == 'MESSAGE_CREATE') //heard new message?
    {
        //Do whatever you want....!
    }   
});

Documentation

maybe when we had time for it....

Support

feel free to ask your question on our official discord server

discord_invite

Keywords

discord

FAQs

Package last updated on 16 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts