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

@ayanaware/bentocord

v1.0.0-beta.62

Published

Bentocord is a Bento plugin designed to rapidly build fully functional Discord Bots.

Downloads

2,569

Readme

@ayanaware/bentocord npm (scoped) Discord install size

Bentocord is a Bento plugin designed to rapidly build fully functional Discord Bots. But stay powerful enough that you never have to leave

Bootstrap

With most things Bento you have a lot of options when bootstrapping Bentocord. However we highly recommend usings Bento's Application helper. It is the most painless way to get up and running:

import { Application } from '@ayanaware/bento';
import { Bentocord } from '@ayanaware/bentocord';

// Create our Application instance
const app = new Application();

// Anonymous async function so we can use await
(async () => {
	await app.start();

	// Add Bentocord
	await app.bento.addPlugin(Bentocord);

	await app.verify();
})().catch(e => {
	console.log(e);
	process.exit(1);
});

Bentocord Variables

Bento variables are used to change the behavior of Bentocord. They can be set various different ways. Some common ways are to use Bento's built in VariableLoader or VariableFileLoader plugins. You can also bring your own plugin or alternativly directly inject values via Bento.setVariable().

Note: While some variables are dynamic and Bentocord reacts as soon as you update them. Some are not. This means Bentocord expects you to set all Variables you care about before Bento.addPlugin()

Key | Type | Description | Default --- | --- | --- | --- BENTOCORD_TOKEN | string | Discord Authentication Token | null BENTOCORD_BOT_OWNERS | list* | Discord user id list | null BENTOCORD_IGNORE_MODE | boolean | This will disable much of the bot for users not in BENTOCORD_BOT_OWNERS | false BENTOCORD_COMMAND_PREFIX | string | The default prefix to use for Bentocord's Command Handler | bentocord BENTOCORD_ACTIVITY_NAME | string | The default activity name to set per shard | with Bentocord BENTOCORD_BUILTIN_COMMANDS | boolean | Should Bentocord load it's built-in Commands (ex: ping, bento) | true

* = comma seperated list of items

Bentocord Interface

Bentocord uses a replaceable entity, BentocordInterface, to offer extendable functionality. Bentocord tries to offer sane defaults but for things like Storage, Localization, and other Application specific features you will need to provide a replacement entity. I often refer to this replacement entity as BentocordOverride.

It should be easy enough to implement your BentocordOverride. Simply create a normal Bento Entity. Extend BentocordInterface and override functions you wish to take control over. You can find all the functions and their description here. Then simply make use of bento.replaceEntity().

IMPORTANT: A BentocordOverride implementation should include basic caching for many of the possibly "expensive" calls. Such as getPrefix, formatTranslation, and many more. Functions such as these can and will be hit many times a second, and only increase as your bot grows. Some of these call's even take place on MESSAGE_CREATE. It is extreamly bad practice to hit your backend every call. Both for your backends sake and application responsiveness to your users. So add some caching :)