1.2.1 • Published 2 years ago

@jaxydog/dibbs v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

DIBBS

Discord Bot Backend System!

DIBBS is a wrapper for discord.js that helps make simple things like creating slash commands a whole lot easier.

Creating a client

const { Client, EmbedBuilder } = require("@jaxydog/dibbs")

const client = new Client({
	commandGuildId: /* Guild ID */,
	intents: ["GUILDS", "GUILD_MEMBERS", "GUILD_MESSAGES", "GUILD_MESSAGE_REACTIONS"],
	token: /* Bot token */,
})

client.connect()

Adding commands

Commands added must be defined prior to creation using .define; this ensures that all created commands are sent to the API and can be used. Defined data can be retrieved using .struct(name)

On top of the .commands property, there is also .buttons and .modals for creating button and modal templates and callbacks.

// *snip*

client.commands
	.define("ping", {
		name: "ping",
		description: "Checks the bot's connection",
	})
	.create("ping", async ({ interact }) => {
		const embed = new EmbedBuilder().color("BLURPLE")

		await interact.reply({
			embeds: [embed.title("Pong! (...)").color("BLURPLE").build()],
			ephemeral: true,
		})

		const reply = await interact.fetchReply()
		const delay = reply.createdTimestamp - interact.createdTimestamp

		await interact.editReply({
			embeds: [embed.title(`Pong! (${delay}ms)`).build()],
			ephemeral: true,
		})
	})

// *snip*

Storing data

All stored data is saved both locally in data/ and in memory in client.storage. Data stored in the local filesystem is automatically converted to-and-from JSON with UTF-8 encoding.

// *snip*

await client.storage.set("path/to/file", {
	message: "Hello file system!",
})
await client.storage.get("path/to/file")
// => { message: "Hello file system!" }

// *snip*
1.2.0

2 years ago

1.1.1

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.2.1

2 years ago

1.1.2

2 years ago

1.1.0

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago