#djs-in-dev-version

1 messages · Page 29 of 1

wheat sequoia
#

sharex

amber sequoia
#

is it a sharex theme

wheat sequoia
#

yes

amber sequoia
#

i tried this but

#

discord adds white background to it

proven wolf
#

On Discord developers portal

wheat sequoia
wheat sequoia
amber sequoia
#

k

wheat sequoia
proven wolf
#

But i really dont know why you get a blank message content if your intent is activated and whitelisted

#

Are you sure is the same bot?

wheat sequoia
#

yes

digital root
#

Did collectors got changed in any way

#

Or await component stuff

hoary fox
#

no

shrewd cipher
#

Btw, does await messageComponent still error if the time passed?

dim moss
#
await message.channel.permissionOverwrites.edit('759445952452362290', { VIEW_CHANNEL: true, SEND_MESSAGES: true })

there isnt any err bot the code doesnt work any idea?

#

anyone?

umbral slate
#

when updating to TS 4.7.2, I started getting this error on the guildMemberAdd event
basically I have an array of objects which hold the name and the args of an event, typed using the ClientEvents interface from d.js, yet it's saying this, any idea why and how to fix this?

gloomy kayak
#

Can you show the relevant piece of code?

umbral slate
broken falcon
wheat sequoia
#

?

high nest
#

how do you take round pictures like that

vague coyote
#

dm them or ask in general

weak ridge
#

Hi! How can I make the options of a SelectMenuBuilder remains selected after clicking on it?

umbral slate
knotty plover
#

Just keep in mind, that changes what it shows to everyone who can see it

proven wolf
#

That why do this only if your select menu is displayed per user or if it is in ephemeral message

knotty plover
#

not passing an array

#

yes

#

how so?

#

Which are.....

#

Youre removing all the useful information

#

Thats still not really the useful part

#

Are you catching this error and console.logging it or is it unhandled

#

what would name.changedToAt be, a date?

#

Youd need to provide a string

#

yeah, a number then

#

Needs to be string

bold lichen
#

I have a question, what is #isFromMessage for in the modal options?

knotty plover
#

It checks if the modal was shown in response to an interaction from a message (button, selectmenu) rather than a slash command

#

Because that determines if you can use .update()

bold lichen
#

and, its in v13.7.0 dont exits? and why?

knotty plover
#

Because I didnt backport it properly 😄

bold lichen
#

Oh, and its possible create a pull request to add that?

knotty plover
#

Not to 13.7 no

#

Its already released

bold lichen
#

ok np, thanks and good nigth

prisma kiln
#

what the field amount limit for modals

idle galleon
#

25 rows/fields

knotty plover
#

thats embeds not modals

#

its 5 in a modal

heavy pasture
#

why when I click 3 times in a row on the selection menu it shows unknown interaction?

gritty citrus
#

that clicking 3 times in a row makes it reply to the same interaction

dim moss
#

is this normal 🤔

plain roverBOT
#

Documentation suggestion for @dim moss:
class Attachment
Represents an attachment.

hard bridge
#

Are the new Permissions V2 options for SlashCommandBuilder() available in @ dev?

knotty plover
#

Not yet

#

I don't think the PR is merged

hard bridge
#

Thanks, thought i was going crazy, looked like they were in the doco lol

forest elm
#

They are available in builders @dev

plain roverBOT
hard bridge
#

Do i need to install builders separately? I just updated discord.js @ dev and cant get them working...

proud wigeon
#

nope, they are included with djs 14

hard bridge
#

Strange, bot wont start with setDMPermission or setDefaultMemberPermissions

sage forum
#

What changed in addOptions

#

That would cause Received one or more errors

#

String overflow

proud wigeon
#

you need to pass an array

hazy light
#

anyone know why since 4h or more i can't create roles anymore with my bot ? (I have permission, intents etc)

hazy light
#

It was my first guess but there is no message and i waited 4h before retry

silk topaz
hazy light
silk topaz
#

ahhh... im sorry once again i forgot this is the dev version, there is no ratelimit event there. Maybe listen to "debug" and "warn" instead
BaelzPray

hazy light
silk topaz
hazy light
#
client.guilds.fetch(config.guild).then(async (guild) => {
      console.log('pls work');
      const role = await guild.roles.create({
        name: this.name,
      });
      console.log('don\'t log because the promise never finish');
      const cat = await guild.channels.create(`${this.name}`, {
        type: ChannelType.GuildCategory,
        permissionOverwrites: [
          {
            id: role.id,
            allow: [PermissionFlagsBits.ViewChannel, PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.UseApplicationCommands],
            deny: [PermissionFlagsBits.AddReactions, PermissionFlagsBits.SendMessages, PermissionFlagsBits.AttachFiles],
          },
          {
            id: guild.id,
            deny: [PermissionFlagsBits.AddReactions, PermissionFlagsBits.SendMessages, PermissionFlagsBits.AttachFiles, PermissionFlagsBits.ViewChannel, PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.UseApplicationCommands],
          },
        ],
        position: 1,
      });
});
silk topaz
#

so it is safe to assume you have the guilds intent enabled, and the client is ready when you call this

hazy light
#

Yep, this is my client if you want

const client = new Client({intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]});
``` role creation was working a few hours ago
#

oh wait in debug event what does that mean

    Total: 1000
    Remaining: 1000
``` is this a rate limit ?
silk topaz
hazy light
silk topaz
outer bane
hazy light
silk topaz
hazy light
#

oh { timeToReset: 79442486, limit: 250, method: 'POST', hash: 'Global(POST:/guilds/:id/roles)', url: 'https://discord.com/api/v10/guilds/949615144894361620/roles', route: '/guilds/:id/roles', majorParameter: '949615144894361620', global: false } with client.rest.on('rateLimited')

green plume
#

I am getting this two error since I updated my package. It spams my whole console.

#

It was v14.0.0-dev.1651493371-4ba0f56
now I updated to ^14.0.0-dev.1653480262-68d5169

outer bane
#

do you use <Guild>.me somewhere instead of <Guild>.members.me?

green plume
outer bane
#

yes

green plume
#

Thanks

drifting glade
#

How do you set a color into an embed?, a hex code returns an error?

silk topaz
hazy light
#

yes if timetoreset is in ms

outer bane
#

if you use the reexported embedbuilder from d.js you can also use hex strings

pine patrol
#

apparently this goes here?

outer bane
#

enable ts strict mode

coarse imp
#

are there any official tools to help me learn v14?

outer bane
#

there's a wip guide in the pins and main documentation, other than that you have to look at the commits on github

vast jolt
#

hexColor

#

without hash

fresh prawn
#
0.options[0].name[APPLICATION_COMMAND_INVALID_NAME]: Command name is invalid```

```JS
code: 50035,
    errors: {
      '0': { options: { '0': { name: [Object] } } }
    },
    message: 'Invalid Form Body'
  },
  code: 50035,
  status: 400,
  method: 'PUT',
  url: 'https://discord.com/api/v10/applications/979506674052243477/commands',
  requestBody: {
    files: undefined,
    json: [
      {
        name: 'convert',
        name_localizations: undefined,
        description: 'Converts executes to the new format',
        description_localizations: undefined,
        type: 1,
        options: [
          {
            type: 11,
            name: 'Attatchment',
            name_localizations: undefined,
            name_localized: undefined,
            description: 'File to convert',
            description_localizations: undefined,
            description_localized: undefined,
            required: true,
            autocomplete: undefined,
            choices: undefined,
            options: undefined,
            channel_types: undefined,
            min_value: undefined,
            max_value: undefined
          }
        ],
        default_permission: true
      }
    ]
  }
}```
fresh prawn
#

oh.

#

Lol, thank you!

green plume
#

What is difference between log_one.entries.first() and log.entries.first()?

green plume
#

Okay. Thanks

#

What is the permission bitfield of Manage Guild?

green plume
#

Okay it says when a user lefts the guild or has been kicked. So what should be the event for prune?

knotty plover
green plume
knotty plover
#

I think its still that event, just... lots of them

pallid ice
green plume
#

Okay

green plume
#

I get this error sometimes while using a interaction. How do I fix this?

proven wolf
#

An interaction token is valid only for 15 minutes

nocturne kayak
proven wolf
#

If you can't reply within 3s you can defer the reply (you can edit reply after defer within 13s)

green plume
#

Okay

thorny haven
#

I would like to know the reason for not assigning permissions

#

a small note: in the channel, no permissioners were assigned to all these roles

regal mason
#

Why when I get the string name of my Slash command, on my test bot with guild scoped commands that works I receive the name. But on the production bot I receive undefined for the same piece of code.

The piece of code:

#

args.getString('name') is the part of the code where I get undefined on prod

proud wigeon
proud wigeon
#

ok, seems fine

regal mason
#

So why I received undefined

green plume
#

Error:

DiscordAPIError[10062]: Unknown interaction

Code:

ctx.interaction.reply({ content: `${process.env.FAILURE_EMOJI} | **This user don't have any badges currently**`});

