JSON File Counter
I am trying to make a simple word counter in discord.js I have managed to get the bot counting the specific word i want to be counted but how do i permanently store this data in a JSON file and update it when the bot is active.
Find what role was added/removed with guildMemberUpdate
Hi, I am trying to detect when a role is removed from a user. I currently have the following code:
```js
client.on("guildMemberUpdate", async (old, new) => {
if(old.roles.cache.size !== new.roles.cache.size) { // roles have been updated
let currentRole = null...
.showModal is not a function
I use modals a bit and every once in the while I get the error
TypeError: interaction.showModal is not a function now the modal still works like normal and there is no visual sign of an error etc. Is there any reason to why this could happen?Interfacing with call video
Is this library capable of interfacing with the video streamed by other users during a call? I'm trying to create a bot that records the video streamed through other user's screen share. And if this library can't could I be pointed to one that can, thanks.
command.execute is not a function
Error
```js
TypeError: command.execute is not a function
at Object.execute (/workspace/official-realtrickz-community-bot/src/events/client/interactionCreate.js:11:31)
at Client.<anonymous> (/workspace/official-realtrickz-community-bot/src/functions/handlers/handleEvents.js:15:63)...
Cannot read properties of undefined (reading 'Client')
Hi, so i need to add intents to my basic bot. Now it cant read
Client anymore when i do this, does anyone sees where it goes wrong?
```ts
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [...Is it possible to create the backend of a dashboard with discord JS?
Like the title says. Im wondering if its possible and yes, if it is recommended.
Most of the avaibale tutorials on YT are not made with Discord JS so before investing time in it, i would like to know if its even possible....
how to this type of advanced help menu
https://srcb.in/aatGdT2Ff5
https://srcb.in/IrPCEw0UZu
...
const commands = interaction.client.commands.filter(x => x.data.name == interaction.commandName).map((x) => x.data.options.map((c) => '`' + c.name + '` :arrow_right: :fdot2: ' + c.description).join("\n"));
const commands = interaction.client.commands.filter(x => x.data.name == interaction.commandName).map((x) => x.data.options.map((c) => '`' + c.name + '` :arrow_right: :fdot2: ' + c.description).join("\n"));
Problem: Preparing to connect to the gateway...
Hello i have problem, im running my discord bot on a hosted server, it hasn't worked for the past few days.
I need help i dont understand why its not working anymore.
Anyone have a solution ?
Using discord.js 14.9.0, on typescript node project...
How do i make commands
```js
const {Client, Events, GatewayIntentBits} = require('discord.js');
const client = new Client({intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages]});...
Fetch more than 100 messages in a channel
Hey, I know that I shouldn't fetch more than 100 messages but it's a bot in one server so I wanted to know if there is a way to fetch all messages.
Is it possible to slowly cache all messages at bot startup? There will be less than 1'000 messages for now. Currently about 500....
Embed with slash command
I want that embed command will take embed info from embed.js file but not from index.js
It is possible?...

I can't download discordjs opus
Hi there I can't download djsopus I try many things like delete node module and rebuild the project but gave it this error

Get around deferReply's lag
i'm trying to get around the lag caused by awaiting message.deferReply constantly, i'd like to do message.deferReply without awaiting it, but that causes issues when replying to it: if i do editReply or followUp, then it'll break if the bot tries to reply before the deferReply completes
what's the solution to get around this?...
@discordjs/rest
Hi i just installed discordjs/rest for slash commands but there is a error message now someone know how to fix it
Giving a member permission to change permissions in a selected channel
What is supposed to happen:
User gets permission to change permissions in a selected voice channel
What happens:
User does not have permission to change permissions in selected voice channel...
Edit a database when mute/warn is over
So, I did a command to mute (using timeout method, no problem, it works), same for warn (simple message).
For each and every sanction made by a moderator, it's stored in a SQLite database with some useful infos. Now i can have the infos stored in the db, and the message of "warn/mute executed".
What i'm stuck onto is how to make a long period timeout ? Say 3 months ? I tried, on ChatGPT recommandation (so like, worst idea I could have had but who knows) to use node-cron and 'events' so that an event is emitted, and another file receive it, and launch a cron.schedule to the said date, and then it executes the code of updating the db and sending a message saying the sanction is over.
...