#development
1 messages · Page 1914 of 1
guild.channels.cache.find(predicate)?.send()
yeah ik, but I wanna keep it understandable in this case
No the message only being sent if the channel was found, an additional return isn't needed tho, just extra useless code
Well there's so much you can do, your imagination is just the limit
Also it can happen a guild isn't available
It would make sense to check for this, too
client.on("guildCreate", (guild) =>
{
if(!guild.available) return;
...
I'm proud of you, little Texan boy
These “preparation” sites usually have pretty garbage problems in terms of real-world use but this was fun to write
If you would now choose a real programming language, moving over to PHP I would hug you and send you cash, I swear

Backend is fun, but there’s no point in a backend if you can’t use the frontend 
I'm not the best fancy frontend creator as well but it used to work well the last 10 years
Tbh if I had time to work on web dev I would do it all the time just to get good at frontend
But school 🤢🤢🤢
the shard where each guild is assigned to depends on the number of shards you have
every time you change the total number of shards, all guilds are rearranged
while the total number is unchanged, the guilds will always be in the same shards
@quartz kindle when autocorrect becomes waaaay too correct
damn not even ms word corrects me like that
dizes tu
Verify Badge
wdym
verifius badgeus
what harry potter magic shit is this Tim
Tim, take your pills, now.
Ha! gonna steal all your knowledge once I'm in, Sir!
@quartz kindle It's finally announced.
Damn good, we did compare tests before iirc
if you think about it, every (dynamic) frontend is just a tool to use the backend API
i dont remember @_@
uhmm
damn Discord search is crap, can't find it, too
Those are the DNS servers... may not be really representive as the IO is always high in the background
ye thats average
if this is accurate tho... https://serverdiy.net/review/hetzner-amd-epyc-2g-cloud-benchmark/
its hot
are you gonna buy it?
im getting 1GB/s on average on kamatera
paying $4 for 1gb ram 1 cpu
if i can get 1GB/s on hetzner's 2gb ram 2cpu, im gonna buy it
The price for the cheapest server has increased by 60% because Hetzner now charges a HUGE fucking price for IPs
additional IPs? or does it include the base ip?
For additional IPs
They did only increase the price for the cheapest server because of the static assigned IPv4
Since you can't get cloud servers without IPv4
(yet)
i dont need additional IPs so its fine for me
Got a few servers running already, CX21 as DNS servers
I can now switch from Ionos (trash) finally to the Hetzner cloud US
im really interested in the CPX11
Hmm they perform quite nice
all i need is to confirm the disk speeds
Got cloud servers since they got introduced
because my workload is disk heavy
Well rent one, test it, check it out, if it doesn't work, throw it away
hourly based charge
just a few cents you waste
ye
Deploying and deleting only takes seconds
And the cloud webinterface is a FUCKING CHARM
like a referal code and shit?
cool
i'll definitely give it a try
it seems tho they dont own the US servers
they are "partnered" servers
so their performance might be different form their european servers
i've seen that on kamatera
They own the servers but moved into a datacenter they don't own
kamatera's german servers are faster than their US servers, even if the specs are the same
Nope the hardware is 100% Hetzner, imported from Germany
Funny fact is I was the one figuring that out by watching US costums import list
(in the private forum of Hetzner)
There are tons of benchmerks around the private forum
No I had to do with containers quite a lot in the past
ooo give me some benchmerkels
So I knew where to look
Also that statement should clarify what I mean by own hardware
(published today)
Performance is 100% the same as in the EU
As people in the forum figured out already
Germany <-> US
yeah just saw that
any disk benchs?
also btw, wasnt hetzner voice banned from discord?
Code:
await startMessageCollectors(client, message, args);
function startMessageCollectors(client, message, args) {
let channelFilter = m => m.author.id === message.author.id;
let channelCollector = message.channel.createMessageCollector({
channelFilter,
time: 15000
});
channelCollector.on('collect', async msg => {
const a = msg.content
msg.channel.send('ok1')
channelCollector.stop();
let ewFilter = m => m.author.id === message.author.id;
let wqCollector = message.channel.createMessageCollector({
ewFilter,
time: 15000
});
wqCollector.on('collect', async msg => {
const b = msg.content
msg.channel.send('ok2')
wqCollector.stop();
})
console.log('1)' + a)
console.log('2)' + b)
})
}```
**Error:**
`ReferenceError: b is not defined`
and it doesnt collect any message.. from me.. it directly runs everything.. and finshes the task...
https://media.discordapp.net/attachments/821972674380038166/905518998832177282/unknown.png
not that i need it, just curious
Probably a little bit better atm as the racks are mostly undeployed
I've got no clue tbh, heard this the first time
also, dont use collectors for that
use channel.awaitMessages()
your function is not async either, so no need for await
but i need 2 things from the code... and idk how to use await messages 😅
@NootropiqueZone We have banned Hetzner as a host so if you would like to have your bot connect to voice chat you will need to change your host, we apologize for the troubles!
😅 do u have a example for this
Just asked in the forum for speedtests, I guess it will only take a few minutes
@marcdesch Sorry for the trouble, but Hetzner is blocked on an API level from utilizing Discord.
Read the docs, everything is there
lemme disable piHole to be able to open Twitter, lmao
no no... just takes a second
lel ok
Are you sure this is true
i mean, its the official discord twitter lol
Like, everything by hetzner?
from what i remember, only voice servers
I know someone that had a dedi on Hetzner and they never had an issue with voice iirc
I'm running my bot on my dedi, too
Provide me some voice code real quick and I will test it
They might have purged the blocked IPs
its possible that they fixed it already, 2019 is quite a while ago
It's been years
Would make more sense to block the ASN
thats why i asked, i havent heard anything about it anymore
As Hetzner is still constantly buying new IPs
I doubt they would do that
It's a stupid move
Sometimes it takes years until the changes been announced to any association
What I can say is, I'm not banned
And my IP range is one of the older ones of Hetzner
Anyways I'm sure for that price/performance they will soon need to expand
apparently discord gateway events were getting flagged as ddos?
or something like that
lmao
Yeah that seems to be a real issue I read a lot of times in the forum as well
Lots of customers are complaing about that shit, but it seems things are getting better
The marketing girl stated they're increasing their abuse apartment a lot to handle the increasing amout of conflicts and to deal with things correctly nowadays
Already got a speedtest
CPX11
@quartz kindle
i usually run stuff like https://github.com/jgillich/nixbench
Ok let's see
Seems to be bullshit, there's no issue on my side, the API doesn't block me on my dedicated server nor on my cloud servers
looks like its only specific IPs
Tested 4 completelly different IP ranges
not all hetzner users are affected
yeah
They shared the IPs got buyed a few weeks/months ago by Hetzner
hmm who knows but I don't think so
no
no they're not
im running a discord bot on a hetzner dedi
unless it's a vps thing then idk
Just take a look at the close upper messages
might be a large amount of the vps subnets
I've got no issues, too
because afaik they get blocked programmatically based on abuse factors
Hetzner owns so many IP blocks, maybe they just blocked 1 or 2 or whatever
with voice?
and theres no certain reason why hetzner exactly is blocked?
why not other providers?
there is
anti abuse yeah
ohhhhh
they were spamming discord with abuse emails from their automated system
So discord basically blocks them for being unable to file abuse reports towards them?
OHHHH
basically thinking discord was ddosing them
yeah now I get it
Discord just said "Fuck that"
@marcdesch Sorry for the trouble, but Hetzner is blocked on an API level from utilizing Discord.
2018
Due to a lack of communication and improper use of abuse systems by Hetzner, we'll shortly be blacklisting ALL of Hetzner's IP ranges to our voice servers. If you host a bot on Hetzner that requires voice (e.g. a music bot), it will stop working when this happens. Please reach out to Hetzner and encourage them to open a line of dialog with us to resolve these problems. Apologies to any interruptions this causes for you.
As an addendum to the above, we'll be blacklisting Hetzner IPs from our API at 16:00 PST (GMT -7). Please take measures to move any services or bots you host on Hetzner elsewhere before this time. Feel free to reference ticket number 2017091403020104
As an update to the above, Hetzner reached out to us this morning and opened a line of dialog. Since it's the weekend and we don't wanna ruin anyones fun I've lifted all of the API level blocks. Your bots will still not be able to connect to our voice servers until we fully resolve the issue on Hetzner during the normal work-week. Thanks.
Hetzner was not able to meet our requirements to be unblocked, so the voice block will likely remain indefinitly
Got no issues on the follow ranges...
157.90.0.0/16
138.201.0.0/16
116.202.0.0/16
46.4.0.0/16
5.9.0.0/16
95.216.0.0/16
95.217.0.0/16
78.46.0.0/15
and a few more
Don't think I got anyone
you tried to connect to voice on all them?
then how did you test lol
The bots are running on these
but do you have voice features?
And got moved into different machines
they're blocked on voice
No as I said
the block only affects voice servers
that last one tho kekw

so yeah, its likely still blocked
I wonder what those requirements are
"Stop fucking spamming our abuse email"
lmao
"whitelist all our ips pls"
"lol no"
Would be interessting to know if the Ashburn IPs are affected as well
Probably hetzner being difficult
Maybe it's really a whole ASN block
LMFAO
Click here to clear your system drive of Windows
LMAO
hmm 0 bytes isn't much
idk whats using my space even
uninstall system32
lmao
I only have windows, chrome and discord on my c drive
lies
clean your recycle bin
Omg
Nope, right click the drive
How is this possible
Do cleaning system [...]
you did it wrong
no i didnt
Whatever it's called in English
yes you did
No i didnt
yes you did
Date.now() - msg.createdTimestamp
thats wrong
Message created at 10
Date.now is 15
15-10 = ping
Use the features I mentioned... you will see a lot of space is used for Windows updates
thats wrong
Why
updates dont get deleted after? 👀
No
oh is it because of the "shared updates" dodad
You need to clean up this yourself, that's why it exists
even if wrong the bot responds really fast
Nope they still exist even if that shit is disabled
Date.now() = time in your pc
message.createdTimestamp = time in Discord's pc
if the two pcs's time is off by just 1 second, everything gets broken
different pcs dont always have the exact same time, there are always slight time differences
Click on cleaning, then "clean system data"
Disk cleanup also works
Do NOT use the new fucking settings app to do shit
kek
It was working before
well its not working now
Tim you're ready?
nixbench v0.6.6 - https://github.com/jgillich/nixbench
cpu
---
Sha256 (1x) : 425.66 MB/s
Gzip (1x) : 82.45 MB/s
AES (1x) : 2196.61 MB/s
Sha256 (2x) : 848.32 MB/s
Gzip (2x) : 164.74 MB/s
AES (2x) : 3471.88 MB/s
disk
----
1. run : 1413 MB/s
2. run : 1460 MB/s
3. run : 1491 MB/s
4. run : 1499 MB/s
5. run : 1552 MB/s
Average : 1483 MB/s
geekbench
---------
Single-Core Score : 5134
Multi-Core Score : 9223
Result URL : https://browser.geekbench.com/v4/cpu/16402359
host
----
OS : linux
Platform : ubuntu 20.04
CPU : AMD EPYC Processor
Cores : 2
Clock : 2445 Mhz
RAM : 1939 MB
net
---
CDN : 84.98 MB/s
Amsterdam, The Netherlands : 17.90 MB/s
Dallas, USA : 40.82 MB/s
Frankfurt, Germany : Failed
Hong Kong, China : 7.55 MB/s
London, United Kingdoms : 21.71 MB/s
Melbourne, Australia : Failed
Oslo, Norway : 6.87 MB/s
Paris, France : 21.29 MB/s
Queretaro Mexico : 14.34 MB/s
San Jose, USA : 20.01 MB/s
Sao Paulo, Brazil : 6.00 MB/s
Seoul, Korea : 2.94 MB/s
Singapore, Singapore : 5.99 MB/s
Tokyo, Japan : 5.53 MB/s
Toronto, Canada : 54.00 MB/s
Washington, USA : 86.37 MB/s
@CPX11
check the clock on your pc, then check the clock on your phone, watch the seconds moving. most likely you will see that both devices have their seconds slightly different from each other
const Discord = require('discord.js')
module.exports = {
name: 'ping',
description: 'Pong!',
memberPerms: ["ADMINISTRATOR"],
clientPerms: [],
options: [],
async run(client, i, lang, options) {
let ping = await Date.now() - i.createdTimestamp
let embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription(`Pong! | \`in ${ping}ms\` `)
i.reply({ embeds: [embed] })
},
};
thats CPX11?
Yes.
As I said, keep in mind the racks are fully of "unused" VMs yet
That will probably change a little bit in the next weeks
ye probs
But it's still quite good
as long as it maintains disk speeds above 1gbps, im in
us location too 👀
im buying it today
And i have one more question
const command = client.commands(command.name)
Working on messages
But it doesnt work in interactions
Gonna run the test on a busy one atm, let's see
4 euros is super cheap
heck, I might as well get one too
why?
Slow, not needed, worlds most outdated and overly complicated dashboard
lmao
Yes after reading you aren't even able to deploy your own images, only when contacting the support FOR money, I was out
And yes I heard a lot of complaints about slow servers, too
very slow
well, there had to be a reason why they offered 4 cpus for the price of 1

