#development
1 messages · Page 75 of 1
okey thank you
Whenever Rhythm got bent, my bot saw explosive growth she couldn't handle and was a huge pain in my ass because I had to rewrite everything
xd
long story short. Do not do music.
pretty much
I am no longer asking 
oke guys
I came here with another portion of magic
I have that kind of situation:
I am using VScode
I am starting bot - everything okay
Asked my friends to bomb my bot with same command - everything fine, bot successfully completed all command calls without any exeptions
Now magic:
When i used same command 3-4 times [same command that my friends used to bomb bot], - bot just stops working
Tested it on different stuff and commands, anyone uses command - everything good, me using command - bot stops working

Any thoughts?
maybe you shouldnt use the bot, just a thought
Without looking at the code we wont ever be able to guess
It'd end up being a guessing game
any error?
no errors, also tried to catch anything, still nothing
Show code
if a something crashes without any error then ur absolutely muting the exceptions
as abe said, please show code
who needs parallelism when everything is sync amiright?

show what appears when the bot crashes
do u have a global exception catcher?
Your luck stuff is another func logs, not related to this porblem
just stops like this
what logger are u using?
wdym by that
your log is oddly...empty
hey guys
like, when the bot is starting it generates a log of info on the console
i just started using sqlite3 in js
you HAVE to be muting it somehow
let result = await db.query(sql`SELECT * FROM serverdatabase WHERE id = '${server_id}'`)```would this be a valid way to select something ?
that about bot starting
why, it won't let me login to karuta when i try to vote? @ripe prairie
hm, ok, enable debug level and try crashing it again
And imagine i selecteded multiple servers, would i then have to loop over it? I mainly have been learning about how to create the queries, and how they look in duckdb, but haven't been able to implement it into a real language just yet 🙂
@sharp geyser do u happen to know how to enable it on node?
tried alr
same situation
bot stops, debugger detaches
and thats it
I dont mean debugger
I mean debug level, literally
logs have many levels, debug is usually much more verbose, and detailed
Are you using djs?
If so listen on the debug event and log its responses, thats a good place to start
how can i enter this level in vscode?
I dont mean this debug, I mean loglevel debug
nah, still same
nothing in console
then try trace
trace HAS to output something
if it doesn't then u messed something really hard

anyone that could verify this for me 🙂
i mean it happens only to me, i think it could be not bot problem btw
cuz guys tested out and everything worked just fine
It has to be something
and don't ignore it just cause it currently only happens to you
it could happen to others as well
Do you do any database stuff?
it's probably some exception happening, but we dont know cuz they're muted somewhere
If so, something there could be causing an exception
I can't even reference their code anymore cause they deleted it

i just logged manually and now i know place where this is happens but its kinda weird
Show the code thats stopping the execution
its just odd as hell
I want to push an object to a field in mongodb
database > collection > document > field (array)
What atomic should I use
To reach field?
Document also includes an "userid" that I want to filter with
do u use schemas?
Not at the moment but it's more "first come first served"
I check for fields for functions each time
And if it doesn't exist I make it
but schemas aint my problem rn
wouldn't I
{
"userid":123,
"profiles": []
}
idk
New to mongo
Other words,
Push an object to "profiles"
... .updateOne({userid: certain_user_id}, {$push: {array_field_name: ur_object_var}})
ur_object_var = object that gets pushed in?
yep
sick
Do you make a little framework just to help out with mongo?
like I have functions for setting fields to specific user(s)
Will come up later for me ig
const awaitingObject = {};
await mongo.pushData({ userid: user.userid }, { $push: { profiles: awaitingObject } });```
```js
pushData: function (atomic, data, collection) {
return new Promise(async (resolve) => {
resolve(await collection.findOneAndUpdate(atomic, data));
});
},```
h
Might uhh
It's called testing sweetheart
no assistance needed anymore
One message removed from a suspended account.
that's called rubber ducking
help by listening, people eventually fix bugs by explaining to others
finally i got some kind of exception btw
that it
Process finished with exit code -1073741819 (0xC0000005)
that's uhhh...not an exception
but u can search what that exit code means
my guess is that it has to do with some internal lib
are u using any lib for webp?
ye i searching rn
How do you remove a field/key that is inside an object which is inside an array?
user: {}
profiles: []
0: {}
uuid: "."
fieldToRemove: []
fieldToRemove2: bool
$unset
hmm
pretty sure they mean mongo
Then say it?!

