#development
1 messages · Page 1989 of 1
discord.js has no attachment support yet so cringe
old email MIME attachments ptsd
more than a month
5 week+ wait atm
Verification? Around 2-3 weeks.
Message intent? About 2 months
You can put the tos in ur repo or a new public repo if urs isn't
The idea is that it's readily available to anyone wanting to read it without having to join servers or login to sites
Ye
Took about 3 emails
2 where they kept asking for info that I already supplied on the form
The third they finally sent someone that's not an intern to process my intent application
Will she still answer me?
Is it for message content?
To supply a privacy policy and valid reasons that justify me getting the intent
At least in my case
Those thing which were already present in the form
Very simple why do you need this
You dont need message content intent for this
You can use slash commands they will tell you so
I have message content intent 
Anything that don't require user interaction or can't be converted to slashes
For example, in my case, they're are: custom answers, anti-spam/raid/link and interactive games (crisscross, reversi, tcg, shiritori, etc)
There are probably more, but those are the ones I remember
Leveling isn't a valid reason
Because they can still work even without message content
You just need to know whether an user sent a message, not what they sent
As for games, any interactive game is valid
Cuz they can't be slashed
Any game where it doesn't end after the command is sent
Like, in board games you'd send more messages after the initial command
Those which cannot be counted and making one command for each move would be ridiculous
Take chess as an example
For board games? Unfeasible
I think it would work quite nicely
And modals would close the moment the user refreshed the page
You CAN make them work with interactions yes, but the amount of work to make them slightly as convenient as with actual messages is absurd
What if users want to watch the match? What if it's an in-server tournament?
tournaments on sites are going to be used 99% of the time anyway
I'd say closer to 40% based on my observations
People like to host event on their servers
It gives socialization opportunities to server members
Why i keep getting js client.users.fetch(...) is not a function
So I've used this query before on other things in my user table but oddly enough I'm receiving an error this time and I'm honestly unsure why
await db.query(`UPDATE user SET commands_used WHERE userid = ${message.author.id}`, [commandsused[0].commands_used + 1])
"error": [
"Error: (conn=30144, no: 1064, SQLState: 42000) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE userid = 160679942319767552' at line 1",
"sql: UPDATE user SET commands_used WHERE userid = 160679942319767552 - parameters:[1]",
]
My user ID does indeed match.
https://scs.twilightgamez.net/cYabz.png
That doesn't make sense
await db.query(UPDATE user SET commands_used = commands_used + 1 WHERE userid = ${message.author.id})
I'm using node mariadb, and the whole , [] thing is proper
but ill try urs out a sec
It's not, you can also provide an empty array
I see
await db.query(UPDATE user SET commands_used = commands_used + 1 WHERE userid = ${message.author.id}, [])
would it be then
I'll try it out 🙂
lol
did you read the error..? You didn't provide ANY code, we have nothing more to work off of than you do at this moment. The only thing I can really give you is a link to the docs: https://discord.js.org/#/docs/discord.js/stable/class/UserManager?scrollTo=fetch
WHERE userid = ?
Yes makes sense since youre already using prepared statements
lol
didn't even see that xD
I never fully understood. I can use ? instead of ${message.author.id}?
Kinda newer to mysql
await db.query("UPDATE user SET commands_used = commands_used + 1 WHERE userid = ?", [message.author.id]);
The array represents your values you SET a placeholder for (? in this case)
https://sourceb.in/GV0pdz1TYG after deleting the code line
(await message.guild.members.fetch(args[0]).catch(() => {
return undefined;
}));```
My bot now saying `User not found` Using ID Instead of Ping
They will be insert in the same order you placed your placeholders
Yeah I knew that part
Didn't realise I could do that for a WHERE statement
but I suppose it's for any ? i put in the query
Good thing is, since this a prepared statement, you don't have to worry about SQL injections
because that's not how you use client.users.fetch()
appreciate the info.
You literally replace all of your arguments with a placeholder (?), and will then add them to the array
Yes, the order and amout is important
Learning mysql 
Adding one more placeholder than the array has items, you will get an error
And vise versa
actually hold on a second lemme look at the types
Should i change it as client.users.cache.get(args[0])?
👍
besides my name is the actual db value
that'll work if your user is cached
are you sure args[0] is the id?
from what I'm looking at now, your code SHOULD work if it's an id
alright imma try this one, yeah the js starts with 0,1,2,3
I'd console.log args and just see what the value is
ha?
Keep in mind your arguments in the array will be converted to either a string, int, bigint (float) etc.
Means if you wanna set a value like null, default or now() (which is the current time stamp) you can not use placeholders
client.users.fetch() returns a Promise<User>, you need to await it to get the actual user
that wasn't really your problem from what I saw in your error, but it would still cause problems
I got you there. I tbh probably not a good thing to do, is set my null placeholders as 0 and check if it's 0 or another value
"UPDATE user SET commands_used = ?", [null] -> null would be the same as "null", a string and not null
"UPDATE user SET commands_used = null"
yep
client.users.cache.get(...).then is not a function```
Same goes for other keyword values, like default, now() etc.
Ya I haven't had a case where I needed to set null or now() yet. But I'll keep that in mind for the future.
Alright
using .get() on the cache is not a promise, you can't use .then() on it
oh
Done thankyou ^_^
Assuming the command is suppose to get a user in the guild it's ran in,
message.guild.members.cache.find(m => m.user.id === args[0]) could be another option
user: User {
id: '160679942319767552',
bot: false,
system: false,
flags: UserFlags { bitfield: 0 },
username: 'Miyuka',
discriminator: '0425',
avatar: 'b21284b99f84c72c5f4adf85f5242180',
banner: undefined,
accentColor: undefined
},
avatar: null
}
You don't need to use find here
ah lol
Use get()
just use cache.get(id)
get() will search for the key in the collection which are user IDs
Makes sense. But you wouldn't be able to do that if you were matching multiple checks right. Example:
message.guild.members.cache.find(m => m.user.id === args[0] || m.user.username.toLowerCase().inludes(args[0])) //id or args includes a match to the username
not exactly true, ? can only be used in places where values go. If you want to template column names for example you have to use ??
if you wanna substitute things like Where tough luck cuz u can't
not without string manip
Yeah true, but in which case do you pass column names are arguments?
I mean there are even more placeholders tho
I just never had any use case but yeah, you're right
you might want to template column names if you don't have an ORM I guess
a generic select function should accept table and column names as variables
If I ever have a use case I need that I will keep it in mind
Not correct. Collection is K, V storage and does not use lookups for associates between keys and values. The private _array is strictly for methods like clone or keyArray
My gosh... I don't need to explains things down to the language basics...
It's a fucking map, simply said and uses the user IDs as keys
You don't need to. I'm just recommending that you don't use ambiguous terms where people can misinterpret your knowledge of the language or get the wrong idea how the language works.
If someone told me Maps "searched" the store, I would just not even bother with Maps since that would imply filtering and looping
Nothing against you personally btw. I'm not trying to bully or anything. Just genuinely concerned
Well don't worry I totally agree, I don't feel bullied here.
it just proves that I'm a common JS noob
I’m a professional shitty coder, no matter the language
damn... I'm done, 8h of continuesly frontend developing is just pain
Hii ppl
You see this is why I only backend.
Front end = creativity.
Who said I had that?
indeed
back-end is way more complex but front-end just has too much shit to fix
I would prefer backend to frontend any day
I am not creative enough
people that do both:
Likely didn't find the message you are trying to do soemthing to
It's like running message.reply() on a message that you deleted. This happens a lot if you autodelete the message after a command is ran
♾️ pain
asking for help in custom css day 4
how can i only bob the bot image up and down? i tried using the css for .chakra-avatar__img.css-1f5ob72 but that is literally the id for ALL pfps 🤦♂️ please help
for current state of my bot page check this link https://top.gg/bot/851532461061308438 all the images are bobbing up and down 😢
man i wish there was unique ids for unique stuff like bot pfp, invite btn, vote btn etc..
or am i doing it wrong?
pls ping on reply
kthx
btw does that file exist tho.. idk js but the error says that
main.js file dosen't exist
only start.js exist
so is it replit? cuz ig it searches for a main.js file iirc
yea it is replit
yea.. either you have to rename it or there is some .replit file you can configure ig.. idk abt it much
help for this please
If main.js doesn't exist then use start.js
await profileModel.find({userID: message.author.id, infoCards: {[low]: "lvl"}})
``` why it doesn't work?
I want to get the value of lvl
low => card.lowercase
lowercase is not the toLowerCase, it's a defined value in object
Every user has it's own cards so I'm searching the card's level with the user id
why do you need to put that in the filter then?
just use userID and grab the needed value inside the object
yeah ik
but ```js
await profileData.infoCards[low].lvl
profileData is what you said, the userID and i'm grabbing items from there
if the user models are unique then it shouldn't be a problem, have you tried logging the full object?
oh
will try
and yeah, they're unique mostly (some bugs happened and some objects were duplicated)
looks like InfoCards is an array of objects
https://i.imgur.com/uuYeskD.png how could i make this more secure? cause i have that feeling it can easily be bypassed
its fine ig kinda
To make it more secure anyone who isn't you that tries and use it gets banned from the server and blacklisted on the bot ezpz
😎
ig i can make a blacklist thing
Also can you use f"" outside of print functions?
Does python have f"" I can't remember if that's the language that has it or not
you can in py
So what's the difference between using that and the format method
the same the format one is the old one
Chewy do you still have that minion onesie ?
yes
Livestream yourself wearing it while making a minion themed bot in python

