2025.2 has been released!
Check it Out!
Bit
Bit Source CodeBug & Suggestion Tracker
2025.2
  • Bit
  • Docs
  • Bit Plugins
  • Bit Changelogs
  • Bit Hosted
2025.2
  • Welcome
  • Updating
  • Commands
  • FAQ
  • Install Plugins
  • Dev
    • Create Plugins
      • Commands
      • Events
      • Plugin Requirements
      • Functions
        • bit/plugins
          • .is_active(id, version)
          • .find(id)
          • .list()
          • .count()
        • bit/core
          • .log(type, "Plugin Name", force_console, "Log")
          • .find_emoji(unicode_emoji)
          • .add_intent(IntentGatewayBits)
          • .install_module(npm_package)
      • Run function on bot startup
      • Global Exports
      • Definable Intents
      • Definable Node Modules
      • plugin.json
      • update.json
      • Updating to Bit 2025.2
      • Updating to Bit 2025.1
      • Updating to Bit 2024.2
      • Updating to Bit 2024.1
  • Dev español
    • Bienvenido
    • Crear complementos
      • Comandos
      • Eventos
      • Requisitos del complemento
      • Funciones
        • bit/plugins
        • bit/core
          • .logs
      • Ejecutar función al iniciar el bot
Powered by GitBook
LogoLogo

Copyright 2018-2026 Lockyz Media

On this page
  • Plugin Count and Plugin List functions have been moved!
  • New Plugin Functions
  • Global "database" folder renamed to "data"
  • Experimental: Global Exports
  • Experimental: Definable Intents
  • Experimental: Definable Node Modules

Was this helpful?

Edit on GitHub
  1. Dev
  2. Create Plugins

Updating to Bit 2025.2

Plugin Count and Plugin List functions have been moved!

With bit now exporting the pluginLoader.js file and the functions within, we've officially deprecated the old plugin_count() and plugin_list() functions from Bit: Core.

Replacement Example

// Old Code Example
const core = require('bit/core')

const totalPlugins = core.plugin_count()
const pluginsList = core.plugin_list()

// New Code Example
const plugins = require('bit/plugins')

const totalPlugins = plugins.count()
const pluginsList = plugins.list()

New Plugin Functions

This version of Bit adds a few extra functions added to make interacting between plugins easier.

For example, the new plugins.is_active(id) function makes it MUCH easier to know if a plugin is installed and active.

You can find more information on these new functions in bit/plugins

Global "database" folder renamed to "data"

We've removed the "database" folder and replaced it with a standard "data" folder, this should be better representative of what the folder is actually for.

Experimental: Global Exports

Within bits package.json file, we've now defined a global export, under bit/plugin/*. This means that any exported function within your plugins index.js (HAS to be named that way) can be accessed by importing "bit/plugin/PLUGINID". This should HOPEFULLY make inter-plugin compatibility MUCH better.

Example

const xp = require('bit/plugin/bit-xp');

// Gives my user account, 10 XP and triggers the level up message if that happens
// Coming soon to a Bit: XP near YOU
xp.add_xp(835394949612175380, 10, true)

Experimental: Definable Intents

We've added the ability for plugins to force the bot to import required intents, before the bot defines the client. This feature should ONLY be used to define intents as it runs BEFORE bit defines the Discord Client, and other plugins.

For now, this feature is run through a second function inside your index.js file called define_intents()

Example

const core = require('bit/core');
const { GatewayIntentBits } = require('discord.js');

module.exports = {
    define_intents: function define_intents() {
        // Adds the MessageContent intent
        // I recommend against adding this intent unless ABSOLUTELY required
        // This intent allows the bot to see Message Content and is ABSOLUTELY dangerous
        core.add_intent(GatewayIntentBits.MessageContent)
    }
}

You'll also need to define some settings within your plugin.json file for this feature to work

Example

{
    // ... Other Stuff
    // The below variables NEED to be set to true, and main_file MUST be accessible from within your plugin
    "has_index": true,
    "has_intents": true,
    "main_file": "index.js",
    // ... The rest of the file   
}

Experimental: Definable Node Modules

We've added the ability to install node modules. This will allow your plugin to install node modules from NPM that your plugin needs.

Example

const core = require("bit/core");

module.exports = {
    start_function: function start_function() {
        // This code will install v4.0.4 of the DismonDB module
        // (You should check that out BTW, I hear a really good developer made it :])
        // https://www.npmjs.com/package/dismondb
        core.install_module('dismondb@4.0.4')
    }
}

Last updated 1 month ago

Was this helpful?

WARNING: This feature is EXPERIMENTAL.

Please exercise caution when using this feature!

WARNING: This feature is EXPERIMENTAL.

Please exercise caution when using this feature!

WARNING: This feature is EXPERIMENTAL.

Please exercise caution when using this feature!