discord.js - Imagine an app

DIA

discord.js - Imagine an app

Support server for discord.js, a Node.js module to interact with Discord's apps API.

Join

djs-questions

djs-voice

Public bot ---> off

Guys i have a bot , i want to turn off public bot but its showing error that private bot cannot have default authorization link

kick/ban member in list of servers

why it only kicks from the server i used the command at? the guilds id are consoled correctly ```js async execute(interaction) { const user = interaction.options.getUser("user"); ...

Discord Threads

I've got dumb discord.js related question, if bot is in like lots of threads, does it in any way affect it's performance? Like I don't know where the question came from, I just decided to ask. Like, my bot definitely won't be listening to each, because it won't, it's job will be to create those for the upcoming ticket system and leave a button to close it, nothing more, nothing less.

I have 3 replicas that all respond to the same thing

Yo! I have a bot that sends a message when a thread is created, but Im running 3 replicas, so the problem is that they all send the messge at the same time. I tried to resolve this by just checking if the last message was by the bot, but since they all check at once its false for all of them, and all of them end up sending. Any idea how I can resolve this without creating a database / api or creating extra overhead beyond the function itself? ```js client.on(Events.ThreadCreate, async (thread: ThreadChannel) => { if (thread.parent?.name === 'whatever') {...

Pagination Question

If we are using an pagination how do we make it so it edits the current embed for the new embed? as my new embed uses a pagination and when i use editReply it will use reply from the pagination file...

How can i detect someone timeout got removed?

i wanna delete the user from the db whos timeout gets removed, till i know only 2 possiblity exists of timeout getting removed - timeout period got over - someone manually removed it...

PERMISIONS BITFIELD

someone has an idea how to write it better and also make this thing work? im checking for names instead of bitfield and I need to return a string at the end of the day to let the user know what permissions are missing: ``` const requiredPermissions = [ PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.ManageChannels,...

AutoModerationActionExecution event

```js client.on(Events.AutoModerationActionExecution, async (autoModerationActionExecution) => { try { console.log('AutoModerationActionExecution event triggered:'); ...

Send multiple attachments with spoilers at the same time

. I'm trying to send multiple attachments with a spoiler at the same time, this is what I have currently, but on the webhook it only send the first attachment only...

Store a command

Hi, i wanted to create with my bot a sistem that can store how many times a user write a command, how can i do this?

Cannot set guild permissions to command

Hello, I'm following the doc to set custom permissions to guild commands. https://discordjs.dev/docs/packages/discord.js/14.16.2/ApplicationCommandPermissionsManager:Class#set I reproduce the same line of code as the doc but I get an error. ...
No description

create a Discord bot with AI free

Hey guys! I’d like to create a Discord bot with AI functionality but without having to pay for APIs. Is there a way to do this? Are there any open-source AI models I could use?

About forum

I would like to write code that will notify you when a forum post is made, like this bot function.
No description

When listening to a rest request, can I use an async function?

I just read this: https://discordjs.guide/additional-info/changes-in-v14.html#apirequest And now I want to implement my own logger and may have to use an await statement - is this possible?...

awaitMessageComponent doesn't wait the set time

Hey there, I'm following the guide but I can't figure out why awaitMessageComponent doesn't wait for the set time. Here's my code: ``` const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, ChannelType, PermissionFlagsBits } = require('discord.js');...

Execute command on button interaction

For example, if I have a command that rolls a dice and takes the number of sides as an optional input, would it be possible to setup two buttons to run the command again? One button would be to roll again with the same number of sides and the second would be to roll a d6

Unexpected error for me.

So I have a slashcommands and commands folder where I keep the slashcommands and the prefix commands. And in the slashcommands the commands are bugging. Like all the old commands I used before updating everything, there are 2 of them and neither of them work and the new ones i made today doesnt even work, but in the commands it works. Could anyone explain to me what I did wrong. Here is the index.js: https://sourceb.in/u33AJ7UBKo I think the problem is in here

Get who used a /command on another bot

Hi, I have a bot (Bot1) in our server that i'm trying to create a leaderboard of how many times each user has used a particular slash command (lets call it "/command") The bot in question is a third party bot, so not one that we have control over unfortunately. We have a custom bot (Bot2) that we use for a number of things in the server and I was wondering if there is a way to get the user ID of the person that triggered "/command" on Bot1, so that Bot2 can log the command use in "commandleaderboard.json"...

Discordjs package Check permission

In the discord.js package, how do I check if, for example, permission '1032' is Administrator? I didn't find anything that tells me this in the package version.

forum post reaction + join

hello i am trying to make it so my bot will automatically join new forum posts in the server. my code can be found below: ```js if (message.author.bot) return; console.log('message recieved') ...