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

eris-sakura.js

v1.5.11

Published

Eris framework for easy use of the library.

Downloads

7

Readme

Updates

1.5.11:

Bumped Eris version to 1.17
Added option to ignore bots in command options
Changed things in ErisMessageEmbed such as adding setFooter() and other fixes
changes and fixes done bt @RedStone576

1.4.11:

Added new color pallet outrun thanks to @RedStone576 
Fixed things with CommandArgs and its typings
``

# 🌸 Sakura.js

A Eris framework based on Discord.js.

# ⚙ Setup
```shell
npm install eris-sakura.js
import sakura from "eris-sakura.js";
let sakura = require("eris-sakura.js");

🔧 Examples

let { SakuraClient } = require("eris-sakura.js");
let Eris = require("eris");

let erisClient = new Eris.Client("TOKEN", {});
let client = new SakuraClient(erisClient, { maxAttempts: 3 }); // Call the eris client in the main constructor.

// Its a extended message so there are more methods!
client.on("message", (message) => {
       if (message.content.startsWith("!send") {
           message.post("Hi this is a message from the eris-sakura.js framework"); // message.post() works the same way channel.createMessage() but it catches the error.
       }
});

client.login(); // The login method will connect the bot, but if it is unable to, it will try to connect using the maxAttempts options or the default 5

📄 Embeds and Colors

The framework uses a better color pallet than Discord.js so you can choose what you like! The avalible pallets: Original, Pastel, Light, Dark, Pride, Discord And more to come!

If you would like more pallets, fork this repo and make a pull request.

Embed:

let { ErisMessageEmbed } = require("eris-sakura.js");

let embed = new ErisMessageEmbed()
    .setDescription("This is a embed!")
    .setColor("pasOrange"); // Prefix the color with either "pas", "light", "dark", "pride" or the original color
    
message.createEmbedMessage([embed]) // Don't worry about doing embed.toJSON(), the method already does it.

👷 Collectors

The reaction and message collectors are copied code from Eris-Reactions Eris-Message-Collector

Example of usage

let { MessageCollector, ReactionCollector } = require("eris-sakura.js"); // Import it

client.on("message", (message) => {
    if (message.content.startsWith("!collect")) {
        message.createMessageCollector(filter, options) // Or use it through the extended Message!
        message.createReactionCollector(filter, perma, options);
    }
})

💬 Responses

The client comes with responses that are customizable.

let client = new SakuraClient(new Eris("TOKEN"), {
    responses: {
        cooldown: (time) => `You can run this command again in ${time}!`,
        error: "OH NO an error!"
    }
});

📙 Logger

The logger class is the main class of the client.

Usage:

let { Logger } = require("eris-sakura.js");

let log = new Logger();

log.warn("hi") // It will output a red message with a regular timestamp.

let logger = new Logger({ ISO: true }); // Will use the .toISOString() method in the Date constructor.

logger.custom("he", "idk", "blue")(); // A custom logger function to create a custom log. It returns a function because its a custom.

🌟 special thanks to these contributors