#development

1 messages · Page 14 of 1

earnest phoenix
#

wt???????

boreal iron
#

Look at my previous message

#

That’s what you pass in your setFooter(…) method

earnest phoenix
#

i putting footer already

boreal iron
#

Also .avatarURL seems to be a method not a property

#

So it’s avatarURL()

#

See this:

earnest phoenix
hard wraith
#

You called it anti fish...

#

You applying for verification? Your bot stores data about every command run.

boreal iron
earnest phoenix
#

done and not working

boreal iron
#

Code and error

#

As well as the line causing the error

earnest phoenix
# boreal iron Code and error

client.on("messageCreate", message => {

  if (message.content.startsWith(prefix + "user")) {
    if (message.author.bot || message.channel.type == "dm") return;
    let mnt = message.mentions.users.first();
    let user = mnt || message.author;
    moment.locale("En-ly");
    message.guild.invites.fetch().then(invs => {
      let personalInvites = invs.filter(
        i => i.inviter.id === message.author.id
      );
      let Invites = invs.filter(i => i.inviter.id);
      let inviteCount = personalInvites.reduce((p, v) => v.uses + p, 0);
      let userEmbed = new EmbedBuilder()       
       .setAuthor(message.author.username)

    .setFooter({ text: 'Some footer text here', iconURL: 'https://i.imgur.com/AfFp7pu.png' })
      .addFields([
  { name: 'Join Discord At', value: `**${moment(user.createdAt).format("D/MM/YYYY h:mm a")}**` },
  { name: 'Join Server At', value: `**${moment(user.joinedAt).format("D/MM/YYYY h:mm a")}**`},
]);

      message.channel.send({embeds:[userEmbed]}).catch(console.error);
    });
  }
#

Error

boreal iron
#

There aren’t any line number in code blocks

#

Which one is it

#

Hard to figure out on mobile

earnest phoenix
#

.setAuthor(message.author.username)

ancient nova
#

how do I apply for intents in the application?

#

what intent I need
why I need it
and a code snippet
right?

boreal iron
#

{ name: "author", icon_url: "icon" }

#

I think an author also supports a “url” property to turn the headline into a link

earnest phoenix
hard wraith
#

Wait... they dont have an example?

#

or a best practice for application?

boreal iron
earnest phoenix
ancient nova
#

LMFAO GUYS I HIT THE LIMIT ON THE INTENT REQUEST BOX

#

I TYPED SO MUCH STUFF THAT NEED INTENTS THAT I CAN'T TYPE ANYMORE

#

idk whether that's good or bad

boreal iron
#

Takes you so many chars to explain why and what needs the member details (for)?

stuck dawn
#

how should i overwrite this class i want be the exact same css atributes in whatever occasions

earnest phoenix
#

@boreal iron,, In the user command, when I mention a user and type in it, user answers me with the person’s information without problems, but in the author the name of the message writer is written, not the name of the mentioner

stuck dawn
#

i tried !important in the width & height but i doesn't work

earnest phoenix
#

why ?

boreal iron
earnest phoenix
boreal iron
#

The absolute position however makes the width don’t work in your case

ancient nova
#

guys would anyone be able to add my bot to their server since I was writing this damn verification appliaction for 4 hours. And for some reason people decided to kick my bot from over 4 servers and now I can't verify :/

#

you can kick it after

boreal iron
stuck dawn
#

no i didn't assign anything

boreal iron
boreal iron
earnest phoenix
boreal iron
#

Code?

earnest phoenix
# boreal iron Code?
client.on("messageCreate", message => {

  if (message.content.startsWith(prefix + "user")) {
    if (message.author.bot || message.channel.type == "dm") return;
        let target = message.mentions.users.first() || message.author;
        let member = message.guild.members.cache.get(target.id);
        let user = message.mentions.users.first() || message.author;
      let userEmbed = new EmbedBuilder()       
   .setAuthor({ name: `${message.author.tag}`, icon_url: `${message.author.displayAvatarURL({dynamic: true})}`})
.setTimestamp()


          .addFields(
                { name: 'Joined Discord :', value: `${moment(user.createdAt).format("D/MM/YYYY h:mm a")}`, inline: true },
                { name: 'Joined Server :', value: `${moment(user.joinedAt).format("D/MM/YYYY h:mm a")}`, inline: true },
            )
         //   .setThumbnail(message.user.avatarURL({ dynamic: true }))
           .setFooter({ text: message.user.tag, iconURL: message.user.avatarURL({ dynamic: true })  })

      message.reply({embeds:[userEmbed]}).catch(console.error);
    
  }
});
#

full code

#

error on
.setFooter({ text: message.user.tag, iconURL: message.user.avatarURL({ dynamic: true }) })

boreal iron
#

messages don’t have an user property but author

earnest phoenix
boreal iron
#

If you defined user as the mention and wanna use it’s name in the footer then access the var you defined

#

user.tag not message.user.tag (which doesn’t exist anyways)

#

Same goes for the avatar of course

#

If it’s supposed to be the avatar of the mentioned dude

earnest phoenix
#

need a just reply

#

without mention

elfin tulip
#

Hello, could someone explain how can I make discord.js buttons that will be available all the time and even when bot is restarted?

boreal iron
#

reply({ content: “…”, allowedMentions: { repliedUser: false } });

or

reply({ content: “…”, allowedMentions: { users: [] } });

lyric mountain
#

like a function if it's small enough

boreal iron
#

you can also just use send(…) to send a message into the channel

#

It just won’t be shown as reply

ancient nova
#

I

#

want

#

to

#

not

#

alive

#

I can't submit the bot anymore 😭

boreal iron
#

Patience is all you need mmLol

ancient nova
#

I've been waiting with that tab open for about an hour now

#

nobody be adding it I bet if I waited longer someone else would kick it as well

#

I need 2 people to add it, maybe 1 if 75 is the minimum

hard wraith
#

If it still lets you use that page submit it 😂

#

You started it when you had 75

#

Discord accept the fact it can fluctuate.

#

In a matter of minutes.

#

or open your bot dev portal in a private browser window and see if it still qualifies.

elfin tulip
hard wraith
elfin tulip
#

Yeah, I see, that works. But it still shows "This interaction failed" even when the code is executed.

hard wraith
#

Only way to stop that

ancient nova
#

alright

#

I sent the verification

hard wraith
#

or deferReply() in the thing setting up the button and editReply() once resumed.

sharp geyser
#

That's not the only way

#

You just gotta do something with the response

lyric mountain
ancient nova
hard wraith
elfin tulip
hard wraith
#

thats useless to discord lol

lyric mountain
#

console log isn't defer

sharp geyser
#

Replying or deferring isn't the only way to stop that though

elfin tulip
sharp geyser
#

You can also delete something

#

Or edit the current message/embed

hard wraith
#

interation.deferReply() then when you handle the interaction do interaction.editReply()

sharp geyser
#

It all depends on what they are trying to do

hard wraith
#

It doesnt matter how he does it, he needs to handle the reply to the interaction somehow to stop the interaction timing out and saying it didnt work.

sharp geyser
#

They might not even need to defer the reply like that

elfin tulip
hard wraith
#

then js interaction.reply({content: "Message sent to user and awaiting reply", ephemeral: true});

elfin tulip
sharp geyser
#

Okay so you don't necessarily need to use deferReply here from what I remember. You can just take the result of it you can do whatever like deleting the message sent to the user or notifying them of getting their input

#

Assuming you're using djs you can easily get the result of them pressing the button and then reply to em

hard wraith
#

through interaction.reply() again lmao

sharp geyser
#

Probably

#

I don't use djs so I'm not used to it's method names

ancient nova
hard wraith
#

buttons are just interactions with type being button

sharp geyser
#

I know

ancient nova
#

"thorough"

#

they responded 5 seconds after I applied

hard wraith
#

They have flags on blocked hosts

ancient nova
#

how is Daki a blocked host?

hard wraith
#

Not reputable for VERIFIED bots

#

its not blocked for bots. But they want more reliable and reputable hosts for larger scale VERIFIED bots, as they state.

ancient nova
#

"reputable" really who gon care where a bot is gonna be host?

hard wraith
#

And they give you reasoning what makes a host reputable.

ancient nova
#

yeah daki has all of that

spark flint
#

Well Daki clearly doesn’t meet discords requirements

hard wraith
#

Uptime, data handling practices of the hosting provider, hosting redundancies.... Regional hosting law comliance...

sharp geyser
#

Well it says that it must have support outside of discord

spark flint
#

Not using a discord server for support

sharp geyser
#

But daki relies solely on a. Discord server

#

So there's your answer

hard wraith
ancient nova
#

is there a different free host I can use then

hard wraith
#

Like email helpdesk

sharp geyser
#

It has no other option

hard wraith
#

Daki is pure discord?

sharp geyser
#

Yes

hard wraith
#

Like not even a webmaster email?

sharp geyser
#

If you click it's support link it just goes to discord

#

Not even an email publicly displayed

hard wraith
#

I...

#

I am suddenly regretting using her bot lol...

#

I think Daki might be a reseller service.

sharp geyser
#

?

hard wraith
#

And a poorly thought out one.

sharp geyser
#

Idk anything about a bot

#

I just know it's a hosting service for bots to use for free

ancient nova
#

well then what should I use?not gonna suddently pay for a service when I have a fully working free one

#

that's faster than the one i was paying for

hard wraith
#

Daki is a free bothost...

sharp geyser
#

Then don't get verified

hard wraith
#

its not a VPS reseller or anything...

sharp geyser
#

I don't know of any "free" hosting that will be acceptable to discord

ancient nova
#

saying I daki is faster than a VPS I paid for

ancient nova
hard wraith
#

Digital Ocean, Azure, AWS... Hell even Hostinger.

sharp geyser
#

I doubt that

#

Verification was not even out 4 years ago

hard wraith
#

All of them have lightspeed VPSs with 2gb ram that are faster than Daki.

ancient nova
#

I verified a bot that Imade on my phone with bd script

earnest phoenix
#

?

ancient nova
#

and I can't verify a fully working bot I spent countless months on cause I use a different host than they like??

hard wraith
#

Why are you fighting us about using a "free" host that limits your ability to scale up your bot?

#

You literally cannot configure your host specs.

ancient nova
#

that "free" host was literally faster than the the thing I previously hosted my bot with, which wad paid

ancient nova
ancient nova
#

I can choose cpu speed, ram and storage

hard wraith
#

Cool, dont care.

#

Name your paid host provider.

sharp geyser
#

Why are you guys even arguing in the first place breh

hard wraith
#

You say it was slow. I want to check it out.

ancient nova
hard wraith
#

Cool so you used a smaller named hosting provider for cheaper costs and got what you paid for.

sharp geyser
#

Bae you can search for a free hosting if you want but I doubt you'll find one that's good enough for discord.

ancient nova
#

?? I use Daki because it's free and it's way faster

quartz kindle
#

replit/glitch/heroku are sooo not worth the price

hard wraith
#

Cool and I just ran a speed test on a daki server of same spec as an azure server I created and azure completed the test in half the time. And that was a free plan azure server.

ancient nova
hard wraith
#

And I know azure is supported by discord.

solemn latch
#

discord supports every host afaik

ancient nova
quartz kindle
#

its much more influenced by latency/network than anything else

ancient nova
hard wraith
ancient nova
#

they didn't even check the website out probably

#

responded seconds after I submitted

solemn latch
#

what are you using? 👀

ancient nova
lyric mountain
#

lmao

vivid fulcrum
#

the heading is why they denied you

ancient nova
#

really

#

just because of how a website looks they denied me?

lyric mountain
#

nope, it's because nothing is completely free

vivid fulcrum
#

free doesn't go hand in hand with reliable

ancient nova
#

the actual panel is a ptero 2.0 panel

solemn latch
#

what are the odds its using hetzner?

wasn't hetzner blocked for discord bots for some abuse 👀

ancient nova
hard wraith
ancient nova
#

it literallt uses pterodactyl

solemn latch
#

hetzner is a vps/server provider

hard wraith
#

I had to stop an antivirus block at firewall level to allow it to download the test document from my servers...

lyric mountain
#

the trinity of service is

     GOOD 
      /\
     /  \
FREE ---- SAFE
solemn latch
#

it can be used with pterodactal

ancient nova
lyric mountain
#

you can only have 2

hard wraith
solemn latch
#

not always

#

they have US servers

hard wraith
boreal iron
ancient nova
#

alright gonna try a different vps, I got another one

oak cliff
#

Big sorry to interrupt the ongoing conversation, but can anyone point me in the right direction to make an Interaction handler? Would I want to use interaction.type ? (d.js 14)

hard wraith
#

Only get germany as options.

oak cliff
#

(d.js 14)

hard wraith
vivid fulcrum
#

if it works for you, you could've just lied about hosting providers

hard wraith
#

wait no...

#

hold on...

oak cliff
#

i want to have a different file for Buttons, ChatCommands, Select Menus

#

i dontthink .type gives me that?

hard wraith
#

use interaction.isCommand

oak cliff
#

im just confused where to look

boreal iron
hard wraith
#
eternal osprey
#

how do i check if a member has admin perms in djs v13?

hard wraith
ancient nova
#

bruh imagine 8 didn't save my application

lyric mountain
ancient nova
#

I would have to waste another 5 hours

#

writing a new one

solemn latch
#

^ custom id's is how I did it

lyric mountain
#

like, reserve first line for type declaration

eternal osprey
#

is js message.guild.me.permissions.has("ADMINISTRATOR") a valid method to use?

oak cliff
#

im not sure what you mean by custom ID exactly

wheat mesa
#

use the enum por favor

boreal iron
oak cliff
#
const chatInputCommand = require("../interactions/chatInputCommand");
const selectMenu = require("../interactions/selectMenu");

module.exports = {
    name: `interactionCreate`,
    async execute(interaction, client) {

        if (interaction.isChatInputCommand()) {
            await chatInputCommand.execute(interaction, client);
        };

        if (interaction.isSelectMenu()) {
            await selectMenu.execute(interaction, client);
        };

    }
};``` 

This is what I have right now but i figured there has to be a better way ![KEKW](https://cdn.discordapp.com/emojis/727825308404940800.webp?size=128 "KEKW")
boreal iron
#

Command interactions don’t have that

oak cliff
#

oh i see what you mean

boreal iron
#

And you can not specify that either

sharp geyser
#

it can be anything you want as well

oak cliff
#

im trying to filter before i even get to that point

#

is that not recommended KEKW

sharp geyser
#

I typically make my custom ids specific to their purpose e.g "banButtonYes"

oak cliff
#

InteractionType doesnt respond with Button or SelectMenu or ChatInputCommand

boreal iron
oak cliff
#

I want to have like an event handler but instead of events, its for interaction types

hard wraith
boreal iron
#

The first thing you wanna know is, is, is it a command or component interaction

sharp geyser
#

Aren't buttons and select menus classified under type 3?

earnest phoenix
#

how i get user last voice seen?

hard wraith
#

MessageComponent is buttoins and select menus yes

sharp geyser
#

Which is MessageComponent

oak cliff
#

message componenets?

lyric mountain
oak cliff
#

but then id need to filter them again right to seperate the buttons from the select mnutes

#

menus*

lyric mountain
#

then grab the id and read the first line

hard wraith
boreal iron
#

Yes there are only commands or components

earnest phoenix
#

@boreal iron bro how i get user last voice seen?

boreal iron
#

Can’t help you with voice related stuff

hard wraith
#

so slash commands being ApplicationCommand, buttons MessageComponent, Select Menus MessageComponent etc.

oak cliff
#

ah i think i gotcha now

hard wraith
#

So yes, you can filter it before that code you shared with .type on interaction/

earnest phoenix
sharp geyser
#

If you wanna filter further I'd look at custom ids

oak cliff
#

okay thanks pog_thumbsup

hard wraith
sharp geyser
#

Just make sure your custom ids are descriptive and you can filter pretty easily after that

hard wraith
#

How many users joined using an invite or how many invites a user made?

earnest phoenix
hard wraith
boreal iron
# oak cliff ah i think i gotcha now

I personally load (component) interactions and commands into the cache - their modules - then filter the interaction, then execute the associated module, and for commands I use the command name and for components the custom ID to identify the right module I wanna call my execute method for

hard wraith
#

get from cache or fetch direct from the manager any invites with the userID being that of the user

boreal iron
#

That’s a nicely sorted system and you keep anything in your modules, sorted

spark flint
hard wraith
#

Actually no... Invites dont store the userID of the user that made them?

oak cliff
#

What are Apps classified as? - like from here:

#

are those application commands too?

boreal iron
sharp geyser
#

It gives you the user who made the invite

earnest phoenix
#

@hard wraithDo you know how to summon the last seen member in voice calls?

hard wraith
sharp geyser
#

🤷‍♀️

hard wraith
#

the .fetch accepts channelID not userID

spark flint
boreal iron
sharp geyser
#

Then give it a channel ID 5head

oak cliff
#

which InteractionType would they be considered 👀

spark flint
#

They had some weird sss name

#

Ass**

#

I think it’s the context one actually

oak cliff
hard wraith
boreal iron
#

Tbh I wouldn’t go with the interaction type to sort things

#

Just an hassle you can avoid

hard wraith
#

idk im tired aint been sleeping good so ima clock off.

hard wraith
boreal iron
#

Like I said there’s either a commandName property available OR a customID which already specified the interaction type

sharp geyser
#

And then they'd easily get the correct user

hard wraith
oak cliff
#

so instead of having one file for each type i have one file for each model (each button/each select menu) and one for commands?

sharp geyser
#

They want the user who made the invite no?

boreal iron
oak cliff
#

interesting

boreal iron
#

The rest are all components

hard wraith
#

the DJS guide might be better to learn from...

#

They have an example command handler, button handler etc.

oak cliff
#

the d.js guide doesnt really go into sorting like this

#

i dont want a handler for each one individually

sharp geyser
#

Djs guide is a joke

solemn latch
#

yeah, the djs guide is extreme basics

sharp geyser
#

They don't even show the efficient way to do it

hard wraith
#

Im not arguing its a joke... but you can use interactionFolder/Type in the handler...

boreal iron
hard wraith
#

using their basic handler example to sort that way.

boreal iron
#

Makes it more confusing for beginners than helping

hard wraith
#

always start with a basic example and build off it to your needs.

sharp geyser
#

And it's extremely inefficient as well

hard wraith
sharp geyser
#

It's just stomping on their foot rather than helping

boreal iron
#

As well as doesn’t even point out the accurate registration process and when to use it and when not

hard wraith
#

Im also pretty sure half the guide needs a re-write as they are still pushing v13 methods in the v14 guide lol

sharp geyser
#

That's a given

hard wraith
#

Just take the guide at face value... A BASIC guiding overview of how they want you to use their methods lol. Learn from that how it works and adapt to your needs.

#

Or use the pure REST API

sharp geyser
#

Or not rely on djs at all

#

And go libless like a chad

hard wraith
solemn latch
#

most users wont know how to do that

sharp geyser
#

You need more than just the rest API to make a bot

vivid fulcrum
#

not anymore

hard wraith
#

thats why djs made a basic how to guide on their lib

boreal iron
#

Actually@not any@orw

#

Wow

sharp geyser
boreal iron
#

Interactions don’t require a gateway connection anymore

solemn latch
#

which is amazing

vivid fulcrum
#

never did

sharp geyser
#

But how is the bot supposed to go online

hard wraith
vivid fulcrum
#

it doesn't

sharp geyser
#

👀

boreal iron
hard wraith
#

every method in DJS just converts to a rest request.

vivid fulcrum
#

everything is RESTful

sharp geyser
#

I mean I guess interactions make sense as it is essentially a webhook

solemn latch
#

you dont even need a bot anymore, you can just add the commands to a server

sharp geyser
#

But you can't receive events can you?

hard wraith
#

Yep

#

express

boreal iron
#

There aren’t any events

#

You receive webhooks

vivid fulcrum
#

if you don't use the gateway, discord will hit your webserver with a REST request and you respond back

knotty talon
#

do this server help for developing bots aswell?

hard wraith
sharp geyser
#

I'm talking about like guildMemberAdd fake

boreal iron
#

You also answer to webhook pings

#

To verify your app status

solemn latch
hard wraith
#

sent in via the webhook

boreal iron
sharp geyser
#

Yea so

hard wraith
#

DJS is just a handler library for the discord rest api

boreal iron
#

Either interactions, a gateway connection or both

sharp geyser
#

You can use the cool features but other than that it's useless

#

So a gateway connection is still needed if you wanna respond to events

boreal iron
#

Yes

hard wraith
#

literally says so in the discord api docs...

solemn latch
#

or give roles, interact with the server in anyway right?

sharp geyser
#

So basically I learned something new but it was unrelated to what I was talking about gotcha

boreal iron
#

But not any bot needs to receive the events tho, Misty

boreal iron
#

Just some are there to respond to your interactions

sharp geyser
knotty talon
#

crazy V14

sharp geyser
#

But a lot of people still rely on events

hard wraith
#

you still get events!

sharp geyser
#

So my point still is valid

sharp geyser
hard wraith
#

what do you think client.on is?

#

WEBHOOK!

#

to your endpoint!

boreal iron
hard wraith
sharp geyser
#

I've read the API docs many times my g

hard wraith
#

yes but you said it doesnt send events... it does.

#

how would discord.js handle discord events without using the events sent by the discord api?

sharp geyser
#

They make a gateway connection

hard wraith
#

I make rest APIs at work and node libraries to handle it...

sharp geyser
#

I've read through djs code

#

I know how it works

hard wraith
sharp geyser
hard wraith
#

or any alternative

earnest phoenix
#

When calling my nickname if I don't have a nickname to type the name?

sharp geyser
#

I'd never use express to make a gateway connection

hard wraith
#

a gateway connection is basically just a webhook endpoint.

sharp geyser
#

No it's a websocket connection

#

Lmfao

boreal iron
hard wraith
#

right because the events recieved arent handled like a webhook handles them...

boreal iron
#

It’s happening again

sharp geyser
#

Discord has the server

#

We have the client

#

We use a websocket library to make a connection to that server

#

God talking to idiots is tiring

#

I'ma head out

quartz kindle
#

lmao

hard wraith
#

right so you are gonna continue to say you are right when people are out here using express and the rest api to run their bots like psychopaths?

sharp geyser
#

At this point I don't know if this guy is just dumb or trolling

oak cliff
#

Let's change topics maybe

quartz kindle
#

you can have a bot without gateway

sharp geyser
#

Sure

hard wraith
quartz kindle
#

if you only use interactions

sharp geyser
#

But you won't receive the benefits the gateway gives you

#

Like events

hard wraith
#

Can be done with webhooks!

boreal iron
sharp geyser
#

I feel like your brain is so fucking tiny it's not even noticeable at this point

boreal iron
#

Tim’s here

#

Let him solve this

hard wraith
#

Mate you are seriously retarded...

solemn latch
#

be respectful please

sharp geyser
#

I'ma just leave this conversation before I get bopped

solemn latch
#

thank you misty

boreal iron
quartz kindle
#

the webhook is only for interaction events, it doesnt include the other stuff like guilds, channels, messages, etc

sharp geyser
oak cliff
#

-m 415067295715557376 using slurs | 2d

gilded plankBOT
#

upvote JCoDog#0001 was successfully muted

boreal iron
#

I love you

sharp geyser
#

Glad I left early

#

👀

oak cliff
#

I'm going on a walk

sharp geyser
#

Have a nice walk!

oak cliff
sharp geyser
#

Hope your pregnancy is going well as well

oak cliff
#

It is! yay

sharp geyser
#

Good good

sharp geyser
#

Although you do say you receive interaction events does that include the interaction create?

boreal iron
#

Yes still

quartz kindle
#

isnt interaction create the only interaction event there is?

boreal iron
#

I think he means you still receive it as event using a gatewa connection

#

Not as webhooks

sharp geyser
#

Idk maybe

boreal iron
#

Can you actually separate both?

sharp geyser
#

I don't fuck with interactions at that level

boreal iron
quartz kindle
#

like all interactions kinds are inside the same event, the INTERACTION_CREATE event

#

thats what you receive via webhook, if you opt for it

sharp geyser
#

I see

#

That makes sense though

quartz kindle
#

you cant receive them in both places tho

sharp geyser
#

No need for a gateway connection for that if it's webhooks

quartz kindle
#

once you setup a webhook url, you stop receiving interactions via gateway

knotty talon
#

const { SlashCommandBuilder } = require('@discordjs/builders');
const { MessageAttachment } = require('discord.js')

module.exports = {
data: new SlashCommandBuilder()
.setName('attachment')
.setDescription('Upload a file')
.addAttachmentOption(option => option.setName('attachment').setDescription('Upload an attachment')),

async execute(interaction) {
    let attachment = await interaction.options.getAttachment('attachment');

    await interaction.deferReply(); // Deffer Reply so we have more time

    console.log(attachment.url) // You can see URL, which is what we will use later
    console.log(attachment.contentType) // See the file type

    attachment = await new MessageAttachment(attachment.url, 'image.png'); // Converting URL to image as well as naming the file/assigning the file type

    await interaction.editReply( // Sending the image
        {
            files: [attachment]
        }
    )
},

};

sharp geyser
#

Hm?

knotty talon
#

anyone help me. switching from v13 to v14 confused me

sharp geyser
#

Oh fake is about to have a field day

#

Builders

boreal iron
sharp geyser
boreal iron
knotty talon
sharp geyser
#

Well I don't use v14 so fake you're up

boreal iron
#

Driving

knotty talon
#

ahh lemme downgrade UY96_codm_megakek

boreal iron
#

One second lemme look

sharp geyser
#

Texting while driving

boreal iron
#

Shhh

sharp geyser
boreal iron
#

That’s allowed in my state

sharp geyser
#

I call cap

boreal iron
quartz kindle
#

well

#

there is always docs

#

docs to the rescue

boreal iron
#

Oh I forgot Tim is here

knotty talon
sharp geyser
#

This aint the 1950s anymore where you can do anything while driving

quartz kindle
boreal iron
#

@quartz kindle do my job bitch I payed for your ass

sharp geyser
boreal iron
knotty talon
sharp geyser
#

How

knotty talon
quartz kindle
#

there is no MessageAttachment anymore

#

its AttachmentBuilder

boreal iron
sharp geyser
#

Probably deprecated

#

I wouldn't be surprised

#

Discord just does what they want at this point

boreal iron
#

Well true

quartz kindle
#

the default version is still v6 lmao

boreal iron
#

lol

knotty talon
boreal iron
#

But yet enforcing interactions anywhere

#

🤦‍♂️

sharp geyser
#

When message content intent gets required they might just deprecate every version before v10

knotty talon
boreal iron
#

Probably yeah

knotty talon
#

Didnt see it but anyways ty hope it works

sharp geyser
#

My music taste is so bad

#

I don't even decide my own music anymore I just listen to whatever comes on unless it's country or any kind of rock

boreal iron
# knotty talon

That’s actually a good thing be abuse djs previously build their embeds for example including all properties even if they were not specified so means they were null

#

But the api only sends the embeds with the properties it has

sharp geyser
#

Just make everything nullable

#

Ez

boreal iron
#

Not with properties being null

knotty talon
boreal iron
#

So it was quite hard to compare a response by the api with your embed build

#

Since djs had each property being null included

#

The api response not

knotty talon
#

Slash Commands in V14 so bad compared to V13

boreal iron
#

Just a mess

#

What

#

No

knotty talon
#

Yh Ik its an upgrade but they changed a lot

sharp geyser
#

Just don't use djs

#

It's a scourge upon earth

#

😎

knotty talon
#

I dont know py

boreal iron
#

Still without long requested features app commands and components are actually quite nice and easy to use

#

Once you get to it

quartz kindle
sharp geyser
#

Use tiny discord

#

;)

#

I heard it's really good

knotty talon
quartz kindle
#

:^)

knotty talon
#

I dont want to search up too much

sharp geyser
#

That is if Tim updated to v10

quartz kindle
#

there are other js alternatives

sharp geyser
#

👀

#

Did you Tim?

#

Or you still on v9

knotty talon
#

Im done with this V14 lemme downgrade UZ99_codm_kek

quartz kindle
#

i did, but its literally just changing the default number

#

theres nothing to change about it in the lib

boreal iron
sharp geyser
#

True

#

As your lib is bare bones so you don't have to care

quartz kindle
#

exactly

#

:^)

sharp geyser
#

I just like tiny discord

boreal iron
#

Meant djs light

#

Damn

sharp geyser
#

Ee

#

Djs light sucks no offense Tim

quartz kindle
#

djslight is sill v13

boreal iron
#

Now I nmentiined it

#

Shame on me

quartz kindle
#

still dont know if ill even make a v14

boreal iron
sharp geyser
#

Don't

#

It's not worth it

boreal iron
#

Shhh Misty

#

It is

quartz kindle
#

v14 still doesnt let you turn off channel cache tho

sharp geyser
#

Make Discord's airhorn bot burn

quartz kindle
#

shame on them

boreal iron
#

Tim hasn’t enough projects already

sharp geyser
#

Why the fuck you trying to make Tim do more work

#

At this point his api won't come until 2040

quartz kindle
#

i need to buy 2 new tires for my car

#

the front tires are fucked up

boreal iron
#

Because I like how he’s in pain 24/7 doesn’t know what to do first

#

It’s like me

quartz kindle
#

:(

sharp geyser
#

Tim being in pain not cool

#

Smh

#

Shame on you

boreal iron
#

Well let’s be honest

#

The stuff I wanna do on the net takes like a life time, the stuff I wanna do in reality, too

#

So…

#

At some point you just have to start laughing about it

sharp geyser
#

I felt that tbh

#

I have a really good idea but money's a bitch

#

😔

boreal iron
#

Not going to mention that I’m working 12h 6d a week

#

Which limits anything even more

#

Life is just pain

sharp geyser
#

I'd quit

#

That's too much time to be working

#

Unless you're passionate about it

boreal iron
#

Well it’s still my own business and after 10y you’re really calm about things

#

Also we still have a few employees I really like and I don’t see reason yet to rip anything

#

But tbh times are getting really hard nowadays

#

But to be fair not just for me

boreal iron
oak cliff
#

Please dont use slurs

boreal iron
#

Huh Wut

#

Is that forbidden now? Wasn’t aware tbh

#

Or just a gentle recommendation?

oak cliff
#

Slurs arent allowed, no

#

In other news

#

I have this interaction handler working but now all of my multi select menus are only allowing one selection

#

what did i break 😭

boreal iron
#

Ok in other words, even after 10y I still enjoy what I do even if I have to deal with various people, also some nobody wanna deal with every day

#

But I still enjoy my work

#

Also somehow applies to hanging around here freerealestate

boreal iron
#

Touched by accident?

oak cliff
#

i have .setMinValues(1)

#

i dont have a max value

#

i didnt change it

boreal iron
#

Max is 1 by default

oak cliff
#

whAT

#

did they change that

#

cause i dont remember it doing that before

boreal iron
#

Yeah if you wanna have multi select you need to define max other than the default

#

Which is 1

oak cliff
#

okay lemme update that i guess

#

ty

boreal iron
#

I wonder how that was possible before

oak cliff
#

okay i have successfully updated to v14

#

pushed to github

#

going to bed lmao

boreal iron
#

Soon v15

oak cliff
#

😭

boreal iron
#

Breaking changes

#

Renaming all builders back to what they were called before

#

Because to many people complained

boreal iron
oak cliff
#

yea

boreal iron
#

Ok

#

And it was working before ?

oak cliff
#

it was working on 13 yeah

#

idk why

boreal iron
#

Hmm

#

Maybe those fields are only available to specify when using the v10 gateway

oak cliff
#

lmao i remember this

#

i was definitely an idiot

boreal iron
#

But wouldn’t somehow not make sense

boreal iron
oak cliff
#

idr what the issue was but i pushed the code before i tested it and it br0ke

#

now i test locally before pushing pog_thumbsup

boreal iron
#

Ahh well my push is called “save file”

oak cliff
#

lol

boreal iron
#

There’s no development branch

#

No@risk no fun you know

wheat mesa
#

Fake suggesting the new stone tablet for collaboration

boreal iron
#

Im just… meh don’t like to use a new editor utilizing GitHub and so on

#

Now you’re making fun but.. but but you will understand in 10y

ancient nova
boreal iron
#

lmao

#

Aye wait for it to drop

#

You can never know maybe it will happen exactly like I said freerealestate

sharp geyser
#

I wouldnt be surprised if fake enjoys stone tablets

#

He's ancient

boreal iron
#

Misty…

#

FakE doesn’t even have a tablet

#

So take this

ancient nova
boreal iron
#

Also tf im ancient? Im Young and fresh buddy

sharp geyser
#

I don't think you should ever put young and fresh in the same sentence ever again

oak cliff
#

whats the standard "how big should a file be" before splitting it into subfiles

sharp geyser
#

Depends on what you're doing

oak cliff
#

my bots gonna have a settings command that has like 8 subcommands, should i make them each have a file or just keep it all in one settings.js file

sharp geyser
#

I would

ancient nova
#

keep it all in one file imo

sharp geyser
#

If they are slash commands especially

#

You can definitely split em up

ancient nova
#

joe1 joe2 :joe3:

sharp geyser
ancient nova
boreal iron
ancient nova
#

my biggest command is 24kb

boreal iron
#

Since it’s literally the config command

sharp geyser
#

Yes but I'm assuming xiuh is using slash commands

lyric mountain
sharp geyser
#

So it's out of the question when discussing that

ancient nova
#

acc scratch that it's most likely more

boreal iron
lyric mountain
#

Which can be split into multiple files with different categories

wheat mesa
#

One command one file is the rule of thumb for me

oak cliff
#

my old settings command (pre-rewrite) is 759 lines KEKW

wheat mesa
#

Definitely split that up

sharp geyser
boreal iron
#

Yeah I got Isle 500, too

oak cliff
#

36Kb in size

boreal iron
#

But it’s still one command

wheat mesa
sharp geyser
#

Oh sorry misunderstood

wheat mesa
#

That includes subcommands

oak cliff
#

oh so you have each subcommand has its own file?

sharp geyser
#

Yea

boreal iron
#

Oof

sharp geyser
#

That's a given

boreal iron
#

No imo

oak cliff
#

i wasnt doing that

sharp geyser
#

Wtf

#

So you want all 8 commands in one file fake?

#

That's asking for a headache

spark flint
#

I don’t for subcommands

boreal iron
#

SUB commands

#

Yes

spark flint
#

Because subcommands aren’t commands

sharp geyser
#

No

#

That is dumb

lyric mountain
#

I mean, internally there are only commands

spark flint
#

Each command has a file

oak cliff
#

so im getting that this is personal preference KEKW

lyric mountain
#

Different code, different cmd

boreal iron
#

Since you can also do sub command groups and again sub commands of them

boreal iron
#

How would you organize this?

sharp geyser
#

But I still feel it's smarter to split your sub commands up as well

boreal iron
#

Just a total mess

sharp geyser
#

Easier to manage

lyric mountain
#

You can also put all related commands in a folder

#

So you have everything grouped

oak cliff
#

subcommand handler why_ducky

sharp geyser
#

I'd rather go to the specific file for the sub command than look through 800 lines of code

boreal iron
#

And so on

sharp geyser
#

This is why I love detritus

boreal iron
#

Nesting goes even deeper

sharp geyser
#

Makes life easier

oak cliff
#

hold on i dont remember the difference between sub commands and subcommand gorups

lyric mountain
#

Levels

sharp geyser
#

I don't either so it's fine

lyric mountain
#

command subgroup subcommand

#

Or command subcommand

#

Or just command

sharp geyser
#

I just call that grouping

boreal iron
#

Listen to old farts not the young people KEKW

oak cliff
#

wait can you have multiple subcommands in a subcommand group?

boreal iron
#

They are inexperienced

sharp geyser
#

Ever heard the saying the young are replacing the old?

oak cliff
#

why not just use choices mmlol

sharp geyser
#

You better watch out fake

lyric mountain
#

I mean, in the end subcommand or not, they'll all be treated as separate in ur code anyway

sharp geyser
#

Well I'ma head out

#

I'ma read manga

boreal iron
oak cliff
#

just make like 8 choices 5head

#

gonna have 8 different switches in my code WATCH OUT

sharp geyser
#

Just make 1 command that displays a select menu that executes the commands for you

#

Then you don't need all those slash commands

oak cliff
#

okay so if i wanted to have subcommands in their own files
would i put the handler in the main command file (so, settings.js) or do i need a handler in my interactioncreate event (command.js)

boreal iron
#

The issue with choices is that you can not register other command options based on the choice you did

#

They are static

#

If you could that would be amazing

lyric mountain
#

Aka "context-based arguments"

boreal iron
#

Like choosing /config -> choice (channel) -> now showing channel options for the command

#

Parameters

#

Yeah

lyric mountain
#

The only thing both me and tim are waiting for them to add

#

Who tf only have 1 signature for commands?

boreal iron
#

I doubt discord will give us that many flexibility

lyric mountain
#

I just stick to message commands until they do

boreal iron
lyric mountain
#

My cmd handler allows me to simply convert msg commands to slash whenever I want anyway

boreal iron
#

2032 no message content for kuhuwakakabange but still using chat commands

#

Oh great

#

Internet dropping again okeh

lyric mountain
#

Network coverage when driving ain't good

boreal iron
#

For real

#

I hate it

#

dot dot dot country

#

_slurs forbidden nowadays _

#

In PHP backed enums use the keyword case to specify their items, how are the items - of the JavaScript equivalent constants - actually been called in JavaScript?

#

Also just items?

lyric mountain
#

Enums in js?

#

In js?

boreal iron
#

My gosh constants freerealestate

#

Nvm what I tried to explain actually is an immutable object

#

Got it

#

JavaScript still confuses me

#

Back to my lovely PHP

near stratus
boreal iron
#

Yeah… ik

#

Not only JavaScript is confusing sometimes, English is too

sharp geyser
#

Well than it's doing its job

earnest phoenix
#

welp, my ID verification stalled. i dont know javascript at all. people can just use manycam/obs etc to fake the video feed and bypass the system. damn.

lament rock
#

Do you have examples of this. I am seriously debating making a package which offers a malloc and free function

wheat mesa
#

I mean that doesn't sound like it would be too terribly hard if you think of a buffer as just a slightly higher level strip of memory tbh

winter pasture
#

Please keep this chat English, non english convos can go in #general-int
However I am not aware of any french staff

hidden gorge
#

it was working before and then this happened

#

we can’t figure it out

winter pasture
boreal iron
#

So make sure to check the channel type and exclude DM channels

hidden gorge
boreal iron
hidden gorge
#

I am a dumbass

boreal iron
#

you’re still executing something in a DM channel which doesn’t work in there

hidden gorge
#

yeah i just realized that

boreal iron
#

I would guess you can’t delete the initial message of the user you get

#

At least not in DMs

hidden gorge
#

yeah i just noticed my friend didn’t enable Message Content Intent on the portal

boreal iron
#

But still, line 17

#

If this is the message the user has sent to your bot (in a DM channel) you won’t be able to delete it

#

You can’t remove messages of others in DM channels

quartz kindle
#

idealy you would create some sort of paging system with multiple fixed length buffers or something

whole knot
#

I need some advice... I want to restructure my bot commands and wanted to implement more "autocomplete" for certain commands to reduce the amount of commands in general

I thought about the following member [ban, kick, hackban] or ticketrole [add, remove]. Would you consider this user friendly or should I just leave the normal ban, kick... commands as they are?

#

My concerns are that people will not find certain commands anymore but since we also have native Discord moderation commands I would also not need them in my bot anymore

boreal iron
#

Well as long as they're a slash commands they can be found at any time

#

/ban will also list all sub commands or parts of command names including the name

whole knot
#

Through, if I put all the moderation commands into a member command however, it may be hard 🤔

boreal iron
#

like /member ban /bannable whatever /fake banner

#

Since sub command grouping in the UI isn't a thing yet, they will still be displayed as single command once you start to type

#

no matter it's just /ban or a sub command like /member ban

#

all will show up

whole knot
#

Yeah, it is mostly not about sub commands, more about autocomplete, maybe I described it in the wrong way 😅

boreal iron
#

autocomplete?

#

oof

#

I would consider using choices then

#

The issue with that is something we have discussed yesterday

whole knot
boreal iron
#

You can not specify parameters (command options) dynamically for the choice the user made

whole knot
#

You got a point there, yes 🤔

boreal iron
#

For example:
/member ban <reason> <time>
/member kick <reason>

#

When ban and kick are choices, the other command options aka paramters are not dynamic

#

They're static when registering the command

#

That's the major issue of choices tho

#

BUT

winged temple
#

or option

boreal iron
#

In this example it was choice

whole knot
#

They only thing I see problematic is that commands.Param, in this case my choices, can only be at the end as an argument as far as I remember 🤔

winged temple
winged temple
whole knot
#

Or maybe it was just the case when they were None as default, need to test that

winged temple
boreal iron
#

that's the issue

#

we're talking about

#

where choices are not meant to replace sub commands

winged temple
#

well you could just like leave it and not respond to the option

#

would be ur only option

boreal iron
#

yes but that's not really user friendly

whole knot
#

Well, it is always only one command including a reason that is by default None so there should not be a problem

boreal iron
#

once a command option is required you will have to enter it for any other choice, too

#

for example if <time> would be required for the ban choice, you will have to specify it for the kick choice, too

whole knot
#

time could be optional in your case, if I understood you correctly

#

And if you don't want to offer a time for some commands, simply return an error or something 🤔

boreal iron
#

Yeah but the longer the command gets, the more options it has, the more confused the user will be

whole knot
#

True, good point, though I would not consider 1/2 options as long

winged temple
#

but if you’re gonna do that for all of ur commands

boreal iron
#

Imagine you now use /member kick -> the following options also appear since you need em in other choices <time> <channel> <length> etc.

whole knot
#

Only if you have a command named thisisagoodcommand

winged temple
#

it’s gonna be messy

#

you could just keep them as sub commands

#

cus whenever you type /member

#

both the commands will appear

boreal iron
#

that's where we were at the beginning

whole knot
#

Nah, don't want have it for all commands, just for those that you can put together

winged temple
#

and won’t create confusion

boreal iron
#

it currently the only way

#

even if it will pop up a huge amount of commands

winged temple
#

when options signed to a choice??

whole knot
#

I guess I will start of easy and see the effect of having it on one command

winged temple
#

I hope they add that

boreal iron
#

Something you can also do is:
Have your /member command -> then the choices as option /member <kick/ban/mute> -> then open a modal once the choice is selected

#

then specify and show the required fields

#

that's what I do for a few /config commands I literally just need to enter some text

#

I will show you an example

whole knot
#

Which I would consider too much as I feel like moderation commands should be easily accessible 😅

#

But yeah, for a config command this is super cool!

winged temple
#

making config commands always end up in a mess cus of this issue

#

imma have to steal that idea from u

boreal iron
#

well tbh if moderation commands should be accessable quickly, then categorizing them as sub commands might not be the best idea tho

whole knot
#

Yeah, that may be correct

boreal iron
whole knot
#

I guess I will just keep them this way and start off with other commands

winged temple
#

I give credits don’t worry bro!

whole knot
#

Only command I use modals right now

#

Still waiting for the dropdown support on mobile

boreal iron
#

the issue with modals still is, that you can't define different field types

#

and literally need to verify each text input

whole knot
#

Or pre-set some fields...

winged temple
whole knot
#

Dropdown in modals, sorry

boreal iron
#

this feature is NOT supported or announced yet

#

just in testing

whole knot
#

discord.py already has this feature but you can only see them on desktop

winged temple
# whole knot Only command I use modals right now

with that, how do you do the long text? I’m working on a command that will alert all servers owners incase there’s an issue with the bot, so we can do like /notifyusers, it will then open a model where you can send a msg, but I need like a large text so I can actually use spaces n stuff

boreal iron
#

well you can also build em with djs but without using the builders

winged temple
boreal iron
#

but the field is realtivelly small

whole knot
winged temple
whole knot
#

short, paragraph, short

winged temple
#

what library do you use?

whole knot
#

I use disnake/discord.py

boreal iron
whole knot
#

It should not differ that much if you use another library though

#

And the HEX field is a little more complicated, a friend of mine helped me there

winged temple
whole knot
#

My library did not support Color.from_str so I had to build that in myself kek

winged temple
#

rip

whole knot
boreal iron
#

modal raw object example:

        {
            title: "modal title",
            custom_id: "custom_id",
            components:
            [
                {
                    type: 1,
                    components:
                    [
                        {
                            type: 4,
                            style: 2, // text area
                            custom_id: "value",
                            label: "field label",
                            placeholder: "some text here",
                            min_length: 5,
                            max_length: 400,
                            required: true
                        }
                    ]
                }
            ]
        }
winged temple
#

I use builders 😉

#

makes life easier

boreal iron
#

lol

whole knot
#

I am never looking at the developer docs of Discord, they look so complicated 😢

boreal iron
#

actually makes life way harder but yeah

winged temple
whole knot
#

Once you have a style, you will always adapt to it lul

winged temple
#

mostly cus I’ve always used it tho

boreal iron
#

once the next djs version removes random guards and methods as well as renames them and the builders, you will understand me

#

also writing the raw object is a lot shorter

#

but yeah... my fight against builders will never end

winged temple
#

xdd

#

so if I said I use slashcommandbuilder for my commands

#

would you be pissed?

boreal iron
#

ok... im going to try a different strategy

#

NO I WOULD LIKE PLEASE USE EM

#

PLEASE OR YOU WILL MAKE ME SAD

winged temple
#

slashcommandbuilder good

boreal iron
#

mission failed

winged temple
#

:KEWK:

#

bru

boreal iron
#

tbh I tell you what, a slash command builder makes actually no sense as soon as you write a handler for it anyways

winged temple
#

does that emoji load for u?

#

cus it ain’t for me

boreal iron
#

nope

winged temple
#

wtf now

winged temple
#

but I’m too lazy to change from builders to raw shit

#

too much to change

boreal iron
#
module.exports =
{
    name: "vote",
    description: "Get informations about our most active supporters and how to vote for us.",
    descriptionLocalizations:
    {
        ...
    },
    options:
    [
        {
            type: 1,
            name: "info",
            description: "Show a list of links where you can vote for our Discord bot.",
            descriptionLocalizations:
            {
                ...
            }
        },
        {
            type: 1,
            name: "toplist",
            description: "Show a list of the most active voters supporting this project.",
            descriptionLocalizations:
            {
                ...
            }
        }
    ],
    guilds: ["..."],
    scope: ["global", "guild"],
    async execute(interaction, app, locale)
    {

For example, this the structure of a command module
I don't need builders anywhere and I can access each property nicely when calling the module

#

I just need to write the raw options array and the objects inside