Creating a Discord bot with Slash Commands

This page summarizes the projects mentioned and recommended in the original post on dev.to

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • discord-sync-commands

    Easily keep your bot's slash commands synchronized with Discord

  • This file will be put in the modules/ folder, and called as soon as the bot is launched with the Ready event (events/ready.js). I took it from this GitHub repository made by Androz. It allows you to easily synchronize and update your list of commands.

  • Bord-Pi

    Un robot Discord gérant et aidant les utilisateurs pour votre propre serveur.

  • /** @document : app.js @author : Thomas Bnt @version : 3.0.0 @copyright : 2023, Thomas Bnt @license : GNU General Public License v3.0 @repository : https://github.com/thomasbnt/Bord-Pi @description: Un robot Discord gérant et aidant les utilisateurs pour un serveur. */ const fs = require('fs') const { Client, Collection, GatewayIntentBits, Options } = require('discord.js') const client = new Client({ // The intents will depend on what you want to do with the robot, // but don't forget to activate them in your discord.dev dashboard // at the address https://discord.com/developers/applications/{ID}/bot, // section "Privileged Gateway Intents" intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages ], }) // We create a collection for commands client.commands = new Collection() const commandFiles = fs .readdirSync('./commands') .filter((file) => file.endsWith('.js')) for (const file of commandFiles) { const command = require(`./commands/${file}`) client.commands.set(command.data.name, command) } // Events like ready.js (when the robot turns on), // or messageCreate.js (when a user/robot sends a message) const eventFiles = fs .readdirSync('./events') .filter((file) => file.endsWith('.js')) for (const file of eventFiles) { const event = require(`./events/${file}`) if (event.once) { client.once(event.name, (...args) => event.execute(...args, client)) } else { client.on(event.name, (...args) => event.execute(...args, client)) } } // The interactionCreate event directly here, as this is the heart of the robot. client.on('interactionCreate', async (interaction) => { if (!interaction.isCommand()) return const command = client.commands.get(interaction.commandName) if (!command) return // We log when a user makes a command try { await console.log( `/${interaction.commandName} — Par ${interaction.user.username}` ) await command.execute(interaction, client) // But if there is a mistake, // then we log that and send an error message only to the person (ephemeral: true) } catch (error) { console.error(error) return interaction.reply({ content: "An error occurred while executing this command!", ephemeral: true, fetchReply: true }) } }) // The token of your robot to be inserted client.login("NICE TOKEN NEVER TO BE DISCLOSED")

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • node

    Node.js JavaScript runtime ✨🐢🚀✨

  • Install the latest stable version of Node.js

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Building Your First Browser Game with Three.js and React: Part 1 - Getting Started

    1 project | dev.to | 8 May 2024
  • WebSockets com Socket.io: Criando Aplicações Real-Time com Node.js

    1 project | dev.to | 6 May 2024
  • Day 2: Setting Up Angular Development Environment

    1 project | dev.to | 2 May 2024
  • Part 2: Setting Up Your Node.js Environment

    1 project | dev.to | 29 Apr 2024
  • Announcing Node.js 22.0.0: What’s New and Why It Matters

    1 project | dev.to | 28 Apr 2024