skill issue
Sounds like something you definitely have
not rly, it says this happens when pointers is scuffed
And how tf did u manage to access pointers in js?

idk
tried to google some info
most info is generic and not suitable for my situation
Then u saw answers for the wrong language
Because that's definitely some native lib issue
@quartz kindle I summon thee wisdom
wot
Linux error mysql 
👀 Classic mysql
are you sure thats where the problem happens? does the problem stop happening if you remove the canvas image from the response there?
hmm maybe but how solution?

yes
already all
no solution.
do you have disk space?
idk rly, sometimes this happen, sometimes not, when other uses command it dont happen
no work.
reinstall mysql lol
tried removing canvas from msg, it didnt happen, but i cant be sure about it
cuz even with canvas
it sometimes happens, sometimes not
..
latest version? 1.0.1
yep
sudo apt uninstall mysql-server
but depends on how you installed it
sudo apt remove mysql-server
they had a similar problem in the past, but it should be fixed by now https://github.com/samizdatco/skia-canvas/issues/49
happens not fixed:D
try logging everything you can right before the line that creates the png buffer

so when it crashes, you have logs for the last thing that happened
including all values
sudo apt autoremove
bruh already there remove sudo apt remove mysql-server
and other? sudo apt autoremove ?
ok sigh
yes
yes
only this 3 funcs using canvas here
they are before sending canvas in msg
try uninstall again and delete mysql.cnf file rm /etc/mysql/mysql.cnf
(make a copy of the file first)
rm /etc/mysql/mysql.cnf there is?
sudo rm /etc/mysql/mysql.cnf?

?
@quartz kindle yeah but use my anydesk or Teamvie?

my no idea but first tiem linux learn hard
yes but said "access denied"
Already
said same denied
hmm idk
@covert gale
correct there?
and pub no?
U don't need the public key at all
hmm
yeah but othr is teminal
is okay
and dputty no cant
denied
Sorry but please, use another translator
@lyric mountain look error.
explain: putty no cant said denied access
and terminal [CMD] is good
access succes
oke i tested something out and can show u
i modelled this situaction like this
let i = 1
while(true){
console.time(i)
let canvas = new Canvas.Canvas(1910, 970)
let ctx = canvas.getContext('2d')
await Promise.all([
await this.client.database.createCard(message, cardData),
await this.client.database.createCard(message, cardData),
await this.client.database.createCard(message, cardData)
])
await Promise.all([
this.client.utils.drawCard(ctx, cardData[0], 0, 0),
this.client.utils.drawCard(ctx, cardData[1], 646, 0),
this.client.utils.drawCard(ctx, cardData[2], 1291, 0)
])
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('1')
.setLabel('1️⃣')
.setStyle(ButtonStyle.Secondary),
new ButtonBuilder()
.setCustomId('2')
.setLabel('2️⃣')
.setStyle(ButtonStyle.Secondary),
new ButtonBuilder()
.setCustomId('3')
.setLabel('3️⃣')
.setStyle(ButtonStyle.Secondary),
);
await canvas.png
// Sending msg with summon picture
// Here randomly bot closes for me
/*let msg = await message.channel.send({
content: `<@!${message.author.id}> is summoning 3 cards`,
files: [
new AttachmentBuilder(await canvas.png, {name: "cards.webp"})
],
components: [row]
})*/
console.timeEnd(i++)
}
the thing is
await canvas.png is completely alright
i tested it till 2k
its ok
but if i will create and send msgs
it crashed after 6th attempt