Why does it come?

wintry bear
#

uh

    at ArrayValidator.handle (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:399:70)
    at ArrayValidator.parse (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:113:88)
    at EmbedBuilder.addFields (D:\Discord Bots\Just a tester\node_modules\@discordjs\builders\dist\index.js:244:54)
    at IncomingMessage.<anonymous> (D:\Discord Bots\Just a tester\index.js:106:6)
    at IncomingMessage.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1344:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errors: [
    [
      3,
      CombinedPropertyError: Received one or more errors
          at ObjectValidator.handleIgnoreStrategy (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:972:66)
          at ObjectValidator.handleStrategy (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:906:47)
          at ObjectValidator.handle (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:950:17)
          at ObjectValidator.run (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:102:23)
          at ArrayValidator.handle (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:393:37)
          at ArrayValidator.parse (D:\Discord Bots\Just a tester\node_modules\@sapphire\shapeshift\dist\index.js:113:88)
          at EmbedBuilder.addFields (D:\Discord Bots\Just a tester\node_modules\@discordjs\builders\dist\index.js:244:54)
          at IncomingMessage.<anonymous> (D:\Discord Bots\Just a tester\index.js:106:6)
          at IncomingMessage.emit (node:events:539:35)
          at endReadableNT (node:internal/streams/readable:1344:12) {
        errors: [ [ 'value', [ValidationError] ] ]
      }
    ]
  ]
}```and 
```js
                .addFields([
                    { name: 'User', value: value.name, inline: true },
                    { name: 'Rank', value: value.rank, inline: true },
                    { name: 'Joined', value: new Date(value.joined).toDateString(), inline: true },
                    { name: 'Contributed', value: value.contributed, inline: true },

                ])```
jaunty vault
jaunty vault
bleak pumice
#

hi in what website/programm do i have to code my bot?

plain roverBOT
bleak pumice
#

oh wait nevermind!

green plume
jaunty vault
#

how do I explain that further Thonk

green plume
jaunty vault
proud wigeon
proud wigeon
#

🙂

thorny haven
#

How can I create a channel with specific rights? if I looked at the documentation. just would like to take a detailed look at the permissionOverwrites array

regal mason
rose geyser
#

hello

#
if (msg.mentions.members.first()) {
  var ok = msg.mentions.members.first()
  msg.channel.send("https://cdn.discordapp.com/avatars/"+ok.id+"/"+ok.avatar+".jpeg");
}```
#

why is the avatar always null

#

it works if i did msg.author.avatar

#

i cant find anything why on google i tried looking

thorny haven
#

msg.channel.send(msg.author.displayAvatarURL({ format: "jpeg" }))

white nebula
#

or call that method on ok instead of the author since that seems to be the goal

rose geyser
#

wdym

white nebula
#

.avatar can be null if the user/member has a default pfp, but the displayAvatarURL() falls back and never returns null

rose geyser
#

it always does null

#

my avatar is not default and it returns null

#

that

white nebula
#

you're checking the member's avatar, not the user's avatar
Do you have a guild avatar in the server you're calling the function in?

tame gazelle
#

he doesn’t have Discord Nitro

rose geyser
#

what

thorny haven
rose geyser
#

whats a guild avatar

tame gazelle
#

custom avatar in a specific guild

rose geyser
rose geyser
jaunty vault
plain roverBOT
rose geyser
#

idk i dont understand

#

i dont know what is a guild and what is shown in a specific guild

thorny haven
#

strange, everyone attacked one person, but no one with permissions could help me 😾

rose geyser
#

im a lua coder not this but i started recently

white nebula
#

a Guild is the internal name for a server

rose geyser
#

for a discord server?

white nebula
#

yes

rose geyser
#

ok

plain roverBOT
#

Despite sounding similar there is a distinct difference between users and members in Discord:
User: global discord user data (global avatar, username, tag, id)
GuildMember: user data associated to a guild (guild, nickname, roles, voice, guild avatar, etc.)
• Conversion: User ➞ GuildMember | GuildMember ➞ User

white nebula
#

You don't need the conversion here, but the rest explains what users and members are

#

and you should probably be using #djs-help-v14 since I suspect you are too new to be using the experimental dev branch

rose geyser
#

oh

#

so

#

im using member when i should be using user

white nebula
#

You could be using either, but it depends on what you're trying to get

rose geyser
#

what is difference of global avatar and avatar

vague coyote
wicked tusk
#

Anyone has a clue on this error

src/commands/music/PlayCommand.ts:87:55 - error TS2339: Property 'me' does not exist on type 'Guild'.

87 .permissionsFor(interaction.guild.me as GuildMember)
~~

gritty citrus
#

pretty sure it exist on the member manager now

wicked tusk
gritty citrus
#

no, it exist on the member manager dk why u type asserting a property that does not exist anymore to something else?...

silk topaz
bronze garden
#

what's the correct way to hook into REST requests? not capturing an event via client.rest.on(RESTEvents.Request, ...)

outer bane
#

that event has been removed since the switch to undici afaik, you should be able to use diagnostic channels with undici instead

thorny haven
plain roverBOT
#

guide Popular Topics: Formatters - Mentions
read more

thorny haven
lethal dagger
#

did it fix it?

thorny haven
lethal dagger
#

ok so what did it send?

thorny haven
#

through this formatting in ephemeral interaction only shows

#

he sends only the embed and the components that I specified

lethal dagger
#

hrm

thorny haven
lethal dagger
#

try changing content to `${roleMention(mean.config.roles.event)}`

lethal dagger
#

hrm

#

try console.logging mean.config.roles.event?

scarlet tangle
#

sup, i'm looking for who can make my bot, I pay. He is not that long to build.

scarlet tangle
#

dm me if interested, i'm not accepting useless dm

lethal dagger
#

send in some other server

scarlet tangle
#

Who are you

lethal dagger
#

;-;

scarlet tangle
lethal dagger
#

i just want to say that this is not the right server

scarlet tangle
lethal dagger
#

also why are you even here if you want to find someone to make the bot?

lethal dagger
scarlet tangle
scarlet tangle
thorny haven
lethal dagger
lethal dagger
lethal dagger
#

so it work?

lethal dagger
#

huh

#

try sending like test for content

thorny haven
lethal dagger
#

hrm

lethal dagger
thorny haven
#

I think can use allowedMentions

#

perhaps discord does not see the role there and does not actually send the content. although it should, because ping roles are enabled in the client's options

lethal dagger
#

if ping roles is disabled it should show the role just dont ping it

thorny haven
lethal dagger
thorny haven
#

the role is visible in an ephemeral form, but it is not in the message that is sent to the channel

thorny haven
lethal dagger
#

what

thorny haven
#

dm

lethal dagger
#

uhh ok?

thorny haven
#

yes

amber sequoia
#

