#development
1 messages · Page 41 of 1
Never
Is that the code to start a rocket? Looks like so…
i never understood dafuq does tolocalchecked to
It starts your car's V8 engine blazingly fast
it's like unwrapping an Option type
in v8, there is v8::MaybeLocal, which is basically the Nullable version of v8::Local
Do you think Tim knows Rust?
so toLocalChecked turns a MaybeLocal into a Local? like a null check?
yes
makes sense
if it fails it will crash the v8 engine
i prefer using node-addon-api tho
awesome stuff
bruh i found out why the audio would die on my bot if it was left in a chat for too long
was nothing to do with my shit internet
just didnt have noSubscriber: NoSubscriberBehavior.Play setting before
dumb how that had to require restart to get audio to work after though
sounds like the player was defined in a global static scope, causing the entire bot to no longer work

got some interesting stats to share here
these figures are for the last month, up till now
on my bot
seems message commands are still winning out, but only just
i expect that over time, the message commands section of this chart will go down
Intriguing.
this is on a bot with the message intent, where both types of command are still offered, with a push to get people to try the slash commands
wait until the grace period is over
then check your stats again
or is that stats from your bot
wtf, does cloudflare provide google certificates?
our cloudflare domain has a google certificate wtf
thats the stats from my bot @rustic nova
ye then thats because of people being used to the text based ones
this is my error rn my friend told me to registerFont but im not familiar with canvas so i legit have no idea what to do
this happened before i redownloaded node-canvas package
after i downloaded
need help since i dont rlly know canvas
The registerFont() method is to register new fonts for Canvas to use, you need to provide the path to the font file you want to register and give it a family name
For example
import { registerFont } from 'canvas';
registerFont('./my-font-file.ttf', { family: 'MyFont' });
The documentation for the registerFont() method:
https://github.com/Automattic/node-canvas#registerfont
In an express application, is it possible whereas if a form that has an input button, example:
<form id="inputwords" class="mb-5" method="post" action="/search-word">
<div class="row">
<div class="col-12">
<input type="submit" value="Send Message" class="btn btn-primary rounded-0 py-2 px-4" id="wordsubmit">
<span class="submitting"></span>
</div>
</div>
</form>
It would be disabled after it gets pressed.
Now, when I don't have such said feature, the post method works, however, when I have it whereas after the button is pressed, it would be disabled, the post method doesn't function, why that? Moreover, what's the alternative way?
My current code:
$(document).ready(function () {
$("#inputwords").submit(function (e) {
$("#wordsubmit").attr("disabled", true);
return true;
});
});
im no expert but according to school, theres an onSubmit attribute you can use with forms
honestly why are you using JQuery and <form> and not a nice front-end framework
use that, use document, get id of button and disable
i am getting this error i am not working on ts
duh everyone stop typing after i come
he using bootstrap
i think, cause of the classes
still doesn't change the fact he's using jQuery
now, again im no expert, but what is the better solution to so
what he should use instead
Oh, what instead, then?
Do you wanna disable the button permanently?
if so, just add a css class which prevents user from any input
How so? Example, if possible.
oops once again
.no-select
{
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
pointer-events: none;
user-select: none;
cursor: default;
}
$(document).ready(function()
{
$("#wordsubmit").on("click", function()
{
$(this).addClass("no-select");
...
});
});
wow
you can of course remove the class later if needed, after time, after the submit event etc.
don't forget to add any form validation if there are fields the user has to fill out, or the button is disabled (even on an invalid input since it has been pressed)
javascript -> jquery and the upper one is css of course
React, Vue, Solid.js, Svelte
Well, I'm mostly with Express.JS when it comes to back-end.
that's for the front-end
I used jQuery for selections before, but it's not actually all that good
better way is just to use document.querySelector(...)
and I think there is a builtin .onClick function for the querySelector as well
but it's not actually all that good
it's literally just native JavaScript, not more or less, it just tries to get rid of compatibility issues in browsers etc., still only native JS
so, there's no better or worse
using $ to select didn't always work for me, when I was modding that IO game using the jQuery way messed the script up too much
querySelector always worked so far
oh god... i dunno what to say
I mean, if I'm making a really simple website, that won't bother, no?
And I mean a seriously simple one.
Not a portfolio, or the next google.
idk maybe it was fault on my end, but I honestly don't think so, I even tried importing a jQuery package to fix, but it never worked after that
you'll never have to use jquery in 2022
yeah^
document api does a better job
exactly
dude the $ is just an identifier of jquery() function NOT MORE, you can also call jquery() the entire time instead of using the shortcut $
it was never defined in the first place
does anyone know why requests wont come trough? this is my current code, 25252 is open
no, on a linux vps
well then check the default input policy for your firewall as well as the one your provider may put before the server
well going to it on my browser works
you need to allow incoming requests on that port (TCP)
oh really
does the auth key matches the one on topgg then?
webkey is this:
make sure both are matching each other exactly
they are
if you still have trouble, choose a different auth key, press save on topgg a few times, update the one in your code, try test send again
also check the webserver log if the incoming request is visible
*is logged
*has been logged
errr whatever
not sure how I would do that, there is no reverse proxy in place that could log it
not sure if express has a way of logging the requests, but I assume it has
still try what I told you above before
that mostly fixes the issue
you can also try to remove the auth key from topgg and your code
also hit save a few times
(on the site)
instead of the dbllistener just do .post("dblwebhook", (req,res) => {})
that will give you the ability to log
btw what is your webhook url?
I just copied the code from here https://docs.top.gg/libraries/javascript/, but yes, ill try
oh didn't ask him about that so far... lol
youre missing the /dblwebhook
oh your forgot the path
well make webhook listener an async function and await fetch
If I want to host a website on a vps by configuring a reverse proxy with NGINX...
I'm currently following my hosting provider's documentation, and it mentions to:
create a A record within your DNS manager pointing to your server’s IPv4 address
However, I'm not sure about this: https://cdn.hamoodihajjiri.com/JIM5FSGuZA .
What should it exactly be? 
how exactly would I do that? If it helps, here is the full code, https://pastes.dev/L4Vmc4xWyg
webhook.listener(async (vote) => …
then await …fetch(…);
Your domain probably has an accurate A record already
The proxy doesn’t require an hostname but can also point to an IP address
thanks
If you’re proxy server also runs on the same machine then it’s useless
Usually the goal is to hide the actual webserver and/or do load balancing
is there any way of getting a users locale? i know interaction.guildLocale exists but first of, im not in an interaction and second, a dm isnt a guild afaik
The interaction should also provide locale which is the user locale
Impossible Outside interactions
can I somehow turn that into an interaction?
could I just attach an button to that that just edits the message accordingly?
Still… unless somebody is actively pressing the button you won’t receive an interaction event
An (inter)action can only be triggered by an user
Either by executing a command, selecting an option im a select menu, pressing a button etc.
Simply save the user locale when they first use a command, you have a database already
oh yeah, didnt think of that
Well I mean it can change at any time
well, if he had it before imma guess he still understands that lang
True but why do you need it outside an interaction instance?
to tell a user he voted in his locale
Can someone with regex experience help me?
I'm trying to make a regex that matches audio or video content types which can include application/ogg and application/x-mpegURL, but I do not want it to match any other application/.* content types.
This is my regex so far:
/^(?!application\/json)(audio|video|application)\/(.*)$/
But instead of just application/json, I want it to discard the match if it isn't application/ogg or application/x-mpegURL
Can't you just do /^application\/(?:ogg|x-mpegURL)$/? And then just match against it
I may be misunderstanding what you're actually looking for, but ¯_(ツ)_/¯
True
You should define a default and fallback language in your language handler
Imposes challenges I'll need to figure out for myself, but ok
Passing the locale to it
Once a locale isn’t available you fall back to your default
how i can link my bot server counting to html website
go to your bot's edit page in top.gg and copy the server count badge embedding code (if that's what u mean)
icant find it
because your bot isn't approved yet
1-2 weeks ig
how can I improve my bot's response times cause it sometimes doesn't respond in time and I receive an unknown interaction error and my application doesn't respond with a message but still executes the rest of the code fine. it's coded in python
defer the message before trying to reply
and before you do anything else in the command
@earnest phoenix do i need to add import or just registerFont also any tutorial or etc because i aint much familiar but i did get it but got this font error i will try ltr
Umm which os is better to host dc bots
Guys wtf, my bot CTR% is only 3!! What can I do to possibly increase it? Like how to make it more appealing? Can anyone dm me with a good short description please as I am too bad in marketing.
Click refresh data and then edit save the bot
Thanks
whats CTR% lol
eh
like auction tag ctr?
Click through rate
Yea, I just want to make my bot ad more appealing
what tag
Anyone can suggest me a better description
Not tag, it means the ratio of the number of people who saw and ad and the number of people who clicked the ad
is there any giveaway
Oh, it's on Fun Tag slot 2
Wrong server, no
thats pretty much the average ctr for that tag tbh but if you want more clicks you've gotta intrigue people to click on it
How do I do that exactly
idk what your bot does so i couldn't say
you could work on your bots description page to begin with, theres a bunch of things like stretched/warped images etc...
Oh yea, I will fix that, but can u try to provide me with a better html description? Bc this one I made from onlinehtmleditor.dev
im not a front end dev so i wont be much help, sorry
Oh it's ok np, but can u like suggest me a creative and appealing short description for the bot please?
that should rlly be something you decide for your self, just take a look at other bots with features like yours and take inspiration, but don't copy it exactly cuz that's stupid
Ye thnx
Btw can u tell me which pfp looks better
tbh, those colored pixels around the face look like a bad crop
any linux distro
btw, arent ur navigation buttons inverted?
oh so it is indeed a crop
i thought they were nfts for a second
Hello everyone, how do I make a system so that every time a member votes for my bot, it returns a certain message in a certain channel?
macOS 13 beta support desktop audio recording now
AND THEY ADD ALARM TO THE CLOCK APP! 👏
woah basic features I would expect in $2000+ computers already have been added after a short 15 years!
Apple is honestly a joke when it comes to this stuff
They literally don't bother adding the most basic/important features and delaying them to be implemented after a very long time
Sounds like Discord when they delayed slash-commands for 6 years, and then implemented them
they are, apparently
use top.gg webhooks
so ive had reports from a client for a bot I wrote... basically, people are inviting the bot to their server, but the bot is never joining their server... this has only just started being reported recently, the bot is in 1700-ish servers. Anyone got any ideas? (bots written in discord.js)
also: when i tried to test, the bot joined every server i added it to, so it doesnt happen every time (i wasnt able to reproduce it once)
maybe it's a bot kicking yours
don't u have logs like "Just joined server XXX"?
if not, try logging that to see if the event fires at all
it didnt seem to be firing at all ~ but im now being told that the person had 50 integrations on their server already ~ so fk em, thats their problem 😄
ah yeah, that might be it
discord has limits on how many stuff can exist at once (hence why topgg doesnt invites bots here anymore)
yea lol, honestly, if they told me they had so many integrations at first i would have saved them hours of stressing 😄
hello guys! i have a discord bot running with akairo but akairo isn't supporting discord js 13 and 14
do u know another framework that works with djs v14?
I don’t know what akairo does but I would strongly recommend against using any frameworks that add on to djs
They’re subject to breaking changes and usually aren’t very well maintained
i already found one named commando but it works with djs 13 and i can't see if it works with 14
ok i'll do that
i'm having an issue with akairo rn cause some methods are deprecated T_T
guess i'll have to put many hours of work in it
thx for advice
hey, how would i get the position of the array in the sortedDB?
let sortedDB = Object.entries(userdatabase).sort(function (a, b) {
const [ aKey, aValue ] = a; // unpack a
const [ bKey, bValue ] = b; // unpack a
return (Number(bValue.points) + Number(bValue.points)) - Number(aValue.won) + Number(aValue.points)
});```
not many tbh, command handlers aren't as hard as many people think
it all depends on how intricate you want it to be
why is userDatabase a map to begin with?
most (if not all) databases allow sorting without requiring manual operations
also considering ur current code, is it really supposed to sum bValue.points twice?
i know but i have to refactor my code on all my commands coz they're made with akairo
well, yeah, u can also try to mimic their structure to keep current code
I imagine you're using single-command files right? if so you can try using "Replace in files" feature (if your IDE/editor has that)
I made an entire cacheless Discord.js so I could only rewrite a portion of my bot
not worth it
how do i reply to an interaction without actually replying?
So like ghost replies
defer
weeell yeah, the whole purpose of caching is to not have a slug-slow bot or abuse ratelimits
No I mean my bot ran fine aside from having memory issues because the imported module size was absurdly large
yes
discord.js' size and complexity is its downfall
Are modals yet actually available on all clients? also the "old" android client?
can't really find a client support list
I believe modals are supported on all devices, but not all field types iirc
what yalls opinion on Heroku?
It sucks
free and non free tier
how it divides up resources is stupid as noisy neighbors can take over your resources
paid tiers are actually pretty good
and free tiers are about to be deleted from existence
we use paid tiers at work in combination with salesforce, everything flows together perfectly and from what ive seen the uptime is almost perfect
depends, for apis it's awesome, for bots...not so much
does someone know how I can get ten random strings from here? they shouldnt be the same and should also end up in an array
You can make a temporary copy of that array, initialize another array, loop 10 times to get a random element from that array and remove it from the copied array, for example:
// Original array of values to get random elements from.
const foo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
// Copy the original array as we'll be mutating it to not keep on landing the same value.
const copied = foo.slice();
// The array of random elements we've gotten.
const randomElements = [];
// In this example, we're looping 5 times to get 5 random unique elements.
for (let i = 0; i < 5; i++) {
// Get random index.
const randomIndex = Math.floor(
Math.random() * copied.length
);
// Push the random element to the array.
randomElements.push(
copied[randomIndex]
);
// Remove the element from the array from the random index so we don't land on it again.
copied.splice(randomIndex, 1);
}
// Now the `randomElements` array has 5 random unique elements.
There definitely are other ways to do so, but this is pretty efficient if you want unique random values
thank you so much!
You're welcome
exactly 
css
users aren't guaranteed to be cached at any time
yep, inside <styles> block
DO NOT ADD THE FULL HTML STRUCTURE
it'll not work
use JUST <styles>/</styles>
users.fetch
do note, u cant fetch someone who's not in a mutual server
that's called hackban, u simply add the id to the banlist
if user is an id, ig so
no
u cant members.get
no
u cant fetch someone who's not in any mutual server
because the bot doesn't know they exist
hackban is, by definition, a blind ban
check if both mention and fetch didn't return anything
Or just ban by ID either way
what does a pinged role look like in text?
Like <@&265125253443878912>
i mean like how a text channel is in text #development = [#development](/guild/264445053596991498/channel/272764566411149314/)
and a pinged user @thorny field = @~/.BeastieNate5#6243
oh
it converted it
but im wonder how it is for a role
afaik you can
nvm im good guys i got it
not without the oauth2 scope
pretty sure i fetched many users who did not have mutual servers with my bot
when testing and stuff
you can fetch deleted users for example
really?
some deleted users will return 404, but others will return a valid user with a "deleted user djjejdj" username lol
Does anyone know how to solve this?
pretty-ms is an ES module now
Use import * as ms from "pretty-ms" instead (I think)
you need to use an older version, or change your code to ESM mode, or import it using dynamic import()
the easiest way is to use dynamic imports, but dynamic import is async, so you cant do it top level, for example const ms = await import("pretty-ms") (inside an async function)
you will likely also need to use ms.default
Okay, i used an older version and now it works
👍
thx
I forgor 💀
has anyone got this error before?
Cannot read properties of undefined (reading 'component_type')
Yes, cannot read properties of undefined is an error that has happened billions of times
But without any code to look at, it's very vague
Whatever you're doing, it's basically doing undefined.component_type
Which is an error
@earnest phoenix explain yourself right the fuck now
If you do -= [4] it becomes a number (-4)
It's just like [] + 1 and [] - 1
Concatenation treats it as a string and combines stringified versions of both, but substraction converts it to a number instead and performs the calculation
Someone always getting my bot token
And nuking
Servers
I dont even have a team member or worl in replit
Work*
shit design decision
then you're likely using something else that does so, what are you using
Flashnodes

I can only suggest getting either a VPS or some other trusted host for your bot instead. I'm highly suggesting a vps instead if you want your bots access to be reasonably secure:
Why you shouldn't use free hosts: #development message
Popular VPS providers that have reasonable prices for discord bots: #development message
You will likely continuously face your token being exposed, this could either be someone who has access to that sites backend or someone else has access to your own pterodactyl
-apps
Volunteer Applications
Hey! It seems like you're interested on volunteering for Top.gg. We're glad for any help we can get regarding our server events, support articles, bot reviewing, moderation, and more!
Contributors
Contributors are not considered staff and there is no age requirement. Contributors help out with server events and providing support.
Bot Reviewers
Bot Reviewers are Top.gg staff and must be 18 or older. Bot Reviewers review the discord bots submitted to the site before they are listed to make sure they follow our rules.
Moderators
Bot Reviewer is a stepping stone to Moderator - if you wish to be a Moderator you must first apply and be accepted as a Bot Reviewer.
Please read [this post](#announcements message) for more information and to apply!
@rustic nova gaming
Ur mom


How to stop prettier act like this, the tool is good but sometime it is auto underline like this :))
I don't see an issue with that, that's just the general style
hmmm
wait me
However you can just configure Prettier's behavior by these options of course
https://prettier.io/docs/en/options.html
oh oke
if possible, can you show me what option I need to change?
The reason Prettier splits it into different lines by default is because it wants it to fit in general screen sizes instead of scrolling to the left or right to read the code
Literally the first option
https://prettier.io/docs/en/options.html#print-width
I made it to 30.0000
30000
There's also a warning for readability purposes
Show us how you're setting it
That's just too much, Prettier cannot go that far
it's just a test and my problem still be there
Setting it to 500 should already suffice
Your test won't work because that's an invalid value for Prettier
oke thanks, I will check after 30 mins
I have sth to do now
more important I don't think my eslint working right
Hey there.. I'm trying to get the amount of roles in a server using DJS and it is not going well..
Here is what I have tried (attempting to following the docs):
let roleCount = 0
guild.roles.fetch().then(roles => roleCount = roles.size)
interaction.reply({ content: `${roleCount}` })```
^^ This returns an error saying content cannot be empty
I also tried just straight up:
```js
interaction.reply({ content: `${guild.roles.size}` })```
Both return errors.. Anything that I am missing?
There's no need to fetch roles, all roles are cached as long as you're not sharding, and you can get the amount of roles from the cache's size property, <Guild>.roles.cache.size
i forgor about cache 
Thank you!
You're welcome
Interesting the upper one returns content can’t be empty
That's because the roleCount variable is passed before it's assigned a value, the <Guild>.roles.fetch() method returns a promise which is not resolved in this case
then(…)?
That does not wait for the promise to resolve, the code execution will continue as is
Yes, that's what you're supposed to do
Looks like I misunderstood then() a little bit
imo js shouldn't even allow doing such kind of operations
.then() call async
Basically both of this do the same thing:
let roleCount = null;
// First solution
await guild.roles.fetch().then((roles) => {
roleCount = roles.size;
});
// Second solution
const roles = await guild.roles.fetch();
roleCount = roles.size;
It just resolves a promise without the need to use await or an async function then
it will execute on the microtask queue iirc
like, variables passed to async context should always be effectively final
But doesn’t await it
which is after sync exec
else u run into weird issues
if you had no choice you will have to do async IIFE
That's usually not done in dynamically typed programming languages because they're not strict in those cases, and these wouldn't really cause issues if you know what you're actually doing
It's basic understanding of asynchronous operations
So the main purpose is #development message
the issues is that they usually don't know what they're actually doing 
Yes, and it doesn't halt the code execution for that context until the promise is resolved
at least js being monothread removes some possible concurrent variable modification issues
Ok this has been the breaking point is misunderstood
Thanks
yay got dynamically loading stats page now 😄
https://triviabot.co.uk/botstats/
are u looking at the right shiro?
no longer so oldschool
please make the stroke more transparent
there's no bg
i need to be able to read it
ayo what, mine doesnt look like that lmao
but well, that image is set on the edit page
edge
ah nvm, she is there
I just didn't wait enough for it to load
I mean the graph
the black lines look a bit odd
.theelementclass { color: #rrggbb }
use F12 to find out the classnames
nah
nah
the scrollbar isn't a page element
it's a browser element
technically, you can, but it's heavily browser-dependant
browser-dependant
it might not work in other browsers
and mobile?
I am having doubt with using discord API, is it right place?
Yes, ask away
I want to add button to my message sent using webhook, but this payload is not working as expected. Anyone having any idea about it?
{
"embeds":[ some embed data ],
"components": [
{
"type": 1,
"components": [
{
"type": 2,
"label": "some label",
"url": "https://google.com/",
"style": 5
}
]
}
]
}
what's the expected vs actual result?
it is sending the embed as expected but it is not having any button in it
in response I check too, there is also component empty
this is the component I get in response
I not sure whether u can have buttons in actual webhooks, since they're decoupled from the bot
I am adding a link button, also I googled there were some results stating that we can add actually but they are using discord.js or discord.py
I want to do it with API request
did you check discord docs?
yes, I guess the payload for the webhook message is same as the message payload.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
they don't mention buttons
there was not particulary written anywhere that we can add button to webhook too but if we can add to the webhook too
well if it's not written then you probably cant
not to be confused with interaction webhooks
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
that we can add components to the webhook too
there was not particulary written anywhere that we can add button to webhook
well then it is written
did u try using the exact same structure as the example?
here is the structure I used
also why are u doing it without any lib?
try with the same structure
its same structure
it's not
it is check again
I dont want to send the content, I want to send embed
send the content for the sake of testing
lol, created manually 😅
I havn't seen that
lets see that too
how do you get the sticker id?
Inspect element
hi There is a section called WebHook port for logging the voter, what should I write?
My background code not working
<style>
background-image: url('https://media.discordapp.net/attachments/996766515124777070/1018083952822591558/istockphoto-1200898827-612x612.jpg');
background-size: cover;
</style>
Probably want to look at https://www.w3schools.com/css/ and the first examples
They use background-color but it's essentially the same structure
So background-images don't work
Just look at the link...
There are all the examples and explanations you need
https://www.w3schools.com/css/css_background.asp here for just the background
Use their navbar and search for what you need
And you even made a website, so you can compare the code you sent above with the one of your website and see what's going wrong
I am using it in my top.gg bot page
I out that in the top.gg long description of my bot
And you can compare the code here ^ with the code of your website
You will see what's going wrong pretty fast
Look at this either way
I never made a website
I gues you haven't made your bot's website then
Well the link I've sent has everything you need
Bro, like I am trying to insert css in my top.gg bot pave long description
As simply as thay
...
Should've been already done by now
No you didn't
this is my code -
<style>
background-image: url('https://media.discordapp.net/attachments/996766515124777070/1018083952822591558/istockphoto-1200898827-612x612.jpg');
background-size: cover;
</style>
And where has that gone?
Told you to look at the website, which you apparently haven't done - can't do more than that when there is even an example to copy paste 
oh lol sorry
@earnest phoenix i did, but can pls send me an ss of what u see in ur desktop or pc?
is that good?
how do make it good quality
i did background-size: cover
Don't use a 612x612 pixels picture
Bro it is, its low quality cuz i did background-size: cover
oh
but in my gallery its very high quality
Not really high quality to me
Though using cover won't help making it better
I'd recommend something that you don't need to cover entirely
Like a 'loopable' background or simply a solid color picture
Can u send me some good dark loopable backgrounds please?
google images exists for a reason 
Can u tell me which one looks better
i really think you should decide that, after all it is your bots page. not mine 
But after all others should find it interesting
Not me lol
everyone has a different perception on things like that, not everyone will like it. So I'm not really one to say, just go with your gut feeling.
@drifting cairn can u tell me what u see now?
I don't have pc so
Oh I did, can u make it reload and see
How?
still repeating, idk if its just cuz the previous style is just cached or what not
using the "object-fit" value in the css
Idk shit about css so can u give me code pls
Hello
There's no sin in spoon-feeding a baby
Baby on css
then learn css 
Lol
@drifting cairn can u check what u see now?
Also first click control shit r
To release cache
ah yes ctrl shit r
that background really does not fit with the colorful text, fyi
Well instead of changing all the font colors, just choose a background based on the user selected style
Also possible with css

background no-repeat object-fit cover

yea
yea 😭
thnkkuu
why not put like an iframe as the description instead of all the weird colour text or something 
what is iframe

can u send the link of that bot page?
bro how do i do that?
it’s mine, just search up spixx and you’ll find it
search up iframe tag on google and ull see, its easier than you think it is
oh thans a lot

now its looking good ryt
i’m on mobile rn i’ll check in a minute
uwu
wdym?
The scam was deleted
yooo how can i await till interaction gets deffered before editing?
cuz some times it takes time sometimes it trys to reply before defer
anyone?
deferring returns a promise so just await it?
ah yup!! sorry stupid question lmao

Replit user here, keep getting this.
and whats inside of said file?
You want the entire file?
i just want to know how you export the function

lmao
How do I define aProperty's type that's either a function or null?
export interface IAnInterface {
aProperty: (aString: string) => void;
}
export interface IAnInterface {
aProperty: null | (aString: string) => void;
}
Thanks
inline: true
❤️
tf is that resolution
?
what don't u understand in that question?
idk what you are referencing to
this one
whats wrong with it?
its just a bit weird to have a 200px wide embed I guess
it goes down to 200px at 720p iirc
looks horrofying on 4k
tim, why bot not working anymore?
imagine not knowing the footer text takes text only
I need some hosting ideas
earn some cash, rent a server
or buy a server and steal the electricity of your neighbors
Lol.
anything free is shit and you will be limited at some point
not much more to say about it
Agree
AND is the second bigger field character-wise in the whole embed
for some unknown reason
The footer… yeah idk why

Proves only drunk devs working at discord
Footer only doesn’t look that bad on mobile tbh
But anything bold… eww
Nice for like short status messages without people using emoji bullshit
Since it won’t take up much space
damn that's alot
Has literally nothing to do with your error
this is an improvement
headUsed or rss
rss
Ok good
plus it's around 90 servers
almost 100 gonna have to apply for the last intent before that
meanwhile me at *cough* 1.5gb
but well, it's a tcg bot that deals with huge images so...
I talked with a dude who has an image gen bot, it uses around 10GB
vomit
ok 10gb is a bit too much
Cake’s notsobot uses around 100gb of ram
But it’s also on like 900,000 servers and caches nearly everything
why though
my bot also caches everything, but I managed to optimize it a little bit
evil inc
probably has commands that need to read cache
waffle and kuu
Does anyone know how to call the banner for the user in the dashboard of the bot?
you should check out the gaming in general
I called the user's avatar and I didn't know how to call his banner 😂
there is no endpoint for the banner but you can get the hash of it
Yeah right now it’s in 730000 guilds and 1.4 million applications (I’m assuming that’s an http server)
That has nothing to do with the code you sent
You’re giving it an invalid bitflag, probably with Permissions
Just send it here
This code also has nothing to do with that error. Is that your only file?
the gaming?
mines in ~780 and uses probably 1gb ram 
my code isn't very optimised
website update
also because of the amount of events it handles i expected that
makes like 10 post requests a second
Is that the full error you’re getting? Does it come with other stuff?
oh my 
Mine is in 32 servers and uses 80mb, I have not worked on it in like a year 

Was mostly a passion project for learning typescript, but now I know typescript and I don’t have a reason to work on it anymore
mines in i think 6k and uses just about 1gb
670 servers here
😦
199mb is pretty good for that
i need to start properly tracking my bots stats
does anyone got a command idea
for my stat tracking i just have my aweful homemade tracking system that only works on the first few days of the month because of how bad i track stuff
Still doesn’t really make sense
huhh
What djs version are you using?
total ram across the entirety of my dedi which hosts my websites, bots etc (64gb ram dedi)

posts every 10 mins
question
is it safe to host your website on the same node as you host your bot?
It's best to not expose your ip if possible though
also works as status monitoring too, I can tell if its my bot or the entire server
I want to but I'm reluctant to do it
yeah true
But it is really common
You can always buy a second super cheap host for the website
http://node1.churton.uk is exposed but mostly because I use it as my cname for many things when I cba to update my IP, also allows me to mass change all my sites
I got 2 different nodes on 2 whole different servers
try re-installing or something
but it's harder to make a dashboard that way
final makes no sense as a variable. I think you need to read the documentation of the library you’re using
Not much harder. It'll be just as much work if you're programming it properly
Just a bit more configuration
And not just look at the example of the package and copy paste that into your code without knowing what it does
well what would be the easiest way to send the stuff I need from my client to the website?
oh he sent his code never noticed 
websocket would work for updating stuff
Websockets, webhooks, or an api all work fine
I still use 13.8 discord.js 😁

Which you should be doing anyway because you want to keep the processes seperate
I wanted to go with an API but I got threatened by the entirety of this server
I think it’s because you’re giving it something that it has no idea how to handle.
same
It’s an odd error but knowing javascript it’s freaking out because it doesn’t know how to handle the object
do interaction.reply({ content: final }); maybe? lmao
Either way it doesn’t know how to handle it
how do you handle ratelimits?
what is final?
converted.pipe(fs.createWriteStream('output.pdf'))
because lol
You shouldn't really need a ratelimit for internal API's between your bot and webserver.
Or read the output.pdf file content after piping it
I use localhost to bypass that for my bot
but I mean for dashboard
I ratelimit updating things to 10r/s
because I dont want the endpoint spammed
I also do the regular host checking etc for the dashboard specific API endpoints
yeah I got threatened by people in this server to DOS me by refreshing my website constantly 😔
you can ignore that
🤨
doesnt mean anything rlly
What are you doing
Do this
Refreshing constantly shouldn't do anything.
Ideally things are cached in the browser and server
Use fs.readFile(outputfile, "utf8") as content
For example public pages on my site get refreshed max every 60 seconds.
Private pages update every 5 minutes.
The output file is the file you're piping the converted content to
Excluding forced refreshes(which happen server side under specific conditions)
I think the real question is why the hell is he saving a file in the first place
I think because converted is a stream
I don’t think it’s necessary to have operations done on the hard drive to get the value from the stream
A
thats because its not a djs issue 
It would need to be put all into memory though right?
Lol
Isn't that the point of the stream? Only some of it is in memory at a time.
It’s because you’re giving it an object that it has absolutely no idea how to handle
Oh nvm I see what you mean.
again?
yes 😔
How about work on improving your current commands
I think most of my commands are as improved as they could be
Idk about you but I dislike bots with a million commands that I’ll only use 4 commands of with a shitty experience compared to a bot with 5 very elegant and polished commands
And that’s simply not true. UX is never perfect
I meannn you're welcome to try for yourself
I have no use for a bot like yours
I polished almost every command I have
The only bot I use pretty often is esmBot
just to try, like run a couple commands I mean
I don’t think your UX is perfect no matter what you say, there’s always improvements to be made
well I don't know what else I could improve in them then
That’s the thing with software development, there’s always improvements that can be made
How about refactoring your codebase to be better 😉
It doesn’t always have to do with UX, but your experience in developing the bot
Make things easier for yourself, create modular and easily modifiable parts to your bot that all go together to improve your experience with developing, “KISS; Keep it simple stupid” and “DRY; Don’t repeat yourself”
A DRY KISS doesn't sound too good
that’s all developers are going to get anyways
lmao
I meant in your code. Not your users
I can add commands easily, I kinda stole that format from my multitool where I kinda had my own language
Still using strings for booleans?
That’s not a very good motto to go by
so far I managed to drop the ram from 300 to 125-150
Comparing characters one by one until they all match is much slower than comparing two booleans with a simple bitwise operation
It might not make much of a difference, but it’s still an improvement you need to make to improve your code in general
Do you use raw database calls in your command run functions?
what do you mean by that?
Tortoise orm 
Like do you directly access your database via your commands
brb gonna punch volt a litte
You should make a class that manages those things for you so that you can modify the class easily for reasons like swapping databases in the future
That way you don’t have to go into every file and change your logic
depending on what kind of data ur storing, not even booleans would be fine
yeah but I'm going to have to do it either way
at least not if u need to store more than 2 bools
I’m just going to wait for the day that putting off all the improvements to your code “because it works” bites you in the ass
that thing is still maintained?
I am 😔
well, yeah ig
but using it as a database is blasphemy
why?
Cache != database
You could use at as a caching layer on top of a database, but caches are in memory stores
both enmap and redis are meant to be used like waffle said, in memory
But it supports persistence via sqlite
yeah it's using a physical sqlite file
tho I'd say nowadays having a intermediary caching database is kinda useless unless u got many clusters
why don't u simply use sqlite directly?
dealing with enmap is wayy easier
no need to learn SQL directly
...
easier for simple things, you'll miss sql when u need high performance and flexibility
I mean the response time is literally in nano seconds
of course though I take the settings on boot and put them in the message property
so doing message.settings is basically like cache
respond to the interaction lol
and its exclusive for each guild so I don't have to deal with any slowness
same with warns
you don't have big enough tables yet
Hmm yes the floor here is made out of floor
isn't enmap just literally sql under the hood
so reply to the interaction instead of sending it directly into the channel
yes
just makes it easier by using premade functions
Defer it first, I'm sure converting pdf to text takes time
thing is, premade imposes a minimum bar for your queries
I personally don't see what's wrong with using Enmap as a simple key-value database.
you lose freedom when u need to do highly customized queries
Writing queries in SQL is already a nightmare
only if ur structure is bad
any error?
well what if I store the higly customizable query in a json 
oh no
I basically store the key as whatever I want and pass the entire whole json as the value
then I just convert it back to json whenever I need it
it works well
try doing what flaze said, just defer it first, then edit the reply

yw
what about it isnt working

i have a question for you
are you new to javascript or something
alr then this makes sense
a bot is very different to react
while they could learn js and should
tell emm at least why it isnt working
.then({files: [{ attachment: "output.pdf" }]})
?
interaction.reply({files: [{ attachment: "output.pdf" }]})
why defer the reply and then do .then()
i'd only recommend deferring reply when doing something that make take time to reply
is this command good enough?
Ye they're converting a pdf file to text
1st off defer the interaction before you execute all your code not after you've executed it all because thats dum dum, remove the .then from it as well because yes. Once you get to the part where the pdf has been created, use the .editReply function and then do what you did before, pass the file in it and then boom
wdym u cant understand banbanlistdellockdowndeltimeoutdelwarn
yeah worth deferring them
await interaction.deferReply()
// do the pdf stuff
const attachment = new MessageAttachment(<whatever>, `file.pdf`)
await interaction.editReply({ files:[attachment] })```
something like that
not sure how the pdf is returned?
wdym there's a coma
still add a space 
command, command, command looks better than command,command,command

I do that as well 😔

my phones font does ruin everything lmao
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
but?