maybe u r cursed
try this [...await canvas.png]
and run the test again
u re right
i run more tests
and they did well
even with msgs
still same situaction
sometimes it happens
sometimes not
gg
hello
Where does this error emits?
Console
Bro, which part of code
Instantly after starting
I told ya its from modules
I see you have posted the following
Absolutely nothing of use
Thank you for choosing top.gg #development support
Ok
Most unhelpful shit ever
Instantly after starting could be from a number of places
Especially if you run stuff from other files
@terse bone if you want help, you’re going to need to post something that can actually help us, not just “I told ya it’s from modules”
Bro i mean thats not my code
That's something from node_modules folder
It could be your code though
Chances are it actually is cause you're using something wrong
Nah
I just googled it
And found it happens with discord.js v12
I need to update to newer version smh
Ye but smh v13 is giving compatibility issues with some of my modules
So i had to use v12
Use v14
Then don't use those modules
But ig now i need to update
Don’t use deprecated versions
Ya I'll update soon
I still using v13
I'm willing to create a login system for my website. What's the best way to achieve such so?
Do I use PHP and a database or should I use something else? My website is built with Express.JS.
Why use php only nerds like @boreal iron use it
Honestly as long as you can post to your server some way it doesn't matter what you use
you can use vanilla js, php, react, whatever
Could I do it via passport?
Bcrypt, passport, passport-local, express-session, express-flash, and etc?
Why so?
I've had issues in the past of it not passing the expiry stuff
which is kinda needed when refreshing tokens if going the oauth route
but if youre purely using local then its fine
What could I use, instead?
I do all of it by hand
If I'm hosting an application via Express.JS and I want a login system... ?
I use 2 things
express-session for persistent logins, and bcrypt for hashing
Other than that its all up to how you wanna post to the server
Fair enough.
Oh, I see why now...
Do I just use MongoDB as my database instead?
Doesn't matter what db you use
Would there be a better way to design this so I dont get two responses from topgg?
There are session stores for nearly ever db out there
there's only one response. you just logged it twice?
u right. I just noticed that. 4 am coding moment
i kinda solved it
but need more testing etc
changed await canvas.png
to canvas.toBufferSync()
sync func seems to be safer

its safer yes, but it might lag your bot
is it possible to show another modal after a modal submit?
Hey Tim, you remember us talking about this?
Wouldn't this still send to them even if they are in multiple servers that the bot is also in?
its possible yes
That's the thing I need to get around
How would I only get it to send to them once?
take the script outside of the shards
put it in a separate process, or even inside the sharding manager process
is there any easy way to convert my spaces as tabs (4x) with normal tabs 4 wide?
like, code indentation?
I just want my old code written with spaces as tabs to use normal tabs
so yeah
I just saw a vscode option called convert identation
could that be something?
Just replace two spaces by tabs?
i think so
Or how many spaces are supposed to be one tab
ig imma try it
Eww
You can convert on the fly back to spaces too
That... exists? 😳
ye
yea i think thats it
never knew
is that for every file in the workspace?
Use tabs always, it means you and another coder can see it differently even though its the same file
You can change it for all of vsc, but that will change it just for that workspace iirc.
The button on the bottom opens that too
Yeah probably, I just prefer to just do Ctrl+K and then whatever I want
Find everything with that
Instead of searching for the button(s)
do I need to do that for every file manually?
or is there something to do that to all?
How to get "no of servers bot is in". In discord.js v14
What?
how can i make a bot?
You gonna choose your favorite language and coding
Maybe reading some docs and guidelines, maybe not depending on your skills
uh
client.guilds.cache.size
Thanks
lol tf
making a bot requires knowing how to code
How did you understand this
magic
Do you know how to check if user has a permI updated from v12 to v14 today lol
That's why iam getting soo many errors
no = number