how to fix this error```js
CombinedPropertyError: Received one or more errors
at ObjectValidator.handleStrictStrategy (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1157:70)
at ObjectValidator.handleStrategy (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1007:47)
at ObjectValidator.handle (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1079:17)
at ObjectValidator.parse (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:113:88)
at ButtonBuilder.setEmoji (/home/runner/nCrypt-Bot/node_modules/@discordjs/builders/dist/index.js:598:42)
at ButtonBuilder.setEmoji (/home/runner/nCrypt-Bot/node_modules/discord.js/src/structures/ButtonBuilder.js:27:18)
at Client.<anonymous> (/home/runner/nCrypt-Bot/index.js:21:150)
at Client.emit (node:events:390:28)
at Client.emit (node:domain:475:12) {
errors: [
[
'guild',
UnknownPropertyError: Received unexpected property
at ObjectValidator.handleStrictStrategy (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1154:27)
at ObjectValidator.handleStrategy (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1007:47)
at ObjectValidator.handle (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:1079:17)
at ObjectValidator.parse (/home/runner/nCrypt-Bot/node_modules/@sapphire/shapeshift/dist/index.js:113:88)
at ButtonBuilder.setEmoji (/home/runner/nCrypt-Bot/node_modules/@discordjs/builders/dist/index.js:598:42)
at ButtonBuilder.setEmoji (/home/runner/nCrypt-Bot/node_modules/discord.js/src/structures/ButtonBuilder.js:27:18)

sacred eagle
amber sequoia
sacred eagle
#

Makes sense. If you have the ID, couldn't you simply just use setEmoji({id: "ID"})?

nocturne kayak
#

when passing components to an ActionRowBuilder, does it create new obj from passed components or use reference of those?

white nebula
#

how embeds works in v14 ?

knotty plover
#

same as before

#

Just gotta import the EmbedBuilder from builders

#

Or djs probably re-exports it

white nebula
#

ok

white nebula
knotty plover
#

oh, thats changed to addFields

white nebula
#

oh

knotty plover
#

and takes an array

white nebula
#

ok

obtuse cradle
#

Why'd we remove .addField()?

thorny haven
knotty plover
#

because you have addFields()

obtuse cradle
#

Yeah but everyone is already using addField and addField is (arguably) easier to read and use

#

addField also worked perfectly fine

thorny haven
#

I can't figure out why for several hours now

jaunty vault
#

It's not easier to read, and it just used addFields

obtuse cradle
#

There was no need to really remove addField

white nebula
knotty plover
#

no

thorny haven
#

when I try to check the ping of the role myself, everything is sent, and when I want to embed it does not work

#

😔

manic lynx
manic lynx
#

const { Command } = require('../../structures/functions/Command');
const { PermissionsBitField } = require('discord.js');

module.exports = new Command({
    name: 'test',
    description: 'test',
    type: 1,
    default_member_permissions: new PermissionsBitField('Administrator').bitfield.toString(),

    run: async ({ interaction }) => {
      interaction.reply('test')
    }
})``` I already set the default_member_permissions but its doesn’t work
ivory tartan
#

Can i restrict character limit of option of slash command?

quasi dew
#

is it me or, you cant get png from displayAvatarURL options

#

the format seems doesnt work but the size and dynamic does

#

i tried on avatarURL too, here btw, Progen is 13.7.0 and Cursed is 14.0.0-dev.1653091711-fdeac9d

nocturne kayak
#

it's now called 'extension'

outer bane
#

how do you deploy the commands?

white nebula
#

node deploy.js 😄

#

global commands

outer bane
#

and what is the content of that file?

white nebula
outer bane
#

so you are using builders for your commands with setDefaultMemberPermissions?

#

works for me, although discord's ui doesn't reflect the permissions and shows them as usable by everyone when they are not

white nebula
#

it is working

quasi dew
#

ik theres a preview guide

#

pong if reply :3

quasi dew
#

👍

#

oh-
i thought main was v13, smh my bad

cinder bane
uncut kelp
#

Discord would probably error as you supplied a negative time? Do you mean just a time in the past like an hour ago? If so, that'd be in range but clear their timeout

cinder bane
#
member.communicationDisabledUntilTimestamp ? await  member.disableCommunicationUntil((member.communicationDisabledUntilTimestamp - (Date.now() + duration_timestamp) > 0) ?  member.communicationDisabledUntilTimestamp - (Date.now() + duration_timestamp) : null) : null;

for some reason this code returns this error even though the timestamp is a positive number

cinder bane
uncut kelp
#

That timestamp is too short, can just tell by looking at it

#

It's missing 3 digits

narrow wagon
#

Does anyone know what the partials are like in v14? __

uncut kelp
#

Pins

narrow wagon
cinder bane
#

removing date.now() would fix it

narrow wagon
uncut kelp
#

In the pins there's an WIP update guide

#

You import a ChannelType enumerable though

white nebula
#

and keep throwing err

prisma kiln
#

why interaction.options.getMember method didnt contain required param in chat input command

#

getUser has it, but getMember only one param for name

dull mulchBOT
obtuse crater
#

read this ^^

short tapir
#

