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

shockbs

v0.1.1114

Published

LOTS ultilities to upgrade your Discord Bot using SHOCK API !

Downloads

1,194

Readme

Node version contributions welcome HitCount Vulnerabilities License: CC BY-NC 4.0 GitHub Workflow Status Repo Size PRs Welcome FOSSA Statusnpm License Contributors Size Package ShockBS Npm package version Npm package monthly downloads Npm package daily downloads Npm package total downloads Npm package dependents GitHub release GitHub commits GitHub latest commit GitHub forks GitHub stars GitHub watchers GitHub issues GitHub issues-closed Discord Shock Discord ForTheBadge uses-git ForTheBadge uses-js ForTheBadge built-with-love ForTheBadge built-by-developers Open Source Love svg3 Npm Visual Studio Code GitHub made-with-Markdown Maintenance

Support Server

https://discord.gg/zeBet3HrU4

Getting Started

you can install ShockBS via npm:

npm i shockbs@latest

Getting your API Key

join the support server and visit api settings channel

Logging in with an API Key

import shockbs from "shockbs";
// const shockbs = require("shockbs");
try {
    shockbs.login(process.env.ShockBS_APIKEY);
} catch(err) {
    console.error("Unable to log in, reason: "+err.message);
}

You only need to call login() once, it's recommended to do that on your main file

Checking if you are already logged in

import shockbs from "shockbs";
// const shockbs = require("shockbs");
const loggedIn = shockbs.loggedIn();
if (loggedIn === true) {
    console.log("Already Logged In");
} else {
    console.error("[Shock API] Not Logged In Yet");
}

GuessThePokemon Game

Demo guessThePokemonGame

import shockbs from "shockbs";
// const shockbs = require("shockbs");
new shockbs.guessThePokemonGame({
    base: interaction, // required, can be either message or interaction
    baseType: "Interaction" // required, the type of base, can be either message or interaction, case-insensitive
    embed: {
        title: "Who's the Pokemon?", // optional, string, the title of embed
        color: "#F600FF", // optional, string, the color of embed
        winMessage: "You're right! The Pokemon is ${pokemonName}.", // optional, title when user guessed the correct pokemon name, ${pokemonName} will be replaced with the correct pokemon name
        loseMessage: "You're wrong! Please try again.", // optional, string
        timeoutMessage: "You didn't respond in time. The pokemon was ${pokemonName}." // optional, string, ${pokemonName} will be replaced with the correct pokemon name
    },
    button: {
        text: "Input Answer", // optional, string
        style: ButtonStyle.Primary, // optional
        emoji: null, // optional
    },
    time: "half minute", //optional
}).startGame();

GPT-4 / GPT-3.5 / GPT-3 (FREE & Unlimited)

first initialize gptChat

import shockbs from "shockbs";
// const shockbs = require("shockbs");

const chatData = new shockbs.gptChat({
    model: "GPT-4", // available models: gpt-4, gpt-3.5, gpt-3
    replyMention: false, //whether to mention on reply
    maxInteractions: 30, // max interactions with the ai before clearing conversation history
    components: null, // extra components
    custom: false, // whether to use custom GPT personality
    embed: {
        color: "#FF00F6"
    }
})

custom trained GPT trained from API Panel:

new shockbs.gptChat({
    ...[data],
    custom: true, // enables custom trained gpt, supports all models
})

available models: gpt-4, gpt-3.5, gpt-3

and now you can attach it to your bot client for easy use (optional):

client.shockChat = chatData;

processing messages:

if (!(message.mentions?.users?.first() || {id:false}).id === client.user.id || !message.content?.length) return;
message.channel.startTyping();
await client.shockChat.message(message);

clearing all conversation history:

client.shockChat.clear().then(()=> console.log("Cleared Conversation History"));

clearing a person's conversation history:

const result = await client.shockChat.clearConversation(interaction.user.id);
if (result) {
    console.log("success");
} else {
    console.log("failed");
}

getting a person's conversation history:

client.shockChat.getData(interaction.user.id).then(data=> console.log(data));

getting a person's chat interactions count:

console.log(await client.shockChat.getCount(interaction.user.id));
  • text generation only:
import shockbs from "shockbs";
// const shockbs = require("shockbs");

//gpt4
console.log(await shockbs.gptText("Why does OpenAI not having traditional CEO?","gpt4"));
//gpt3.5
console.log(await shockbs.gptText("Write me a poem of stars.","gpt3.5"));
//gpt3
console.log(await shockbs.gptText("Guide me to make a watermelon spaghetti.","gpt3"));

Star History