users dont have permissions.
but members do
https://discord.js.org/#/docs/discord.js/main/class/GuildMember
its covered on the docs
Oh
You might wanna update your code before running through each error
i did it but idk how o add at my sv
Update your code accordingly to these changes
v12 -> v13: https://discordjs.guide/additional-info/changes-in-v13.html#before-you-start
v13 -> v14: https://discordjs.guide/additional-info/changes-in-v14.html#before-you-start
Ok bro
Thanks
Soon v15
🥸
Breaking anything again
uh
"In this release we renamed literally everything, for consistency with the API"
i created the bot but how do i add?
Pick the permissions you want to invite the bot with, and then copy and paste your bot's ID to the respective field
https://discordapi.com/permissions.html
A small calculator that generates Discord OAuth invite links
You're welcome
whats a regex that matches
a-z A-Z 0-9?
You mean a regex that matches those ranges or that string specifically?
ranges
/[a-zA-Z0-9]/
thanks
how can I use that regex in javascript so it returns true if the string only has those chars?
And the regex should be like this if you want to check that the string only and only contains those ranges: /^[a-zA-Z0-9]+$/
thanks!
Hey , I wonder if having multiple replace like that, is a bad things ? Note: I can't know before the result of sp. If it is bad how i can do ?
this.jsonLang.tower.quest[sp["commands"]][sp["type"]]
.replace("%command", sp["commands"])
.replaceAll("%nb", sp["value"] )
.replace("%MyNb", DataQuest[key].value)
.replace("%floor", this.FloorData.floor_max)
.replace("%nameBoss", sp["targetId"] >= 1 ? MaxFloorInformation["boss"][sp["focusId"]][this.playerLang+"_name"] : " ")
.replace("%targetId", this.jsonLang.stats[sp["focusId"]] ?? sp["focusId"])
.replace("%lootbox", Items[sp["focusId"]]?.[this.playerLang+"_name"])
.replace("%skillsName", SkillsDatas[sp["focusId"]]?.["language"]?.[this.playerLang+"_name"] || "")
not a "bad thing" per se, but it could be replaced with a map + loop
while not faster, it'll at least be more readable
false
I can make bot with botghost
Misteey nub
I see, but i forget to say each sp doesn't use each replace in fact. For example this one use only four out of eight
"use": "Use the command ``%command`` **%nbx** (**%MyNb**/**%nb**)"
ew
you can improve the performance a tiny bit by using indexOf to check if it exists before using replace
I have a question regarding a system like this
Wouldn't those replaces end up doing nothing cause it can't find it and in turn end up causing a slight performance hit?
what?
Liar. You aren't even a member of this privileged and exclusive group of bot devlopers

you guys have no rights how are you privileged
you have to ask voltrex, but whatever indexOf does under the hood is faster than what replace uses to find the substring
string.indexOf() is stupid fast
more code != slow
well, it's at worst O(n)
anyone know why this isnt working
What error are you getting
just use createdTimestamp
it'll be time in seconds
that gives me loads of stuff that i don't want
Mon Aug 08 2022 23:41:22 GMT+0000 (Coordinated Universal Time)
thats what it comes out as
I want it to be neater
I think you may have put new Date(createdTimestamp)
Try just using created timestamp.
https://discord.js.org/#/docs/discord.js/main/class/User?scrollTo=createdTimestamp
Createdtimestamp is just a number
I mean the field itself
getUTCMiliseconds returns only the milisecond number
not all other parts
Why do people not make use of the discord stuff
<t:1670795480129:R>

<t:1670795557432:R>
Yea I think it might be broken
It can be a timestamp
<t:1099720595:R>
It takes a UNIX timestamp
which is in seconds
Youre right
I remembered wrong
:p
why do I think u just told ur age

Hewwo Tim
welcome to warhammer 40k
long live the god emperor
Games in 34798 years will be so immersive you could die playing them
but its fine cause you're already uploaded to the cloud so you are immortal
Got this code that uses Discords.com API to check for votes but it's coming up with an error..
https://pastebin.com/Zpx7BSv2
This is the error and it's coming from the if(memberDB.isPremium === false && !todaysVoters) line.
P:\MYDIRECTORY\v1.3.0\node_modules\@sapphire\shapeshift\dist\index.js:40
throw this.error;
^
CombinedPropertyError: Received one or more errors
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
The code works as soon as I remove !todaysVoters from the IF statement
memberDB.isPremium === false 💀
Not really sure if this is the correct place to ask this, but in top.gg, I have a bot page that I'm working on. However, I'm getting really annoyed because when I make an edit in my testing cite and bring it over to top.gg, everything is different because of top.gg's css styles.
Is there any way to just overide every single one of those styles? I tried all: initial; or all: unset; but nothing seems to work. Can anyone help me?
you can use !important yes, but it'd be best if you didn't
ye
topgg uses a lot of variables in their styles, you can edit their values
okay. Thank you. I'll see if I can.
somebody knows a online api creator other than aws?
Your text editor
its not that hard to make your own api. seriously.
are you serious?
unless you have masters in computer science, I'd stay VERY far away from aws
unless u have unlimited bank balance
aws is insanely expensive
especially if you don't know how to read their extremely vague price charts
You all are just insanely poor