Is it illegal to do .setThumbnail({url: ``}

#

because I get:
ValidationError: Expected undefined or null
& ValidationError: Expected a string primitive

copper jetty
short tapir
#

as in won't work

copper jetty
#

yes

short tapir
#

what should I do instead

copper jetty
#

pass string instead of object into setThumbnail

short tapir
#

Then it won't set at all

#

oh wait..

#

give me the darwin award already Facepalm

restive bear
#

Does anyone know why this await interaction.reply executes twice??

#

Cause that Interaction has already been acknowledged is hella annoying to get

outer bane
#

can't say anything from this snippet, might be worth showing what's before those lines. why do you fetch the reply twice? in v14 you don't need to fetch it at all to create collectors for the message

restive bear
#

This is the code before, didn't even know you didn't have to fetch the reply first but ill make sure to change that.. Thanks for noticing that, not up to date on everything in V14 just yet lmao

outer bane
#

could you send the entire file in a pastebin? would be a lot easier to read since there's now a few lines missing in between. is this the only interactionCreate listener you have?

restive bear
#

Ill get the code into a pastebin one sec

outer bane
#

could it be because the entire tos thing runs for every kind of interaction, so it runs both for the slash command and the button?

restive bear
#

Hmm, you're actually onto something here

#

Oh that might be why, lemme check if its a button and see if that helps

#

Yes, that was it thank you so very much 🙏 just gotta fine tune it and it should work better this time 👌

tame gazelle
#
ReferenceError: message is not defined
    at Object.execute (/root/ObitoInteractions/events/interactionCreate.js:94:44)
    at Client.<anonymous> (/root/ObitoInteractions/Structure/Client.js:59:37)
    at Client.emit (node:events:527:28)
    at InteractionCreateAction.handle (/root/ObitoInteractions/node_modules/discord.js/src/client/actions/InteractionCreate.js:81:12)
    at Object.module.exports [as INTERACTION_CREATE] (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
    at WebSocketManager.handlePacket (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
    at WebSocketShard.onPacket (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/WebSocketShard.js:447:22)
    at WebSocketShard.onMessage (/root/ObitoInteractions/node_modules/discord.js/src/client/websocket/WebSocketShard.js:304:10)
    at WebSocket.onMessage (/root/ObitoInteractions/node_modules/ws/lib/event-target.js:199:18)
    at WebSocket.emit (node:events:527:28)

I don't have any message in my interactionCreate.js file
could it be a internal bug?

outer bane
#

ObitoInteractions/events/interactionCreate.js:94

tame gazelle
outer bane
#

doesn't look like it's internal

#

did you save (and compile if ts) the code?

tame gazelle
#

oh wait
the project name is ObitoInteractions ._.
I'm looking at a bad project

hybrid crest
#

what is the character limit for responding to a command in v10 API? the official documentation doesn't list a maximum length, so i'm wondering if it's 2000 or 4000 characters

jaunty vault
uncut kelp
#

It's 2,000

hybrid crest
#

ty jira

exotic nexus
#
new SlashCommandBuilder().setDefaultMemberPermissions(0)
TypeError: (intermediate value).setDefaultMemberPermissions is not a function

I'm on the latest version, is this not implemented yet?

outer bane
#

works for me, which version of builders do you have installed?

exotic nexus
#

the dev version exports builders, doesn't it?

#

I'm importing it from discord.js

#

and it's the latest dev version

exotic nexus
somber mirage
manic lynx
manic lynx
somber mirage
#

What's the error?

manic lynx
manic lynx
# somber mirage What's the error?

And also I’m not using REST.```js

const { Command } = require('../../structures/functions/Command');
const { PermissionsBitField } = require('discord.js');

module.exports = new Command({
name: 'test',
description: 'test',
type: 1,
default_member_permissions: PermissionsBitField.Flags.Administrator,

run: async ({ interaction }) => {
  interaction.reply('test')
}

})```

somber mirage
#

I don't think the permissions v2 is ready

#

Or merged

manic lynx
#

Trying it

#

Doesn’t work

#

const { Command } = require('../../structures/functions/Command');
const { PermissionsBitField } = require('discord.js');

module.exports = new Command({
    name: 'test',
    description: 'test',
    type: 1,
    default_member_permissions: new PermissionsBitField('Administrator').bitfield.toString(),

    run: async ({ interaction }) => {
      interaction.reply('test')
    }
})```
#

I use it but Its doesn’t work

#

And also PermissionsBitField.Administrator doesn’t exist

manic lynx
#

I said its doesn’t work try it first in your code editor

#

Yeah

#

default_member_permissions? ?string Set of permissions represented as a bit set all discord.dev docs

#

Its just a class command bro

#

Nah, I tried it many times but I will try it again

#
const {
  ChatInputCommandInteraction,
  ChatInputApplicationCommandData,
  PermissionResolvable,
  GuildMember
} = require('discord.js');
const { WbotClient } = require('../client/WbotClient');

/**
* @typedef {{ client: WbotClient, interaction: ChatInputCommandInteraction & { member: GuildMember, client: WbotClient }, args: String[] }} RunOptions
* @param {RunOptions} runOptions
*/

function RunFunction(runOptions) { }

class Command {
  /**
  * @typedef {{ cooldown?: Number, userPermissions?: PermissionResolvable, botPermissions?: PermissionResolvable, run: RunFunction } & ChatInputApplicationCommandData } CommandOptions
  * @param {CommandOptions} options
  */
  constructor(options) {
    Object.assign(this, options)
  }
}

module.exports = { Command }
#

Did I need to change to REST?

knotty plover
#

Discordjs doesn't support permissions v2 yet, only builders and therefore rest because it's raw API

manic lynx
knotty plover
#

wdym "access" it?

manic lynx
#

use

knotty plover
#

use where/how

manic lynx
knotty plover
#

it should accept them yes

manic lynx
knotty plover
#

nope

#

Theres the Discord API docs

manic lynx
# knotty plover nope

const rest = new REST({ version: '10' }).setToken(token);

(async () => {
    try {
        console.log('Started refreshing application (/) commands.');

        await rest.put(
            Routes.applicationCommands(clientId),
            { body: commands },
        );

        console.log('Successfully reloaded application (/) commands.');
    } catch (error) {
        console.error(error);
    }
})();``` How do I set this in guild only commands and this will be in ready event or no?
knotty plover
#

applicationGuildCommands(clientId, guildId)
No, its a separate script, not in the ready event

#

The guide explains that

manic lynx
knotty plover
#

You never need to use builders at all. It's just a tool for constructing JSON

#

If you like them, use them

manic lynx
knotty plover
#

Cool

manic lynx
# knotty plover Cool

But I created a package because IDK how to use classes in JS I only know TS creating classes

knotty plover
#

It's the same though...

manic lynx
knotty plover
#

You don't need to

#

Because there's no type safety

manic lynx
knotty plover
#

Those are type annotations

#

JS doesn't have them

#

It's just client, interaction

manic lynx
knotty plover
#

I genuinely have no idea what you're talking about

#

If you don't use TypeScript you don't get types

#

If you know how to use TypeScript, use it

gentle haven
#

hi

#

i tried this code/script in

#

JS

#

and was wonering if any of guys could tell me if there are any mistakes i might have missed?

#

heres a pic

jaunty vault
#

We aren't debuggers you know

gentle haven
#

oh ok

#

sorry

nocturne kayak
#

what is this error? ver: 14.0.0-dev.1653480262-68d5169

#

well importing SelectMenuBuilder from builders instead fixed the error

plain roverBOT
#

Invalid interaction application command:
• After updating a global command Discord prevents you from receiving stale data until the update rolled out
• Refresh your commandlist to receive the updated command and try again

devout narwhal
#

Thanks

plain roverBOT
#

Version 13 has released! Please update at your earliest convenience, we will not indefinitely support v12.
• Update: npm rm discord.js npm i discord.js
Update guide (use CTRL + F to search for the old method or property)

vague coyote
mental inlet
#

can I ask why PresenceUpdateStatus is in discord-api-types instead of discord.js for the dev branch?

forest elm
#

everything from discord-api-types/v10 is re-exported in discord.js

mental inlet
forest elm
#

yes

#

make sure you are using the latest dev build

mental inlet
#

@forest elm is 14.0.0-dev.1653091711-fdeac9d the latest?

forest elm
#

no

mental inlet
#

alright ill update then

tame gazelle
#

or just by checking the npm page

dusky agate
#

How can I make the interaction failed disappear when editing the message

dawn phoenix
#

if you initially respond with update that doesn't happen

#

don't message#edit it, but interaction#update it

fleet tulip
#

Someone can help me?

forest elm
#

seems like you're trying to fetch a channel before the client is ready

#

or somehow you removed the token from the client

pseudo flare
#
const {
    readdirSync
} = require("fs");
module.exports = (client) => {
    try {
        let amount = 0;
        readdirSync("./commands/").forEach((dir) => {
            const commands = readdirSync(`./commands/${dir}/`).filter((file) => file.endsWith(".js"));
            for (let file of commands) {
                let pull = require(`../commands/${dir}/${file}`);
                if (pull.name) {
                    client.commands.set(pull.name, pull);
                    amount++;
                } else {
                    console.log(file, `error`.brightRed);
                    continue;
                }
                if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach((alias) => client.aliases.set(alias, pull.name));
            }
        });
        console.log(`[ ${amount} ] :: Commands Loaded`.brightBlue);
    } catch (e) {
        console.log(String(e.stack).bgRed)
    }
};

the commands don't work

gentle coyote
#

how do i access message.guild.me in v14

outer bane
gentle coyote
#

ty

acoustic temple
#

Sometimes I get this issue when I reuse URL of some images, can anyone help?

knotty plover
#

Not really no. That image URL is no longer accessible

hybrid crest
#

I assume that people have suggested making ChatCommandInteraction.showModal return a promise with the modal, is the reason that this isn't being implemented because discord doesn't send updates for cancelled (clicked outside of box to close) modals?

knotty plover
#

Thats what interaction.awaitModalSubmit is for

#

But yes, thats part of the problem

#

Thats why time is a required parameter on that method

hybrid crest
#

i'm not seeing an awaitModalSubmit method as part of Interaction on the docs for v14?

knotty plover
#

Interaction is a parent class, make sure you're looking at the right child class

plain roverBOT
hybrid crest
#

ah i see, it's just not present on the parent docs, i see it on button as well

#

i do think it's kind of cool how you can write bots 30 different ways with DJS, i've used at least three by now and my main file is only like 40 lines long which is unbelievable given the 200+ line mess it usually turns into

hybrid crest
#

stupid question, does TextInputBuilder.setValue set a default value for the text input like changing .value for an input element does in browsers?

knotty plover
#

yes

proven wolf
hybrid crest
stuck solstice
#

Hey what are the values for SUB_COMMAND_GROUP and SUB_COMMAND in ApplicationCommandOptionType?
I tried loking at the source to find out but my editor's dumdumb

nocturne kayak
#

ApplcationCommandOptionType.SubcommandGroup and .Subcommand

stuck solstice
#

thx

vivid thicket
#

RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: undefined. i only use new at new Discord.Collection() and new Client() so i dont understand

knotty plover
#

You're passing something undefined probably to intents

vivid thicket
# knotty plover You're passing something undefined probably to intents
const { Client, GatewayIntentBits, Partials } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.GUILDS, GatewayIntentBits.GUILD_MESSAGES, GatewayIntentBits.GUILD_MESSAGE_REACTIONS, GatewayIntentBits.DIRECT_MESSAGES, GatewayIntentBits.GUILD_PRESENCES], partials: [Partials.Channel] });
knotty plover
#