pain
i wanted to test if it comes out that im a guild leader https://i.imgur.com/QOmvtqy.png

Well I guess you're just not a guild leader
https://i.imgur.com/QazHMz8.png buts its set to my id
It's likely your checks are wrong but idek python
damn i dont even know case existed
i haven't even made a create guild command 
python 3.10 added switch case statements
damn didnt know that
match/case
yes yes
Guess why

Cause python wanna be different

shiv ur a saint
Either int() the shit in your file, save it as integer directly, or stringify your user.id
ahhh okie
Stringifying the id is probably easier
its the same ig
I mean it just makes sense
Why move away from the file when you can just stringify the id
It's called me being lazy
probably can use match cases with this? https://i.imgur.com/NTls4AK.png
holy
yandere dev moment

that is a bad idea
i should try to match case as much as i can

the level of indents https://i.imgur.com/nCx4Tx1.png
what is wrong with me
how much crack did i sniff during the summer
one thing I hate about python is its use of indents
It gets very ugly very fast imo
its agony
cmon its not that bad
cause if you indent everything too much by one you have to manually backpace each one
noooo 
Time to go into daffs code and indent everything incorrectly
time to do user inputs 
With one extra indent I can fuck ur entire program up daff
I might make my own rpg bot that I probably won't ever release to the public and will work on it rarely
so it'll be like this ```js
profileData.infoCards.forEach(function(item) {
//Dunno
});
Oh god
Just filter or smth
dont u dare
Please use a filter instead
i love my indent
Daff I will learn python just to fuck ur code up in a way you won't understand
time to finally update my bot to v13 
Or better yet
@slender thistle how do you secretly put bugs in people's python code
I need the sauce
at least your bot still isn't on v8

