npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

devland.js

v1.4.5

Published

A powerful API wrapper for the Discord API designed for modern bots

Downloads

388

Readme

Links

Need help ?

If you need help with the module you can take a look to the documentation or come into our discord server.

You found a bug ?

If you found a bug you can just open a issue by explaining this one. You can report it on our discord server too.

Let's start

This is a little part present in our documentation.

const {Client, IntentFlags} = require("devland.js")
const bot = new Client({
    intents: [IntentFlags.FLAGS.GUILDS, IntentFlags.FLAGS.GUILD_MEMBERS, IntentFlags.FLAGS.GUILd_PRESENCES]
    guildsLifeTime: 7200000, 
    // here we ask to the module to cache all guilds during 2h
    // after all events with a guild as target, the life time will be reset to 2h
    connect: true,
    // represent the auto-connect, if true you will need to provid the token here
    token: "YOUR TOKEN" 
    //token is optional if 'connect' is on false, you will be invited to put
    // the token in the next page (Connect Client)
})

bot.on('ready', () => console.log(`${bot.user.tag} connected`))

All cache options available for the client :

guildsLifeTime: milliseconds, //will unlock bot.guilds
channelsLifeTime: milliseconds, //will unlock bot.<type>Channels (ex : bot.textChannels)
usersLifeTime: milliseconds, //will unlock bot.users
messagesLifeTime: milliseconds, //will unlock bot.messages
threadsLifeTime: milliseconds, //will unlock bot.threadChannels
membersLifeTime: milliseconds, //will unlock <guild>.members
rolesLifeTime: milliseconds, //will unlock <guild>.roles
invitesLifeTime: milliseconds, //will unlock <guild>.invites
presencesLifeTime: milliseconds, //will unlock <guild>.presences & <member>.presence
voicesLifeTime: milliseconds, //will unlock <guild>.voicesStates & <member>.voice
enableAllCaches: //will unlock all caches of the client
waitCacheBeforeReady: boolean, //wait for all caches enabled to be completed before emit the ready event, by default set to true
fetchAllMembers: boolean, //by default fetch all members in a guild
checkForUpdate: boolean, //check for a new update when the program is up

// warning, for the members, roles, presences, voices & invites cache the guilds cache must be enabled too

All ws options available for the client :

large_threshold: number,
compress: boolean,
properties: propertiesOptions,

propertiesOptions = {
    $os: string | NodeJS.Platform,
    $browser: string,
    $device: string
}

All presence options available for the client :

status: string, //dnd, online, invisible, idle, offline
afk: boolean,
activities: simpleActivity[],
since: number,

simpleActivity = {
    name: string,
    type: ActivityType,
    url: string,
}

ActivityType = {
    Game = 0,
    Streaming = 1,
    Listening = 2,
    Watching = 3,
    Custom = 4,
    Competing = 5
}

All others options available for the client :

connectionTimeout: number, //how many time before throwing a error if still not connected, default set to 30000 (30s)
maxReconnectAttempts: number, //how attempts to reconnect the gateway after a error, default set to Infinity
maxResumeAttempts: number, //how many attempts to resume the gateway connection after a disconnect, default set to 10
invalidCommandValueReturnNull: boolean, //<interaction>.getCommandValue() must return a null value or undefined if invalid, default set to true (null returned)