#development
1 messages · Page 14 of 1
i putting footer already
Also .avatarURL seems to be a method not a property
So it’s avatarURL()
See this:
What to do in not being called?
You called it anti fish...
You applying for verification? Your bot stores data about every command run.
replace message.user.avatarURL by message.user.avatarURL()
done and not working
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
There aren’t any line number in code blocks
Which one is it
Hard to figure out on mobile
.setAuthor(message.author.username)
how do I apply for intents in the application?
what intent I need
why I need it
and a code snippet
right?
Well then author expects an object, too
{ name: "author", icon_url: "icon" }
I think an author also supports a “url” property to turn the headline into a link
You mean I have to do this?
{ name: `${message.author.username}`, icon_url: `${message.author.displayAvatarURL()}` }
Pretty much
Wait... they dont have an example?
or a best practice for application?
Yeah
Check the checkbox and the questions to answer will pop up
nice, username is working and avatar not shown
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
Takes you so many chars to explain why and what needs the member details (for)?
how should i overwrite this class i want be the exact same css atributes in whatever occasions
@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
i tried !important in the width & height but i doesn't work
why ?
That has to do with your position property
bro .
D:
A percentage always is relative to it’s parent
The absolute position however makes the width don’t work in your case
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
Could also be possible !important has been assigned before on that element already means another !important won’t overwrite ot
no i didn't assign anything
You need to get the message.mentions containing the mentioned users, channels etc
Width doesn’t work in that context then, try using left: 0; right: 0;
TypeError: Cannot read properties of undefined (reading 'tag')
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 }) })
It’s still the message.author not message.user
messages don’t have an user property but author
This is how he did not summon the Mentioner
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
How do I disable the reply with a mention?
need a just reply
without mention
Hello, could someone explain how can I make discord.js buttons that will be available all the time and even when bot is restarted?
By specifying the allowed mentions as option in your reply method
reply({ content: “…”, allowedMentions: { repliedUser: false } });
or
reply({ content: “…”, allowedMentions: { users: [] } });
store something you can use to resume into the custom id
like a function if it's small enough
you can also just use send(…) to send a message into the channel
It just won’t be shown as reply
Patience is all you need 
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
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.
And then I should do
client.on("interactionCreate")
right?
slash commands, buttons, select menus, modals? Yes.
yes?
Yeah, I see, that works. But it still shows "This interaction failed" even when the code is executed.
interaction.reply()
Only way to stop that
or deferReply() in the thing setting up the button and editReply() once resumed.
bcuz ur either not deferring or doing nothing

Responses time out if you dont defer or reply.
I did console.log()
thats useless to discord lol
console log isn't defer
Replying or deferring isn't the only way to stop that though
Just to check it out 😉
interation.deferReply() then when you handle the interaction do interaction.editReply()
It all depends on what they are trying to do
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.
They might not even need to defer the reply like that
I just need to bot dm the person and await for response when they click the button.
then js interaction.reply({content: "Message sent to user and awaiting reply", ephemeral: true});

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
through interaction.reply() again lmao
buttons are just interactions with type being button
I know
how is Daki a blocked host?
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.
"reputable" really who gon care where a bot is gonna be host?
And they give you reasoning what makes a host reputable.
yeah daki has all of that
Discord
Well Daki clearly doesn’t meet discords requirements
Uptime, data handling practices of the hosting provider, hosting redundancies.... Regional hosting law comliance...
Well it says that it must have support outside of discord
Not using a discord server for support
Well you can, just you need a backup non-discord support option
is there a different free host I can use then
Like email helpdesk
Did you not notice us saying solely
It has no other option
Daki is pure discord?
Yes
Like not even a webmaster email?
If you click it's support link it just goes to discord
Not even an email publicly displayed
I...
I am suddenly regretting using her bot lol...
I think Daki might be a reseller service.
?
And a poorly thought out one.
Idk anything about a bot
I just know it's a hosting service for bots to use for free
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