real?
ofc
Cause I heard your nokia flip phone ringing in the vc
xd
one day you're using azure, the next day you're living on the streets because u forgot to make the api go idle
but well, apis are nothing more than normal programs listening to outside requests
it's the very same as making a bot, but without the discord calls
https://min.io/ I dont need aws s3 when I have this that just uses my own storage but has a aws-like s3 api
or I could just outright get a object storage plan from contabo
shiii actual boomer
tf will you put in 4tb?
I didn't say I would use it
a panorama that can barely fit your mom
I was just asking
They allow you to go up to 25TB as a baseline
if you want more you gotta email them for more

For that price probably just a common database ssd without nvme
They somehow need to get rid of all the stock I guess
So... offering cheap prices
wasabi charges half that but it's probably half as reliable
hi xet
Does anyone know how to disable this extra gap between elements in html (in top.gg)? I have attached two pictures. They both have the same code, but the first is from top.gg and the second one is on a private testing cite. Top.gg adds an extra space between these elements and I don't know why / how to disable it. Does anyone know?
Because topgg has predefined css values for most elements already your site doesn't have
Just edit the appropriate css properties which are most likely padding and/or margin
exactly. I have, and it still does it.
Do I need to do it for every object? Because right now, I just have it being done to a parent div
Add !important to the rules as topgg will overwrite them
okay. I'll try that
Like padding: 0 20px !important;
One message removed from a suspended account.
Am I doing this right? Because I'm getting red squiggles. I know I've done this before, but it was a while ago.
Sorry, just realized. Goes after it.
Nope. Still happens.
Go back to your general dungeon !important;
I doubt the preview is already fixed
Try to save it and see the live result
yeah, I did. I edited the code in top.gg and reloaded the page. Do I need to do something more?
One message removed from a suspended account.
Any ideas?
Yeah after saving it use the browser inspect tool to figure out which element you have to adjust
That's the easiest way
It will also show which parameters are inherited
yeah, so I was looking at that. There are like 1 million values. I can look through them, but do you have a general idea of which one it would be?
You navigate straight to your element the issue happens
And then if not found parent ones
okay. I'm looking
I really don't see any values that would change it. I even tried changing some of the values, and (other than messing up top.gg) it didn't fix the spacing.
What element is it?
That I'm checking?
No, it's not actually something like that. This is the code.
your top.gg return 403
Mine, yeah, it's private. Long story
oh alright
Add a style attribute to class gray-text with: style="margin-bottom: 0 !important; padding-bottom: 0 !important;"
Also remove the spaces between the attributes and = and "
This isn't a valid html syntax
Anyways I'm sleeping now
Will head to you later if needed
Okay. Thank you for your help. It still doesn't work, but I'll keep working on it.
Show me what u did
Err
You added it to the wrong element
<p class="gray-text" style="...">...</p>
Line 5 in your ss
Oh, you wanted me to do it there. Gotcha. One Sec
And remove the spaces
It's no valid html syntax
Remove it anywhere
Then after saving make sure to clear your browser cache when reloading
Show again to make sure you choosed the right element 
I did it on gray-text
so instead of <span>
I see
Remove the br below it
It might have a weird line height
Keep everything else and remove the spaces
It reduces the space, but it doesn't solve my overall problem. Extra padding, if you will, is being added to every element. The check list, the text, everything.
Yee can't go on without inspect tool to see it's css properties
So ping me if you can't solve and I will head to you later
Unfortunately I need to sleep for a few hours until life begins
For anyone who cares, this was due to top.gg's white-space:break-spaces attribute. It's under the css-18r9pyf style sheet.
I couldn't overwrite the attribute though. I think I need to be more specific in my style sheet. I'll try again tomorrow.
Some help would be appreciated though