well v11
Use content.lower()
Idek make it as unreadable as possible

if answer.content.lower() == "paladin":
Do stuff

add a space
lol
what about upper
Add ZWS somewhere
I mean feel free to do it but your lazy ass can't be bothered with using Shift
Shiv what should I make an RPG bot about
Your mom
let filteredC = await profileData.infoCards.filter(item => item === card.low);
let xp = await filteredC.exp;
let lvl = await filteredC.lvl;
``` doesn't work
Idk make it milsim
too much await lol
Wanna know what shiv
You think I'm creative?
why not
You're my brother so doesn't that mean you're talking about ur own mom as well
Yes
I'm telling sora you made bad comment about her
DM me the joke
Filter doesn't need await
call?
What is item
You might have to do item.low === card.low
there's no item.low
Random but
the item is written in lowercase
so then that means no item is being found with that comparison
Highly likely
Not like as pfp or anything
Disney a bitch like that
just in a command
But I mean
Apparently not
nintendo
I want the nickname on the right to change as the text input changes. What can I do?
And you do realize Pokecord got dmca
Yeah
There's your answer
you can't delete bots 
Yes you can
You can delete the application
lol
That deletes the bot ig
i hate making this bot
Then don't
it requires all my brain cells for this
Your first mistake was downloading python
hey
Second mistake was using it in a bot
^
cya
he‘s gone - now let’s party!
https://i.imgur.com/qfb6jlr.png close enough
hi
hi
So I started new bot and I tried staring it with node . that doesn't work, I tried node index.js that doesn't work either. I tried reinstalling node.js that doesn work either
Any help?
You do node index.js and it doesnt do anything?
Yup
Is your bot online?
Nope
Can you show screenshot
And sdmn is the directory of the bot?
sdmn is bot file
Can you type node -v and tell me what it sais
Oh
Wait
I see the issue
Try pressing ctrl + s in your index file
And then run node index.js again
crtl + s doesnt do anything
Then run node index.js again
i have a scheme just like that:
const schema = new mongoose.Schema({
id: mongoose.SchemaTypes.Number,
item1: {type: mongoose.SchemaTypes.Number, default: 0},
item2: {type: mongoose.SchemaTypes.Number, default: 0},
item3: {type: mongoose.SchemaTypes.Number, default: 0},
item4: {type: mongoose.SchemaTypes.Number, default: 0},
item5: {type: mongoose.SchemaTypes.Number, default: 0},
item6: {type: mongoose.SchemaTypes.Number, default: 0},
item7: {type: mongoose.SchemaTypes.Number, default: 0},
item8: {type: mongoose.SchemaTypes.Number, default: 0},
item9: {type: mongoose.SchemaTypes.Number, default: 0},
item10: {type: mongoose.SchemaTypes.Number, default: 0}
})
and im making a buy command with the item id
example: !buy <item id> <quantity>
but i want to search the item by its id
example: the item is "1"
inventario.(item + quantity.toString())
would be the same as
inventario.item1
but obv that doesnt work, how can i make that?
inventario["item" + quantity.toString()]?
ill check that out
"infoCards": [
{
"giantt": {
"lvl": 1,
"exp": 0
},
"archers": {
"lvl": 1,
"exp": 0
},
"minions": {
"lvl": 1,
"exp": 0
},
"arrows": {
"lvl": 1,
"exp": 0
}
}
],
``` ```js
let filteredC = await profileData.infoCards.filter(item => item.includes(card.low));
``` what is wrong with the filter?
oh
not to be rude, but are you just going to post a question on every small issue you have on this system
well i'll stop then
feels like the 20th time
worked, tysm
I'm making a create guild command https://i.imgur.com/6SFAKEq.png but I don't know how to check each guilds available https://i.imgur.com/NVLIgaE.png to check if its the same name or not
Why the match?
Also be warned, json-based storage is really bad if you use it frequently
is really if
Autocorrector
anyone know where theis error is coming from
all it does is ping minecraft servers
and every now and then it crashes
and its not coming from any of my code cuz i handled if the host is unreachable
Did ya use try-catch or .catch?
yup
it does work 99% of the time
says whether the server is up or down and lables the chat as such
Check the inner workings of that function
See if it throws an exception before starting the promise
how would it do that
Ctrl + click
bruh im using notepad ++
Rip
indeed
some times i get an error but it doesnt crash the code
well i mean thats a different error but its not fatal
That's when u restart the router or something
and nither of them are comming from my code
bruh i mean my internet is pretty bad at times
If it drops and promptly returns u get econnreset
ah
sounds like my internet
is there any way that i can catch these errors so that it doesnt kill the entire program?
or do i have to go through every module that im using and correct someone elses code
That's a tricky question
Cuz it's crashing due to connection itself
Tim is required here
lol
why is it i get all the "fun" errors
i mean im guessing theres no universal error handling thats like
on "error" => {
console.log("somthing somewhere broke but who cares")
}
asking for help in custom css day 4
how can i only bob the bot image up and down? i tried using the css for .chakra-avatar__img.css-1f5ob72 but that is literally the id for ALL pfps 🤦♂️ please help
for current state of my bot page check this link https://top.gg/bot/851532461061308438 all the images are bobbing up and down 😢
man i wish there was unique ids for unique stuff like bot pfp, invite btn, vote btn etc..
or am i doing it wrong?
There is
I just don't remember how was it
oh damn
You're doing it wrong
There are ways to select elements without using classess
The classname changes on every page refresh so you have to use stuff like first-child selectors instead
can you please show how to do one element? cuz im not able to properly figure it out
yea... but then how do i select only the bot img? i tried but the only class/div name i was getting is the randomized one... and only entity_content (smthg similar) was the only "contant" name i found
span.chakra-avatar > img
{
animation: float 5s ease-in-out infinite;
}
All "unique" elements on the site have a static class name
You simply can't access the img directly as it's class name is dynamic, but you can access it's parent element, thus you can access it's child - which always is an img (selector) in this case