btw
which virtualization does hetzner use?
kvm?
kamatera uses vmware
its op as fuck
Yeah I think so
ah, gotta be verified
ye
We are running KVM as a hypervisor. We use virtio for both virtual NICs and disks.
Got a second one
root@vm4-teamspeak:/tmp# curl -sS https://raw.githubusercontent.com/jgillich/nixbench/master/nixbench.sh | sh
nixbench v0.6.6 - https://github.com/jgillich/nixbench
cpu
---
Sha256 (1x) : 291.84 MB/s
Gzip (1x) : 246.45 MB/s
AES (1x) : 148.60 MB/s
Sha256 (2x) : 577.03 MB/s
Gzip (2x) : 489.48 MB/s
AES (2x) : 364.23 MB/s
disk
----
1. run : 1413 MB/s
2. run : 1495 MB/s
3. run : 1502 MB/s
4. run : 1498 MB/s
5. run : 1495 MB/s
Average : 1481 MB/s
geekbench
---------
Single-Core Score : 5623
Multi-Core Score : 9936
Result URL : https://browser.geekbench.com/v4/cpu/16402372
host
----
OS : linux
Platform : ubuntu 20.10
CPU : Common KVM processor
Cores : 2
Clock : 3094 Mhz
RAM : 3932 MB
net
---
CDN : 94.52 MB/s
Amsterdam, The Netherlands : 35.08 MB/s
Dallas, USA : 11.65 MB/s
Frankfurt, Germany : 50.74 MB/s
Hong Kong, China : 7.67 MB/s
London, United Kingdoms : 67.38 MB/s
Melbourne, Australia : Failed
Oslo, Norway : 28.91 MB/s
Paris, France : 59.12 MB/s
Queretaro Mexico : 7.23 MB/s
San Jose, USA : 9.14 MB/s
Sao Paulo, Brazil : 5.67 MB/s
Seoul, Korea : 4.28 MB/s
Singapore, Singapore : 8.45 MB/s
Tokyo, Japan : 4.69 MB/s
Toronto, Canada : 14.73 MB/s
Washington, USA : 15.96 MB/s
oh woops
I'm an idiot
you dont have cpu passthrough?
no lmao opened the wrong batch file which opened the wrong console of the wrong server
LMAO
It's the proxmox VM I benchmarked accidently
whats a more reasonable and cost effective method:
- buy another reseller hosting plan (gonna be offering a paid plan for devpage so people have a choice for what control panel and specs etc)
or - buy a dedicated/cloud server and install it all myself
doesnt exist
the second one is probably more cost effective, considering the extra amount of work you'll have to do
fuck... can't run that shit on my DNS server tho
true
setInterval()
ye
location?
US
a reason i may just get a reseller plan is that i don't have anybody paying yet and having a reseller plan to be able to cancel/restart at anytime without having to setup again
idk
OMG I can't paste the password
ffs
one second
Alright, test is running
weew
@quartz kindle Hasn't walked throug yet but I need to go in a few minutes
nixbench v0.6.6 - https://github.com/jgillich/nixbench
cpu
---
Sha256 (1x) : 428.62 MB/s
Gzip (1x) : 83.44 MB/s
AES (1x) : 2251.40 MB/s
Sha256 (2x) : 851.31 MB/s
Gzip (2x) : 165.25 MB/s
AES (2x) : 3647.49 MB/s
disk
----
1. run : 1394 MB/s
2. run : 1465 MB/s
3. run : 1491 MB/s
4. run : 1476 MB/s
5. run : 1479 MB/s
Average : 1461 MB/s
geekbench
---------
Single-Core Score : 5168
Multi-Core Score : 9315
Result URL : https://browser.geekbench.com/v4/cpu/16402378
host
----
OS : linux
Platform : ubuntu 20.04
CPU : AMD EPYC Processor
Cores : 2
Clock : 2445 Mhz
RAM : 1939 MB
root@ubuntu-2gb-ash-1
awesome
why gzip so slow tho
hmm not sure tho, test is stuck I guess
network tests take longer
yeah but not that long
probably a few timeouts
cpu
---
Sha256 (1x) : 426.42 MB/s
Gzip (1x) : 82.44 MB/s
AES (1x) : 2056.12 MB/s
Sha256 (2x) : 848.52 MB/s
Gzip (2x) : 164.61 MB/s
AES (2x) : 3294.30 MB/s
disk
----
1. run : 1432 MB/s
2. run : 1528 MB/s
3. run : 1478 MB/s
4. run : 1547 MB/s
5. run : 1553 MB/s
Average : 1508 MB/s
hmm
sha and aes are amazing
twice as fast as galaxygate for example
disk is also amazing
50% faster than kamatera
hahaha
Gonna send an invoice, Sir
im gonna go straight for monthly
its usually cheaper
do they give discounts if you buy per year?
There's no option you can choose
Have you made an account yet? Just noticed they have referrals
no yet
You pay hourly, MAX xxx per month
Should have used fakes but didn't 😔
(only)
gimme your referral
ty
its like $10 or $20
oops
lmao
lmao
Best development of your lunch
gonna send you over 10€ if I got their cash
hmm why not I mean I it's a nice thing
im gonna go to the shop real quick to buy more food, that burnt shit was the last food i had
LMAO TIM
@boreal iron I need your apache2 expertise again.
Background Info:
I have bought a new domain and since my old one will expire, I am transferring the search console property,which requires a 301 redirect from the old domain.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(https://|http://|)old.ga$ [NC]
RewriteRule ^(.*)$ https://new.com/$1 [R=301,L]
# https redirect
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
My Problems:
- https://old.ga doesn't redirect
- the redirects are marked as 302 sometimes
the domain doesn't exist
I replaced my domain lol,i didn't want to expose it

what the fuck
System.ArgumentOutOfRangeException: 'Index and length must refer to a location within the string. (Parameter 'length')'
no problem,take your time
nice format
yes you can, as long as its in an async context and you use await for the delay
Is that the actual domain name (old.ga)?
Also you're over complicating things a little bit with your rewrite rules
You don't need a condition for the rule
no just a placeholder
Redirect 301 /path/ http://new.domain.com/
for general redirects
If you wanna keep the path you will indeed need rewrite rules
but if i remove the condition, wouldn't it redirect everytime with 301 👀
<VirtualHost *:80 *:443>
ServerName www.old.com
ServerAlias *.old.com
RewriteEngine On
RewriteRule ^/?(.*) https://new.com/$1 [R,L]
Redirect 301 /
</VirtualHost>
Isn't that the goal to redirect the user always if the domain expires?
Maybe I didn't get it, yet
Ah your approach is correct,I have used the old domain as server alias
Well it's the virtual host, yeah
The domain name being resolved to the IP, arriving in your webserver, checking if a virtual host exists listening on that server name or alias, then manage/route the request
That's how the 'net works

nice
simply said
In my example www.old.com and any possible subdomain would be redirected
Ow
btw thx for helping me out :D
Might also be a good idea to include the actual TLD name
ServerAlias old.com *.old.com
Keep in mind my example will cause a SSL error
You will actually need two virtual hosts if HTTPS is a thing
<VirtualHost *:80>
ServerName www.old.com
ServerAlias old.com *.old.com
RewriteEngine On
RewriteRule ^/?(.*) https://new.com/$1 [R,L]
Redirect 301 /
</VirtualHost>
<VirtualHost *:443>
ServerName www.old.com
ServerAlias old.com *.old.com
SSLEngine on
SSLCertificateFile "${SSLROOT}/file.crt"
SSLCertificateKeyFile "${SSLROOT}/file.key"
RewriteEngine On
RewriteRule ^/?(.*) https://new.com/$1 [R,L]
Redirect 301 /
</VirtualHost>
oh... woops SSLROOT is a var in my case
Just replace it with your full path
Well or simply define it, however you like
Define SSLROOT "/path/to/certs"
color: Math.floor(Math.random()*16777215).toString(16)
don't create a var if you just use it once
ehm lol
that will always be the same var
color
I mean
look what I wrote above
only if you restart the app
not if the interval "restarts"
since you declared the color before
That will pick a random color each time, yeah
I don't ask why

creating vars doesnt really matter
the compiled code inlines almost everything anyway
if vars make it cleaner, use them
Compilers are smart
v8 is ridiculous
it has like 3 different compilers, all for different stages and different purposes
its google
wait no
its community
idk who maintains nodejs
wait yes
v8
= javascript v8
ok sorry bye
yes
lmfao
The OpenJS Foundation is made up of 29 open source JavaScript projects including Appium, Dojo, jQuery, and Node.js, and webpack.[4] Founding members included Google, Microsoft, IBM, PayPal, GoDaddy, and Joyent.[2]
Some years ago there was no TV, Discord, anime and other bullshit.
You started something and was working on it until it’s done.
how did men function without anime girls
these days i write code for 5 mins when spend 2 hours on 9gag/youtube to rest
Only distraction was shitting and eating
lmao
if (message.content === `${prefix}move` || message.content === `${prefix}t`){
let chanel101 = args.slice(1).join(" ");
let category = message.guild.channels.cache.find(c => c.name == chanel101 && c.type == "category"),
channel = message.guild.channels.cache.find(c => c.name == "general" && c.type == "text");
if (category && channel) channel.setParent(category.id);
else console.error(`One of the channels is missing:\nCategory: ${!!category}\nChannel: ${!!channel}`);
}```
When I run that command it doesn't move the current channel to the given input
Your command doesn’t accept arguments since you check if the whole content matches your prefix and command
so i get my id and the avatar id thingy that discord provides
Wym?
The user data returned includes the avatar hash
!move channel
if(content === "!move")
Your statement will never be true
So how would I correct that?
First of all you don’t check if the whole content === your prefix + move
You check if the content includes it or starts with it
o-o
src="<%= "https://cdn.discordapp.com/avatars/" + user.discordId + "/" + user.avatar + ".webp?size=128" %>"
i am using ejs how dumb is this from 1 to 10
well from that it looks like <%= " will interfere with the src tag
it works
might also want to use back ticks and dollar signs
you're using ejs so it's 10 dumb
I'm getting ptsd just looking at this code because this is basically legacy top.gg codebase
poor man's command handler

commandus handlerus maximus
That will populate this channel again
didnt even begin porting stuff to interactions
i need to finish my api first
aw man but i didn't want to use react for a very smol project
Stop 9gag and YouTube
just use pure html
with template strings
:^)
Ok, no more alcohol for you after 8 pm
jokes on you, i dont drink
erwin drinks enough for the both of us
lol
That’s why he’s always recommending detritus, because he’s drunk
I knew it
Thought he’s always high
yes
how do I go back to the previous page?
I'm talking about passport-discord / express
like: I log in, and it goes back to the previous page it was on, so it saves more time for the user.
just redirect again?
Discord supports an &redirect_uri I believe
oh my shit...
I wanted to explain it well, but I can't
user signin on page "/admin/blablablabla", and instead of him go to page "/", I would like him to go back to "/admin/blablablabla"
good
when done, redirect to that url again
cookie-parser, does it still work?
never used it
you have to await
those methods return Promise<Message>
const toDupe = await message.channel.send("Duping items...")
const duped = toDupe.edit("Covering your tracks...")
duped.edit("Items successfully duped!")
a setTimeout inside a promise
setTimeout()
oh
const toDupe = await message.channel.send(...);
await new Promise(r => setTimeout(r, 5000));
await toDupe.edit(...);
await new Promise(r => setTimeout(r, 5000));
await toDupe.edit(...);
or make it a function
function sleep(time) {
return new Promise(r => setTimeout(r, time));
}
await sleep(5000);
woah tim new pfp
yes but that will create 2 concurrent timeouts, so unless you set the first as 5000 and the second as 10000 for example, they will clash
to simulate waiting for the first timeout to finish, youd have to put the second timeout inside the first
pog I like the new pfp
also, if you're not using await, its a good idea to add .catch()
ty
ye, in most cases await is easier and cleaner
YES
I don’t like that new face, too old one again please
wdym it's like what u said?
client.on("ready", async()=>{})
async and await goes hand in hand like […] no that gets me banned
Fake’s driving at the moment and hates to watch code embeds on mobile
Your interval is missing the async def
You’re awaiting somethings in it’s scope
Okay then undo your change and forgot what I said

Stop texting and driving or I’ll cancel the minigun shipment 
Huuh ffs
I will fly to Texan and get it myself then
Just kidding… I always stop for a moment while writing, I swear
As if you were missing the clutch making the car constantly choke
how about this one
Hmm can’t really see what’s going on it on mobile
Not sure if I’m supposed to be scared or not
Also where are the big rings around your eyes?
Where’s the shockingly white skin tone of a programmer who never saw the sun before?
… can’t be you!
am eating yakisoba
im making a social media website, how can i store user content such as avatars / posts?
make sure to store all your passwords in plaintext in a non-password-protected database with public API endpoints
yes thats what ill do
ill make a /passwords
and itll show the account / pass
Now that’s the type of creativity we need in the development world!
Encode the password in amogus
else if (message.content.startsWith(`${prefix}move`) || message.content.startsWith(`${prefix}t`))
{
let chanel101 = args.slice(1).join(" ");
let category = message.guild.channels.cache.find(c => c.name == chanel101 && c.type == "category")
let channel = message.guild.channels.cache.find(c => c.name == "general" && c.type == "text");
channel.setParent(category.id)
}```
That returns; Error; cannot read property 'setParent' of undefined.
The error says it all. "Cannot read property 'setParent' of undefined" Meaning channel is undefined
Makes sense, ty will go put "message" infront of it lmao
Fixed one error and now got this:
'hasOwnProperty'
how do i create a voice channel in discord.js v13
it seems to only let me create a text channel
interaction.guild.channels.create(`${ticker}: ${price}`, {
type: `voice`
})```
heres what im doing
looks like i found the problem
const {
MessageEmbed
} = require('discord.js');
const Discord = require('discord.js')
module.exports = {
name: "await",
/**
*
* @param {Client} client
* @param {Message} message
* @param {String} args
* @returns
*/
run: async (client, message, args) => {
message.channel.send('start')
const filter = m => m.author.id === message.author.id;
message.channel.awaitMessages({
filter,
max: 1,
time: 10000,
errors: ['time']
}).then(collected => {
message.channel.send('done')
message.channel.send('start2')
console.log(collected.first().content).then(() => {
// message.channel.send('start2')
// const filter = m => m.author.id === message.author.id;
message.channel.awaitMessages({
filter,
max: 1,
time: 10000,
errors: ['time']
}).then(collected => {
message.channel.send('done2')
console.log(collected.first().content)
})
})
})
}
}```
TypeError: Cannot read property 'then' of undefined
then of undefined > then is undefined
(Jk I've literally asked for help like 2,000,000 times today. My brain is off atm)
console.log() returns void, not a promise

then of undefined = whatever is before then is undefined, not then itself
You will need to wait for quite some time
K
i tried nick=reset but not working

Free hosting been strong so far only times when bot was off is when i had something broken or i pushed an update
Free hosting is strong? Am I in the wrong dimension? 
im expecting it to die any time soon
Or you getting an unexpected bill
had to disconnect from school internet and switch to mobile internet to connect to my db 
OMG NO
So what to do
You have to select all permissions except administrator
in the part where it is has bot, identify and the other crap
I selected all perms
Amm what
My name taklu
..

You select and send ss
Ok only one
Third line second thing
What is scopes
Ok i now this
Ok bot and application.command
stop pinging 😭
Sorry
I selected all but not administration
which language do you use
This bot prefix is R! for seeing commands type R!help. This bot is 24/7. I deleted the NSFW command it comes automatically so I deleted it. My bot is a modration bot and multi-function bot. Made by Robo Gamer and we want a team for bot if you a codder I welcome you. If you have any complain or report a bug join our official server and ask me everything. This is not my bot this is our bot.
Hindi
Type Noob
what.

it does not work
also
do you know coding
any
type of coding
since if not it will be kinda hard ngl


Join. My server
i give up
bye
do it yourself
Noone appreciates copying code
atleast give credits in the help cmd
can anyone tell me how to use hugo themes
@frozen sundial
Pythonnn @fallow harbor
Help me when when when

hmmm
i suggest ask in the official djs server
gg/djs
await member.edit(nick=None)
that was evident
@cobalt junco do .setNickname(null)
didnt he said py?
ty
I'm trying to speak hindi with him 🙏
😂someone star this
What

hm dont u know hindi ?
🤣
Yeah I do but I'm not great at it
Alright so I've talked a bit with him and I found out that:
- His bot is based on a template from replit
- He has added autoresponses when you type Pro/Noob/Raistar - it just deletes your message and responds with some Hindi text that even I couldn't understand
And that's pretty much it
He says Top.gg is his "dream" and if it gets declined he will add some more things and keep re-submitting it until it gets approved
i like being the only indian on all of discord who can actually speak english
really?
Hi
How do people not feel bad even after humiliating their own country's people...
even if thats a joke
K
Send me those text I'll tell what they mean
👀
The entire conversation with him was in hindi
I too talk English 😂
Me too indian
👀
Ya many indian people talks in English on discord
If some doesn't then that's their choice
vanity url is discord .gg/<something>, a custom invite url that is
so I'm 90% sure the event is triggered when an admin creates a vanity url
because y e s
await profile.guilds.forEach(element => console.log(element.id));
is there a way i could check if the guilds include a id aka my servers id
on a foreach function
why not use find instead of forEach
or filter
so I'm learning c# and I had a question
can c# infer the type of the variable without me having to explicitly define it's type? (like js var)
because this looks pretty much like a string:
string name = "rick astley";
and there's no point for me to put the word string
var?
so the keyword is var?
Pretty sure you have to specify the type
Easier to develop that way
not for my spaghetti code
var resp = await fetch(); // Response object
resp = await resp.json(); // what how is it Object object now
Looks like javascript
static types cringe at my code
Just skill issue
another question:
what is the point of char
finally
a language that forces double quotes for strings
everytime I copy code from stackoverflow
ctrl + g
find '
replace with "
ctrl + enter
replace all matches
wait c# has no ===?
so == always has to be the same type?
so I have to convert them to the same type before comparing?
yes
I was going to say what if I'm not sure of the type until I realized I have to declare the type
you can either ToString() the int or int.Parse the string, the latter is the preferred way as strings are "slower"
Don't help if you can't help
I do like tryparse tho
yeah
TryParse is safer
you can't hardcast strings to ints anyway
so it's still invalid
Still debating between golang and asp for my backend
i'd go asp anytime
i am basically speedrunning w3school's c# course rn
the language is like js but with PascalCase functions and static types
oh
C# isn't like js ,maybe the sytnax ,but that are 2 different worlds
yes
so c# is brainfuck?
they are twins
Why the quote marks? Is there no significant performance difference between the two?
correct
int.Parse is slightly faster but the difference is so small that in practice it generally doesn't matter
I see
EVENTS
interactionCreate.jshttps://sourceb.in/hRg1aZXiWO
ready.jshttps://sourceb.in/KaeUauHDiV
HANDLER
index.jshttps://sourceb.in/kTXnlZG4Dg
Slash Commands
agents.jshttps://sourceb.in/pQwfSkHaBi
config.json
index.js https://sourceb.in/DQnCKHPwzh
My issue is that bot reads and replies with what is in index.js but not ready.js
and slash commands dont work
There’s no default export in index.js I’m assuming. You can’t require a variable from another file like that unless you export it
no
C# is Java but infinitely better
Hi
weeew blue background... oh my eyes
no
C# is it's ownself
C# is nowhere near like javascript bro
I said Java
-_-
C# and Java are a lot different when you actually look into it (Like how most of the “primitive” types are actually structs in C#), but on the surface they’re very similar
Especially in syntax
nvm, ignore the message. Sorry for ping
I think your event handler is incomplete because I don’t see client.on there
Aniruddh^
@rose warren
ohh
anyways doing it again
:/
Hi, I get the following error when running the code:
TypeError: Cannot create property 'shardCount' on string 'nYIZDVrp9C6JnMvfkaUunFisiSiOxhN1EEoLv5VWPXvvDh4rCjVgDW8rXIMCYehFHSMZ'
Here's the code:
const settings = require("./settings.json");
const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./handler.js', {
totalShards: 'auto',
respawn: 'false',
token: settings.bot.token
});
manager.spawn(); //Start spawning the shards.
manager.on('shardCreate', shard => {
console.log(`[Shard ${shard.id}] Shard has been launched.`);
shard.on("death", process => {
console.log(`[Shard ${shard.id}] Shard has been shut down.`);
require("./Functions/Webhook Logs/shard-death.js");
});
shard.on("disconnect", () => {
console.log(`[Shard ${shard.id}] Shard has disconnected.`);
require("./Functions/Webhook Logs/shard-disconnected.js");
});
shard.on("reconnecting", () => {
console.log(`[Shard ${shard.id}] Shard is reconnecting.`);
require("./Functions/Webhook Logs/shard-reconnecting.js")(shard);
});
shard.on("spawn", process => {
console.log(`[Shard ${shard.id}] Shard has been spawned.`);
require("./Functions/Webhook Logs/shard-spawned.js")(shard);
});
});
- Leaked token? 2. Looking at a forum, try to send the web hook data as an object
show full error
E:\Discord Bots\HentaiCord v5\node_modules\discord.js\src\util\Util.js:336
given[key] = def[key];
TypeError: Cannot create property 'shardCount' on string 'token thingy'
at Function.mergeDefault (E:\Discord Bots\HentaiCord v5\node_modules\discord.js\src\util\Util.js:336:20)
at new BaseClient (E:\Discord Bots\HentaiCord v5\node_modules\discord.js\src\client\BaseClient.js:20:25)
at new WebhookClient (E:\Discord Bots\HentaiCord v5\node_modules\discord.js\src\client\WebhookClient.js:26:5)
at module.exports (E:\Discord Bots\HentaiCord v5\Functions\Webhook Logs\shard-spawned.js:7:19)
at Shard.<anonymous> (E:\Discord Bots\HentaiCord v5\start.js:33:61)
at Shard.emit (node:events:390:28)
at Shard.spawn (E:\Discord Bots\HentaiCord v5\node_modules\discord.js\src\sharding\Shard.js:135:10)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
behave yourself
whats your discord.js version?
It was v13
Currently set it back down to 12
The most recent v13
Yeah
Not sure about that yet chief
Just finished my break haha
Give me a couple hours
Or whenever I can
Will ping u
It’s nothing to do with anything in that file btw
I removed the webhooks to test
Still same thing
@quartz kindle
That’s because it’s running that file, if I return before it runs the function, that line disappears
@quartz kindle
const date = require("../get-current-date.js");
const webhooks = require("../webhooks.json");
const Discord = require("discord.js");
module.exports = (shard) => {
let webhook = new Discord.WebhookClient(webhooks.shard_log.id, webhooks.shard_log.secret);
var embed = new Discord.MessageEmbed()
.setTitle("Shard Spawned")
.addField("Shard", shard.id, true)
.addField("Date", date(), true)
.setColor("00ff28")
webhook.send(embed)
.then(sent => { console.log(`[Webhook Logs][shard-spawned] Successfully sent webhook to discord.`) })
.catch(error => { console.error(`[Webhook Logs][shard-spawned] ${JSON.stringify(error, null, 2)}`) });
}
the error shows a stack trace, which is a chain of events that lead to the error. so that particular error came from that file. if by removing that file the error still happens, it will be a different error with a different chain of events
in v13 thats not how you create a webhook client
new Discord.WebhookClient({ id: ..., token: ... })
That’s it?
yes
11:28am
Will you be available to continue this at about 3:00 or 4:00 your time if this doesn’t work?
no idea
You have anything planned? lmao
And epic its working
nice
Useful to see how big servers the bot gets invited to
And how fast servers kick it
lmao what
how long interaction customId can be?
can I put some data in button? like.. you know..
if I want to get module and action that button did..
I tried to put in ID as JSON string.. dumb idea.. wrong idea.. it doesn't work
hi how i pick the var of the servers (guilds) where are the bot?
108 symbols are too many for Discord.. pfft
are you counting or..?
no
ok thxù
@boreal iron ty the 301 redirect worked 😄 ,but i occurred at a problem now :C
My Main Domain doesn't redirect http requests to https anymore
My Current Config
<VirtualHost *:80>
ServerName new.com
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
ProxyPreserveHost On
ProxyPass / http://ip:port/ retry=0
ProxyPassReverse / http://ip:port/
</VirtualHost>
<VirtualHost *:443>
ServerName new.com
ProxyPreserveHost On
ProxyPass / http://ip:port/ retry=0
ProxyPassReverse / http://ip:port/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/new.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/new.com/privkey.pem
</VirtualHost>
You forgot to enabled the rewrite engine
yeah ,lol thx
thx everything works perfect now 😄
np
how do you understand this cryptic config file
I'm using my eyes, looking at my monitor, screaming damn loud, ask google, post a possible solution and say it all based on my own knowledge.

nice
you could write the config file in c ,but it would be a pain
Are any of your bots getting guildDelete events with most of the guild's properties undefined, only the guildId is visible?
Can or be used like this?
if(message.author.id "..." || "...") {};```
No
Ight thanks
if(message.author.id === "id" || message.author.id === "id") {
// Code
}
Not that I would be a benefit but comparing multiple IDs, let’s say a few more than 2 could be less code using an array
if(["id", "id2"].includes(message.author.id)) …
Much easier than using OR
Also saves you a lot of time if you have a lot of IDs to compare
Its so so op
Maybe itsnt modern but works so good
why does this work on windows but not on linux, returns / on linux
app.set("views", __dirname+"\\views");
\\ returns this
__dirname just returns / on Linux?
Error: Failed to lookup view "index.ejs" in views directory "/wServeriews"
Does your user even have the permissions to see the absolute path?
?
It of course does not on Linux
Just replace \ by / in the dirname
__dirname.replace(/\\/g, "/")
Ahhh fuck discord
Now it’s right
Yes windows accepts / as well
Only Linux does not understand back slashes
how to fix interaction error in button?
just.. how to process it without this message in DS Client

