#development
1 messages · Page 147 of 1
also is the const here completely necessary?
No but it is to hint at the compiler for further optimizations, but most importantly to be 1:1 with the original solution
does using const give you performance gains
Absolutely
it leaves less guessing to the compiler
ah alright
what about using curly brackets for variables?
they look really ugly in code tbh
yeah whats up with that
That's called direct initialization, it allows for further optimizations by the compiler, using = means copy initialization which copies the entire value which is less performant/efficient
so doing a = b + c means store b + c in some temp location, then copy it to a?
but it just looks soo ugly 
Correct
i don't see C++ codebases rewriting their variable initialization to {} anytime soon
i mean it makes sense, but i would've guessed the lang/compiler knew to already store the result in the right location when its being asigned to a variable
Well that's not really how it works in C++, what if the value is an lvalue from a different scope or location? The different initializations are there to help the compiler know and also change the behavior explicitly
this one is also wrong, third and fourth should return 3 and 6
ok time to start a war
this one is correct
no
what is the fastest database for handling lots and lots of data
as in like hundreds if not thousands of reads and writes a second
dynamodb
do you need synchronous writes or can it be eventual consistency?
the latter
ai tried and failed
my old version of it used Mongo
which inserted every 1000 entries to reduce load
looking at Cassandra now too
well, postgres is well known for being scalable, other than that, any other db thats is specifically designed for distributed storage and eventual consistency
mongo took like 2 mins to query when it had 255 million entries
it all depends on configuration tbh
like MongoDB is tecnically designed for distributed computing too, but it takes very careful configuration to make it work corectly
here are some interesting comparisons
sorry for spam
no dynamodb?
in this particular article no
isnt dynamo a database "service" tho
like, can you download it and install it offline?
all the ones above can
yeah, i use localstack to install it on my computer
ah ok
idk then, they didnt mention it, nor they did cassandra
anyays g2g sleep, its almost 3 am
ffs
finally development is free
if i see one more function named getCost in this channel i am going to lose it
const getCost = () => "L"```
I understand that server emojis can be added to Select Menus, but I'm missing how they can be added if the server does not have said emoji. I've seen other bots have emojis or icons in the Select Menus, but I don't have those emojis available. Any insights?
They don't need to be in the server
All u need is the name + id
This applies to every component
what am i supposed to look at
open it in your computer
You draw the windows by clicking and dragging to a different point, the bigger the better
My friend came up with the idea to use the formula for triangular numbers https://www.google.be/search?q=triangular+numbers&ie=UTF-8&oe=UTF-8&hl=nl-be&client=safari
I did the rest of the math after that wich was actually quite simple
My websocket ping 40500 ms... How can I fix it...
cool
how did you calculate that?
client.ws.ping
if you did that right at the bot's start, wait a minute or so until the bot stabilizes then try checking the ping again
@rustic nova Step one to making a storage server completed, got a minio server implemented 
I checked, its 17500 ms...
either you are doing something wrong, or as css jail said above, something is seriously wrong with your internet and/or hosting service
soo how was it @civic scroll
there's a bug when you spawn a new window
that causes it to get spawned out of bounds
and said window doesn't have a handle
(projects -> pick any)
also the window dragging operations are often briefly suspended, resulting in a very jaggered feel
and scrollbars are not styled
there's also no window resize handler
but overall
it looks nice
it looked like what i could achieve, but failed to (i stopped and window and process management emulation)
rip
'Home for Discord' website: navigation hover menu lacks opacity animation upon removal
another thing
besides Scroll to zoom, you should also handle Ctrl + Scroll input operations
true
another thing is, handling cases where the controls grows out of the window
this looks illegal
besides that i have nothing else to say
because after all
you have a portfolio and i don't 
(for now)
you literally have a portfolio repo on your github
just pull up a figma and start working

you can't draw raster art with svg
is it gonna be like pixel art or something
no, just good ol' Live2D
because that's what i want to do
is that the thing they use for vtubers
do you have a planned layout on how it would look like?
if you find it, send me the link
i need to install it too
i dont install viruses
virus benefits from virus
wait also that means it's lightweight
ez space saving
nah I give up, was trynna make a new frame design to pair with the new star design but I'm just not good at this
whatever I make feels off the theme
battleless left 😢
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.

should we start a campaign to get him back in
as much as we didnt realise it he was an integral part of development
storyboard?
Hi, I would like to ask how can I make vote rewards so when someone vote for my bot, it gives him some rewards
Pls ping me
use topgg websocket
with it u receive an event when someone votes containing the voter's ID
No
Official Top.gg Node SDK. Latest version: 3.1.5, last published: 3 months ago. Start using @top-gg/sdk in your project by running npm i @top-gg/sdk. There are 9 other projects in the npm registry using @top-gg/sdk.
Oh, bcs I use python (discord.py)
like how a story is told
as you scroll, the "story" progresses
nice
how would you fit that story in a mobile phone
a bit of layout work
ah icic
or i can go with classic section-based approach
(about, projects, timeline, yada yada)
and ofc, interactive mascot
problem with storyboard is that i have to think of a narrative and get enough assets
what kind of story would it be?
will it be a character introducing your projects and skills or what
Can u say some example?
something like cherupil's website
a demonstration of my passions, skills, hopes and dreams
cherupil?
inefficient algorithm over large input
but i'm guessing that's out of spot
i'm mainly suspecting about bad internet delay
No...
I use different hosting service bu I got same ms..
his website is incredibly laggy though
then it's code issue
you have device issue 
well
...
unfortunately most website visitors have the same issue
not everyone has big expensive computers yknow
but yeah ima add an option to reduce animation / reduce assets if needed
totally smooth on my phone
don't know exactly what you expect us to tell you, there's nothing to work with
no problem
again, timeline should be scrollable
like how you scrubbing through a record
what matters is how you set it up
about the mascot, she has delayed action so scrolling rapidly won't do anything, except swapping out her outfit
your prts startup animation already looks really good
the old one?
Can I find the problem by adding the commands in order?
or the concept
no
or the rewrite version
prts.vercel.app
oh the old one
you can start by showing how you're checking the latency
I use json database and I have 10k person in this database
oh boy
.....
Omg
Yea I know
you found your issue
that could be part of your problems...
having to rewrite the entire file every time you update something
that's problematic
Bot is on it's death bed with that 👀
use a proper database like mysql, mongodb, postgresql, etc
something that is meant to be queried and updated often
json is unoptimal for this use case because even though you can use json, it requires you to parse and reserialize the file each time you want to update it
MariaDB is pretty nice aswell. I like mysql queries. Like writing english.
which is slow when your file is large
Thanks for advice
You should use something like PostgreSQL over MongoDB if you don't want to worry about scalability
My personal favorite is postgres
sql u mean
10/10 would recommend
json slow
you might wanna use mongodb if you wanna keep using json format
Mongo is easy to use and should be fine for what you're doing if you don't want the burden of learning SQL (Though it's not very hard)
INSERT INTO
VALUES (
)
Thanks everbody for advices guys
I know mysql, I was learn while I work on web development
Can I use this on my bot?
yes it's a database like any other
facts.
📠
❤️❤️❤️
bruh i have this function on my microcontroller which does processing on a lot of bytes
i needed to call it 1024*1024 times and i was wondering why it was freezing then i worked out it would take 16-17 minutes to complete
second time i did it its almost instant
turns out gdb is just very slow with its "watch variable" feature
Use LLDB :^)
im in the gnu ecosystem now i cant escape
Yes you can, join the light side Chloe, experience the power of the LLVM project

didnt read the context, thought that was a new database
low level database when
come make tcg cards smh
Soon 👽
i've been playing around with LMDB lately and it feels really great to use
using it for synchronous multiprocess cache / shared memory
much better than redis
this is the logo for gdb
very fitting the fish looks sick so it needs to be debugged
idk
bugfish

aurelbug
yes
who comes up with these gnu logos seriously
they suck
well now i know how a gnu sounds like
the sound it makes is fitting considering giving you weird linker errors for the simplest bug in your code is unintelligible
fish
when did discord invalidate discord invites?
i noticed the invite strings are 3 characters longer now
maybe it already exists
One message removed from a suspended account.
One message removed from a suspended account.
With the JDA java discord api library, is there a way to acknowledge an Interaction without sending a message?
By doing a follow-up, dunno the equivalent of that in jda
What's a follow-up? I'm familiar with deferring a reply, but my understanding is eventually you still need to send a message to complete the action.
yeah the only way is to defer the reply if you want to actually respond to that specific interaction
Ah. feels bad. I have a StringSelectMenu that I don't want to have to respond to every selection. But I guess there's no way around that.
I remember using something in pycord that allowed me to respond to the interaction without a message, no clue what that was called though
cool cool. I'll look into that. ty
edit the original message
like, if it's a button simply edit the message with the same content
this will consume the interaction and the user won't really notice anything
beauty. I'll give that a try. ty
anyone got any vscode themes they recommend
been using this for a while and I want to change it up
bros making a whole turing machine 💀
i use github dark
cant find anything else thats a balance of cool and not distracting
just a little project to learn tauri tbh, I'm bored
basically just going to be a visual brainfuck interpreter so you can see the steps it takes
What's the name of the theme that you're currently using?
One Dark Pro
I don't know of any theme that comes even close to how good One Dark Pro is, but if you don't mind the UI being changed then there's also https://marketplace.visualstudio.com/items?itemName=GitHub.github-vscode-theme which makes VSCode look like GitHub's UI with it's syntax highlighting and whatnot
It also has tons of downloads
ehhh
not a huge fan of the colors
feels a little scuffed
I think I'll keep running One Dark Pro for now
Oh God, those colors are angry af
I don't think I would be able to program with those
Yeah
I use vesper++
I kinda like it
GitHub Dark Theme with High Contrast my beloved
stop advertising

now i have this problem Traceback (most recent call last): File "/home/container/bot.py", line 37, in <module> bot.topggpy = topgg.DBLClient(bot, dbl_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.11/site-packages/topgg/client.py", line 98, in __init__ self.http = HTTPClient(token, loop=self.loop, session=kwargs.get("session")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.11/site-packages/topgg/http.py", line 84, in __init__ self.session = kwargs.get("session") or aiohttp.ClientSession(loop=self.loop) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.11/site-packages/aiohttp/client.py", line 228, in __init__ loop = get_running_loop(loop) ^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.11/site-packages/aiohttp/helpers.py", line 289, in get_running_loop if not loop.is_running(): ^^^^^^^^^^^^^^^ File "/home/container/.local/lib/python3.11/site-packages/discord/client.py", line 140, in __getattr__ raise AttributeError(msg) AttributeError: loop attribute cannot be accessed in non-async contexts. Consider using either an asynchronous main function and passing it to asyncio.run or using asynchronous initialisation hooks such as Client.setup_hook
(i did it like it was in that docs)
Or using discord’s formatting <t:timestamps in seconds:R>
@earnest phoenix
hehe that's what I did
how would i add cookies into an axios request?
for node
axios.get(url, {
headers: {cookie: "cookie data here"}
})
for browser
axios.get(url, {
withCredentials: true
})
thx
is the cookie required to be a string or can it also be an object?
should i a string i believe
alright thx, now how would i add a delay? setTimeout() works but im planning on using something that pauses the execution of the code
promises and async/await
Pls
ask in #topgg-api
thanks js :^)
for XOR ciphers when you have multiple bytes as the decryption key do you pad the input to match the multiples of the length of the key or do you just ignore that
i did it by padding the input to match the key multiples
have to make an exercise for a local school thats coming in to my work for some "work experience day" lol pretty fun
also helps with obfuscating the true length of the plain text i guess
@rustic nova task view
looking p nice
I think u can fetch votes, but you'll need to read the docs to know for sure
What os is that? Is that a linux dist?
Oh it sais lilyos…
yeah
but can it be an os if i modify the kernel?

thanks
If anybody happens to want a YouTube Data API library that's a little more noob-friendly and YouTube-specific than the googleapis npm package, I've made a library called Popyt that is just that.
https://npmjs.com/package/popyt
https://github.com/brandonbothell/popyt
It has life-saver quality of life features like caching and pagination built-in, and over 80% test coverage that is all passing.
Other features include automatic input resolution (detect whether the user is trying to search for something or list it by ID/URL automagically!) and methods directly on the object classes for quick data access/editing.
Sorry if this is advertising, but I see similar messsages in this channel and have made the library myself (with a few open-source contributions) over the last four years or so, and really want to show my work to others and hopefully help people make great things.
it's okay, advertising isn't against the rules
do these colors look right? it's using this logic to pick the background color based on the text color, but some colors seem too light to have a white background.
const contrastColor = (rgb) => {
const luma = (
0.299 * ((rgb >> 16) & 0xff) +
0.587 * ((rgb >> 8) & 0xff) +
0.114 * (rgb & 0xff)
) / 255;
return luma > 0.5 ? 0x000000 : 0xffffff;
};```
Everything is legible to me but I have no forms of color blindness
does this look better? js const contrastColor = (rgb) => { const luma = ( 0.299 * ((rgb >> 16) & 0xff) + 0.587 * ((rgb >> 8) & 0xff) + 0.114 * (rgb & 0xff) ) / 255; return luma > 0.36 ? 0x000000 : 0xffffff; };
Personally my solution would be to give the user list of colors to choose from and use slightly different colors internally depending on the theme of the website
it's taking the color from a discord role
Ohhhh, maybe then I would adjust the background color of the role text to always be the same color for consistency
Only because everything is a lot more understandable to the human brain, but maybe I'm just easily overwhelmed lmao
colors are tricky
Giving random roles background color makes them seem more important
i need to figure out how to lighten or darken a color
So I would give all of them some type of background shading/color to keep it consistent
they have a black background on extra dark blue
so you can't see it
maybe i just need to make that dark blue less dark
Oh wow, I would make the black more like discord gray
Yeah, anything to make the text outline pop from the background a bit more
Could do black background and letters with white outline
i think i'm doing outlines wrong
Maybe the text is too small on your screen? I can only see like 5 pixels, try zooming with CTRL + scroll wheel up
https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-stroke maybe this CSS property? @proven lantern
It looks like you're adding a "stroke" using a workaround I found on stackoverflow using text shadows, which is probably not the best way to do it
that text-stroke property doesn't look like it's a standard
yet
looks better
though
It seems like a text shadow like this works well until you zoom in on it too much:
text-shadow:
1px 0 0 white, /*right */
0 1px 0 white, /*top */
-1px 0 0 white, /*left */
0 -1px 0 white; /*bottom */```
But yeah I agree that it looks a lot better than before here
.addStringOption(option =>
option.setName('severity')
.setDescription('The severity of the blacklisted word')
.setRequired(true))
.addChoices([
['Warn', 'warn'],
['Mute', 'mute'],
['Kick', 'kick'],
['Ban', 'ban']
])```
how come that it says: (intermediate value).setName(...).setDescription(...).addStringOption(...).addStringOption(...).addChoices is not a function
Yes
I created a Base class to give an extends in a class to create the slash commands, passing the options in this, but this is not accepted in super, or before it, how can I solve?
example of what i want to do:
class Base implements ISlashCommands {
public name: string;
public description: string;
public name_localizations?: object | undefined;
public description_localizations?: object | undefined;
public options?: ApplicationCommandOption[] | undefined;
constructor(slashCommandBaseOptions: ISlashCommands) {
this.name = slashCommandBaseOptions.name;
this.description = slashCommandBaseOptions.description;
this.name_localizations = slashCommandBaseOptions.name_localizations;
this.description_localizations = slashCommandBaseOptions.description_localizations;
this.options = slashCommandBaseOptions.options;
}
getName(prefix: string): string {
return prefix;
}
}
class SlashCommand extends Base {
constructor() {
super({
name: this.getName('example'),
description: this.getName('example'),
options: [
{
name: this.getName('example'),
description: this.getName('example')
}
]
});
}
execute()...
}
anyone with any ideas? 
show the type error
also, you cant call this inside super
this only becomes available after super has completely finished
I know this, I want to get a result like this, I even tried to return the name in the Base class with the function, but when I pass the options name it returns an error
class Base implements ISlashCommands {
public name: string;
public description: string;
public name_localizations?: object | undefined;
public description_localizations?: object | undefined;
public options?: ApplicationCommandOption[] | undefined;
constructor(slashCommandBaseOptions: ISlashCommands) {
this.name = this.getName(slashCommandBaseOptions.name);
this.description = slashCommandBaseOptions.description;
this.name_localizations = slashCommandBaseOptions.name_localizations;
this.description_localizations = slashCommandBaseOptions.description_localizations;
this.options = [
{
name: this.getName(this.options.name)
}
]
}
getName(prefix: string): string {
return prefix;
}
}
Error: The type '{ name: string; }' cannot be assigned to type 'ApplicationCommandOption'.
The type '{ name: string; }' does not have the following properties of type 'ApplicationCommandSubCommand': type, descriptionts(2322)
gives a typing error that comes from djs
and even so, I could not use it that way because I could only pass one option
and my creativity is nothing but that 
you aren't providing the option type and description?
seems like a valid error to me
yes, I'm passing the ApplicationCommandOption[], but even so, as I said earlier, it wouldn't work to pass the name of the options in the Base class, because it would only be possible to pass one options
I'm trying to think of a way to get the same result as this in super
and yes it is a valid error
i still dont get what you're trying to do lol
lol
I want to get the names and descriptions of my commands by prefix
so that I can manage more easily
for example, there is a yaml folder, with the text options of the specific action that is identified with a prefix, there will be the command name, description, locations of the name, etc...
so i am creating some functions such as response, getName and getDescription
and I wanted to implement them in a way that avoided importing, so that the code would be cleaner
and more self explanatory to myself
This grab command in my old code iam add new code but not removed this grab command snd also new cmds not showing how fix 🥺
You can't call methods before (or inside) super is called
Because those methods don't exist yet
Pls help
And yeah, neither does this
how do the modals work? Are they message components? How do I display them and get back data?
Use the hook
Can't, didn't understand a thing of what you said
When the user uses a slash or a button
I want to make the user press a button on a message and then the modal should pop up is that possible?
It's the same as sending an eph message
slash commands have to be registered/updated/unregistered separately from the bot code
just having the code will not register them automatically, and removing the code will also not unregister them automatically
you need to explicitly do that
How to do
How to add bro
do nodejs/express http servers support SO_REUSEPORT?
whats SO_REUSEPORT
it lets multiple applications listen to the same port on linux
sus
pesky torvalds confusing us by giving 2 different things very similar names
but that can lead to UB no?
tldr nodejs will not support it because there is no way to emulate it on non-linux systems
and according to them, the core values of nodejs is to work the same on all systems
the only OS where node will actually use SO_REUSEPORT is BSD
because on BSD REUSEPORT and REUSEADDR essentially do the same thing
and nodejs does support REUSEADDR
however as someone pointed out in the last comment, there is a trick you can use to enable that feature
open the port outside of node, then inherit the port through its file descriptor
How do
@quartz kindle can you check dm
Tim open your door
tim open the noor
<iframe width="100%" height="1000" id="1065706786600009771" src="https://we-love-nsfw.gitbook.io/welovensfw/"><p>PUT RANDOM TEXT HERE TO MAKE THE CHARACTER COUNT HIGHER gggggggggggggggdgdgdgwgfwgfdjjddjjdjdjdjdjdjjdjdjdjdjjdjdjdjdjdjdjjdjdjdjd</p></iframe>
like this ?
dont need the id
that id is for the iframe, not your bot's
btw, I do hope the bot isn't entirely about nsfw
It is
We Love NSFW is a bot based on the NFW theme but which also contains fun and useful moderation commands.