Theyre PascalCase now

vivid thicket
#

PascalCase?....

knotty plover
#

yeah, written like that

#

GUILD_MESSAGES => GuildMessages

vivid thicket
#

@knotty plover 'discord.js/typings/enums' not found waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#

😢

knotty plover
#

Are you importing something directly from enums?

vivid thicket
#
const Discord = require("discord.js");

const { Client, GatewayIntentBits, Partials } = require('discord.js');
``` are my only imports
knotty plover
#

yeah idk

vivid thicket
#

i had it right before updating to v14 and i thought v14 would fix it lmao

#

bc this is my first time using modals

#

maybe it's the modals?

#

type: Discord.Constants.ApplicationCommandOptionType.STRING, TypeError: Cannot read properties of undefined (reading 'STRING')

knotty plover
#

PascalCase

#

Also its generally advised to just import enums from discord-api-types/v10

vivid thicket
#

for string?

knotty plover
#

Its saying ApplicationCommandOptionType is undefined

vivid thicket
#

oh yeah

#

and that's not a PascalCase?....

knotty plover
#

It just doesnt exist, use the enum

#

This is covered in the guide Im pretty sure

knotty plover
#

Yeah but youre not using an enum, you're using the string constants which were removed I think

#

Look at the second example

#

Literally the ApplicationCommandOptionType

vivid thicket
#

oh wait constants

#

im dumb

#
        const input = new TextInputBuilder()
            .setCustomId('translationInput')
            
            //the label is the prompt the user sees for this input
            .setLabel('Enter your text here, we\'ll translate it for ya')

            //long input, other version is single line of text.
            //we might need to put a maxiumum on this is we display it as an embed.
            .setStyle('PARAGRAPH')
        
        const row = new ActionRowBuilder()
            .addComponents(input)

gives typeerror found non-callable @@iterator at .addComponents(input)

knotty plover
#

takes an array

proven forge
#

I'm getting modal error, not using modal

knotty plover
#

That says Model, not Modal

#

Something invalid in your embed(s)

#

Show how youre sending it

proven forge
#

this error happens when i press the button

knotty plover
#

so whats pages[0]

hybrid crest
#

can't seem to register a command with autocomplete through client.application.commands.set

#

i'm guessing this would be the guilty command

{
    name: "help",
    description: "view details on how the bot works",
    type: ApplicationCommandType.ChatInput,
    options: [{
        name: "category",
        description: "select which area you would like help in",
        type: ApplicationCommandOptionType.String,
        required: true,
        autocomplete: true,
        choices: [{
            name: "tags",
            value: "tags"
        },{
            name: "help",
            value: "help"
        },{
            name: "random",
            value: "random"
        },{
            name: "prefs",
            value: "prefs"
        }]
    }]
}
knotty plover
#

Autocomplete isn't supposed to have choices. You provide them dynamically via AutocompleteInteractions

hybrid crest
#

ah my bad, wasn't aware of that. what's the choices field of ApplicationCommandOptionData for then?

forest elm
#

String/integer/number options without autocomplete

hybrid crest
#

so if i wanted to have those as the only options, would i remove autocomplete: true?

vague coyote
#

Yes

#

autocomplete choices are dynamic and chosen via the interaction, choices are fixed and predefined

hybrid crest
#

ty all

mental inlet
#

how do you check if a member is a bot or not? ver: 14.0.0-dev.1653480262-68d5169

#

they both return 0

#

or random numbers in general

mental inlet
vague coyote
#

Keep in mind that what you are doing relies on cache, so fetching before that may be needed

mental inlet
unreal stump
#

having an accurate count of members, yes

mental inlet
#

ah okay

#

it always stays as 1 however

#

so is cache not accurate?

unreal stump
#

cache has only cached members

devout narwhal
#

I keep getting Value "MAX" is not int for auto thread archiving, does anyone know what the issue is? Is it still an option?

#

I assume its because boosts are no longer required for the duration

uncut kelp
devout narwhal
#

Thanks!

short tapir
#

Are colour resolvables no longer settable in an embed builder?

outer bane
#

if you import the builder from d.js it should work

short tapir
#

such as

.setColor('Red')
#

hmm

#

I assume you mean literally from djs

outer bane
#

yes

short tapir
#

Alright

outer bane
#

you can also use the Colors "enum" from d.js instead of strings

pseudo flare
#

How do I set these two commands?

forest elm
#

pass a single array with both commands in it

scarlet tangle
#

why you censor the guildId

#

and why gyazo

hard bridge
#

Has anything changed with embeds? For some reason my image and thumbnail are not showing in the last half hour or so.
Edit: (It could be something i did, just doing some testing)

exotic nexus
#

network issues?

hard bridge
#

Tried from 2 different networks, and tried directly accessing the image in a browser. Image loads fine in my browser, but still nothing showing up in the embed
Edit: Seems to be an issue between discord and my image hosting, disregard 🙂

mental inlet
#

anyone know a guide for slash command attachment options?

plain roverBOT
#

guide Interactions: Replying to slash commands - Parsing options
read more

tender spoke
#

This is how you add and get

white nebula
#

why UI doesnt update in slash command section ?

mental inlet
dusk heath
#

Which API version is recommended for use currently?

jaunty vault
velvet jasper
#

You can use v9 or v10

#

v10 has a longer lifespan than v9 at this point tho

white nebula
dawn phoenix
#

the ui doesn't reflect default perms atm, discord is apparently aware and planning a fix

unkempt hawk
#

is there a reason why djs sticker tags proprety holds string[] | null even though dapi handles strictly string | null?

hoary fox
#

modal doesnt have eval2 option

pseudo flare
idle galleon
#

You have to make sure it’s the proper one depending on what the block does (evalmodal, formModal, etc)

cold lotus
#

Is v14 unstable? (have a lot of error issue?)

knotty plover
#

Thats not what unstable means

#

v14 is not buggy, no

#

But its subject to change at any time

proven wolf
#

Hi, do you know if select menus in modals are going to be integrated into the test version of discord.js? Unless they are supported by the API only temporarily

knotty plover
#

They arent even announced by Discord yet so no

#

We will not be adding them to the dev version until Discord formally announces and documents support for them

slow storm
#

Are there any alternative for Constants.APIErrors in v14?

slow storm
#

Thanks

forest mulch
#

Type 'ChannelType.GuildVoice' is not assignable to type 'ChannelType'.

forest mulch
# unreal stump show code
import { ChannelType } from "discord-api-types/v10";

 if (![ChannelType.GuildStageVoice, ChannelType.GuildVoice].includes(_channel?.type))
//blabla```
forest mulch
#

bot dosent try to login after this, no errors.
Code:

const { Client, Collection, GatewayIntentBits } = require('discord.js');
const config = require('./config.json');
const fs  = require('node:fs');

const client = new Client({ intents: [
  GatewayIntentBits.Guilds,
  GatewayIntentBits.GuildVoiceStates,
  GatewayIntentBits.GuildMembers,
  GatewayIntentBits.GuildMessages,
  GatewayIntentBits.MessageContent
]})

client.commands = new Collection();

client.on('ready', () => {
  console.log('READY!')
})

client.on('debug', (d) => {
  console.log(d)
})