Since your profile avatar is a button the selector span in span.chakra-avatar will not access the button
That means only your bot avatar will float around
In d.js v13
I get this error
const collector = m.createMessageComponentCollector({
^
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
But m is already defined
const generateAPIMessage = (page = 1) => {
const embed = {
color: data.config.color,
title: 'Radio Searched Results ...',
description: matches
.slice((page - 1) * INDEX_BUTTONS.length, page * INDEX_BUTTONS.length)
.map(
(s, i) =>
`:${INDEX_BUTTONS[i]}: - [${s.name}](${s.favicon}) | Language: ${s.language || `Unknown Language`}`
)
.join('\n'),
footer: {
text: `Page: ${page} of ${Math.ceil(
matches.length / INDEX_BUTTONS.length
)} | React on the correct buttons - 30 seconds response time`
}
}
return { embeds: [embed], components: [row1 , row2] }
}
interaction.reply(generateAPIMessage()).then((m) => {
const buttons = PAGE_BUTTONS.concat(INDEX_BUTTONS).concat([CANCEL_BUTTON]);
let page = 1
const collector = m.createMessageComponentCollector({
componentType: 'BUTTON',
idle: 3e4,
filter(interaction) {
if (!buttons.includes(interaction.customId)) return false;
return true;
}
})
You need to fetch the message in your interaction.reply()
so by thr same logic...
chakra-stack.chakra-link > a
{
}
will be the invite btn only? am i right?
As example interaction.reply({ content: 'Pong!', fetchReply: true }).then((message) => ...
The fetchReply option is what you need to define
By default the message object will not be fetched when replying to an interaction
No chakra-stack is no valid selector
img, a, div etc.
would be a valid selector
Yours is a class
If you just wanna animate the bot avatar, then it's exactly what I wrote above
so then it will be div.smthg? im jus trying to find out all the btns that i can put valid css on
html body div img a

My gosh read the context
@green pebble here's a fun fact:
Right click the element in developer tab then click copy selector
i meant like.. the vote btn, invite btn, stars, stuff like that i would like to change stuff abt
it should give you a selector to select the element
oh wait how? is it firefox too?
maybe
I use uc browser :)
.css-1dhgl5b > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > a:nth-child(1)
uh wtf is this
I know you're being weird
i got this for the invite btn.. how shld i interpret this for the css?
what is the first element
the random class name that changes?
The issue with the button is, it has no unique identifier
You're either going to adjust all buttons using a.chakra-link.chakra-button as selector or you can try to indentify the invite button by it's rel attribute
@boreal iron
so just this ...
return { embeds: [embed], components: [row1 , row2], fetchReply: true }
noopener noreferrer might be unique but I'm not sure
Well this would always fetch the message
If you necessary need to fetch it, then yes
I mean calling generateAPIMessage() will then always fetch the message
Since it's hardcoded into the options you return
POV you use typescript
await ctx.send(("created: %s" % time.ctime(os.path.getctime("guilds/{}.json".format(answer1.content)))))```

So for example to just get the invite button
a.chakra-button[rel^="noopener noreferrer"]
{
background-color: purple !important;
}
and, how do i do that? like.. aint there an eaasy way to jus select the elements and create css that works everywhere? jus like you said for bot img
But there's no guarantee there's no other element with noopener noreferrer as rel attribute
oo
I haven't found another one at least
You can also use this identification method to indentify parts of class names, or any attribute inside a tag etc.
very limited regex
but now for the vote btn its more.. complex... cus there are parts within it too
Lemme check
In ReactJS, how am I able to re-render a component in an onClick function? The component that should be rerendered isn't the one containing the button...
like thats one vote btn
No the vote button is very easy
As you can take it's href attribute value using regex
One second, lemme give you an example
ok cool
a.chakra-button[href$="/vote"]
{
background-color: purple !important;
}
I now see a better selector to match the invite button would be
a.chakra-button[href$="/invite"]
{
background-color: purple !important;
}
You as suggestion, you shouldn't change the site background as you will have to change like every font color
If you do that, in your case by choosing a dark background, make sure to enforce dark theme in your bot settings to adjust all font colors for a DARK site
well.. im unable to do that
Oh... wut I see that option has been removed lol
thats pretty cool.. lemme check that rq
yea.. :pain: idk how to force dark now
Nope
ight
no ig... cuz they will need a discord one
Well I mean in theory you can
Its a discord one its like the rhythm bot one
You can add your URL as invite link to topgg
But that will only redirect you to your site
That somehow destroys the purpose of the invite button but yeah it's possible of course
that the option inside the invite link.. look closely to the invite link
Not sure if there's a redirect_url parameter you can add to the query string
In ReactJS, how am I able to re-render a component in an onClick function? The component that should be rerendered isn't the one containing the button...
Might be... never tested it
huh imma just check the docs
yeah
thanks for your help though
Hey someone
you need to specify a url in the bot page.. and add it there
Maybe also for invite links who knows
can someone give me some rest apis?
alexflipnote apis... its a collection lol
i too have an api (for graphs) but its not a rest api
alright thanks
just any rest api?
Give a function to the child which the child calls when the component is clicked
Yes, but I want many
here i like this one.
https://discord.com/developers/docs/reference
Discord Developer Portal
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
lol
but really https://apilist.fun/
function Parent() {
const [state, setState] = useState();
return <div>
<Child onClick={() => {
setState(...);
}} />
</div>
}
then the child uses the onClick provided by the parent
aight, thanks man:) I think that should work
@junior pecan https://github.com/Soheab/alexflipnote.py/tree/2.x
jus sending the link for the wrapper...
perhaps this might work
div.chakra-stack > div.chakra-stack a.chakra-link.chakra-button[rel="noopener noreferrer"]

In this case it makes more sense to work with the href tag
open devtools do document.querySelectorAll("a.chakra-button[rel^=\"noopener noreferrer\"]") and see if it returns more than one element
why tf do you repeat anything I already said?
¯\_(ツ)_/¯
Still makes more sense to indentify it by it's href attribute as the rel attribute can change
The URL will stay the same
dunno, just try to find if you can find them in any JS code
doubt they're relevant for the CSS
Oh btw
They exist multiple times on the website
Found them 3 times
Just open the site source code and search for noopener noreferrer
discord api go brrrrrrrrr
probably deleted servers
like discord deleted
for tos breaking
they cache for like 60 days or some shit
bruh the bots only in 23 servers
mine had that issue on 10 servers 
lol
Regarding your timestamps you somehow call the unavailable guild multiple times
@spark flint what the actual fuck is that banner
*pfp
ah
its garry
i thank misty
@earnest phoenix you have officially been sentenced to 2 months in Florida
Yes
what do you mean call? these are all just roge guild.delete events fireing
Yeah probably repeatedly for the same guild
The guild doesn't exist any longer and you're still receiving the event
Doesn't the deletion event include at least a guild ID?
If so, get it and try to leave the guild
i dont think it does
thats why i implamented that filter to beginwith cuz i use the id to delete a file with the server id as its name
and i kept getting errors comming from the fact there was no id
i cant remember exactly how i filter it but i think it looks to see if guild name exists
and if it doesnt then its a fake event
Check if the guild ID is available at first
mmm
idk if its still a problem though cuz i restarted the bot today and for the first time in ages it didnt send the message on startup like it has done for the last several days
can a Child call a state from another child?
using contexts and some wizardry, yes
you should store the state in the parent if you want a child to modify something else's state
Directly - no. But you could make a connection between the two children if the state is taken from the properties:
const [childOneState, setChildOneState] = useState();
<div>
<Child1 state={childOneState} />
<Child2 setChild1State={setChildOneState} />
</div>
that's mutating the parent's state
it would rerender both childs instead of just child1
no it won't
how tho
alright thanks guys I will try some things out
You could also potentially use events - child 1 subscribes to an event and child 2 emits the event. But some people consider this to be an anti-pattern
cough its props have techincally changed because childOneState is now different so it rerenders
I meant Child2
Child2 might potentially skip a render
Child1 always gets re-rendered when childOneState changes
is the setState function same for every rerender?
should be
pog
so if i store state in parent instead of child and the state update affects only one child, react won't rerender the entire tree but just the child?
cmd.info.name.set.add({
[message.author.id]: Date.now() + (cmd.info.cooldown * 1000)
})```
This is supposed to work, right? No. It doesnt, I don't even know why.
what does that do
cmd.info.cooldown cooldown for a command in seconds.
cmd.info.name.set cooldown's set.
what is set.add
shouldn't it be set.set
or are you using an actual Set instead of Collection
I am using a set.
then i don't know the problem
Its saying its reading undefined, my brain has been on this for the past 5 minutes.
TypeError: Cannot read properties of undefined (reading 'add')```
I even console logged everything.
Well, atleast I can ask copilot.
Copilot did it first try, I'm quitting.
ai will replace us all
no it won't... well it will help us code but not detect and analyse the problems.
Artificial intelligence will replace us all.
bro didn't you read it?
oh man 🙄
const webhookClient = new Discord.WebhookClient({ url: process.env.webhook });
webhookClient.send(`<@${client.user.id}>`)
405 method isnt allowed
You know that feeling when after days of frontend development your site fucking looks as it should - with a backwards compatibility back to IE6
and the hate begins
xDD
my mangodb database
bro i told you not to use angular
wut
Wrong method
hating on front end is a sign you use angular
ai will replace us all
finally a valid solution to the big human-issue on this planet
or just earth 2
The ai:

yolo is not perfect
lmfao cry about it react
Hello, anybody has any idea about why my form is not giving any value in a dropdown input, i am using express and ejs
that screenshot of your html code is more compressed than my discord bot
actually no its just the width and discord client making it look like that
and have you given the dropdown input a name? cant see because it ends
Would it be better to pass in my packages needed in my command handler or require them in every command I need to use it for?
const stuff = {
message: message,
args: args,
fs: require('fs'),
config: require('../config.json')
}
cmd.run(stuff);```
I just wrote this on my phone.
require
Yes, require..
require them in every command
Does the select tag have a name attribute?
Wouldn’t this just save time?
exports.run({ fs }) => {
}
time as in your time? I guess so but if we're talking speed then theoretically requiring them every time is going to be faster
Well, it’s cached isn’t it? All require() objects are cached.
you could do it either way, it's mostly personal preference
Oh okay.
Yes but you're storing a key and a value with a reference in each of ur commands
nope
You've added the name attrib to the options of select tag. That's not how it works... You may refer to this for more info: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
How can i set the channel Announcement to true / false

?
im not sure what this means
do you know what a antinuke is?
if not before.is_news() and after.is_news():
if i.user.top_role >= i.guild.me.top_role:
return
await after.guild.ban(i.user, reason="Anti-Nuke: Changing Channel Announcement")
await after.edit(news=False)
this is an example
i tried using the kwarg of "news" but in the docs it says smth about type.. channel type n shit
basically if the before is not "news" and after is "news" to edit back to "false"
Yea
I dont think thats possible, I think you need to set the type. I dont think true false exists for that
what if it's true
Yea this is probably not possible
that was good for channel extra security
But with an if loop you can have the bot return an error message if the channel is a news channel
so is there a way to do it or not?
yep, just set the type to news
By editing the channel type to news
it doesnt take a true false
oh
only text channels have topics right?
i mean ye
so i can use
if not isinstance(before, discord.TextChannel):
return
to avoid errors

damn
you can do anything with my token just pls don't spam images of among us

I promise it won’t be images of among us
To make sure it’s your authentication token, please send me your PayPal login and password to verify yourself

OTM0NTQ3Mjc2NDk0NDI2MTUy.Yexq-Q.p2VYhAlG7uIm_-v7r2gamwsCVAY
free token? o_O
the only code I have is for my campaign bot i'm making, and it's not done so 
ok
you download the file with any http lib
filetype you can get from the file name or from the file data, there aere a few libs that can detect file type from data using whats known as "magic bytes"
alr
in Javascript how can you send 2 HTTP headers
var details = {
'username': member,
'type': form,
'message': `Test authorised by xxx: ${request}`
};
var formBody = [];
for (var property in details) {
var encodedKey = encodeURIComponent(property);
var encodedValue = encodeURIComponent(details[property]);
formBody.push(encodedKey + "=" + encodedValue);
}
formBody = formBody.join("&");
fetch('xxx' + '/request', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
},
body: formBody
Your function can be returned once only
You could return your prefixes as array for example
By pushing each prefix to the array your returning you can later check if that array includes the entered prefix by the client
That has nothing to do with djs at all.
You’re already passing two properties to the header.
Does your POST request expect a JSON result from the endpoint?
Yes
Well if you don’t expect a JSON result then remove the header
Should I make a bot in C# to practice C#?
Should I drive without drivers license to practice driving? 
Yes and yes

I mean
sure
Yeah
I mean typically you do start driving before your license.
By law(for minors) you need to drive a certain number of hours before you can get a license in the US.
^_^
A discord bot is usually a good beginner-medium sized project to learn a language
Which is why im waiting until im 18
That's what I did
fuck waiting 6 months before I can get my license
Got my license in a week
Should I install Linux on my laptop which I use only for school
Just to piss off my teachers
Did the school provide it?
Nah it’s mine
TempleOS
I paid
If its yours why not ^_^
^_^
Then you're not pissing anyone off
I should install amogos
Except yourself maybe if you don't like Linux
Well my teachers like checking my work and are like oh just open that rq
They always like checking what I’m doing so
You can't just dual boot?
I tried and failed
?
uh
so I went with just linux
Was referring to misty
When you hit power you can choose the OS
You can even have the same OS multiple times
It just splits the OS on separate partitions iirc
Some installers come with the option to install that OS alongside another
definitely
doing something you'll enjoy doing is the best way to learn
I just cant think of anything else to do to practice C#
Make a game?
mm
I don't really like making games tho
Woo, I would love to do that
But I am beginner C#
very epic
As a beginner I have 0 confidence to make a game engine
My game engine would be a bootleg godot
:^)
Pfff no risk no fun, Sit
Or just bite the bullet and do it...?
misty smol brain
web APIs, desktop apps etc
c# can do everything
Can it do ur mom
no, but i already did yours
I'm sorry uncalled for thanks for that
Touche
smh
I'm kinda mad at myself for just realizing ? : true / false is a thing and how useful it can be
Ternary?
ya
It’s just a shorthand if else
Aka Shorthand statement
Nothing too special about it
Just syntactic sugar
Caught a glimpse of it in a YT video and I'm like "tf is that suppose to be?"
Started immediately using it for my music system message.previousSongs.length === 0 ? client.distube.seek(message, 0) : client.distube.previous(message)
If you don’t have an endless statement chain then yes it’s very useful and good to look at
is there a way to make an interaction button that can only be clicked once? like a client side thing that enforces it
Well disable it after clicking?!
lots of ways
- disable it after clicking
- ignore it if it's clicked twice
- remove the button from row after clicking
Nah
I mean disabling it isn’t a big deal
Yes there’s an official fanhate club meeting once a week discussing about how to fuck you off at next
you work at google?
nope
Can’t be fancy then
my pipeline went straight to prod
and i couldn't really work on branches
but i setup some fancy stuff to let me make branches and keep the prod branch untouched

i have an integration environment and a prod environment now
or dev and prod
i called it dev
Shit I use the prod site for testing as well
fuck them kids if they using it
I gotta make sure the text is perfect!
Is there a way to add a placeholder for an img tag so it has something to display while the image is loading?
ty
I wish I could use top level await but setting the module to ES2022 makes this error occur
SyntaxError: Cannot use import statement outside a module
does someone use discord.py?
isn't discord.py unmaintained now?
Have you set the "type": "module" at package.json?