I love how instead of writing a ban appeal they try to add a bot from another account even though it has already been declined twice for the owner being banned
An alias for the infamous Discord senior developer called "Ian Mitchell" He is known for his deploys that have caused Discord's prod deployment to crash multiple times, exactly at 05/25/2022 09:38:26 Mitchell committed and pushed untested code to Discord's GitHub repository which instantly started a chain reaction in Discord's infrastructure, th...
i love this
number one result on UD
ian deployed
ive actually had it UP TO FUCKING HERE with linux
ive been trying to allow r/w access for a SPECIFIC FILE SPECIFIC ACCOUNT
litearlly tried every command on the planet still "permission denied"
user owns the file too 💀
maybe ill have some luck with filezilla instead of linux cmd line
also which genius over at the linux foundation decided it was a great idea to not allow user accounts to listen to port 80
instead making people run apps with sudo/root to run applications and opening up a massive vector of attack
ive had enough of linux for today
ok they apparently did somewhat address it via: /sbin/sysctl -w net.ipv4.ip_unprivileged_port_start=0
but it was not easy to find this since apparently its a very new feature
Love this shit
Same thing happens to me
I’ve given up and just sudo it
turns out it was a symlink
for some reason permissions applied to symlinks dont get applied to the destination of the symlink
so it still permission denies
cmd line needs to make it more clear whether something is a symlink or not
instead you need to run an explicit command
Technically it does, for example when you run the ls command it'll color symlinks as light blue
Unless you're using a terminal that doesn't support colors
And if so there's the file command (it may not be installed but you can install) so you can run file <path> and it'll tell you what it is, if it's a symlink it'll tell you that
For example:
I’m going to create another bot project that uses postgres as my database of choice. Should I bother learning how to use something like docker to deploy it? Or should I just go with my usual “clone the repo and pray there’s not a ton of setup on the host” approach
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
just add a command cooldown that refreshes itself if used before the cooldown expires
One message removed from a suspended account.
it kills 99% of the bot spams
make it a random cooldown time and it kills the remaining 1%
not what they mean
they probably got caught in a bot farm
One message removed from a suspended account.
But is it worth the effort for a bot
I suppose I should learn it anyways but still
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Yeah that’s the biggest reason as to why I was thinking of doing this
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Is docker something you have to set up from the very beginning or can you kinda just throw an existing codebase inside of it and work with it from there
One message removed from a suspended account.
One message removed from a suspended account.
I’ll look into it
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
nevermind have opened a discord support ticket
why'd you delete the original question tho
not everyone needs to know 😄
You can wrap your application in a docker container at any time. It's just setting up the dockerfile. A docker container isn't related to any one language, it's sort of like a VM if that helps. It's just a place that your code runs. It's language agnostic in other words. My bot runs in a docker container. If you have any questions let me know.
my bot too runs in a docker container (three actually), they're great for deployment
So how do I view the list of all Dayz trader bot commands once I’ve added it to my discord server?
oh so you're the reason my EC2 instance was so slow
this unfortunately is not a bot support server, this is a support server for people who make bots
Oh well this is where the trader bot sent me to
At least it’s the discord it sent me to for it I thought
Thanks
np
@cerulean ingot I think it's a matter of checking the pateron python api
cant even get my patreon client
oh you already have it set up?
is this what ur using
oh ok. I don't know enough to help with that sorry
I don't even use the pateron py API but that has documentation if u need
what would be the best for storing passwords?
import { encryptStr, hashStr } from "rjutils-collection"
const ENCRYPTION_KEY = 'something'
const getHashPassEH = (password: string) => {
const encrypted = encryptStr({ text: hashStr({ text: password, algorithm: 'sha512' }), key: password })
return hashStr({ text: encrypted, algorithm: 'sha384' })
}
const getHashPass = (password: string) => {
return hashStr({ text: password, algorithm: 'sha384' })
}
const getHashPassE = (password: string) => {
const encrypted = encryptStr({ text: hashStr({ text: password, algorithm: 'sha512' }), key: ENCRYPTION_KEY })
return hashStr({ text: encrypted, algorithm: 'sha384' })
}
const getPassE = (password: string) => {
return encryptStr({ text: hashStr({ text: password, algorithm: 'sha512' }), key: ENCRYPTION_KEY })
}```
just use a password hashing algorithm
like bcrypt, scrypt or argon2
nodejs has scrypt built in
I am facing a small issue
using chakra-ui btw:
<Box as="li">
<LinkBox>
<LinkOverlay href="/security" onClick={onToggle}>
<Button
leftIcon={<FaUserSecret />}
fontWeight="bold"
px={4}
py={2}
w={32}
bg={'transparent'}
color="white"
onMouseEnter={() => setShowSecurityText(true)}
onMouseLeave={() => setShowSecurityText(false)}
_hover={{
bg: 'red.600',
borderColor: 'red.600',
}}
>
<animated.span style={{ ...securityTextStyle }}>
Security
</animated.span>
{!showSecurityText && '******'}
</Button>
</LinkOverlay>
</LinkBox>
</Box>
const [showSecurityText, setShowSecurityText] = useState(false);
const securityTextStyle = useSpring({
opacity: showSecurityText ? 1 : 0,
config: { duration: 500 },
});
Still "good" to try it to learn about it
sure, but in that case start with the basics of how password hashing algorithm works, for example how its purposefully inefficient to make the cpu spend more time on each password and prevent dictionary attacks
is there any way to decorate this embed, meaning but a background image or something? I was thinking about using canvas but yeah.. not sure how to get all the info's on the embed, on the canvas image.
You cannot change the background colour of the embed unfortunately. Best you can do is change the left border colour
as i figured that already. I might be able to send a message attachhment instead right?
What i actually wanted to do, edit an image to my liking, and then use canvas to put the details as depicted above onto my embed.
using the .setImage() property, i mean it should work \0/
but right now i am having issues putting the text onto the image.
yall idk how to fix the text issue
@quartz kindle what was a good websocket ping interval? every 2 seconds?
A verified music bot change in to all in one bot code any issues

not really
just remember to update your description on topgg if u already submit it for verification
I love having to deal with sync process timeouts
async u mean
how does a sync process timeout?
tokio::select! {
_ = long_async_fn() => {},
_ = tokio::time::sleep(Duration::from_secs(2) => return Err(TimedOut)
}
Timeout for an async function
that's the neat part, it doesn't
then how did u?
what's that _ = for?
just a tokio-select syntax oddity
i didn’t
since it's _ = i suppose you were meant to store it in some sort of variable
wait is it for something like this? ```rs
tokio::select! {
value = long_async_fn() => println!("{:?}", value),
_ = tokio::time::sleep(Duration::from_secs(2)) => return Err(TimedOut)
}
it does allow you to do that
yeah
o nice
can't you just spawn a thread for the blocking task and for the timeout and select! them
i ended up moving the goalposts so i don’t have to worry about it
i was going to allow users to have custom rendered SVGs for my leveling bot, but i’ve decided to just make a library of these cards to pick from
no, what I mean is why is sync timeout an issue if you cant have sync and timeout in the same context?
what about this
select is only for async
because i wanted to make a timeout for a sync task, but it’s nearly impossible to do that- whereas it’s easy to make a timeout for an async task
you need to spawn a new process
which is a huge pain in rust
well, yeah but it's not nearly impossible - it is straightout impossible
yeah why not just use async at this point
you can kill a process
that'd be async
because the library is not suited to async
what library
i mean async as in rusts async/await system
wdym by that?
I suppose resvg is similar to java's g2d, as in not being thread-safe
that isn’t the issue
the issue is that i can’t just cancel it in the middle of it running like i can with some asynchronous functions
cant u just spawn a new thread?
CPU-bound tasks shouldn’t be async
killing the thread would cease any actions within it
no, because you do not simply kill a thread
there is no way to do so without potentially fucking your allocator
you can make a wrapper which checks whether the thread was signalled to stop, refusing to continue if it was
for the svg operations, that is
no, because that would require forking resvg
all the time would be in an external function
cant u just extend it?
idk how things work in rust regarding oop, or if that lib uses class instances at all, but for java I'd just class SomeName extends Graphics2D and override the methods to add stuff on top of them
another option is to make your own drawing suite, svg ain't too hard to parse into opengl instructions
it actually does the parsing for you, mostly- but rust doesn’t have anything to add a hook inside a function
rust has no oop
i can wrap the function fine
well yes but actually no
eh
I meant making a lib yourself
i don’t feel like doing that much maintenance
but technically you can simulate extending with Deref
well not necessarily a lib, just the functions to pass svg to opengl
not a public lib
parsing SVG is incredibly dangerous
and i’d rather a big library do it and i can sanitize the SVG manually
how is it incredibly dangerous
XML is hard, text layouting is hard, etc
resvg is like 70,000 lines of code
loading fonts is trivial in opengl, and there's likely a lib for handling xml for rust
also, i don’t think fly VMs have opengl access
fly?
there is, but resvg just generally does it well
i could absolutely write my own renderer on top of resvg that took care of timeouts
but i don’t really care enough
at $7.78 4vCPU 1GB is very overpriced
hetzner for example is $8.47 for 4vCPU 8GB
cheaper if u dont care abt ipv4
i’m aware their fancy stuff is expensive, but i don’t use their fancy stuff
i use their 256mb 1vcpu plan
which may have poor performance per dollar, but i’m not aware of any providers that have a cheaper plan then that
jesus
might wanna suggest looking here: #development message
very cheap, yet trustworthy names of hosts
contabo is fairly good, didn't have issues since they changed their infra
same
just had issues with network connectivity a few days ago, which caused some important infrastructure to die while I was at work
all of these are more expensive then fly
they gave me a prio ticket though
and don’t come with a lot of the convenience features
the move to full-ssd was good but the hdd plans were decent for storage lmao
not much for anything else
i am aware of the alternatives, but i prefer fly for little things- which is currently all of my projects
then you'll have to deal with that price
no?
and the money/resources balance
I like how they alert u 2-3 weeks before some sched maintenance, and dont take more than a couple hours at worst
never had been affected by any maintenance tbf
usually I dont even notice they went down
if i can, cloudflare workers, but the rust support is lacking and the lack of database connections hurts me
although if anyone knows any good orchestration systems for VPS services, that would be appreciated- i might look into something like Terraform with Kubernetes, if i ever grow beyond a single fly.io VM
i do use github actions, fly has a very nice deployment system
i’ve yet to come across something with the same kind of DX as fly, which i value a lot
baremetal servers are nice until you want to automate deployments
whats dx?
developer experience
well said
I want to replace ✔️Verified✔️ role with all the users in the server
The bot wasn't designed me i never worked with discord api
Please help
userDict: dict = {}
for i in range(len(role_members)):
userDict.update({role_members[i].name: role_members[i].id})
await appendUser(userDict)
await interaction.response.send_message("Done, Collected all users.")
what does appendUser do
you're not providing a user to it
also
getting roles and fetching the members from it doesnt work like that either
async with aiofiles.open("./users.json", "w+", encoding='utf-8', errors='ignore') as file:
await file.seek(0)
await file.truncate()
await file.write(dumps(usersList, indent = 4, ensure_ascii=False))
```
???
Oh no, json database 
Gonna help or not???
Gave you a response
.members is not a thing
nah more like 30-60 seconds
discord uses ~45 seconds
no i am looping over it
using a foreach
but idk still doesn't work
749763576226381845 is not banned.
post your code again
interaction.guild.bans.fetch().then(bans => {
const bannedUser = bans.find(ban => ban.user.id === memberID);
if (bannedUser) {
console.log(`${bannedUser.user.username} is banned.`);
} else {
console.log(`${memberID} is not banned.`);
}
});```The user is in the bans section
i verified that both ids are correct.
wow djs really fucked up their docs now lol
barely usable
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
see if setting cache: false makes a difference
alr i will have a look
didn't work sadly
Error [FETCH_BAN_RESOLVE_ID]: Couldn't resolve the user id to fetch the ban.
└─┬ react-spring@9.7.2
└─┬ @react-spring/zdog@9.7.3
└── react-zdog@1.1.1
for some reason react-spring has this dependency called react-zdog which requires react lower than version 17
What could be a way around this
i really don't wanna get rid of react-spring
aight, i'll go with 30 then
Nothing other than contributing to the dependency to make it support the React version you want, or you can go to your node_modules directory and change it directly
Though from looking at it, it supports React 17 and 18
yeah i wiped out everything and reinstalled
You'll have to change >=16.8 in that line to ^16.8.0 || ^17.0.0 || ^18.0.0 to make it support the new React versions
im not a cache professional but my users cache limit doesnt seem to be working
i see three issues. your number has an underscore. there is an arrow character instead of => and there are 3 parallel lines instead of ===
you're welcome
underscore is to help readability (doesn’t affect numbers afaik)
Those are font glyphs my guy
hes obviously trolling lel
where are you using that manager option?
Options.cacheWithLimits()?
yeah i was hoping that
yeah cachewithlimits
makeCache: Options.cacheWithLimits({
ApplicationCommandManager: 0,
BaseGuildEmojiManager: 0,
GuildBanManager: 0,
GuildInviteManager: 0,
GuildStickerManager: 0,
GuildScheduledEventManager: 0,
MessageManager: 50,
PresenceManager: 0,
ReactionManager: 0,
ReactionUserManager: 0,
StageInstanceManager: 0,
ThreadManager: 0,
ThreadMemberManager: 0,
VoiceStateManager: 0,
GuildEmojiManager: 0,
AutoModerationRuleManager: 0,
GuildForumThreadManager: 0,
GuildTextThreadManager: 0,
UserManager: {
maxSize: 69_420,
keepOverLimit: (user) => user.id === user.client.user.id,
},
GuildMemberManager: {
maxSize: 69_420,
keepOverLimit: (user) => user.id === user.client.user.id,
},
}),```
well, last time i tested this, it worked, but i havent messed with djs in a long time so idk
does 0 work for the other managers?
Does the keep over limit function always return true?
I believe so
nope
it works fine on a dev bot with a lower limit
So I went onto my vps after realizing that my site no longer is running and all the firewall stuff is just gone
all it has is active
but none of the nginx or mailcow ports that are usually open are and I don't remember what nginx uses so any help?
cause iirc nginx uses a specific port other than what I have in my server blocks no?
fixed it
Nginx uses no specific port, it just routes
yea I just sudo ufw allow 'Nginx Full'
80 and 443
Nginx Full: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)
Nginx HTTP: This profile opens only port 80 (normal, unencrypted web traffic)
Nginx HTTPS: This profile opens only port 443 (TLS/SSL encrypted traffic)
So I am using Contabo's s3 object storage cause its fairly cheap, but I am wondering how I would go about dishing out the space on it to other users and make sure they can only access what is given to them (or how I would even give them space). If anyone has any idea or has done this before please do let me know, googling it has only given results that tell me what their object storage is and not how to accomplish what I want. From my understanding even though you can create accounts on contabo's object storage it gives them full access to any of the buckets made allowing them to read and write to any of them (just not create their own bucket)
You can use an api for managing transactions and control disk usage
Oh?
Like, you already have ftp access to it, simply create an api for managing the data
So should I just make a database of users and essentially link their account to a specific bucket?
whats ftp
I THINK apache/nginx are able to control that through plugins, but never attempted something like that
hm
File transfer protocol
I just wanna make sure no one can interact with another's bucket
Basically link a token to a specific ftp address

Then u can retrieve folder size to check how much space the user has left
I didn't know there was such a thing as an ftp address
It's like using http, but for files
I don't know how this would work with contabo
Like ftp://123.123.123.123:1234
Would this be something I have to do myself?
Can u filezilla into it?
That url, what is it used for?
Also no idea
When I visit it I just get a {'message': 'Unauthroized'}
I assume its meant to give access to that specific bucket
but you need credentials to do so
Maybe, try to see if u find any docs on it
https://api.contabo.com/#section/Introduction theres this
but as far as docs on the object storage goes
I dont really understand much
There's likely a way to ftp into it, as using a panel defeats the purpose of a storage server
As it'd be used for stuff like cdn or backups
Also malwarebytes keeps interfearing with everything
blocking the connection between me and the service smh
Lmao
I keep having to exclude the ip's contabo uses
but they have so many
yea you can ftp into it
as to how I have to figure out
but its a supported protocol
Also depending on how those buckets work u can just automate their creation
Like, u likely can limit their size yes?
Then u can give that address or add a wrapper on top of them (api) if u want more fine control
Though I do realize that using contabo for this might not be the best idea
I have to use my access key and secret to ftp into it
which exposes a lot
Then make an api and abstract all of it
Wouldn't it be more trouble then its worth?
Like, the api being the only one to know the tokens and secrets
Anyone with the brains could find my access key
They wouldn't know it
They'd be sending the files to your api, that's it
Then your api sends to the server, but on an entirely new request
So my api would handle all the bucket creation and file saving
Yes
hm
Fair point then
Still there doesn't seem to be a way to limit the amount of storage space a bucket has
Make the api limit then
Yea I would just have to do a lot of checks before they save the file
It's somewhat a fun project tbh
How would I allow them to view their own files though?
Would I not be exposing my tokens and secrets to do so?
U can serve the files directly
Actually I wouldn't if I am not dumb (which I likely am)
I would just have to fetch all the files from their bucket and display them in a list on the client
Yea this will indeed be a fun project
Yep, u don't even need to download the files, just their metadata
I plan on doing it as a side gig to make some money see how well this will turn out
When they open a file simply stream it directly
As u have both the input and output streams
yea I will figure this out when I come to it
A fun part about using contabo as a vps and storage is that they're likely to be within the same datacenter
I can make this into a profitable side gig if I do it right ngl
So if u make an ftp symlink u can use it like a part of the vps
hm?
Without having to upgrade ur vps plan
Oh so basically extending my storage capacity?
Basically making a folder that's linked to a remote ftp address
But since it's within the same datacenter there'll be zero delay
This only works if both the vps and storage servers are in the same region tho
I will likely be heavily using this channel throughout my journey on this endeavor
Else latency will start to appear
Windows has that feature too, it's pretty seamless
Just got to My Computer, right click anywhere, add remote folder
Then type the ftp address and credentials
https://docs.contabo.com/docs/products/Object-Storage/HowTo/mount I think contabo tells you how to do just that
It is possible to mount S3 Object Storage to your VPS/VDS or personal computer. This way you can access the files and folders of your S3 Object Storage like a local drive. This makes usage more convenient.
After that u can use the folder like any other folder
A common use case is to allow usage of one bucket to one specifc user whereas another bucket should only be accessible to another user. The following How-To describes on how to allow access to buckets to a restricted number of users.
this might be handy
Nice
I dont quite understand it yet but ima keep reading
Also remember to write a ToS and PP for ur storage api
As you don't want to be liable for what people might upload
Indeed
When I first started this idea I wanted to find a way to moderate it without invading people's privacy
but I have no idea how to do that so 
At this point I will just leave it up to the hopes that the people who use it to do illegal things are dumb enough to share it and people report it to me
I think u can analyze the data (but not store) if u state on the PP
analyze how?
Idk, like use AI to check whether an image is against the law
Or check if it's a virus
Hm
Yes indeed
I will figure that out somehow
I doubt I will have to create my own model either
there's likely stuff like that online
For virus u can use virustotal api
Or some other open source self-hosted virus analyzer
probably will use a multitude
or just use virus total and if it flags it as malware I can either put it in a moderation queue for people to confirm or just outright deny it
probably will outright deny it though
Likely, making models for detecting illegal porn is probably an awful experience
Yea thats what I was thinking
I was hoping there was some poor soul who already did so but it doesn't seem like it which makes sense
Glad no one had to go through that
I don't wanna scrap this idea but I also don't wanna give a tool to nefarious people hmm
Try to research how services like Mega or gdrive do it
As they have automatic flaggers for those types of content
yea
https://torrentfreak.com/google-drive-uses-hash-matching-detect-pirated-content/ well this is the only thing I could find as a first result for anything on how they detect illegal content
but this seems to be limited to pirated content
hm
Tbh tho, it might be impossible to prevent using it for nefarious purposes
As all u need to do is zip the folder with a password
Best u can do is throw the entire burden of liability to the user
true
At this point I can only implement a report system and hope people use it
and state in my tos and pp I am in no way liable for what people use the service for
@lyric mountain Discovered something new
When you make an account for that user giving them read and write access they get their own acess key and secret key
Oh nice
theoretically I don't really need to make anything but bucket polices at this point
Thing is if they login to the contabo object storage panel they can see everyone's buckets
Would making my own site for them to view files even be useful at this point?
They can just login to the contabo panel themselves
Also as for this, doesn't this only deny specific users and not any user but the one meant to be the owner of the bucket?
So that means only a specific person is denied it instead of everyone
this is all too confusing rn
ima take a break from it and come to it soon
gonna watch anime
Also just realized that contabo only allows 100 buckets per s3 account, so that means I would have to buy multiple at some point I think
Can you help me only coming one music iam so many search song no change
that doesn't provide us with anything
What to do if you are not getting this pencil icon to connect a domain with replit ?
Anyone there?
@lyric mountain Actually just realized that contabo specifies that ftp will not work, as they use smth called "Amazon S3" protocol
Unless im reading this wrong
@wheat mesa pls help
No one can help without any code or errors
can some1 help me code go boom
How has your code gone boom my good sir?
Boom boom boom
std::uint64_t trol = 2;
while (trol < 0x8000000000000000ULL) {
trol *= trol;
std::malloc(trol);
}
``` and your ~~computer~~ code will go boom 
When I use a command, that will send messagecomponents (buttons in this case) for the user to click. The buttons appear on computer but not on mobile. Is this an issue with discord?
Likely a mobile bug
Alright
Running this gave me millions of dollars, I 100% recommend

now you can leave Iran
this code is so cursed
Then use the other protocol instead
Protocols are just how the data is exchanged, in theory they're the same thing