client.login(config.token)```
knotty plover
#

Can't see any reason for that

somber mirage
mental inlet
gloomy kayak
#

Didn't you like... hit ctrl+c or something for real?

frigid sleet
#

Hey, I have a small question, I'm trying my hand at syntx based commands(text commands) again after a long time, but somehow my messageCreate event doesn't work, and I don't know why, I've looked up everything possible via console.log( ), I logged my collection and it still doesn't work, and I don't know why, the only thing I found out is that comm = undefined

does anyone know why this doesn't work

message create

//text commands
    const {ChannelType} = require('discord.js');
    try{
        let args = message.content.split(/ +/);
        if(!message.content.startsWith(`a#`)) return;
        let cmd = message.content.slice(`a#`).trim().split(/ +/).shift().toLowerCase();
        let comm = client.commands.get(cmd);
        // console.log(comm)
        if(comm) {
            comm.execute(client, message, args);
        } else {
            message.reply({ content: `Dieser Befehl existiert nicht!` });
        }
    }catch(err){
        console.log(err)
    }

command file

module.exports = {
    name: 'botinfo',
    description: 'shows some botinfo',
    async execute (client, message, args) {
        //code here
    }
}

collection

Collection(1) [Map] {
  'botinfo' => {
    name: 'botinfo',
    description: 'shows some botinfo',
    execute: [AsyncFunction: execute] 
  }
}
outer bane
outer bane
#

v14 uses api and gw v10, you need the intent

frigid sleet
#

but even if I have it on, nothing happens

tame gazelle
#

enable it in the client constructor too

frigid sleet
gloomy kayak
#

You shouldn't use magic numbers

mental inlet
jaunty vault
#

magic numbers removed? I don't think that's true

mental inlet
#

i dont think they've been removed really

#

but as i said earlier, i'm not sure

outer bane
#

you couldn't really remove them without removing enums

outer bane
mental inlet
#

i have a question, how can you access the text voice channels

outer bane
#

access? voice channels have a MessageManager in v14

frigid sleet
#

Ok thank you both of you

mental inlet
jaunty vault
#

The channel type is still GuildVoice

mental inlet
#

ty for telling 👍

plain roverBOT
stuck fiber
#

what is the current version of discord.js@dev?

tame gazelle
manic perch
#

why did they remove .getBoolean() and getString() and stuff from the commandInteraction?

velvet jasper
#

No, it wasn’t removed

manic perch
#

yee i see em in the types but like

#

they ommited for the commandinteraction?

uncut kelp
#

Perhaps you need a chat input interaction

manic perch
#

ah different type now?

uncut kelp
#

It was renamed to reflect its type - chat input

manic perch
#

yeee thats it thanks a lot!

uncut kelp
#

CommandInteraction is now a base for context menu application commands and chat input application commands

manic perch
#

v14 looks very nice so far

manic perch
#

bit lost as to what it wants?

jaunty vault
manic perch
#

yos ty

dark minnow
#

The <Message>.fetchReference() uses the cache before fetching the message?

tame gazelle
#

yes
wait no

dark minnow
#

It does

#

The channel.messages.fetch() checks the cache first

#

Thanks 🙂

tame gazelle
#

ah yeah forgot about that

serene karma
#

For fetching command interaction options, is it sufficient to use interaction.options.get([option_name], true) ?

#

The interaction is typed as CommandInteraction and I'm trying to parse the application command interaction options

plain roverBOT
#

guide Interactions: Replying to slash commands - Parsing options
read more

pseudo mirage
#

does the intents constructor exist in the dev release?

#

cuz its throwing an error for me

outer bane
#

has been renamed, see pins

pseudo mirage
#

thanks

hasty beacon
#

Is there a way to send a message to a voice channel without reacting to an event? I don't see send in VoiceChannel

knotty plover
unreal stump
hasty beacon
#

Ok, thanks, I don't see the answer in faq

knotty plover
#

Yeah I dont see where it has that

#

Oh nvm yes I do

hasty beacon
#

If it's "fully implements the feature", that could be interpreted as "fully implemented it in a way we wanted to", which could have excluded send

slow storm
#

why EmbedBuilder.from is returning any? Am I missing something?

unreal stump
unreal stump
unreal stump
slow storm
gloomy kayak
#

Try updating djs version (npm i discord.js@dev)

manic lynx
uncut kelp
#

The error says you didn't set an author name. Did you?

manic lynx
unreal stump
plain roverBOT
icy dew
#

Yup

icy dew
#

Np

manic lynx
pallid ice
#

the docs are your friend

upper stirrup
#

How to check if a bot has permissions?
interaction.guild.me.permissions.has(['ManageGuild']) - this doesn't work
Error: Cannot read properties of undefined (reading 'permissions')

manic lynx
pallid ice
#

in dev it’s been moved, to get the client as a member its guild.members.me

lethal dagger
icy dew
lethal dagger
#

wait really?

#

didnt know that

vague coyote
#

what did you think was valid lol

lethal dagger
#

MANAGE_GUILD

icy dew
#

All permission flags are now pascal cased in dev

vague coyote
#

@ dev uses PascalCase

lethal dagger
#

ok

digital sequoia
#

The new Voice text channel are full supported in @digital dust right?

outer bane
#

yes

digital sequoia
#

👍

#

I saw this thing with .setDisabled for buttons do i need this new function if I dont use the old buttons and just set a new components array?

#

I mean I dont have a receivedButton I just set a completly new comp array with a disabled button

outer bane
#

what do you mean exactly? If you already have a row with a disabled button you can just send it (?)

digital sequoia
#

Example:
My bot send a msg with a button
If you click the button the bot edits the msg
with a new components array that have the same button but to create the disabled button it dont use the old button thing it creates a new

#

Row1 = ActionRow with no disabled button
Row2 = ActionRow with a disabled button

Bot sends msg with row1
click on the button =>
edits msg with row2

is this better to understand? haha

outer bane
#

in this case you don't have to change anything. what v14 adds is a differentiation between received data which is immutable and builder data to send to the API. To edit received components you have to first convert them via Builder.from or Component.toJSON if you are not using builders

digital sequoia
#

Ahh thanks

regal mason
#

Is there a way to know which local the user uses ?

#

(In which language is the client of the user that use the command)

plain roverBOT
regal mason
#

thx

crystal atlas
indigo fable
#

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
  ],
  allowedMentions: { parse: ["users", "roles"], repliedUser: false },
});

not getting message content after updating - do i have the right intents?

crystal atlas
#

Thanks! ❤️

indigo fable
outer bane
#

I don't see any issue with the intents, you get messageCreate events but content is always an empty string?

indigo fable
#

lmaoo i had the event as message and not messageCreate 😭 thank you

digital sequoia
tender spoke
#

it doesnt look like an error to me

digital sequoia
#

Yeah its a multiple resolves but with v13 I dont get this

digital sequoia
#

Is this no longer supported?

channel.permissionsFor(guild.me).has(['VIEW_CHANNEL', 'SEND_MESSAGES', 'EMBED_LINKS'])

cuz I get this error:

TypeError: Cannot read properties of null (reading 'has')
tender spoke
digital sequoia
#

thx

