1.0.0-beta.62 • Published 10 months ago

@ayanaware/bentocord v1.0.0-beta.62

Weekly downloads
71
License
MIT
Repository
gitlab
Last release
10 months ago

@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()

KeyTypeDescriptionDefault
BENTOCORD_TOKENstringDiscord Authentication Tokennull
BENTOCORD_BOT_OWNERSlist*Discord user id listnull
BENTOCORD_IGNORE_MODEbooleanThis will disable much of the bot for users not in BENTOCORD_BOT_OWNERSfalse
BENTOCORD_COMMAND_PREFIXstringThe default prefix to use for Bentocord's Command Handlerbentocord
BENTOCORD_ACTIVITY_NAMEstringThe default activity name to set per shardwith Bentocord
BENTOCORD_BUILTIN_COMMANDSbooleanShould 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 :)

1.0.0-beta.62

10 months ago

1.0.0-beta.61

1 year ago

1.0.0-beta.60

2 years ago

1.0.0-beta.59

2 years ago

1.0.0-beta.55

2 years ago

1.0.0-beta.56

2 years ago

1.0.0-beta.53

2 years ago

1.0.0-beta.54

2 years ago

1.0.0-beta.52

2 years ago

1.0.0-beta.57

2 years ago

1.0.0-beta.58

2 years ago

1.0.0-beta.51

2 years ago

1.0.0-beta.50

2 years ago

1.0.0-beta.49

2 years ago

1.0.0-beta.48

3 years ago

1.0.0-beta.45

3 years ago

1.0.0-beta.46

3 years ago

1.0.0-beta.47

3 years ago

1.0.0-beta.44

3 years ago

1.0.0-beta.43

3 years ago

1.0.0-beta.42

3 years ago

1.0.0-beta.40

3 years ago

1.0.0-beta.41

3 years ago

1.0.0-beta.39

3 years ago

1.0.0-beta.37

3 years ago

1.0.0-beta.38

3 years ago

1.0.0-beta.33

3 years ago

1.0.0-beta.34

3 years ago

1.0.0-beta.32

3 years ago

1.0.0-beta.35

3 years ago

1.0.0-beta.36

3 years ago

1.0.0-beta.31

3 years ago

1.0.0-beta.30

3 years ago

1.0.0-beta.29

3 years ago

1.0.0-beta.28

3 years ago

1.0.0-beta.27

3 years ago

1.0.0-beta.26

3 years ago

1.0.0-beta.25

3 years ago

1.0.0-beta.24

3 years ago

1.0.0-beta.23

3 years ago

1.0.0-beta.22

3 years ago

1.0.0-beta.21

3 years ago

1.0.0-beta.20

3 years ago

1.0.0-beta.19

3 years ago

1.0.0-beta.18

3 years ago

1.0.0-beta.17

4 years ago

1.0.0-beta.16

4 years ago

1.0.0-beta.15

4 years ago

1.0.0-beta.12

4 years ago

1.0.0-beta.13

4 years ago

1.0.0-beta.14

4 years ago

1.0.0-beta.11

4 years ago

1.0.0-beta.10

4 years ago

1.0.0-beta.9

4 years ago

1.0.0-beta.8

4 years ago

1.0.0-beta.7

4 years ago

1.0.0-beta.6

4 years ago

1.0.0-beta.5

4 years ago

1.0.0-beta.4

4 years ago

1.0.0-beta.3

4 years ago

1.0.0-beta.2

4 years ago

1.0.0-beta.1

4 years ago