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

Was this helpful?

Edit on GitHub
  1. Dev
  2. Create Plugins

Definable Intents

Last updated 1 month ago

Was this helpful?

Added in Bit 2025.2, you can now define intents to be added to the bot before the bot starts.

This feature adds a new function that runs when the bot first starts define_intents() runs BEFORE the Discord client is defined and started, meaning that any discord.js specific functions DO NOT work.

This function can be used to run literally any code, however plugins will NOT be certified if they run any code within this function that isn't used to define an intent, or a node module.

Within your plugin.json file you'll need to set has_intents and has_index to true, you'll also need to define your main_file

Example, defining the MessageContent privileged intent

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)
    }
}

WARNING: This feature is EXPERIMENTAL.

Please exercise caution when using this feature!