1.0.1 • Published 8 months ago

discord-channel.db v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

discord-channel.db

Important Message Before Use

  • This package doesn't care about ratelimits of the discord api so use at your own risks 😁
  • This package can be extremely slow fetching values
  • This package do not have well readme page so sort the things sort your own 😉
  • Any Bugs or Improvement in the package? Message @leziuwu on discord.

Installation

Download the package from npm,

$ npm i discord-channel.db

After installing your can import the database using,

import { Database } from "discord-channel.db";
//or
const { Database } = require("discord-channel.db");

Initialising Database

const client = new Client({
  ... // your client options
});

const database = new Database(
  {
    client,
    categoryID: "1263827193776177269",
  },
  ["table1", "table2"]
)

client.on('ready', async () => {
  database.connect().then(
    () => console.log("Datebase Ready")
  ); 
})

Database Options.

PropertyTypeDescriptionRequired
clientimport("discord.js").Client<boolean>The client to use for databasetrue
categoryIDstringCategory ID for the forum channels to be createdtrue

Usage

// expecting you initialize the database as "database"
database.set("key1", "some value")
database.set("key2", "some value", "some table") // to spefic table

database.bulkSet(
  { name: "bulk1", value: "something" },
  { name: "bulk2", value: "something", table: "some table" }
)

database.get("key1")
database.get("key2", "some table")
1.0.1

8 months ago

1.0.0

8 months ago

0.0.1

1 year ago