crystal atlas
#
channel.messages.fetch().then((fetchedMessages) => {```Messages that are returned in `fetchedMessages` seem to have blank content, any ideas? Those messages are from a voice-text channel.
outer bane
#

do you have the MessageContent intent?

crystal atlas
#

Let me see, I should unless it's a new thing 🤔

#

Silly me, seems like I don't thanks! 🙂

#

Added this and it's crashing the bot now 🤔
GatewayIntentBits.MessageContent

outer bane
#

did you activate it in the dev portal?

#

it's a privileged intent

crystal atlas
#

Ah, let me see!

#

Yup, got it, activated now, thanks! 🙂

slow storm
#

@velvet jasper pinging u since u had added fetch less component collector. When I'm using it with an ephemeral reply, it's not working Is it intentional?

velvet jasper
dull mulchBOT
indigo fable
#

is this a bug? the docs say setEmoji should take string or ApiMessageComponentEmoji

outer bane
#

did you import the builder from d.js?

crystal atlas
#
channel.parent.children.forEach((child) => {```How would I go about updating this to v14?```CategoryChannel#children is no longer a Collection of channels the category contains. It is now a manager (CategoryChannelChildManager). This also means CategoryChannel#createChannel() has been moved to the CategoryChannelChildManager.```
forest elm
#

.children.cache

crystal atlas
#

So like that?channel.parent.children.cache.forEach((child) => {

#

Thank you! ❤️

frank moss
#

I get the same error when sending a normal message, I wonder if there was a change in v14?

frigid sleet
#

If I add a normal SelectMenuBuilder as a component to a modal, does it work or is there an error?

onyx cove
#

Error

knotty plover
#

Selects in modals are not announced, officially released or supported yet

velvet jasper
#

@slow storm I can't seem to reproduce your error, here's my code:

client.on('interactionCreate', async (interaction) => {
    if (!interaction.isChatInputCommand()) {
      return;
    }

    const msg = await interaction.reply({
      content: 'test',
      components: [
        new ActionRowBuilder<MessageActionRowComponentBuilder>().addComponents([
          new ButtonBuilder()
            .setCustomId('test')
            .setLabel('test')
            .setStyle(ButtonStyle.Primary),
        ]),
      ],
      ephemeral: true,
    });

    msg
      .createMessageComponentCollector({
        componentType: ComponentType.Button,
      })
      .on('collect', (btn) => {
        console.log(btn.customId);
      });
  });
serene karma
knotty plover
#

They look like shit right now anyway, you cant label them, they arent ready to be modal controls

frigid sleet
#

ok

graceful bolt
#

Hi!
I'have a question...
How to get the voice channel client with this version discord.js@dev?

grizzled iron
#

how does one send a message in tiv?

knotty plover
#

channel.send

soft ice
#

just curious, how can I send a message to a voice channel's text channel?

#

couldn't find in the docs or in the actual github how to do that

#

or, simply, how can I access the text channel inside a voice channel?

exotic nexus
#

the docs are outdated, <VoiceChannel>.send() works

soft ice
#

oh, gotcha, thanks

scarlet tangle
#

Am I thinking about this the wrong way? Trying to get my bot ready for v14 and hit this wall of options not having a type despite them clearly having one, any ideas?

idle galleon
scarlet tangle
idle galleon
#

The error says the one in index 0, 2, and 4

#

Can you show the first command in the Array?

scarlet tangle
#

Ah, I see what I did wrong.. Used the wrong ApplicationCommandOptionType thing for subcommand.

slow storm
velvet jasper
#

It prints the custom id every time the button is pressed

slow storm
velvet jasper
#

Did you try my code?

slow storm
#

I'll do it now

slow storm
# velvet jasper Did you try my code?

I just tried and it's working. But in my case, it's a ButtonInteraction sorry I thought it was any interaction that's why didn't mention it. Can u try with MessageComponentInteraction please?

hasty beacon
#

With v13, we could create a new ActionRow, and pass that directly to the reply function, like reply({components: [actionRow]}). However, with v14, I'm getting an error when passing the ActionRowBuilder instance to reply. Do I need to pass ActionRowBuilder.data or ActionRowBuilder.components instead?

const row = new ActionRowBuilder()
    .addComponents([
        new ButtonBuilder()
            .setCustomId(JSON.stringify({data: voiceChannel.id, command: 'end'}))
            .setEmoji('🛑')
            .setLabel('End')
            .setStyle(ButtonStyle.Primary),
    ]);
await interaction.reply({content, components: [row]});
No overload matches this call.
  Overload 1 of 2, '(options: InteractionReplyOptions & { fetchReply: true; }): Promise<Message<true>>', gave the following error.
    Type 'ActionRowBuilder<AnyComponentBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
      Property 'type' is missing in type 'ActionRowBuilder<AnyComponentBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.
  Overload 2 of 2, '(options: string | MessagePayload | InteractionReplyOptions): Promise<InteractionResponse<true>>', gave the following error.
    Type 'ActionRowBuilder<AnyComponentBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.ts(2769)
hasty beacon
knotty plover
#

You need to toJSON() it I think

#

Otherwise it might be the lack of a generic in the constructor for ActionRow, not sure how builders works there

velvet jasper
#
msg.createMessageComponentCollector().on('collect', (c) => {
      console.log(c.customId);
});
unreal stump
slow storm
# velvet jasper ```ts msg.createMessageComponentCollector().on('collect', (c) => { console...

const changeChannelButton = new ButtonBuilder()
                    .setCustomId('announce-change-channel')
                    .setLabel('Change Channel')
                    .setStyle(ButtonStyle.Primary);

const changeChannelRow = new ActionRowBuilder<MessageActionRowComponentBuilder>().setComponents([changeChannelButton]);

const msg = await i.reply({
            content: `announcement send to ${channel}`,
            components: [changeChannelRow],
        ephemeral: true
        // fetchReply: true
          });

const channelCollector = msg.createMessageComponentCollector({
                    filter
            });
channelCollector.on('collect', async (int) => {{
                   console.log(c.customId);
});

My code and it works with fetchReply: true. And i is a ButtonInteraction

velvet jasper
#

what is your filter?

slow storm
# velvet jasper what is your filter?
const filter = ({ member }: MessageComponentInteraction<'cached'> | Message) => member.id === interaction.member.id;

Is it an issue with member? my filter uses member instead of user bcz I'm using it with messagecollector too

#

let me try with users

#

I tried and still not working with user

velvet jasper
slow storm
velvet jasper
#

try this, listen to interactionCreate and print it if it's a message component

slow storm
#

ok

slow storm
velvet jasper
#

Also is this a chat input command or context menu command?

slow storm
velvet jasper
#

like what is the ephemeral response to?

slow storm
velvet jasper
#

ok I'm able to reproduce it now

#

Good news is that it’s definitely fixable

stuck harness
#

v14 migration was easier than I thought it'd be, though I wish the change in deprecation status for 'message' had yelled at me in TypeScript-land. Are y'all taking PRs on that sort of stuff?

velvet jasper
#

On what kind of stuff?

#

Isn’t there a deprecation message in previous versions when you use the message event?

stuck harness
knotty plover
#

It was definitely throwing deprecation warnings in v13

velvet jasper
stuck harness
#

I did not see it in there but my app spits out a whole ton of junk at runtime so it was probably lost. It should be possible to set up the typescript defs to emit an error at compile time

tepid gust
#

hi, i notice guild.me no longer exists, what's the alternative?

nocturne kayak
tepid gust
#

cool cool, thanks!

green plume
#

Will these clear all permissions from the role?

roles.cache.get(log.entries.first().target.id).edit(
 permissions: null,
)
graceful bolt
#

it's normal that PermissionsBitField don't work?
When i try PermissionsBitField.Flags.Administrator this return undefined
i use commonjs for import discordjs as here -> const {PermissionsBitField} = require('discord.js');
but don't work -_-
AND i don't found PermissionsFlagsBit on discord-api-types/v10 (no enum too)

unreal stump
graceful bolt
#

.-.

unreal stump
proven wolf
unreal stump
proven wolf
unreal stump
proven wolf
graceful bolt
#

i have a error with this ._.

unreal stump
past pumice
#

hi are voice channel broke in the recent update?

my code:

if (
      message.guild.me.voice.channel &&
      !message.guild.me.voice.channel.equals(message.member.voice.channel)
    )
unreal stump
graceful bolt
past pumice
split fulcrum
#

How would i do if i would like to edit a Message and then check the lastMessage and if it was by the Bot or not??

#

i'm using v14 so

scarlet tangle
#

I don't see any problem in this code. Why do I get this error?

if (message.member.roles.highest.position >= message.guild.members.me.roles.highest.position) return;
scarlet tangle
#

cause the code runs fine, but it shows the error

unreal stump
#

anti-everyone.js line 21

scarlet tangle
#
if (message.member.roles.highest.position >= message.guild.members.me.roles.highest.position) return;
unreal stump
#

fetch the bot member

crude valley
plain roverBOT
#

Documentation suggestion for @scarlet tangle:
property Guild#me
The client user as a GuildMember of this guild

forest elm
#

it's message.guild.members.me

scarlet tangle
crude valley
#

ah ok my bad, didn't notice this is the dev channel

scarlet tangle
unreal stump
#

guild.members.me is nullable, u can fetch client.user.id from guild.members and have the "me" object you're trying to use

scarlet tangle
#

👍 Thanks, will try it

cloud pewter
#

Hi, who to send message in new vocal chat beta option

dawn phoenix
#

as you would on a textchannel, just call #send on it

cloud pewter
#

Oh okey thx

leaden axle
#

👍

plain roverBOT
knotty plover
tidal quest
#

I'm using discord.js@14.0.0-dev.1653480262-68d5169 and for some reason interaction.options.getBoolean()\getString() doesn't exist. Anyone know why?

exotic nexus
#

you're missing something in that sentence

plain roverBOT
reef meadow
#

Hi
Does anyone have hashs of commits about support of text in voice pls ?

#

I heard it was supported in dev but in discordjs/discord.js i dont found commit(s) about that

unreal stump
#

anything past may 2nd

tidal quest
unreal stump
#

read the updating guide

nocturne kayak
#

EmbedBuilder
check out the guide in pins

reef meadow
storm knoll
#

Is it possible to get the customid from a ButtonBuilder?

tame gazelle
#

iirc no
you can do new ButtonComponent(<ButtonBuilder>.toJSON()).customId

storm knoll
#

I tried that but typescript dont like that because ButtonComponent is a private class contructor

outer bane
#

you should be able to access it from <ButtonBuilder>.data

#

though you should consider restructuring your code so you don't need to check it since you should have all the data since you are using it for the builder anyways

undone yew
#

how to fix?

outer bane
#

addComponents takes an array

undone yew
#

it's array

outer bane
#

you are showing addOptions

vague coyote
#

new Menu()
wut

manic perch
#

uhm i did setDefaultMemberPermissions("0") but the command isnt disabled for @ everyone?

forest mulch
#

is everything from discord-api-types/v10 re-exported in djs v14? nvm

outer bane
#

can you try using it with an account with insufficient permissions? the ui doesn't reflect default permissions yet

manic perch
#

thats uhm weird, assumed it was just disabled for @ everyone??

#

ig it is but just invis

outer field
#

Hi

#

Where can I find the button styles, I can't find them in Constants anymore

#

and in the doc the type is not a link anymore :/

outer field
#

My IDE was not autocompleting it but now it works??????? wth :')

#

what kind of magic is that

#

Thank you!

tame gazelle
#

no prob

scarlet tangle
#

Was MessageAttachment renamed? Tried AttachmentBuilder and that also did not work.

manic perch
#

new Attachment() ? i think?

plain roverBOT
#

Documentation suggestion for @scarlet tangle:
class Attachment
Represents an attachment.

scarlet tangle
#

oh sweet ty that worked

plain roverBOT
#

Documentation suggestion for @west eagle:
interface Locale
A Discord locale string, possible values are: (more...)

west eagle
#

oops

frigid sleet
#

How can I get the choice of which option a user selects in a SelectMenu when multiple items can be selected at once?

plain roverBOT
#

Documentation suggestion for @frigid sleet:
property SelectMenuInteraction#values
The values selected, if the component which was interacted with was a select menu

frigid sleet
#

thanks

tidal quest
#

How exactly do you get message content now?

jaunty vault
tidal quest
#

Yeah but that's returning an empty string

jaunty vault
#

Is your bot verified?

tidal quest
#

no

manic furnace
tidal quest
#

In the dev portal? Because I did that

jaunty vault
#

And code

manic furnace
#

In the dev portal and in your code

tidal quest
#

ah ok

tidal quest
#

What is GuildStore in ChannelType

hoary fox
#

it should be removed soon from djs
from discord it was removed in march

uncut kelp
#

It is removed

hoary fox
#

okey

rugged plover
#

Is there any benefit to start looking at v14 to code new standalone features? (I'm planning to segregate feature in different container)

outer bane
#

pascal case, GuildMembers

forest elm
#

you don't need all of those intents

jaunty vault
#

99% sure you don't

forest elm
#

integrations is misspelled

outer bane
#

kinda interested in what you want to do with DirectMessageTyping

night light
#

EmbedBuilder iirc

#

?? u still have MessageEmbed on here, i literally told u to use EmbedBuilder and import it from djs

tender spoke
#

yes!!!

#

and setFooter takes an object

night light
#

setFooter takes one param, as an object .setFooter({ text: 'your text' })

plain roverBOT
#

<MessageEmbed>.setFooter() and <MessageEmbed>.setAuthor() now each take an object:

- embed.setAuthor('This is an example text', 'https://example.com/icon.png', 'https://websiteofauthor.com')
+ embed.setAuthor({ name: 'This is an example text', url: 'https://websiteofauthor.com', iconURL: 'https://example.com/icon.png' })

- embed.setFooter('This is an example text', 'https://example.com/icon.png')
+ embed.setFooter({ text: 'This is an example text', iconURL: 'https://example.com/icon.png' })
tender spoke
#

its in the pinned messages

#

its 1.30am

#

im central european

night light
exotic nexus
#

help.js line 45

kind carbon
#
const client = new Discord.Client({
    intents: [
        GatewayIntentBits.Guilds,
        GatewayIntentBits.GuildsMembers,
        GatewayIntentBits.GuildsBans,
        GatewayIntentBits.GuildsEmojisAndStickers,
        GatewayIntentBits.GuildsIntegrations,
        GatewayIntentBits.GuildsWebhooks,
        GatewayIntentBits.GuildsInvites,
        GatewayIntentBits.GuildsVoiceStates,
        GatewayIntentBits.GuildsMessages,
        GatewayIntentBits.GuildsMessageReactions,
        GatewayIntentBits.GuildsPresences
    ],
    partials: [Partials.Message, Partials.User],
})``` RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: undefined.
knotty plover
#

Guilds is plural but the rest are all Guild singular

warm spade
#

GUILD_TEXT change from v13 to v14 to?

#

The clear channel type

knotty plover
#

GuildText

warm spade
#

nop

nocturne kayak
#

you use enum now
import ChannelType and use ChannelType.GuildText

warm spade
#

ok

#

Yes, thanks

knotty plover
#

Use the enums

scarlet tangle
#

I am so lost.

#

How is the reaction emoji's name not equal to "⭐️"?

idle galleon
scarlet tangle
#

coding on a phone sucks sometimes

idle galleon
#

Huh, I’ve never ran into such issue

#

Mb I haven’t used emojis enough

scarlet tangle
#

ah

cinder bane
#

is there any way to get the id of the text channel of the voice channel?

#

or will the id be the same as the voice channel?

knotty plover
#

Same

small light
#

i get this err when i try to run a cmd

outer bane
#

addFields takes an array

small light
#

ty

small light
#

i just installed v14 btw

#

still trying to merge

outer bane
#

whatever you pass to setColor is not a ColorResolvable. You can check out the WIP upgrade guide in pins

small light
#

for the topic im searching 4

outer bane
#

docs have a search feature, make sure to select the main branch or use the link in the pins

undone yew
#

how to fix?

tame gazelle
undone yew
#

how??

tame gazelle
undone yew
#

wait

#

i fixed

storm knoll
#

Why isn't it possible to update the original message with a modal submit interaction when the modal is triggered by a button press?

nocturne kayak
#

it is possible?

storm knoll
# nocturne kayak it is possible?
await interaction.awaitModalSubmit({ filter, time: 60000}).then(async i => {
    await i.update({ components: [row]))
})

Property 'update' does not exist on type 'ModalSubmitInteraction<CacheType>'.ts(2339)

nocturne kayak
#

you do a isFromMessage() typeguard

storm knoll
#

Ah alright, thank you!

dusk heath
#

Are radio buttons already supported in dev?

exotic nexus
#

radio buttons are a thing?

vague coyote
#

nothing other than text inputs are documented by discord, so thats a big no

dusk heath
exotic nexus
#

looks very fake

dusk heath
#

no it got confirmed by a staff shrug