Daki is a free bothost...
Then don't get verified
its not a VPS reseller or anything...
I don't know of any "free" hosting that will be acceptable to discord
saying I daki is faster than a VPS I paid for
BS
bro what I legit verified a bot hosted with mobile bot creating thing like 4 years ago
Digital Ocean, Azure, AWS... Hell even Hostinger.
All of them have lightspeed VPSs with 2gb ram that are faster than Daki.
I verified a bot that Imade on my phone with bd script
?
and I can't verify a fully working bot I spent countless months on cause I use a different host than they like??
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.
that "free" host was literally faster than the the thing I previously hosted my bot with, which wad paid
I can
Name the provider.
I can choose cpu speed, ram and storage
Why are you guys even arguing in the first place breh
You say it was slow. I want to check it out.
it was eithe repl, or glitch or something else shitty. And I was paying for that, and it was slow as fuck
Cool so you used a smaller named hosting provider for cheaper costs and got what you paid for.
Bae you can search for a free hosting if you want but I doubt you'll find one that's good enough for discord.
?? I use Daki because it's free and it's way faster
replit/glitch/heroku are sooo not worth the price
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.
it took seconds for my bot to respond to a command
And I know azure is supported by discord.
discord supports every host afaik
u couldn't have created an account in that time
honestly thats not a very good metric to follow
its much more influenced by latency/network than anything else
they literally said my host isn't good enough for them
Since I read your deny message I started making one lol.
they didn't even check the website out probably
responded seconds after I submitted
what are you using? 👀
lmao
the heading is why they denied you
nope, it's because nothing is completely free
free doesn't go hand in hand with reliable
the actual panel is a ptero 2.0 panel
what are the odds its using hetzner?
wasn't hetzner blocked for discord bots for some abuse 👀
it is free unless u want more specs on ur servers
Because they can pull SEO about a site and have reviewed that host in the past and added it to a blacklist.
it uses pterodactyl
Seems to be
Its sketchy
it literallt uses pterodactyl
hetzner is a vps/server provider
I had to stop an antivirus block at firewall level to allow it to download the test document from my servers...
the trinity of service is
GOOD
/\
/ \
FREE ---- SAFE
it can be used with pterodactal
my bot never been down once since I started hosting on daki
you can only have 2
Hosted in Germany by chance?
lol
alright gonna try a different vps, I got another one
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)
Only get germany as options.
(d.js 14)
Thats if you wanna filter by type yes
if it works for you, you could've just lied about hosting providers
i want to have a different file for Buttons, ChatCommands, Select Menus
i dontthink .type gives me that?
use interaction.isCommand
im just confused where to look
You simply filter interactions by either the custom ID or command name which flags then either as command or component interaction.
how do i check if a member has admin perms in djs v13?
look up the interaction event and use that to finid how to filter 100% for your needs
bruh imagine 8 didn't save my application
u could use the custom ID to specify the type
^ custom id's is how I did it
like, reserve first line for type declaration
is js message.guild.me.permissions.has("ADMINISTRATOR") a valid method to use?
im not sure what you mean by custom ID exactly
use the enum por favor
It’s easy to check if an incoming interaction has a custom ID or command name, both at the same time isn’t possible
That make it a perfect way to filter the type
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 
Each non-command interaction such as a button or select menu interaction requires a custom ID
Command interactions don’t have that
oh i see what you mean
And you can not specify that either
it can be anything you want as well
I mean... .type works
I typically make my custom ids specific to their purpose e.g "banButtonYes"
InteractionType doesnt respond with Button or SelectMenu or ChatInputCommand
What do you wanna filter em before?
I want to have like an event handler but instead of events, its for interaction types
The first thing you wanna know is, is, is it a command or component interaction
Aren't buttons and select menus classified under type 3?
how i get user last voice seen?
MessageComponent is buttoins and select menus yes
Which is MessageComponent
message componenets?
BUTTON/MENU/COMMAND
...rest of the id
but then id need to filter them again right to seperate the buttons from the select mnutes
menus*
then grab the id and read the first line
yep .type is just an enum of the type it is
Yes there are only commands or components
@boreal iron bro how i get user last voice seen?
Can’t help you with voice related stuff
so slash commands being ApplicationCommand, buttons MessageComponent, Select Menus MessageComponent etc.
ah i think i gotcha now
So yes, you can filter it before that code you shared with .type on interaction/
how i get user invites Count 🙂 😂
If you wanna filter further I'd look at custom ids
okay thanks 
What way do you mean?
Just make sure your custom ids are descriptive and you can filter pretty easily after that
How many users joined using an invite or how many invites a user made?
how many invites a user made?
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
get from cache or fetch direct from the manager any invites with the userID being that of the user
That’s a nicely sorted system and you keep anything in your modules, sorted
Actually no... Invites dont store the userID of the user that made them?
.inviter
Not being delayed until noe 
It gives you the user who made the invite
@hard wraithDo you know how to summon the last seen member in voice calls?
doesnt help when fetching all invites from a guild by userID
🤷♀️
the .fetch accepts channelID not userID
IIRC It’s called application interactions, was looking into them the other day
Also commands but context menu commands or something like that
Then give it a channel ID 5head
which InteractionType would they be considered 👀
Could fetch all invites in a server and filter the response.inviter for the ID?
Tbh I wouldn’t go with the interaction type to sort things
Just an hassle you can avoid
idk im tired aint been sleeping good so ima clock off.
should i just use this then 
Its what we use mostly lol
Like I said there’s either a commandName property available OR a customID which already specified the interaction type
Depending on how they are trying to fetch the invite they could just use the invite code
And then they'd easily get the correct user
They want for User not invite code.
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?
They want the user who made the invite no?
basically?
Yes either a command or the rest
interesting
The rest are all components
the DJS guide might be better to learn from...
They have an example command handler, button handler etc.
the d.js guide doesnt really go into sorting like this
i dont want a handler for each one individually
Djs guide is a joke
yeah, the djs guide is extreme basics
They don't even show the efficient way to do it
Im not arguing its a joke... but you can use interactionFolder/Type in the handler...
True
using their basic handler example to sort that way.
Makes it more confusing for beginners than helping
always start with a basic example and build off it to your needs.
And it's extremely inefficient as well
Fair point.
It's just stomping on their foot rather than helping
As well as doesn’t even point out the accurate registration process and when to use it and when not
Im also pretty sure half the guide needs a re-write as they are still pushing v13 methods in the v14 guide lol
That's a given
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
Like i said here?
most users wont know how to do that
You need more than just the rest API to make a bot
not anymore
thats why djs made a basic how to guide on their lib
Wym?
Interactions don’t require a gateway connection anymore
which is amazing
never did
But how is the bot supposed to go online
What do you think the DJS library uses?
it doesn't
👀
every method in DJS just converts to a rest request.
everything is RESTful
I mean I guess interactions make sense as it is essentially a webhook
you dont even need a bot anymore, you can just add the commands to a server
But you can't receive events can you?
if you don't use the gateway, discord will hit your webserver with a REST request and you respond back
do this server help for developing bots aswell?
So like I said, express.
I'm talking about like guildMemberAdd fake
thats not the question
thats just a restt event type
sent in via the webhook
You can’t use events without a gateway connection
Yea so
DJS is just a handler library for the discord rest api
Either interactions, a gateway connection or both
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
Yes
literally says so in the discord api docs...
or give roles, interact with the server in anyway right?
So basically I learned something new but it was unrelated to what I was talking about gotcha
But not any bot needs to receive the events tho, Misty
Just some are there to respond to your interactions
Sure you're completely right
But a lot of people still rely on events
you still get events!
So my point still is valid
How the hell are they going to send events in real time
Guess I didn’t see what you wrote in the first place
https://discord.com/developers/docs/intro literally talk about recieving events in this.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
I've read the API docs many times my g
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?
I make rest APIs at work and node libraries to handle it...
and you can do the same with express...

