#development
1 messages · Page 1917 of 1
Is that discord.js or discord.py
Discord.js
I'm asking for discord.py
You didnt specify language
so how we can do it?
Show me a database set example
Oh You can identify it by looking my example code
Your cmd clears reactions that might be the prob
You sent it when i was typing
Oh
Make like if the bot has permission then clear otherwise don't
You should decorate your command with
@commands.cooldown(1, 30, commands.BucketType.user)
@client.command(pass_context = True)
async def getalt(ctx):
msg = ["gabrielwarren2000@gmail.com:Cyber123", "leandroriveros123@gmail.com:culillo123", "albesi8@msn.com:Albakortoci1", "dryden6@yah...
checking that only
Yeah. It's a cooldown for every user. I want to set different cooldown for different users
Ok
Just googled for you
it is
i confirm @carmine topaz
but there isnt a fix
so it removes the reactions
and doesnt requires manage perms
@clear marlin
Change they if bot has permission then remove
Or make help menu in js I can help on that when online pc
If you do that your help command wont work and topgg wont accept your bot
ok
It happened to me

yeah thats the problem
Use buttons more faster
but discord.py hasnt released
You dont need to wait until bot react all emojis
😢
Make help in d.js 13
whole project in py and help in js will that work
Or just shut down bot

lol no
Yes multiple hosting works
That's the worst idea that anyone can come up with 
well i think i need to use another lib
Yes
Or learn js

Actually discord js isnt hard that
Either rewrite in js or other lang, or just fork any custom dpy libs if there are any
Seems like the last resource though
Even then double hosting and running your bot on 2 client instances is really the worst choice which u should never do
True
I was doing 5 host when iam noob 

Everyone was a noob at some point, what matters is how fast and how good you develop your skills
I was thinking about using multiple hosts... can someone explain me what problems do you face?
Brainfuck
Itsnt hard code bot with all features in the same code
use aws lambda. it'll be free
How do I use SQLite as an if statement?
What I want to do
async with aiosqlite.connect('D:\Room_Sealer\db\quests.db') as db:
if ctx.author.id == "USER ID IN DB":
#execute code
else:
#raise custom error (Already know what to say for the custom error
Language is Python
Here is the DB data:
and also https interactions
and sloooooow
💀
What this chendge? On end of the day your code compiled runs on hosting and works faster
2 gateway client instance yes, but when u running interactions http server or dashboard api isn't that stupid
can you content.includes(array)?
like one item of the array matches and it becomes positive?
A help command shouldn't require permissions. Now, if you're talking about a help menu, each time the user reacts to a certain reaction it edits the page that was sent by the bot. The bot doesn't need permissions to edit it's own message.
Hello guys, have you ever faced this problem when you invite Plasma to your Discord server?
"This bot can't join more servers as it has not been verified or is requesting gateway intents it has not been verified for. Ask the bot's developer about https://dis.gd/bot-verification so you can add it to your server!"
they need to verify their bot
The bot needs to be verified
lol
Plasma is such a popular Discord bot; however, I can't add it to my server. Is this related to developers, right?
it must not be that popular yet
^
i think it's limited to 100 servers until its verified
Looks like an old bot
can someone help!
it was a verified bot but it was unverified because bot was against discord api rules
😂 nice gif thanks for it
lmao good good

Okay, thank you. I'll find another bot that creates giveaways that by user' levels
ok
what rules did they break?
Plasma was recently unverified due to our invite requirement giveaways and server requirement giveaways, this is due to our outdated docs which say we still have server requirements
Plasma does not allow advertisement with the bot. We removed server requirements months ago, and to comply with Discord’s rules we will be removing invite requirement giveaways
We have been unverified mainly due to a misunderstanding and lack of communication
Thanks for understanding, Plasma management
ouch
what does invite requirement giveaways even do?
inv roles
basically make it so you need to have x invites to be able to join a giveaway
for guild requirement you need to be in said server to be able to enter
how does that break tos
yes
Needs fixing a bit
seems like a dodgy link
The positioning at the footer too
its not responsive for mobile yet
it's horrid
um ok
navbar looks like a w3schools navbar but with some animations
lol true
font doesn't match the aesthetic you're going for, the colors don't match, you don't have a palette at all, nothing is pleasing to look at and everything has attention, i don't know where to look at first
also statements like these are cheesy and annoying
Please please please fix the text sizes
pleaase fix the images
look on https://dribbble.com/ and https://www.behance.net/search?field=132 for good UI/UX inspiration
because this is horrid and it looks like a 5 minute project
^
^^
wtf is that
The site they wanted us to look at
escape it with a backslash
\`
what are you confused about
literally just insert it into your string
lol
...inside of the string
where you want the codeblock to appear
you didn't escape the second backtick
Peope quick question do you know how to get a emoji as a image file using a bot??
a custom emoji or a unicode emoji
custom
https://cdn.discordapp.com/emojis/emoji_id.png
i.e.

!dbl
the ID is 757235965629825084
the URL is https://cdn.discordapp.com/emojis/757235965629825084.png
hi
Oe mp stp
I'm working on a domain parking system, where you just point the nameservers and it shows a really simple coming soon page.
which is better for my usecase:
apache or nginx
domain parking doesnt sound very ethical
well its just a landing page
change nameservers to ns1.XXXXXX.com and ns2.XXXXXX.com and it will show a coming soon page with no ads or anything
i meant parking as in buying tons of domains and selling them at a higher price
ah no i don't do that
nice
why does this error occur and how can i fix it?
...\node_modules\canvas\build\Release\canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).```
do npm rebuild
alr did that
try deleting the node_modules folder
and then
npm i
their native code is so sloppy it requires a very specific environment otherwise it will not compile
my vsc is dying
oh dear
compiling is cpu and disk heavy
but yeah uninstalling and reinstalling everything should work
the classic meme
at least it worked
and bro your pc is about to fry
you are saved by that ssd
try compiling with a hdd
yes it is
wha?
with a hard disk drive
right there are two types of disks yes
i was saying that compiling with a hard disk drive would be very slow
oh
i dont think it stands for slow spinny disk lmao
no it doesnt
Msg.reply() replies mention on how can i turn it off
if v12, i think you cant and you just have to do <message>.channel.send() and V13 you can do something with the Allowedmentions: option, check the docs for that
yeah
message.reply({ content: 'hello world', allowedMentions: { repliedUser: false } });
Is there any way to do it to all messages
Like define it in client
I think there actually is
As client option, yes
new Client({ allowedMentions: { repliedUser: false } });
for once discord js got something right
Thanks you
This red area was making me crazy
can anyone help me
in making a music bot
"reference"
const ticks = loadJSON("/home/runner/Bot2/Handlers/ticks.json")
console.log(ticks)
var objIndex = ticks.findIndex((obj => obj.userid == message.author.id && obj.closed == false));
if (ticks[objIndex].userid == message.author.id && ticks[objIndex].closed == false) {
return message.reply("You already have an active modmail. Do ?mmclose to close your modmail.")
}
console.log(ticks[objIndex])
why does it says cannot read property userid of undefined
[
{
"userid": "testid123",
"closed": true
}
]
this is the ticks.json
obj.userId
Oh mb i didnt see second msg
lol
wait
bruh it worked now
nvm i put the json upside down
its supposed to be
[
{
"closed": false,
"userid": "testid123"
}
]
Whats different?
Actually nah i was just tripping the object is undefined
hey
i want to learn to develop a bot
problem is i dont know what is javascript
i dont have knowledge about it
so should i learn java script first
?
I wonder if that's a question or not...
Might make sense to learn driving a car, before driving it.
common sense 
:D
That supposing some people actually learn how to drive
but like some websites saying install node.js
and any other coding apps
my friend used
repl
so is repl better
i made node.js repl
of replit
uh
no
my friend used itt
to make
first created node.js
there
something like this
um
idk
my friends all made
bot
in 2 to 3 days
someone made songs
with mini games
my friend made a mod bot
like carl bot
with repl
no
hm ok thanks
thanks
So if anyone get the bot Id they can fill the missing part
token letters
uh
but it is a test
bot
i am learning currently how to make
i am new to discord.js and node
And yes, invest time in learning JS first, then Node.JS and only then bot devving
ohk
i will learn
js first
it has both, Online IDE and code hosting
There are some steps you can't skip else you end up with a broken and unfixable bot
uh
ok
w3schools
hm
i dont have any
i am in 8th grade
i only learnt html little bit
like to create webpages and forms
umm isn't it still kinda hard if u sum up all stuff in just 2 hours?
is basic knowledge enough or need to go advance
uh
this website good for java?
js
java script
it is like this
oh ok
for java script should we know
html
and css
yeah, but as of he/she said he/she hasn't tried other languages too
otherwise 2 hours are kinda ok to start
i havent learn html
python
css
i havent learnt any language yet
that's what she said
you don't need to know html and css for js
that's just if you're making websites/frontend stuff
js is primarily used for web development, that's why it's trying to teach you that
but for discord bots you don't need to know and html or css
(Unless you plan on making a website for your bot, but that can be done later on)
author: {
name: `${req.user.username}`
},
i am passing a embed through a webhook and whenever i pass something like req.user.username inside a embed it doesn't work but as a message it works
i've also logged it and it is just fine
it just doesn't send
Because the context isn’t the same for embed and message
wym
You should be sending the embed as a embed not a message
if i do name: `Grainger`` it will go through
They aren’t the same code
u don't get what i mean
Explain
so basically if i do this it doesn't work
but if instead of req.user.username i put my username "grainger"
it works
as an embed
yes
Not my cup of tea
Do anybody here already applied for a gateway intent and know how long it takes. Because you just send the form and that's it... there isn't any mail or DM confirmation that would give an estimate
Usually takes about 5 business days
Might take a little longer though because of message intent requests coming in at a high rate
Nice, I sent it the last week. It should be approved soon 🤞
Gl!
thx
I hosted localhost 3000 with my pc but i cant connect it with my phone they are connected to same wifi
well then add a firewall rule to allow incoming requests on port 3000
you likely need to port forward your router
I though local is meaning wifi not device 
Using online editors more easy
Or just ctrl+f12 and mobile mod
localhost = this pc
from the phone you should connect to PCs_Local_IP:3000
the phone will ask the router to find the local IP of your pc
which might need port forwarding so the router knows what to do with it, as most block incoming requests by default
you can use cmd ipconfig to find your local IP
Okay thanks
usually they are something like 192.168.1.5 or 10.1.1.5
the first 3 numbers are the local network, the last number is the device id in the network
Can i ask you another question (i ll want to you to check my code (is it good coded or no))
if your local network is 192.168.1 then your devices will be:
192.168.1.1 (router)
192.168.1.2 (pc)
192.168.1.3 (phone)
etc
Not in your local network
I applied day one and it took about 2 weeks, if I recall correctly
You were right about it having no sign of confirmation, it straight up just redirects you back to the bot page after you submit the form, which wasn't very reassuring
Accepte ma demande d'amis
yes
ok thx
why did you censor 83% of the screenshot
maybe his user name or private infos
nobody cares about that crap
because mysterious language
soo we posting long downloads ? https://cdn.discordapp.com/attachments/476618062179729438/897943577605341214/unknown.png
Anybody knows a PCI-E m.2 adapter card with 2x M-key support?
I can't fucking find one on mobile
Or B+M key support on one or both
nvm
node version manager
tim you're such a comedian
:^)
Yeah well trying to update my home server
Proxmox doesn’t support hardware RAID
So the mainboard has only limited SATA ports
Means I need a PCIE adapter card for one or better two m2 drives
what about ESXi
Since Proxmox is heavily writing the drive I necessarily need a second one for the OS as soft RAID
Yeah but I need two m.2 drives
In one PCIE slot
8x for 2x 4x NVME
Humans have 1 mouth but 2 or more sausages can fit in it at the same time
Well it’s not an issue at all just need an adapter specially made for this
That’s not so easy than you might think
I’m limited with x8 slots
The RAID controller also needs a slot
I could technically fit all 3 in but unfortunately the place between RAID controller and 2nd adapter card is not enough
I’m already thinking about just putting in 1 NVME drive instead of a RAID
And taking the risk
But since I’m already upgrading again I hoped for a solution which lasts for some years
raid shadow legends
I not speeking English ferry god
watashi wa ingurishu wakarimasen

No, I don’t buy anything!
baka
What does this error mean and how do I fix it?
event: exit
Error: exit
/home/container/node_modules/discord.js/src/structures/VoiceState.js:158
return this.member?.edit({ channel }, reason) ?? Promise.reject(new Error('VOICE_STATE_UNCACHED_MEMBER'));
^
Error [VOICE_STATE_UNCACHED_MEMBER]: The member of this voice state is uncached.
at VoiceState.setChannel (/home/container/node_modules/discord.js/src/structures/VoiceState.js:158:69)
at VoiceState.disconnect (/home/container/node_modules/discord.js/src/structures/VoiceState.js:147:17)
at Query.<anonymous> (/home/container/index.js:1317:18)
at Query.<anonymous> (/home/container/node_modules/mysql/lib/Connection.js:526:10)
at Query._callback (/home/container/node_modules/mysql/lib/Connection.js:488:16)
at Query.Sequence.end (/home/container/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query._handleFinalResultPacket (/home/container/node_modules/mysql/lib/protocol/sequences/Query.js:149:8)
at Query.EofPacket (/home/container/node_modules/mysql/lib/protocol/sequences/Query.js:133:8)
at Protocol._parsePacket (/home/container/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/home/container/node_modules/mysql/lib/protocol/Parser.js:433:10) {
[Symbol(code)]: 'VOICE_STATE_UNCACHED_MEMBER'
}
/entrypoint.sh: line 106: output: not found
Line 1317 is newState.disconnect(); Would this:
if (!newState) {
if (!oldState) {
newState.disconnect();
return;
} else {
oldState.disconnect();
}
return;
}
Work?
discord js relies on cache to the point where it shits itself if cache isnt present
at least now it gives you a proper error
v12 was "cant read x of undefined" left and right if you had missing caches
nice
think of the wasted cpu cycles checking if the cache is okay
sorry os development makes you go insane
thats nothing compared to the gazillion checks v8 does on every single js value
besides, thats the entire point of a cache, checking if its there lmao
Whenever I start my bot I get this error.
this.Promise = options.Promise || Promise;
You might wanna post the actual error then
oh yeah
xd
this.Promise = options.Promise || Promise;
^
TypeError: Cannot read properties of undefined (reading 'Promise')
nevermind I fixed it <o/
i just found out something surprising
github actions has full access to the internet for an action.... and lets you run a discord bot.
im using it for a unit test of my lib
im able to connect to discord websocket, run REST requests, connect to a VC and send audio...
yeah would have expected just a few more restrictions than that though
and apparently the instance can run for up to 72 hours before github yoinks it
so you could have a cron job to run every 72h if you wanted to relaunch it lol
yes, there was a dude who was literally hosting his bot on github actions
apparently well enough for him not to need a vps
so i guess a D++ bot wouldnt even tickle it
but from what i've read, github action max runtime is 6 hours
i could practically run triviabot in it if not for the lack of a db lol
so his bot would probably restart every 6 hours
lol true
but im really liking how i can do proper unit tests in it
i havent seen any other lib running unit tests in gh actions
not sure why
but these projects are years old, you'd have thought they'd have had time
they have a few independent tests and stuff
but i dont think anyone has a full online test
ive managed to get it all up and running in 6 months with auto packing and all sorts, its not that complex 🙂
lmao, i sure am not
im more like one of these people who has 60 iq when it comes to anything not a computer
well i admire how much effort you put into things and how fast you made D++
i run out of energy super quickly, so i develop very slowly
im finding it hard to concentrate these days idk why
maybe im just burned out
yeah
a few months ago i started working on an independent discord lib in js
and found out that the ws package is pretty terrible
i rolled my own custom websockets and they are like 20x faster lol
API v2 est. 2031
it just feels like a chore
whats up with the ws module
a lot of time is wasted in their internals, their code is confusing with lots of checks and lots of jumps
but to be fair they go very far to support the entire spec
weird
youd think something so well tested and highly relied upon would be optimised
i wrote a websocket for just the subset of the spec that discord uses
i found another discord ws quirk today
if your lib talks ETF, then a shard websocket must be binary, if it talks json, a shard socket can be EITHER binary or text frames, but in either instance, a VOICE websocket can ONLY EVER be text frames, or your frames are.... silently ignored

i measured the time spent processing websocket messages from tcp reception until json parsing, and over 2000 messages, ws spent full 6 seconds processing them
ick
lmao
i didnt do voice yet
tbh
voice was the one set of tests i expected to fail on gh actions
i'd have expected udp to be firewalled except port 52
i also rolled out my own ETF in pure js, which turned out faster than discord's official ETF package lol
lol
discords package is ass
its supposed to be heavily optimised, is it bob
the code that builds a buffer uses C malloc, and uses it badly
i changed it to use a vector and reserve(), its a ton faster
nice
im going for pure js so i cant do that
but i got a pretty nice 30-50% performance boost
also
it uses recursive descent to build a js v8 object
Local<> type or something
those are shit slow in comparison to nlohmann::json containers
can you do direct conversion between nlohmann and v8 tho?
no
im pretty sure you always need transversals
but i dont need to, i needed nlohmann
ah well yes
v8 objects cant be converted from anything, they always need to be built from scratch
kind of a bummer
from what i hear the discord team hates ERL/ETF
i heard they'd love to get rid of it
but too many bots use it
they should just do it
iirc the official client uses it too
other updates dont generally remove anything
just make it a semver major api version and deprecate etf
they just change things
etf vs json makes lietrally 10% difference in message size
i bet some massive bot devs would kick up a stink
in exchange for 50% more cpu usage in most cases
its not about difference in message size
if you parse json, you have to deal with indentation, character encoding, etc
basically build a recursive descent parser
if anything, they should use messagepack
and all your numbers, you have to read from strings
with a binary protocol all your numbers come packed as binary
there are plenty of better binary protocols to chose from
also, ETF stores boolean and null and strings lol
two kinda esoteric languages
yeah true false and null can be identified quickly though
theyre an atom type
strings are not
you just look for an atom being used as a value whos first char is one of: n, t, f
yeah but they cost the same amount of bytes as strings
they are O(1) to parse
at least if you do it in C++
you can make a safe assumption, discord only ever uses an atom as a value in the case of null, or boolean
any other time it uses a utf8 string type
so if you have a value that is atom, you know its one of those two types and just check the first char 😄
(erlpack doesnt do this)
im pretty sure they use atoms for other things
key names
but never values iirc
oh oh, in etf, an object key can also itself be a complex object or array type
but youll never see it in anything discord sends you
as it mimics json, and json can only have a string as a key
or number
im using the same code to parse both keys and values
so im not really taking that advantage
yeah
but json cant represent this legally:
{[1,2,3]: [5,6,7]}
etf can, i suppose C++ could (but why)
ye
another buffer quirk in js is that depending on the buffer length, its faster to loop over it rather than use the built in latin/utfslice functions
lol really?
ye
generally if a string is shorter than 20-30 characters, looping is faster
a lot of my performance improvements came from this lol
same for utf
I thought I understood coding but now I might just quit..
thats like default vsc?
ah
it was an extension, but now its built in
you have to enable it in the vsc settings
👍
its just a matter of learning how things work behind the scenes
for example how UTF8 works, how text is represented in binary
sure
but a binary buffer is not a string
having it as a string means youre stuck with string methods
having it as byte array would be more practical
but it is a string?
kinda?
its a string value received from discord
i have to give it to the user as a string
i mean a jpeg file can be held in a string too
well discord doesnt send you jpegs
it can
since when
only if you use the cdn
nope, this isnt for cdn
unless you mean a REST endpoint
Why does the typescript enum type suck
enum SomeEnum {
some, // 0
thing // 1
}
type SomeEnumType = keyof SomeEnum; // "some" | "thing"
const anotherOne: SomeEnumType = SomeEnum[0]; // type string is not assignable to type SomeEnumType
It doesn't even offer suggestions for the inverse of the enum definition
Some DBs offer expression evaluation like simple math. SQL for example allows for instance: UPDATE table SET column = column + 1;
That's exponentional, not linear
linear would be a static value
Adding to the previous value
xp gaining should not be linear
the more xp you gain, the harder it should be
it should be somewhat exponential
Then you should be careful with your multiplier because too much or too little is disheartening
last time i did this i drew a curve into a paint program
and then i would read from the curve

level across X axis XP across the Y
convered the curve to a spline in a draw package
You can statically create a curve with some coordinate and spline logic vs reading pixels
this meant that if i wanted to change the levelling i could edit the curve visually
Logarithmic-ish level gain?
no dont read the pixels
convert it to a spline and save that
then read a position
Okay. You didn't mention that, so it was kinda ambiguous. Just want to make sure people are still sane
but im not a maths/stats guy, i did this via a pregenerated table
you only need precalculated points for each level number vs xp value
hmmm, ^2 can get out of control quickly
In mathematics, a parabola is a plane curve which is mirror-symmetrical and is approximately U-shaped. It fits several superficially different mathematical descriptions, which can all be proved to define exactly the same curves.
One description of a parabola involves a point (the focus) and a line (the directrix). The focus does not lie on the d...
something like this perhaps
its not exponential, but becomes more difficult to level up the more you go up the scale
and lol, rectum
access how? list or find? find based on what input?
You could have a static amount of xp required per level, but have a 📉 so that it gets harder to reach a level each time. If you use math to figure out what level someone is based off xp instead of incrementing a level field, you're saving some storage space, albeit a little amount, and you won't have to deal with BigInts as soon
arr.find(item => typeof item[key] !== "undefined")
imagine using a language where bigints are a problem 
I fucked myself because I use BigInts for currency but can't mix with floats
just keep your ints below 53 bits :^)
Someone is already at something something quintillion
but just you try and store it in a js number
it'll round it to the nearest 10k
lol
its not below 53 bits lol
it'll do the same to a 53 bit number
gain xp based on if they were active during a 1 hour window
so no matter how much you spam, you can only gain xp once per hour
or per 15 min
or 5 min
whatever you choose
all my homies love mee6.
chose one
function xpNeededForLevel(lvl) {
const base = 7.5;
return (lvl * base) ** 2 - base ** 2;
}
just adjust the base to match the curve you want (taken from some random stackoverflows)
another question is if the xp is cumulative or if it resets on every level
if its cumulative you may want a much higher curve
I agree, Tim is hot

My bot is in 98 servers but it is unable to join any further
...
I have counted by printing guild array in console
And they are 98
But it is showing that bot has reached the limit
Just import the json using require()
umm .arrayName ?
Depends on your json's structure
😮
from where do i create one
@marble juniper
ok
just put the respective values into place
What does the import return?
If its anything other than a function, then yes it is wrong
a js file
What do u export in the js file?
top.gg api thing
i'll try doing it in main file

I'm also confused...I'm stupid
how define bot Library in -botinfo ?
you can't anymore; the option is deprecated
Does anyone here know how to do vote events in DBM? It runs up until the first send message to console, and sends with the right id, but doesnt control the member data or send messages when i had them there
dbm sucks tho
lol this is still just writing code at the end of the day, just not inside an editor. Why not just learn how to write code and pick up a super useful skill while you're at it
because some people just want to make a bot quickly and not go through the hassle of programming it
don't blame them
idk this looks like a lot of work
its not toxic
you wanted reviews on it
you've picked horrible fonts
and all the buttons are massivw
could've said it in a nicer way though
like
"those fonts don't look good maybe you should try different fonts"
whatever doesn't matter
Bad font, Not compact, bad song, bad color combination.
no offence, but looks horrible
lmao
stop rating the song
i didnt made the song
still the layout isn't very good
design nowadays is about simplicity and ease of use - prioritise that
i literally said 3 other things
color palette wrong ,bad transition with other elements ,but the layout is good
why you domain addict?
you have domains?
like a bigillion
can i have 1
35+ atm i ithink

no
why?
WDYM WHY
Bro he literally pays for em
lol
and you call him, rude and also an addict
why would he give it to you, he doesnt even know you lmao
anyways
no i didnt
yews you did
where show me
how do i send a message in a specific channel when someone votes on my bot? i have tried using the on_dbl_vote but i dident get any outputs when someone voted
no its not for domain
Its cuz i was annoyed when all coding community sayed its worthless
and i am not good at designing
you asked for opinions
yea
k fine
@spark flint I am really so sorry please forgive me for what i did i really didnt meant to hurt your feelings
done!
@sly sierra
hes still not gonna give a you domain
was just stating osmething
anywas
#general or smth
i dont want i know he will not give me
So I have this welcoming message and it doesn't want to send. Am I doing something wrong? It doesn't send any errors upon launch nor when a member joins.
maybe its ur return statement
Maybe what I have watched is old or smth
Are you using djs v13?
Figured it out myself somewhat
That's v12 code
Well I noticed something was wrong when the video was 2020
You should upgrade to v13 if you haven't yet done so
Probably have, if not, how so?
Check your djs package version
I guess it's like this?
Yeah that's why then. You're trying to run v12 code on v13.
That'd be why then
What I have done now "works"
what's the max amount of servers you can have on an unverified bot again? is it 100 or 75?
ah, that makes sense then. My old bot shows at exactly 100 servers and isn't verified. Thanks
It's not that hard to re-write that code you posted above for v13.
I guess this is the problem I have ran into (I had a previous way more simpler more than this)
so I am literally that dumb
quite*
😛
We both dumb then huh
cheers
just rename it
pov you say php is trash
and dead
even though it powers more than half of the web in total
turns out you are a lie
would rather use php than go
i was watching a fireship video about go and went "oh this language looks pretty good especially since its compiled!" but once i saw the lua-like if statement without braces i immediately said no
My man got his priorities right
Not even that, go's 'simplicity' is also its downfall
isnt simplicity supposed to be an aim for all modern languages
after all as times goes on coding is supposed to get easier and more powerful
The easier the language the less control over smaller things you have
There’s a lot of room for optimization in js for example, but not nearly as much optimization as would be possible with C++
But maybe there should be a language that offers control over tiny things and allows you to make small optimizations like C++, but allows you to write compact code if you don’t want to optimize
have i introduced you to 
Haven’t really looked much at rust, all I really know about it is that it’s similar to C++
it was smth like welcome.send{( embeds : [welcm])}
who knows how to check the guild scopes on djs v13?
@green kestrel wont be happy with this statement
lol
theyre similar only in they loosely share some syntax, in the same way a newcomer who doesnt know either language might say javascript looks like java
the design philisophy of both is completely the opposite
the philisophy of rust is like... um.... imagine you have a self driving car, that is fast, but wont ever break the speed limit, wont let you drive it unless theres an emergency, and will never crash, but you cant push it to its limits
and the philosophy of C++ instead is like a kit car, you made yourself and can do 200mph, but you could crash it horribly
one of them tries to guide you towards its model of "code safety"
the other doesnt get in your way, gives you a hammer and some nails and says "go build house"
😉
@wheat mesa ^
ironic
rust has a pre-parser thingy thats part of the compiler and checks for thread safety and race conditions, illegal memory accesses etc. C++ doesnt care.
C++: "the programmer knows what they are doing"
Rust: "the programmer needs to be brow beaten to do it right"
JavaScript: "HERP derp me make progrum"
sorry couldnt resist 😄
^ both rust and C++ ideals have their flaws. sometimes the programmer does know what theyre doing, but maybe half the time, rust is right and they dont 😄
no?
no he isnt, it was
when js was made, there were only web browser java applets
and they wanted to make something that people who were into making applets could quickly pick up
java embedded in websites oh dear
didnt browsers drop support for java a few years ago
java applets sucked big hairy ones.
it was a horriffic mess
yeah they dropped support for it a loooong time ago
not only were applets bloaty, but every one that wanted to run prompted you with a security cert prompt
they'd take ages to load up
oh the good old times when you'd get greeted with you have to install Java Runtime Environment
and every week you'd have to update java runtime, like updating flash player
as they were about as secure as a cardboard bank vault
in the end the approach of java applets was just to 'enterprisey' for web dev
too bloated, slow, and not the right tech stack
flash player filled that niche for a long while though
then html5 killed it
well not initially
though sucks how browsers dont let people choose if they still want to run flash or not
many old game websites host flash games you cant run
java applets is a different story
didnt flash hard-code a kill switch which triggers after a specific date
i saw some guy modify the binary to change that date to still be able to run flash
why would you want to? do you also want to run it in IE6 on windows XP? lol
its like asking if you still want to be at risk of catching the plague 😄
Except that rust is as fast as C++ 😛
you're lucky i wont ping brain for that one

Does anybody know how I’d go about showing how many servers my bots in on my website?
Save the data in your database frequently and fetch it from you side
i'd only say do that if you already do that for some other reason
i'd probably just setup a server on the bot side where you can query it for data
Well since it's static, irrelevant data about the bots status it can easily be written into a JSON file.
(instead of a database)
And yes, a database only makes sense if you already have one set up.
In Apache, I am trying to run 2 express app on the same server !
I am not sure,if this is even possible
Beta Web Server
<VirtualHost *:80>
ServerName beta.domain.com
ProxyPreserveHost On
ProxyPass / http://ip:3000/ retry=0
ProxyPassReverse / http://ip:3000/
</VirtualHost>
<VirtualHost *:443>
ServerName beta.domain.com
ProxyPreserveHost On
ProxyPass / http://ip:3000/ retry=0
ProxyPassReverse / http://ip:3000/
</VirtualHost>
Main Web server
<VirtualHost *:80>
ServerName domain.com
ProxyPreserveHost On
ProxyPass / http://ip:3001/ retry=0
ProxyPassReverse / http://ip:3001/
</VirtualHost>
<VirtualHost *:443>
ServerName domain.com
ProxyPreserveHost On
ProxyPass / http://ip:3001/ retry=0
ProxyPassReverse / http://ip:3001/
</VirtualHost>
As soon i enable the beta web server none of them works anymore
The conf's are simplified (ssl removed, rewrite rule removed)
@rustic nova
how do i find a channel using its name with djs?
ty
how do i set an embeds image to a deleted images image?
elaborate
profile pic changes etc?
no,
someone send a picture in a channel, they deleted it, the bot sends an embed with the embeds image being the image that was unsent
you could save that image and upload to a file storage system etc
on message delete get the image id, save to vps/pc, upload via ftp and get link, delete from vps/pc, log the url
The baseline is that once the message is deleted, the media can no longer be fetched
so you have to dupe save it elsewhere which is super inefficient and expensive to do
Another method is on message delete, save attachment locally, resend as new file
So you don’t have to store anywhere
is it possible to have unflattened cnames?!?!1
Just unflatten it 🙄
how tf
Unflatten it
but cloudflare doesnt have that!!1
what's a flattened cname?
Cname at root
CNAME flattening allows you to create a CNAME record at the root of your domain without violating RFC's (the rules that govern the Internet).
You have to be a pro member to use it
be a pro member
*in cloudfare
yes but to unflatten
not even possible in cloudflare
you can flatten all cnames or flatten cname at root
the file becomes unavailable on MESSAGE_DELETE
I thought it cached for like 15-20 mins
I can access via url for a while after
just download all attachments sent and save in memo /s
what
deferring replies now crash my bot
i changed nothing
worked fine for about 10 hours then it took my bot down for the rest of the day
actually
whenever my bot does anything it crashes
such as responding to a slash command
shitty ass fucking api if you ask me
seems like a you problem rather than an api problem
you badly designed your code
an api error shouldn't cause the app to crash
nah
not a me problem
maybe if discord fixed their shit my code wouldnt break in the middle of the day for no apparent reason?
not a me problem
whenever my bot does anything it crashes
thanks for the help headass
no problem! anytime
how we make it ?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
thx
discord js is not my favorite library, however it’s certainly not broken. Most issues you’ll encounter with it are a result of user error and not discord
discord.js is g ❤️
can js add operator overloading
and its so cool
why doesn't this work when i type it, but it works for my bot.
(Helllo)[https://top.gg]
that only works in embeds right?
😦
Yeah
using a specification object as a parameter makes life even easier
cuz ur not bottum dum dum
that's so kind of you
anyways, static types shouldn't be used in application languages
Hello,
I would know if it's possible to create a sub-function, like the toLocaleString function.
var number = '45000'
console.log(number.toLocaleString('en-US'))
// 45,000
I want to remove toLocaleString(), and create a new function "format", to do the same thing as toLocaleString but like that number.format() it is possible and if yes how can i do this
var
I don't get why ALL people that appear here for the first time use vars
is it some kind of starterpack?
yes you can, override String.prototype
HOWEVER be warned that modifying it usually lead to VERY grotesque errors
String.prototype.format = function() {
return this.toLocaleString("en-US");
}
console.log("45000".format()) // 45,000
Isn’t there a static var you can set to define the locale?
(in JS)
Wouldn’t that be easier?!
wasnt user error like i said
i changed nothing
works now
Probably user error regardless
the user error is in allowing the entire process to crash from an issue like this
If your bot crashes then you should catch the error 😛
Copy pasta of codes from 2015
dont open the db multiple times


