#development
1 messages · Page 2029 of 1
xD
the other that looks like a giant E is an add-loop
that pi one is a multiply-loop
yeah honestly the symbols just complicate it for people who don't understand them completely
the number above is the limit, below is the starting value
and the formula in front is what's inside the loop scope
i'll ask you to translate formulas for me the next time i need it
xD
also, rip formulas that uses constants that js doesnt support
like this one, eslint screams at me that the number is too big for double precision lmao
thats a lot of numbers
in an alternate universe:
LOL
you even inverted the text
lmfao wtf
my bot does hit the rate-limit at some points 🤔 what should I change restGlobalRateLimit in Client option to prevent it
instead try to fix what's causing the ratelimit
global rate limits?
or regular rate limits?
I think global since I even used proxy but I still hit it I think
"global" just means account-wide limits, not ip related
oh then whats about temp Cloudflare ban?
that's another thing
im trying to get my bot online first since it wont go online on my host, still work on local tho
is it related to IP? also what does the bot do to trigger the ban?
Usually when hitting ratelimits it is cause you are requesting a resource too many times in x amount of time
ip, yes
its a youtube,twitch notification bot so it does send quite amount of messages to a lot of servers
for CF yes, but not for discord
usually if u hit a CF ban something went VERY wrong
usually it happens when discord api crashes and ur bot spams it trying to reconnect
any other reason is a serious logic issue
do you use sharding?
hmm, if my bot sends 20 messages to around 350 servers, does it trigger the ban?
my bot is small so I dont do sharding
so your library will handle the rate limits for you
however you should still help it by running proper code
for example dont create 350 requests concurrently, instead do it sequentially
ok let me send my example code so you guys can judge it
laplus
Do we have to care about the rate limit even if we are using discord.js-light 🌚
depends on what your bot does and how big is it
the only time i get hit by a cf ban is when i use replit
for smaller bots you generally dont need to worry about it
const promises = data.map(async (data) => {
//do some thing here
const promises = client.guilds.cache.map(async (guild) => {
// do something here
});
await Promise.allSettled(promises).catch((err) => {
console.error(err);
});
return;
});
await Promise.allSettled(promises).catch((err) => {
console.error(err);
return null;
});
This is what im doing, I think I've done it the wrong way
yeah thats creating multiple concurrent requests
djs should execute them in sequence for you, but i wouldnt trust the library to handle that
yea it does but sometimes it just breaks
what's the better way to refactor this to sequentially
i would do it with for loop and await every request
so im gonna for loop both data array and guilds array?
yes
shouldn't this validation always fail? or did I miss understand onsubmit somehow? because the page is reloading anyways
async function search(args) {
return false;
}```
```html
<form name="search-form" class="bg-slate-100 dark:bg-slate-600 flex justify-between items-center p-2" onsubmit="return search({{ raw_veh_list }})" action="" method="get">
<button class="bg-slate-300 dark:bg-slate-50 p-1 m-1 text-slate-900 rounded font-medium">Submit</button>
</form>```
dont you need to use preventDefault()?
or try <form onsubmit="search(...); return false;" >
ah wait, its an async function, pretty sure you cant use async functions in an onsubmit
since an async function returns a Promise, which is a truthy value
the function does get executed, tho the result might have to be awaited or something?
await is only allowed in async functions and top level bodies of modules 😬
so then you have to use <form onsubmit="search(...); return false;" >
ok perfect, that worked 👍
plans to work on os aborted power went out and my laptop lasts about 2 hours on full charge
rest in peperoncinos
I need to implement a power and log function before I can use the geo average but I have no idea how
the fpu doesn't support powers or logarithm
I mean an integer power function is easy but a float one is tricky
and reading c function source code is like reading Hebrew without knowing it
worse case scenario I'll rip the implementation off someone else's os on github
won't be a speedy os then
power can be done with repeated multiplications
log can be done with division, but don't remember the formula
hii guys, so I made channel which is basicly like a decoy, so If hacked account join a server and send message there, bot should ban it...but rn, i dont have idea on how to make that to work
so for fun i tried with this code: ```js
client.on("messageCreate", message => {
let memebrBan = message.author
if(message.channel.id === "970724218352316426") {
if(message.content) {
memebrBan.ban()
}
}
})
``` and got an error on the: memebrBan.ban() : index.js:140
memebrBan.ban()
^
TypeError: memebrBan.ban is not a function
It’s not a function
message.author is a User object, which is not associated with a guild
Use message.member instead
can I code svg in html, and use it like a background-image for a div
no
i think yes
but why not use photo
do some photoshop
add svg there, export as jpg or png
and use as bcg
ok so I've tried that but it seemed like awaiting every requests block other tasks. I think because all my cron tasks are quite complex
na, its a dynamic svg code
yes, then I want this svg to be background-image of a div
indeed but I don't know how you would implement powers with decimal points
coz I want to use background-blend-mode on that div
I know it has something with rooting but other than that I'm stuck
your scheduled tasks should be fire-and-forget, they should not wait for any result
but even if they do, they shouldnt be blocking other tasks
async code is non-blocking
@oak cliff Delete messages?
thought i got them all
Smh
i wanna kms just from seeing this
https://www.netlib.org/fdlibm/e_pow.c
when I converted to for loop for all of my tasks. 2 of my tasks just sit still I think? They all just sent the first message and then they stopped, the tasks took more than normal duration to finish
like from 30s duration to 2mins
"Omg you could've used 1 byte less memory how could you not see that"
show I think they were blocked
yes thats normal, since you are "spreading out" the requests in order not to hit the api too hard
Convert to decimals to fractions
Then use the concepts of radicals to evaluate.
Calculus for roots: https://www.youtube.com/watch?v=6LBA5toYZ_0&list=PLJ-ma5dJyAqqAJAQxIuYyhzgwQyonHKmq&index=2
Related Link: https://www.youtube.com/watch?v=Psp07bIZHW4&list=LL4Yoey1UylRCAxzPGofPiWw
only lead I have so far is 2^0.5 is the square root of 2
this explains it pretty easily
yea but after the tasks finished, messages didn't even get delivered
indians on youtube
the entire internet is backed by random indians on youtube
then you're doing something wrong
even though they were saved in DB ( which is the previous code before sending msg)
yea i wonder what i did wrong
ok, let's clarify a thing
hash != encrypt
the former is a one-way procedure, the latter is supposed to be reversible
there's no thing such as "dehash"
yeah
my false
like encrypting and decrypting
I sent you the preview of the code in dm
bro I don't know the best site to throw my spaghetti code
tell me which one
anything that uses AES
node itself has it already
password
you dont use encryption for passwords
i want to encrypt the hashed password
Hashes
why
i dunno
that does not increase security
I’m by no means an expert, but hashes are definitely secure enough
cause I fell unsafe transfare the raw password via Graphql
It’s just input / x / x / x = 1 @split hazel
But computationally I have no idea how to do that efficiently
3 * 3 * 3 is 27
yes
hash comparison is always done in the backend
but computer doesn't know
Like I said, no idea how to do that computationally
you dont need to encrypt anything before sending it
but kinda unsafe to transfare it via http
do it via https
its safe enough
mhmm ok
https is literally encrypted http
then no encryption
https://www.geeksforgeeks.org/find-cubic-root-of-a-number/amp/ binary search is probably wildly efficient for this use case
I watched yt and learned about the III Quake root or smth
3 Quake Root
they use it very often in Game Dev
That’s different
review my code before im going to sleep pls tim😭
That’s the quick inverse sqrt algorithm
How can add my bot
that's by far the worst thing to be done

it's like putting butter in margerine
just for every case
?
I don’t see how it would even increase security
no no, you see, you'll be sacrificing performance for 0% increased security
maybe even -1%
you're still sending a bunch of stuff concurrently
Hashes are designed to be indecipherable without large amounts of computational power
Like a one way mirror
Sure, you can break it, but when you do are you really gaining anything after all that?
oh really, but I thought changing to for loop should work
you're using .map(async () =>)
all other tasks also looks that file
therefore creating concurrent promises and then resolving them using Promise.allSettled
You could have a queue of promises that get resolved at a set ratelimit
to put in perspective, the odds of someone breaking a sha-256 are lower than if you grind a glass cup down to dust, threw it in a beach then a year later tried to pick all particles that once belonged to the original cup to rebuild it
oh I think I sent the file in wrong branch lol I changed that map to for loop in the other one
@_@
it's so insanely low that the universe would die before u manage to accomplish it
if u want to be extra insane, hash in sha-512
it has been proven many times by researchers and scientists that double hashing or double encryption does not increase security
I mean the code is still quite similar, I just want you to review why they block eachother
Stupid question, if you have access to the hash (say through a db leak or something of that sort), wouldn’t you be able to hash tons of passwords using the same algorithm until you find one that matches?
ohh
(Assume you know the algorithm and the salt)
well yes, if the password is a common one
thats what brute forcing does yes
like "cake"
I see
that's why most sites enforce 1 letter, 1 uppercase, 1 number and 1 symbol
So that’s why password hashes are still useless against brute force attacks if you have a shitty password
it is like the crypt tokens right
tokens are base64 mostly
only a quantum machine can brute force it
brute forcing takes thousands of years if your password is long enough
a dictionary attack is faster but you need to be lucky that the password exists inside the dictionary
Quantum computers are a whole new thing lol
"quantum" doesn't necessarily means "better"
how do I achieve this?
yeah, watched that on yt. I dunno haha
a quantum computer is basically a computer that guesses
like I seperate them to chunks?
Quantum computers are still very very very very early/experimental
but it can do things faster
on the theori
Some things
because it guesses
It’s like trying to run hades on a nasa supercomputer though, some things it’s good at, others it’s not
like, if I input "is duck an animal?", a conventional computer would do expensive operations, master hacks and whatnot to say "it's 100% an animal"
Little do they know I’ll have access to their minecraft account after the heat death of the universe 😈
a quantum computer would say "I'm 90% sure it's an animal" and give the answer right away
depens on the machine tho
it's obviously more complex than that, but u get the idea
for insane math, a quantum computer would be faster because it'd guess the answer, work in probabilities
while a normal computer would calculate it to the end to reach a 100% certain answer
I've looked at the video you've sent me but it doesn't really explain how to calculate it in code
convert the equation to code
it talks about nth roots of x but calculating that is another story
only thing I have is square root since that instruction comes with pretty much all modern cpus
don't think the float processors are able to compute nth roots
you probably can use square root to calculate nth roots
looking at how to do it in c people say to use the power function but that isn't really possible since my power implementation would use nth roots
well yes you'd usually use power
this looks promising https://stackoverflow.com/a/32541958/11138133
btw this table ^was for MD5 hashes cracked by an RTX3090 gpu
this is the table for bcrypt hashes
one of the the weakest hash
I'm curious abt this case tho
didn't see the fact it only works with integers:(
aren't all execution times going to be integers btw?
also it only hits the ban when it sends around ~20 messages concurrently to all servers. If its like less than that to all servers, its still fine tho even though ratelimit event warns
🤔
how much is "all servers"?
350
that's 7000 requests
put one second between each 500 requests
looks much better
ye, although djs should have some kind of request delayer
or was supposed to have
it does but some how my bot still exceeds it
how does restGlobalRateLimit option in clientOption of Djs work?
thats only for global limits
can you show which ratelimit you're getting?
native modules need to be built on the target machine
you cant copy paste them between different computers
uhh im actually on bed rn lmao but it usually hits the global
just use node's native hashers
I didn't
sha-256 is enough
mostly by sending messages
ok
then the install failed
the install logs should show the error
crypto.createHash('sha256').update(pwd).digest('hex');
lan?
host-only?
host-only is connection between pc and vm
lan is connection between other pcs in your house
what are you trying to do?
This is oracle hypervisor while mine is VMworkstation.
you want the vm to be able to connect to the internet?
btw, why dont u use windows' built-in hyperv?
Have the network connection attached to internal network.
Remote Desktop?
you want the vm to be able to connect to the internet?
hyperv
... to be attached to the internal network. 
...
Alright, I mean, yeah.
then do bridge or NAT
As long as hackers (from who knows where) can't have my computer vulnerable.
if ur going to do malware testing u cant have any kind of network enabled
I'm downloading a vulnerable machine to try hacking in so the video I'm following tells me that I need to switch to internal network to be safe.
if by internal network you mean the vm will not be connected to the internet at all, then yes use host-only
@lyric mountain how I can compare it?
hash the input and check if string equals
that is?
...hash whatever the user types in the password field
and check if it matches the one saved on database
Ahh.. now apparently, from he says: https://cdn.hamoodihajjiri.com/ys38c4fK3W (he's using oracle), so for VMworkstation, I use host-only?
{
timeout: 745,
limit: 50,
method: 'get',
path: '/channels/912492265614770226/messages/918753513436229662',
route: '/channels/912492265614770226/messages/:id',
global: true
}
{
timeout: 721,
limit: 50,
method: 'patch',
path: '/channels/854030382587314218/messages/897099667786059807',
route: '/channels/854030382587314218/messages/:id',
global: true
},{
timeout: 513,
limit: 50,
method: 'post',
path: '/channels/915272476190208061/messages',
route: '/channels/915272476190208061/messages',
global: true
}
bridge = vm sees internet, internet sees vm
NAT = vm sees internet, internet sees host
host-only = vm does not see internet, it only sees host
custom/LAN = advanced configuration
the bot usually hits these
is there something wrong with this code?
msg = message.content
word=['*,-,/,+']
if any(word in msg):
await message.channel.send('sup')
it's in python
I set the global limit to 50 but since you said it wont work in this case
yes, there's something wrong with that code
Host only it is, I believe.
care to helpout a little pls? '-'
so basically you can ignore those, its djs working as intended
I can't, what's wrong is that u didn't give any context to what it's supposed to do
but if you dont wanna see them, you can add a delay in your for loop for every 50 messages
or so
I have no idea what that code should do
yea I know they are like warn but the serious thing is cloudflare ban
it should send sup when it finds any word in message
or what ever caused the bot to stop responding
railway
is that a vps or an app host like replit?
its like heroku
word = ['*,-,/,+']
is it popular for hosting discord bots?
what is this supposed to do?
yea it is
then that may be the reason for the cf bans
but someone said using proxy would work and I set up one and still got banned I think
🤔
which proxy did you use?
tailscale
and how many other people are using the same proxy?
these are the word
and its not shared by other customers?
is it supposed to find EXACTLY '*,-,/,+'?
i think the problem is that it returns true while the code doesn't take bool so it crashes there
nope
any of them
but that's a single string
you see, it's not a single string, it's a single string inside an array
it'll not check if the message contains any of those char, it'll check if the message contains that entire string
i thought that first but the problem here that it returns nothing
but how do you know that the bot doesnt cause the cf ban?
@earnest phoenix last ditch effort but do you know how js does Math.pow (source code)? is it manually written or does it use the standard library implementation
even if i put the whole str
since it triggers global ratelimit alot
can you suggest a better method?
because you're running a single shard, and djs usually handles everything correctly as long as there are no external processes interfering
oh, but you said to not really trust djs handling
if so the theory is maybe my proxy didn't work or it wasnt connected 🤔
Kinda a combination of sorts
https://chromium.googlesource.com/v8/v8.git/+/refs/heads/main/src/builtins/math.tq#128
Is it possible whereas VM does not see internet neither does see host?
just turn off internet in vm
Lmao, fair.
or remove the network adapter from its hardware
if any(word in msg):
TypeError: 'bool' object is not iterable
where is this implemented? extern macro Float64Pow(float64, float64)
yeah i dont trust it enough to handle concurrent promises, but sequential promises i wouldnt care much, but try adding your own delays on top of it
for example every 10-20 messages sent, add a 1-2 second delay
Apparently, I have the VM's ip address, and when I ping into it from my local machine (pc), it has a reply, how can I not have that and fully isolate so?
i used to add my own delays on reactions, because their handling of rate limits for reactions is terrible
but since we use buttons now, it doesnt matter anymore
remove its network adapter
👍
I see, I'll try that I guess, gotta sleep now
ty for helping ❤️
maybe i'll back here tmr lol
💀
if 'something' in msg ig
i tried this
if msg.contains('*,-,/,+'):
await message.channel.send('sup')
it worked
except that it worked for *,-,/,+ as a whole str not char
yes, that's EXACTLY what I've been trying to tell you from the start
putting comma in a string doesn't automagically make it a char array
chars = ['*', '-', '/', '+'] <- correct declaration
Not ANY of those
note it isn't a single string
'a,b,c' is NOT the same as 'a', 'b', 'c'
Now, what's the benefits of having a virtual machine not having a network adapter, and why should it have no wifi when attempting to ethically hack into a vulnerable machine?
And, in addition, should I always have it not connected to the wifi when it comes to doing so?
i can't do that because then it will check if the str a has an str b in it
using the contain class
how are you gonna ethically hack into anything without internet?
or you just want to crack hashes?
I'm doing it locally but installing a vulnerable machine and also isolating it from the network.
Honestly, I got a bit lost since I've been trying to figure out what he has been doing in 6:04 and do the same, however, I'm using another hypervisor making it difficult to understand.
just trying to remember how to code bots
whats the format for prefix and token config.js
use slash commands
what are you trying to do?
it should send sup when it finds any '*,-,/,+' in message
any what? any of * - / + ?
yup
you need to put it in a list
list = ["*", "-", "/", "+"]
then you should be able to do something like
if any(x in string for x in list):
obligatory xkcd
or using a regular loop, for char in list: if string contains chart return message.channel.send()
xD
what's the format for prefix and token config.js
{
"prefix":"!",
"token": "Token here"
}
you dont need internet to bash someone with a wrench 
js or json?
tactical leak INCOMING
put ur token in an env file
not in the actual code
nah, hardcode the token as base64
gimme ur password or I leak ur internet history
hardcode an aes encrypted token and decrypt it on the same file
keep ur token on a server in siberia and just request for it on every login
via 7 proxies
ye
Wanna know what I need to do
I need to actually properly learn js
My entire js career has been me just going with the flow :^)
I also lack problem solving skills and the ability to come up with solutions on my own
:p
.js
const object = {
prefix: "!",
token: "weouhwoeut2n3uv023u0v92"
};
module.exports = object;
well i lack trust in other people's solutions so i make everything myself which makes all my projects take ages and makes me always broke
¯_(ツ)_/¯
thanks i just need a basic welcome bot for a server, im just very stuck i might just hire someone or VSC collab as i forgot code
I actually would prefer this over the latter
I feel like to really grow as a programmer I need to actually learn how to code properly to the point where my "solutions" actually work
without needing other's help every step of the way
read docs, lots of docs
can't sleep well at night knowing you can save 1 byte of memory
see I always loved reading but that just seems to bore me I never actually comprehend what is being done in the docs
here i am pondering whether or not i should reserve 8 entire bits on my index byte to save 1 byte on every bigint value smaller than 64 bits
yeah I don't bother reading the entirety of docs I only read parts i need this second
this is basically me with my database
whenever you hit something you dont understand, do read docs specifically for that something until you understand it
I sit for 10 minutes debating in my head
10 minutes? i do it for days
💀
Mmm what should I work on tho
my biggest issue is always finding a project to put my time into
Mmm I should try and come up with something that I can use socketing on
do you enjoy making things more efficient/performant?
I wanna understand websocketing
lmao
Well, all my code is generally lacking in that area so
:^)
xD
I don't i do it to satisfy my sanity
i learned websocket from reading the rfc document lol
Waffle no one asked u go play overwatch /s
I’m at school
The WebSocket Protocol (RFC 6455)
loser
loser
laser
You read all that???
not all, just the important parts
and whenever i had a doubt, i go there to double check
usb support is so complicated
usb is probably 100x times worse than websocket
I want to write a gist of what you have to do
it really is
it's the most complicated piece of useful tech
see you guys think so highly for me, yet you do things that are 100x more difficult/advanced than the shit i do
im not awesome, you guys are
💀 I just have high expectations of you
high expectations lead to disappointment
anyways from what I know from a brief look you need to write a parser for a language called YAML which is used by the ACPI which controls the power and discoverability of connected devices where you then extract data from it and write some fancy code to interface with the USB hub
what shitty advanced stuff do I do
:^)
I honestly don't know why they couldn't just use structs
the table which you have to scan the whole memory for to find which contains a number which allows you to activate manual support for the ACPI uses structs
it's so complex I asked about it and some guy just told me "please just use a library someone wrote to interface with it"
lel
On top of that YAML opcodes and features also aren't documented very well so it's mainly guess work
discord library
That has a lot to do with websockets
If you want to learn about it
this also makes shutting the computer down equally as difficult because you need the data from the acpi to do that
your best bet for restarting the computer is to disable interrupts and divide by 0 to cause a triple fault causing the cpu to reset
Not as difficult as stopping Speedy from being as NFT
nfts are the future
not as hard as reading c source code tho
seriously the dude that wrote it could probably read obfuscated js without a problem
🤦♂️
he is the obfuscator

that means send it to nowhere
That’s all for today
before you shut your computer down make sure to thank the person that wrote the AML parser for your computers ACPI in order to shut the machine down
otherwise hold the power button
can I request a mini collaboration for someone to write two basic commands? -DMs
yeah
if (message.content === "!help") {
message.channel.send("Pong");
}
there you go
funny, but i was serious.
Why not yourself?
It's a basic command now, but what when it breaks? What if you want to change something? What if suddenly A becomes B?
It's never "just a basic command"
I simply pull the plug dumb speedy

soo guys, i have this code: ```js
module.exports = {
name: 'msg',
execute(message, LineSplit) {
try {
if(!message.member.permissions.has('BAN_MEMBERS')) return message.reply('You cant use this command...')
let title = LineSplit[0]
let description = LineSplit[1]
let guild = message.mentions.channels.first()
if(!title) {
message.reply('This message need to have a title.')
return
}
if(!description) {
message.reply(`You can't send an empty message, please give it description.`)
return
}
if(!guild) {
message.reply('Please mention channel where you want to send this message')
return
}
guild.send(message)
}
catch(err){
console.log(err)
}
}
}
` !msg -- Title -- Message Content -- Channel where i want to send message `
But problem is: if i create message structure like this, it literaly send the whole command in the tagged channel. Anyone have idea on how to fix this?
that seems to be what your code asks for.
guild.send(message)
message being the command message.
its hard to say with just this part of the code(we are missing how LineSplit array is defined), but what you probably want to do is send the description variable.
Well it should send title and description in the mentioned channel, and line split is basicly this: ( -- )
I mean how the variable LineSplit is defined.
https://i.imgur.com/ZlxTMqt.png
anyway, if you want to send the tital and description you would want to just send those variables which you defined in code
const LineSplit =
message.content.slice(prefix.length).split(' -- ')
const LineCommand = LineSplit.shift().toLowerCase()
Here is line split
And yea i think i figured it out
I just added title and description inside brackets at guild.send
how do i start bot .node?
do you mean how to run node programs?
i have a bot i want to start it through terminal
node filename.js
i want to start the whole bot do i do node index.js
if thats your main file yes
its most often index.js, but its whatever you named it to.
it just wont come online
const Discord = require('discord.js')
const { prefix, token } = require("./config.json")
client.on("ready", () => {
console.log("Hey wg your bot is online")
const actitvites = ["A Mythical Tale", "! Prefix"]
})
client.login(token)```
is it due to index itself
You don't have client defined anywhere
Client and intents yes
this is me pasting things i copied two years ago
i have no idea how to use a basic js index bot is online code
I don't recommend copy pasting stuff, read the documentation and the guide before diving in
anyone good with python?
it changes weekly i swear
why?
Ask your question or tell us the problem, if someone knows about it they'll answer
so the question?
ok so someone here helped me with a question using that code
but it didn't work so ineed to know why
list =["*", "-", "/", "+"]
x= message.content
string=str
wait
Are you trying to check if the content of the message starts with any of those prefixes?
x is prefix or content?
so uhh what are you trying to achieve?
They're trying to see whether the content of the message contains one of the strings in the list
so i thought it's part of it's iterarion and thought i should learn it as it shortens the numer of lines used to work a code and is simpler as well
idk how it should work but that line of code definetly didn't work
nvm
What you're doing already achieves what you want to do, the global any() function in Python accepts an iterable, which the expression of x in string for x in list you're passing to it is a generator which is an iterable, so it should work
also what do you mean by not working? any error?
it should in theory but in praticaly it didn't
Show us more code I guess?
it shows this error
TypeError: argument of type 'type' is not iterable
i tried chr
didn't work as well
idk if i don't divide the string in list like i.g. word = ['*,-,/,+'] it works fine
as multiple people pointed out, '*,-,/,+' means a single word, and not 4 different characters
but it zorks zhen you send '*,-,/,+' qs q full sting not as one char
Btw, you're assigning a global function to a list, list is a global function in Python which you're reassigning
you4re still up thank god lol i needed u thought u zent off
lmao you see Tim you're peoples last hope

went to eat then came back to test the code but it didn't workout
I think I need expedite the development of my scam website
lmao
NITRO EMOJI
tell him, "yes i have 100 bitcoins"
I knew it
billionaires lol
you should try using it more to piss off fake
Yeah and in some months they are worth shit again
@boreal iron

I'll say what is bitcoins then say oh yes I think my son set up an account for at <insert my website here>
Arararrararaggggg
well not if you visit africa then u still a billionaire
Quiet nft promoter
You aren’t better at all
in zimbabwe you'd have 400 quadrillion dollars
And there was the guy who spent 100 bitcoins years ago to buy a single pizza
lmao
happens to the best of us
and there was a guy who had a bitcoin wallet worth millions but lost the password
wasnt it like 10k bitcoins?
🙂
Oh yeah it was 10k
Well shit happens

anyway i keep getting this error
TypeError: argument of type 'type' is not iterable
what am i doing wrong?
@quartz kindle
show code
did you read what voltrex said about the name list being a reserved keyword?
Rename your list to something else, list is a global function
i did rename it word
but then i thought we should stick with list till we figure something out first
i changed string to str btw
You're not supposed to name it list, since you said you renamed it, replace the list in the if statement expression to the renamed list
because it keeps showing error for string
string is reserved too no?
i did both none of them worked
For example
content = message.content
chars = ["/", "-", "+", "&", "$"]
if any(x in content for x in chars)):
print("Passed")
like, isn't the code editor SCREAMING for u not to use those words?
string is not reserved in Python, str is however
whats x here
so i need 3 names?
do you know how a for loop works?
x, message.content and list
when you use a for loop, you create a variable that will represent the current item being worked on
its the same thing
i could do the for loop but i thought i need to learn your method
it seemed better, shorter in code and more practical when the code gets more complicated in the future
Let me explain what x in content for x in chars does
for x in chars is executed first, iterating through the list called chars and naming the list item as x, then x in content is executed, and when the in keyword in Python is used on a string, it checks if x (the list item) is contained in the string called content
btw voltrex am i right in assuming the above code does a char-by-char comparison? like for each character in the string compare it with each character in list
Perhaps, just explained it
it should yes by logic
Why does it seem like making your own discord lib is so annoying...oh wait cause it is
it's python so not same speed lol
😔
👀 would regex be faster here, since you can have messages with 4k chars
Im good at english
and putting thoughts in words
in js i would do for each character in list, use string.indexOf(char)
regex is also an option yes
content = message.content
chars = ["/", "-", "+", "&", "$"]
if any(x in content for x in chars)):
print("Passed")
Is the same as
const { content } = message,
chars = ['/', '-', '+', '&', '$'];
if (
chars.some((char) => content.includes(char))
)
console.log('Passed');
Shouldn't be slow much either way
yesterday i was building a calculator in python it literraly took me like 20 lines of code then one dude just showed me one line of code in c that did exactly the same calculator i built IN JUST ONE EFFin line of code
i think i know the issue it's *
could be that * won't let the code work somehow idk
this code does work
I ran it
i know
So what is the dffierence between the get gateway and get gateway bot endpoint for discord?
My guy, what even are you doing? Are you trying to learn what's going on? Trying to achieve what you wanted which we already showed? And are you gonna show more code as you're running into other issues?
indexOf is a linear search no?
like, it's fast cuz it's always less or equal to O(n)
get gateway only gives you the gateway url
get gateway bot gives you the recommended shard count, the number of logins you are allowed per day, etc
So when making a discord library I should use the get gateway bot?
i dont know how, but its much faster than o(n)
the speed does not increase linearly with the number of characters
1000 chars is not 10x slower than 100 chars
maybe the chars are backed by something?
i'm gonna cry
i guess technically it is o(n), but its very efficient
yeah - it also returns an error if the token is incorrect/bot is not allowed to login for whatever reason
You still haven't renamed your list...
Alrighty thanks :)
i want to move on pls i have other things to life to live for :' )
list = [...] -> chars = [...]
any(x in content for x in list) -> any(x in content for x in chars)
Try it
It still says list in the error stack trace
run it
@_@
also that one fucking indent annoys me so much
py dev problems :^)
ive developed ocd since using py
can't believe i got stuck there
that is asking too much
like prefix commands? you mean?
that one works btw
I have no idea how or why in God's name that error even occurs, because it doesn't make any sense, generally running the same thing outside just works fine
but...
maybe because of the '''
the ''' is like ##
That's just a specialized comment
it's a comment

"' is for comment so it is fine
tha code works btw but only for a sting
so like i have to write these lines 6 time for each charachter
Replit is not a Python version
it will work regardless should work atleast
Run python --version in the Replit console
google says the default is 3.8
Log this
import sys
print(sys.version)
been there done that
lmao
import os
so far I am on tracking state
its not that terrible tho
and I still have no idea where to start with this discord lib
their docs are pretty good
I'm telling you to log the Python version that way
are you using a websocket library?
oh sorry ok
haven't even started coding yet
I am just reading the docs to learn what I need
no idea what websocket lib to use tho when I actually start
basically you start with an http library and a websocket library
are you using nodejs?
you just sounded like my father on a brain breakdown there lol
indeed
for http there ae dozens of them, but if you feel like it, give undici a try
for websocket ws is pretty much king, not sure if there are any good alternatives
The nature of #development, brain cell loss the more you stay here
XD
its 3.8 from the logs of his picture
it's past midnight my brain started lagging
Also I noticed something about using a shared context synchronous compression thing to receive payloads wtf is that?
its a zlib stream
Oh yeah didn't even see that, but either way what I proposed should work
you can use node's built in zlib, although its not that good because its async
there are alrenative zlib libraries for that
like zlib-sync and fast-zlib (im the author of fast-zlib)
I noticed you made one called fast-zlib
I am started to get demotivated with this discord lib idea
i dont actually implement it
it's 3.8
Mmm but didn't they mention something like they will sometimes compress data and I will have to recognize and decompress it?
only if you enable compression
thanks for the fast and totally not late response
Ah, I didn't notice that part
wtf
fuck
fail
'-'
mobile moment
momeny
print('fuck')
stfu misty 
:^)
I saw, I think something else is happening here rather than just failing on the way to execute it properly, either your indentation is fucked up, the msg variable is not a string, or the chars variable is not what it seems to be
print the type of all of those ez
I'm gonna ask you to do print(msg, chars)
try printing msg
just... print it
idk what else should i do
@quartz kindle So what do you recommend I do first when making this lib? Should I just try and establish a connection with the gateway or is there anything else I should research on before making a connection?
ok ok chill '-'
just make the connection
Alrighty
you know how to print right?
print(msg)??
yea
.-.
it needs some time to run sorry
bare with me a little more
i can sing if that helps w ur anxiety '-'

ok i feel stupid 😄
bro
print(msg)
is basically the message i send in chat to check on the bot
We have logged in as Fuckery
that(s my bot's name 😄
Anyway try printing their types as I showed
This is the longest time I've spent trying to help someone about a specific thing

welp that didn't change anything
I didn't think you're actually printing them, it seems to get stuck at some point
Show code?
You're printing it in that if statement, print it outside
Am I supposed to be receiving this when connecting to the discord gateway?
<Buffer 7b 22 74 22 3a 6e 75 6c 6c 2c 22 73 22 3a 6e 75 6c 6c 2c 22 6f 70 22 3a 31 30 2c 22 64 22 3a 7b 22 68 65 61 72 74 62 65 61 74 5f 69 6e 74 65 72 76 61 ... 68 more bytes>
I thought it'd be a json response?
Discord sends opcodes through the websocket from what little documentation I’ve read
ik it won't work elsewhere
it will show error
...
Yea but it is either sending a buffer or nothing
Which is not at all what the docs say it should return
the websocket by default gives you a buffer
it needs a class method you can't throw it on the street and expect it to work '-'
just use .toString() and then JSON.parse()
I'm telling you to print it outside of the if statement, you're printing it INSIDE of it
{
t: null,
s: null,
op: 10,
d: {
heartbeat_interval: 41250,
_trace: [ '["gateway-prd-main-qj3j",{"micros":0.0}]' ]
}
}
Ah I see yea it did respond
mood
Sometimes I want to explode when I'm in this channel watching as brain cells go poof

ikr
did i mention that i love u 🙂
literrally same conv w my father when he's done with me
@fossil bone just to explain something, when people ask you to print something, just do it, and show whatever comes up, even if its an error. saying that something "didnt work" or "it errored" without showing the actual error does not help anyone, if it errors, we ALWAYS need to see the error, because it contains clues to solving the problem
i'm sorry guys i'm doing my best idk
print it OUTSIDE of IF statement but INSIDE of the function
the error is pretty simple it doesn't identify the msg so i have to identify it again by msg= message.content then it shows outside the class method that it doesn't understand what is message.content and that's when i decide to put it under if where it fits right
What
i found the answer
😅
thats not the problem, when we troubleshoot something, we have a checklist of things that we need to check, to narrow down the problem. often that checklist involves seeing/confirming something specific like seeing something being printed or seeing a specific error happening. if you hide those things from us it only confuses as and we cant be sure whether that specific checkbox can be safely ticked or not.
thats why you see peope here being frustrated with you
because they dont know whether you did something or not, whether something was successfuly checked or not
ok i'll find a software to record u me typing print(type(msg)) so you can belive me when i say nothing shows up in all scenarios
and unfortunately experience tells us that we cannot trust what the person is saying because they are often doing something wrong or they are misunderstanding what we tell them. not saying you are doing this, but it has happened a lot in the past
this is rplit btw not some ide
we dont need to see a recording of you typing, we just need to see the code and the output of that code
like you did before, a screenshot of the code on the side, and the output on the other
that's what im trying to say nothing shows up
like the code print isn't there at all
replit is an ide
it only shows up when i put it under if user sends a message print(msg)
okay.. where do you put it when it is outside the if statement?
everywhere
define everywhere
under every class method
you see how what you're saying is not being helpful?
one image is worth a thousand words
ik how u feel
Hey tim any idea on how I can make a basic implementation of the ready event so I can see if my indentify actually worked?
bruh i knew it, thismf 💀
it will only work here