or any alternative
When calling my nickname if I don't have a nickname to type the name?
I'd never use express to make a gateway connection
a gateway connection is basically just a webhook endpoint.

right because the events recieved arent handled like a webhook handles them...
It’s happening again
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
lmao
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?
At this point I don't know if this guy is just dumb or trolling
Let's change topics maybe
you can have a bot without gateway
Sure
Finally someone with a brain.
if you only use interactions
Can be done with webhooks!
Remember yesterday 
I feel like your brain is so fucking tiny it's not even noticeable at this point
Mate you are seriously retarded...
be respectful please
I'ma just leave this conversation before I get bopped
thank you misty

the webhook is only for interaction events, it doesnt include the other stuff like guilds, channels, messages, etc
<3
-m 415067295715557376 using slurs | 2d
JCoDog#0001 was successfully muted
I love you
I'm going on a walk
Have a nice walk!

Hope your pregnancy is going well as well
It is! 
Good good
Right, a gateway connection is still very important if you wanna interact with discord beyond interactions
Although you do say you receive interaction events does that include the interaction create?
Yes still
isnt interaction create the only interaction event there is?
I think he means you still receive it as event using a gatewa connection
Not as webhooks
Idk maybe
Can you actually separate both?
I don't fuck with interactions at that level

like all interactions kinds are inside the same event, the INTERACTION_CREATE event
thats what you receive via webhook, if you opt for it
you cant receive them in both places tho
No need for a gateway connection for that if it's webhooks
once you setup a webhook url, you stop receiving interactions via gateway
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]
}
)
},
};
Hm?
Yeah so you can separate them to an existing gateway connection
What errors are you facing
Shh I’m trying to ignore
attachment not sending
Well I don't use v14 so fake you're up
ahh lemme downgrade 
One second lemme look
Texting while driving
Shhh
Don't recommend
That’s allowed in my state
I call cap