this will constantly change
Anyone knows how this effect is called and how its made?
I suppose with position absolute but that won't rlly make it responsive right?
nvm managed to make it but anyone knows how it's called? does it have a specific term?
What are disadvantages of bitwise operations?
Looks a lot like MEE6 😭
Bitwise operations have no disadvantages in general, but these operations can be slow depending on the precision of the numbers used
Coincidence /s
Alright thanks. I would say the only disadvantage or let's say limitation is the scalability. Because let's take JS.. the int max is 31 bits so the max would be 31 different options of a type. (Even if there would be LongInt in DB etc. but that's stored like a string not as an int (i'm not sure))
We're talking about disadvantages in general, not programming language-specific disadvantages but this is really not a disadvantage of JavaScript either because it already has big ints as well which have an arbitrary precision, which also work with bitwise operators
The disadvantage you're talking about are of the databases who have no way to hold such data in it's pure form
Yes fair point. Another person also said a reasonable point, the readability. But after all it's pretty much perfect
I love bitwise 
same, it's awesome xD
with bitwise you can compress lots of data in just a byte or two
There is always someone https://dontasktoask.com
okii
so i've received a question on my assignment about this code snippet. It's clearly a race condition. They ask us how to mitigate this race condition. I answered with: "
To mitigate the race condition, we must make sure that the operations don't have gaps between each other, so that
one operation can take in the place of the other and therefore ruin the perfect sequence.
In this code we can see that the last time.sleep(1) only has 1 ms of timeout. This is not enough for both transactions to go through, due to
the sleep(0.2). We must make sure that we remove all gaps, so we should remove all the time.sleeps, so it becomes one glued system,
and becomes an atomic operation where the operations run after each other(first operation deduct 1100, then operation deduct 100, then the print operation)
this is because it's a function that locks your whole system while the rest of the code still runs.
By removing the time.sleeps, both operations belonging to the registerdeduction can complete before the print operation gets initialized." Would this be correct?
wrong
to fix a race condition all you need to do is synchronize the code
also "this is a function that locks your whole system" would be a phrase that'd void the entire answer in my books
sleep only freezes the runtime, not the system
the sleeps are there to simulate real life delays, they are not meant to be removed
race conditions are fixed with mutexes, semaphores and versioning
Just await it ezge
How are bitwise operations used for the communication over ports/sockets?
owh really?
but we would have to remove all the sleep functions right to synchronize it?
I ran it without the sleeps and it worked
there are no "sleep functions" in the code
read the comment right in front of it
time.sleep()
**read the comment right in front of it
**
it means it doesn't exist, it's there just so the teacher doesn't have to write a huge function with considerable delay
but what would the problem with this function then be?
Like how would we be able to synchronize it?
that's what ur supposed to research
u can't simply ask for the answer here, you're supposed to research and find a solution yourself
I already gave u a word to search for
u need to synchronize whatever function needs to be thread-safe
but this is wrong i think?
the last sleep DOES exist doesn;t it?
Yeah so i think that we could use shared variables and data structures, so that the operations get synchronized. It's because when one shared variable is used by one operator, the other ones basically 'queue' up.
This would remove the whole race condition right>
any form of synchronization will solve it
okay thanks!
is this safe?
const key = crypto.createHash('sha256').update(String(json.key)).digest('base64').substring(0, 32)
const algorithm = json.algorithm || 'aes-256-cbc'
const iv = Buffer.alloc(16, 0)
const cipher = crypto.createCipheriv(algorithm, key, iv)
let encryptedData = cipher.update(json.text)
encryptedData = Buffer.concat([encryptedData, cipher.final()])
return encryptedData.toString('hex')
}```
love seeing sites like this, lmgtfy.com is my personal fav
That ain't encryption
Ah nvm
Well, define "safe"
Ur probably thinking too much, u just need a random salt to encrypt your data, no need for all that huge stuff u did
I call it safe if you can only decrypt with the key
That's true for all encryption algorithms
That's like, the whole point of encryption
Unless ur storing state secrets, just go with a decent and not so slow algorithm
Nobody will try to crack some rando info like that
well its for storing passwords so I hope
🧐
The second line in ur code, use that to hash the password
And store whatever you comes out of it
Whenever u need to check if the password is correct just compare the hashes
Hashes are irreversible, so ur safe from cracking
Just make sure not to use a weak hash like md5 or sha1
Else u might get collisions
it sha512 & sha256 not safe?
it's not about being unsafe, it's just that both are considerably slow
especially 512
256 is guaranteed to never collide during sun lifetime
512 is guaranteed to never collide until heat death of universe
?
hard to say, but I don't think so
we're talking about nanoseconds of difference
The event when bot left a server is guildDelete ri8?
V14
Or is it changed
you're using js anyway, don't worry too much micro-optimizing
if u really want to squeeze every possible performance u need to use a language that properly supports threads and low level features
guildRemove no?
whats the benefit to sha256 if spped doesnt matter? is the output smaller?
anyway, use the constants instead of strings
V14 ?
half the bytes
idk, check the docs, but ik v14 has constants for events
it always has the same length, correct?
so I should do varchar(32)?
just char(32)
what does that change?
varchar is variable length (up to the limit)
ahh
if u know the exact size always go with char
u can also drop the char entirely and simply save the bytes
it'll be more efficient since u dont need to convert to hex beforehand
hashes are supposed to be saved as bytes anyway
you mean this?
I have this, shouldnt that do it already?
so this?
.digest()
u can reduce that to a single line
just allow it to pass undefined as encoding
How do I store that in my db?
as a binary field
know what, just go back to what u were doing
not worth the extra hassle
store as char(32)
https://srcb.in/BprmqDl0Zm here is my CommandAbstract file now i just want yo execture await commandAbstract.command_context(message, command) when
commandAbstract.CheckPermissions(message, command)) won't return any err but it returns missing permissions which i am handling .. it crashes my bot.. so i just want it to return missing perms message but not crash the bot ..
under no circunstances you'll ever need something like this
but well, show what's inside CheckPermissions
and please, use a single casing, either go PascalCase or snake_case
also new SomethingAbstract() is literally the antithesis of what it's supposed to be (abstract classes are never instantiated, they're molds for other classes to inherit from)
i did this cause that function returns true when it pass else it will return false
just remove that
then what's the correct syntax/format ?
if it returns true or false that's already the condition
answered inside parenthesis
abstract is something that'll be inherited, not instantiated
u can name it like that ofc, but it's non-standard
then ig i am not wrong here ..
const CommandAbstract = require('../Structures/CommandAbstract');
const commandAbstract = new CommandAbstract(this.client);
if((await commandAbstract.CheckPermissions(message, command))) {
await commandAbstract.command_context(message, command)
}
``` so running it like this is not correct ?
it's definitely a wrong implementation of "abstract"
class Something extends SmthAbstract {
but well, show what UserPermissions and clientPermissions are
also never do
if (...) return true;
else return false;
just do return ...;
return true ?
no,
return (userPerm && clientPerm)
KuuHaKu how can I transfer my varchar() column (which has the new values that work with char()) to char()? postgres
make a new column -> copy data to that column -> delete old column
sorry but...holy fuck what a mess
u dont need to do 1% of all that
just check if bot has permission in channel
also you might be able to simply alter the table, worth a try
i'd personally do stuff like that through an ui such as phpmyadmin to not fuck it up
check clientPerms once i am doing the same
U mean
ALTER TABLE table_name ALTER COLUMN column_name TYPE new_data_type?
u dont need anything other than that
channel perms already account for all levels
yes
do a backup if you wanna be double sure
some databases dont allow doing that tho, never tried with postgres
or even better a transaction:)
well its in their docs so I assume it does
varchar -> char I mean
according to docs it tries to auto convert if not valid
that's not the case.. it logs in console Missing permissions and terminates the bot.. check if i am doing something wrong in my class
I...cant
your code is at best unreadable
it'll take someone like waffle or tim to find the error there
Ehh.. just ready client and user Perms function at the bottom of class
that's not how debugging works
anyway, try logging the values on each step, see if anything looks off
or if you know how, use a debugger
At your service
would this technically work?
https://pastes.dev/jBtc7UC4DR
sql runs 1% righter if YOU USE SCREAM CASE
/s
try it once sir lol
64 is sha512
which it shouldnt be
32 * 8 = 256
oh wait, nvm
sha256 is indeed 64 (when using hex)
I mistook with something else
it's only 32 when stored as binary
also 💀
this reminds me of bae
holy crap
waiting ping when using encrypt / decrypt -> 80ms
waiting ping when using hashes -> 18ms
🧐
yep, hashing is a fuckton faster than encrypting
a guy who had...peculiar coding habits
lul perhaps
ah no it was fake
#development message
Me?
I can't remember
I don't click that link, probably scam link
So many cryptic numbers
Report is out!
a
Help lol.
with?
<ul>
<li class="nav-link scrollto"><a href="/profile.php">Profile</a></li>
<li class="nav-link scrollto"><a href="includes/logout.php">Logout</a></li>```
for php

Look there Benzitczologin but need only benzitczo to change login name
example: if (isset($_SESSION['user'])) { // Set username } else { // set login }
but my think complicated.d
An example for you to understand:
if (!empty($_SESSION['user']))
{
echo "<li>{$_SESSION['username']}</li>"
. "<a href=\"{$someurl}\">Logout</a>";
}
else
{
echo "<a href=\"{$loginurl}\">Login</a>";
}```
Depending on your backend check if a session exists or not you have to show the html elements you want
Nowadays if you don't like to escape your chars inside the string literals you can also use heredoc which I really like
echo <<<MENU
<ul>
<li>$_SESSION['username']</li>
<li><a href="$logout_url">Logout</a></li>
</ul>
MENU;
which keeps the embedding and code hierarchy
Bot Designer for Discord mobile app kick code
-------------------- Don't need anything special -------------------- Usage: ki - b832b120
How can i write like this?
Just type on keyboard? 
How can i write like FakE?
like this?```
yea
oooohlua
ty
-------------------------- Create_ticket -------------------------- Usage: What - 10175edc
One message removed from a suspended account.
Okay... I just post these for new guys
------------------------ Flip command ------------------------ Usage:What you w - 224d922d
lol
lol
rip banned
its a great thing for beginners to begin coding with, as not everyone wants to jump straight in with JS or python etc
try reload discord.
Yeah
not for everyone
one bad experience for you shouldn't mean you discourage others from using it
Who joins discord that early and wants to make a bot?
maybe.
relaxgood.
hmm center?
think profile?
margin: 0 auto;
If the parent element has 100% width, it will be centered
Looks good. Purely my opinion, but from a UI design standpoint, I would have added Icons for the "Home" and "Projects" Menus, and maybe given your description a dark gray color, but purely my opinion.
Maybe instead of a hyperlink a button?
Honestly, it looks fine
Anyone know what's rich presence invite image?
might be just me but the rounded corners looks funky af
its too round on the navbar i think
In top.gg, one of the tabs in the edit area can do that. Just go looking through there.
When you are so dumb you dm advertise to staff
Lmao
ngl it's actually pretty good for coming up with ideas
xd
bank account
Not I meant on dev portal it was showing for my bot
?
Oh, no idea
Me too lol
online game
In what language
I was going to do typescript but I’m going to make it in C# now
Just the websocket backend
Maybe I’ll make a frontend for it with ts
you should try tauri
I feel you'd like it
Any one know whats this err about?
no
I have no idea what else could be a path collision
Are you 100% certain no duplicate keys
duplicate key?
as in channelId or whatever being put in twice
you mean these ids ?
no
well as channelId yes
Well are you trying to export your db file to json?
the errors are came from these two
Then there is your issue
your db will likely have multiple entries with feature_welcome_channel.channelid
json cannot have duplicate keys
hmmm
well
if I try to select all outputs
I will get that err
buttttttt
if I don't select all of these it will successfully export and in json file I have both of them
so when I want to export I have to de select childs?
Well no, cause children keys can be duplicated
but you can't have multiple feature_welcome_channel keys
so I have to de select parents ?
that shouldn't be valid json
Yes correct much many bots
Private information we are not allowed to disclose
It's just a number, no?
So you cannot disclose the amount of bots that are currently pending review?
Exactly, as said above
it was disclosed a few times in the past, on average there are 200-300 bots pending review every day, some times the number goes up to 1000+
There is a datadog dashboard
No idea if its still active
Ok its not active anymore
It has been removed because we got hit by a high bill
Hence, it's private information
I remember when one of my bots was removed from topgg (after being verified) because I accidentally sent a discord invite to one of the mods or someone that has power over accepting and deleting bots
abuse of power imo
I didnt dm him out of the blue, we had been talking before.
One day I was inviting everyone on my friends list to my server using the invite feature and had accidentally sent them an invite (which I deleted immediately) and they removed my bot instantly
lol
thats out of the blue
you invited them from nowhere


