2025.2 has been released!
Check it Out!
Bit
Bit Source CodeBug & Suggestion Tracker
2025.2
  • Bit
  • Docs
  • Bit Plugins
  • Bit Changelogs
  • Bit Hosted
  • 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 español
  2. Crear complementos

Comandos

¡Esta guía no está terminada! Te recomendamos que sigas la guía de comandos de discord.js que se encuentra aquí https://discordjs.guide/creating-your-bot/slash-commands.html#individual-command-files

Ejemplo de comando

const { EmbedBuilder, version: discordVersion, SlashCommandBuilder } = require('discord.js')
const moment = require('moment');
require('moment-duration-format');
const language = require('../../../config.json')

module.exports = {
    cooldown: 5,
    data: new SlashCommandBuilder()
        .setName('info')
        .setNameLocalizations({
            de: 'info',
            fr: 'info',
        })
		.setDescription('Get advanced information about the bot.')
        .setDescriptionLocalizations({
            de: 'Erhalten Sie erweiterte Informationen über den Bot.',
            fr: 'Obtenez des informations avancées sur le bot.',
        })
        .setIntegrationTypes(0,1)
        .setContexts(0,1,2),
	async execute(interaction) {
        const client = interaction.client
        var lan = language;
        const locale = require('../../../locale/'+lan+'.json')

        const botUptime = moment.duration(client.uptime).format(' D [days], H [hrs], m [mins], s [secs]');
        const memUsage = (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2);
        const guildSize = client.guilds.cache.size.toString();
        const userSize = client.users.cache.size.toString();
        
        var d = new Date();
        var n = d.getFullYear();
        const embed = new EmbedBuilder()
            .setTitle(locale.bot.name)
            .setDescription(locale.bot.description)
            .addFields(
                { name: locale.misc.support, value: "https://discord.gg/NgpN3YYbMM", inline: true },
                { name: locale.misc.developer, value: "Robin Painter", inline: true },
                { name: locale.misc.guilds, value: guildSize, inline: true },
                { name: locale.misc.users, value: userSize, inline: true },
                { name: locale.misc.uptime, value: botUptime, inline: true },
                { name: locale.misc.memory, value: `${Math.round(memUsage)} MB`, inline: true },
                { name: locale.misc.discordJS, value: `v${discordVersion}`, inline: true },
                { name: locale.misc.node, value: `${process.version}`, inline: true },
                { name: locale.misc.version, value: "v5.2.0", inline: true },
                { name: locale.misc.bugTracker, value: "https://tracker.lockyzdev.net/set_project.php?project_id=5", inline: true },
            )
            .setFooter({ text: locale.misc.copyrightText.replace('{year}', n)});
        interaction.reply({ embeds: [embed] })
	}
};

Last updated 3 months ago

Was this helpful?