Oh I forgot Tim is here
I recommend its way different from v13 
This aint the 1950s anymore where you can do anything while driving
did you read the v13 -> v14 guide?
@quartz kindle do my job bitch I payed for your ass
lmao
Until v13 gets deprecated

I did I got confused 
How

did you read the section about the builders?
there is no MessageAttachment anymore
its AttachmentBuilder
I wonder does the v9 gateway gets deprecated in a month or do they update it to not send the message content anymore?!
Probably deprecated
I wouldn't be surprised
Discord just does what they want at this point

Well true
the default version is still v6 lmao
lol
Ohh thank you
When message content intent gets required they might just deprecate every version before v10

Probably yeah
Didnt see it but anyways ty hope it works
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
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
Not with properties being null

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
Slash Commands in V14 so bad compared to V13
Still without long requested features app commands and components are actually quite nice and easy to use
Once you get to it
ther are other alternatives lol
Ik but I enjoy Javascript 
:^)
I dont want to search up too much
That is if Tim updated to v10
there are other js alternatives
i did, but its literally just changing the default number
theres nothing to change about it in the lib
Warning: shameless ads incoming
Not an ad if I mentioned it
I just like tiny discord
djslight is sill v13
still dont know if ill even make a v14
Shame on you
v14 still doesnt let you turn off channel cache tho
Make Discord's airhorn bot burn
shame on them
Tim hasn’t enough projects already
Why the fuck you trying to make Tim do more work
At this point his api won't come until 2040
:(
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
Not going to mention that I’m working 12h 6d a week
Which limits anything even more
Life is just pain
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
So yeah that’s pretty much it
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 😭
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 
Min and max values property
Touched by accident?
Max is 1 by default
Yeah if you wanna have multi select you need to define max other than the default
Which is 1
😭
Breaking changes
Renaming all builders back to what they were called before
Because to many people complained

Did the max value fix the issue?
yea
But wouldn’t somehow not make sense
Don’t really know GitHub much…
Why would that be the case?
idr what the issue was but i pushed the code before i tested it and it br0ke
now i test locally before pushing 
lol
Fake suggesting the new stone tablet for collaboration
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

okay maybe v15 is gonna be okay then 😩
lmao
Aye wait for it to drop
You can never know maybe it will happen exactly like I said 

I don't think you should ever put young and fresh in the same sentence ever again
whats the standard "how big should a file be" before splitting it into subfiles
Depends on what you're doing
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
I would
keep it all in one file imo
:joe3:
That's just asking for a headache
that's what I usually do 
I personally filter by the command name as i explained before, so I keep my sub commands in the same file
my biggest command is 24kb
Since it’s literally the config command
Yes but I'm assuming xiuh is using slash commands
I always put one command per file, and shared functions in a helper file
So it's out of the question when discussing that
acc scratch that it's most likely more
yeah I’m, too
Which can be split into multiple files with different categories
One command one file is the rule of thumb for me
my old settings command (pre-rewrite) is 759 lines 
Definitely split that up
You wanna put 8 commands in one file?
Yeah I got Isle 500, too
36Kb in size
But it’s still one command
No? I said one command one file
Oh sorry misunderstood
That includes subcommands
oh so you have each subcommand has its own file?
Yea
Oof
That's a given
No imo
i wasnt doing that
I don’t for subcommands
Because subcommands aren’t commands
I mean, internally there are only commands
Each command has a file
so im getting that this is personal preference 
Different code, different cmd
Since you can also do sub command groups and again sub commands of them
Essentially yes
How would you organize this?
But I still feel it's smarter to split your sub commands up as well
Just a total mess
Easier to manage
subcommand handler 
I'd rather go to the specific file for the sub command than look through 800 lines of code
Then consider a sub command group -> sub command handler, too
And so on
This is why I love detritus
Nesting goes even deeper
Makes life easier
hold on i dont remember the difference between sub commands and subcommand gorups
Levels
Listen to old farts not the young people 
wait can you have multiple subcommands in a subcommand group?
Ye
Ever heard the saying the young are replacing the old?
why not just use choices 
You better watch out fake
I mean, in the end subcommand or not, they'll all be treated as separate in ur code anyway
You will quickly notice you can’t reall combine them with other options
Just make 1 command that displays a select menu that executes the commands for you
Then you don't need all those slash commands
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)
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
Aka "context-based arguments"
Like choosing /config -> choice (channel) -> now showing channel options for the command
Parameters
Yeah
The only thing both me and tim are waiting for them to add
Who tf only have 1 signature for commands?
Well I’m, too but since this probably won’t happen I moved to sub commands again
I doubt discord will give us that many flexibility
I just stick to message commands until they do

