discord.js - Imagine a bot


discord.js - Imagine a bot

Support server for discord.js, a Node.js module to interact with the Discord bot API.

Join Server

How to add emoji in modal?

How to add emoji in modal. Like we can be able to select emoji but in modal

How to access older posts in a forum channel?

Here is my current code: ```js async function countNewGallery(client) { const galleryForum = (await (await client.guilds.fetch(guildID)).channels.fetch(galleryChannelID)); const options = { "limit":100, "cache":true};...

Making a /command

Hi, how would I go about making a command where any .js file in the folder /commands gets registered, and how do I register commands? I canโ€™t get them to work. I want it to be guild only.

TypeError: Cannot read properties of undefined (reading 'members')

const guild = container.client.guilds.cache.get(event.guild_id);
const member = await guild.members.fetch(event.author.id);
const guild = container.client.guilds.cache.get(event.guild_id);
const member = await guild.members.fetch(event.author.id);
LPLeon Pricefield4/11/2024

is this bot code uptodate with discord.js 14

i found a updated code for a bot that schedule lock and unlock for channel i was wondering if its uptodate cause the bot becomes online but when it comes time a for locking i get a BitFieldInvalid error when its supposed to send a message and lock the channel the code: https://sourceb.in/oGMGowLbro...

modal with select menu (answered - not possible)

This modal has features such as a select menu and an on/off button, but there are only text inputs in discord.js. Will these features be added to discord.js as well?
No description
LPLeon Pricefield4/11/2024

i need help making a bot for a schedule locking and unlocking for a channel automatically daily

hello im new in coding i just started but i know and understand some stuff, i just want to get this bot working i found a code for it and im getting ClientMissingIntents error when i run the bot, i installed everything in the folder and cron because the bot code guide says so, if u can rewrite my code to fix this problem i would be thankful

Way to listen for MessageReactionRemove when the messages aren't cached

I am trying to detect when reactions are removed from a post in a forum channel. The relevant code looks like this: ```js client.on(Events.MessageReactionRemove, async (reaction, user) => { console.log("Event: Reaction Removed"); if (reaction.emoji.name === '๐Ÿ‰') {...

General questions I have in mind, any help is greatly appreciated.

Hi! I am trying to learn JavaScript (coming from Lua, specifically Robloxโ€™s Luau) with the goal of eventually being able to create my own Discord bot(s). I watched a course to learn the very basics of JavaScript and understand it, but I have some questions for somebody more experienced with using Discord.Js and JavaScript in general. Question 1: Other than knowing/understanding JavaScript and Discord.Js, are there any other useful tools I should learn about to help with development, or a tool that a pro would use? (Such as node.js)...

Command handler, loading commands in

```js const { Routes } = require('discord.js'); module.exports = (client) => { client.commandHandler = async () => { const fs = require('node:fs');...

Interacting with a kicked user

Hey yall, I am trying to make a verification bot that dose not use a external website (Just checking if the user can enter the correct info in a field really) but I want the bot to kick the user and DM them, then have the user reply to the bot with the info. I am aware that you cant dm a user after you have kicked them so is there some way to message them before they are kicked with a button that opens a modal or some other way for the user to interact with the bot and provide text input? Thanks...

Register Global Command

Hi everyone, this code takes care of recording all commands globally. However, currently it doesn't work, in the console it only prints the message of the start of recording the commands but never the completion message without even giving an error, in fact the commands are not visible. I am 100% sure that the code is correct since by changing the application, i.e. by changing the token and the client id, it works correctly and records all the commands. I'm also sure of it from the fact that it...

New discord Poll detection

is it possible to detect if a message is actually a poll (new discord poll) via API?

Display a random button array

Hello, I created several buttons in a file, then put them in an array to mix them up for random output. Random works fine, but when I want to display this button array under an embed, it doesn't work. I get an error (view picture)....
No description

Set initial volume without enabling inlineVolume

Im using @discordjs/voice and would like set the initial volume for playback because the default is way too loud. But I have no need to update it on the fly and don't want the extra overhead of turning on inlineVolume. Is there a way to just set the initial volume?

WebhookClient vs raw request

What are the benefits of using WebhookClient over sending a raw request, and vice versa? Currently, it is just being used to send logs and nothing complex, so I have a feeling sending raw requests will be more beneficial than creating a WebhookClient object every time I need to send a webhook message. I dove into the source code and saw that the WebhookClient uses the main REST client to send requests, does this count towards the bots overall rate limit or is this separate?...


is this actually a thing
No description
PBPronuncia bella4/10/2024


First time working with it, I have a cron job running eery 5 minutes. In the callback, the bot fetches an array and loops over it. Each array has a mp3 and a channel id. Now i want to run each mp3 in its own channel. Scenario:Bot runs the join function, a connection is created. It then listens to ready event and create a player to run audio on the connection. ...


I'm not able to fix this. Tried resetting the token and adding the new token in secrets
No description

Inviting Bot after authing, occruing 500 error

hello, i have a problem by inviting discord bot. i occur 500 error while authenticating. Bots are invited normally, but roles are not assigned. how can i solve this problem?...
No description