My cmd handler allows me to simply convert msg commands to slash whenever I want anyway
2032 no message content for kuhuwakakabange but still using chat commands
Oh great
Internet dropping again 
Network coverage when driving ain't good
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?
My gosh constants 
Nvm what I tried to explain actually is an immutable object
Got it
JavaScript still confuses me
Back to my lovely PHP

Well than it's doing its job
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.
Do you have examples of this. I am seriously debating making a package which offers a malloc and free function
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
Please keep this chat English, non english convos can go in #general-int
However I am not aware of any french staff
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
it was working before and then this happened
we can’t figure it out
Mac 
We don’t talk about Mac these days, he has left the world of CMs and ascended beyond to Team member
Whatever action you’re doing it can’t be executed in a DM channel as the error message says
So make sure to check the channel type and exclude DM channels
lmao
the bot is made for you to dm so you can talk to someone to help you
You mean like he isn’t available for us normal people anymore? 
I am a dumbass
you’re still executing something in a DM channel which doesn’t work in there
yeah i just realized that
I would guess you can’t delete the initial message of the user you get
At least not in DMs
yeah i just noticed my friend didn’t enable Message Content Intent on the portal
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
its not that simple considering buffers cant be resized. the easy way would be to create a different buffer for each malloc, but that wont be memory efficient because the buffer instance has a lot of overhead
idealy you would create some sort of paging system with multiple fixed length buffers or something
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
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
Through, if I put all the moderation commands into a member command however, it may be hard 🤔
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
Yeah, it is mostly not about sub commands, more about autocomplete, maybe I described it in the wrong way 😅
autocomplete?
oof
I would consider using choices then
The issue with that is something we have discussed yesterday
You can not specify parameters (command options) dynamically for the choice the user made
You got a point there, yes 🤔
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
ban being the sub command?
or option
In this example it was choice
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 🤔
but can you set stringoptions to a specific choice?
wouldn’t the <time> also be available for kick?
Or maybe it was just the case when they were None as default, need to test that
that’s an issue I had
yes the command option is static since it's registered
that's the issue
we're talking about
where choices are not meant to replace sub commands
well you could just like leave it and not respond to the option
would be ur only option
yes but that's not really user friendly
Well, it is always only one command including a reason that is by default None so there should not be a problem
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
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 🤔
Yeah but the longer the command gets, the more options it has, the more confused the user will be
True, good point, though I would not consider 1/2 options as long
but if you’re gonna do that for all of ur commands
Imagine you now use /member kick -> the following options also appear since you need em in other choices <time> <channel> <length> etc.
Only if you have a command named thisisagoodcommand
it’s gonna be messy
you could just keep them as sub commands
cus whenever you type /member
both the commands will appear
that's where we were at the beginning
Nah, don't want have it for all commands, just for those that you can put together
and won’t create confusion
when options signed to a choice??
I guess I will start of easy and see the effect of having it on one command
I hope they add that
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
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!
making config commands always end up in a mess cus of this issue
imma have to steal that idea from u
well tbh if moderation commands should be accessable quickly, then categorizing them as sub commands might not be the best idea tho
Yeah, that may be correct
I guess I will just keep them this way and start off with other commands
I give credits don’t worry bro!
the issue with modals still is, that you can't define different field types
and literally need to verify each text input
Or pre-set some fields...
not a thing yet? wtf
Dropdown in modals, sorry
discord.py already has this feature but you can only see them on desktop
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
well you can also build em with djs but without using the builders
I believe there’s a module for that
the text area supports new lines
but the field is realtivelly small
TextInputStyle.paragraph should be your thing, at least for my library
for example, the top field, what would that be called, and the middle would be called?
oh kk
short, paragraph, short
what library do you use?
I use disnake/discord.py
https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles or simply INT 1 or 2 if you build the object without using a builder
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
isn’t that almost the same thing but with a short field? or is the issue getting the hex code
My library did not support Color.from_str so I had to build that in myself 
rip
When it comes to this: Issue with getting the HEX code
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
}
]
}
]
}
lol
I am never looking at the developer docs of Discord, they look so complicated 😢
actually makes life way harder but yeah
not for me
Once you have a style, you will always adapt to it 
mostly cus I’ve always used it tho
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

ok... im going to try a different strategy
NO I WOULD LIKE PLEASE USE EM
PLEASE OR YOU WILL MAKE ME SAD
slashcommandbuilder good
mission failed
tbh I tell you what, a slash command builder makes actually no sense as soon as you write a handler for it anyways
nope
ok true
but I’m too lazy to change from builders to raw shit
too much to change
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




