#development
1 messages · Page 1578 of 1
well people can create multiple accounts to use my bot
so its called "alt-ing"
i dont really need the ip or anything just asking :p
you wouldnt be able to fetch ip adresses regardless
you'd have to make a website for it, and even then, it'd fall under the same issue of discord, vpn's
you'd need to hardware + ip detect someone
well to answer your question, even if you don't want an answer anymore, no you can't get addresses from djs - alt detector uses account ages and other factors to detect alts
gotcha
any idea why alt detector is ded?
its been like months i think
3 weeks atleast
everyone taking their bots down now i see
me taking my bot down for a while just created competition
well i guess it is less competition for the other side

tru
pokecord do be hydra king
my bot broke as hell i have no idea why people still love it lmao
idk
I've just dumped like 3k lines of code because i made the mistake of giving people a choice 
I made a bot who can verify on certain (you can choose which domains) emails to get a badge. So you have a secure discord server. But I don't want to pay a host server to put it online, cause I'm a student. Is there another safe way?
pay 
which host server you recommend ?
thanks for the info, I made a .env file in the code with private variables like passwords/bot token
private keys
Can the server owner see those info?
i mean the owners of the server can potentially
but that would be a massive violation of data protection
@quartz kindle need bitsy help
how does d.js send timestamps on embeds?
from Date or string?
i know theres a key timestamp, but the moment i sent a string in it with unix timestamp, it just gurgles
OOOH
im stupid
one sec
i might've figured out
its ISO string
you need to Number() it
yup, looks like its an ISO string
which is really weird
timestamp: this.timestamp ? new Date(this.timestamp) : null
I need help with my math homework
because ISO 
flaze new pfp confirmed
@quartz kindle got another question
buffers

embed , e is a canvas buffer
in d.js this works
wait, wrong first image
heres the other one
value key?
the heck is d.js doing in the back with buffers before sending requests?
not d.js
what's that
detritus
yeah
weird
anyway
discord accepts files in multipart-formdata
so djs streams buffers into it
with the form-data package
the form-data package accepts buffers as well
ah yes
so key would be the item key, and value the actual data
like in the form-data function
so sending a buffer should've worked, no?
yes
you can use urls too
let me check detritus docs
data is being generated on my end
lmfao fr?
thats why nobody uses detritus, theres no docs lmao
holdup let me ping the users that do
good luck finding shit out if you arent used to digging through thousands of line of code
okay pinged them
thanks I try my hardest to be funny
amazing eh?
refresh
happened to me some times too
pls tell me it has css
thats just a feature @opal plank
though half of it was my fault for having ssh tunnels open
does it have css?
flaze
isn't it any
flaze hru
in the types only
ic
hi i'm fine ig
What happen to yuri the bot?
what's generally considered the best way to ensure the discord bot process restarts if it crashes? using internal sharding
i am using a .sh script but it isn't working too well
pm2 would do the trick for you
will look into it, thanks
@raven elbow eri?
it shut down
the owner was banned
its moved to a bot called moi
thats exactly where im looking at
try giving it a stream instead of a buffer
streams work better anyway
what credit?
what
So yuri does not work then

you did, yes
nope
Aki
we been through this, check chat
its a completely different library than d.js
any
any>.?
however with streams it doesnt even send the message
with <Canvas>.toBuffer() i dont get an API error
thought with both a pipe and a PNGStream it returns a 404 error
so im assuming discord aint liking one bit whatever its sending
just use d.js
if you like being fucked by the caching system sure
lite
Discord.js™️ btw
3k gb
djs lite
fuck js
uh
lewd
you're using js
im not
flaze lewd
im using ts
good one
they are different
in types, in everything, they get compiled to js after in the end
compiled to js
the only error i get is from discord itself with a 404
400*
try running a .ts on node and see what happens
ts and js are not the same thing aki
anyway, if you're not gonna contribute to the topic, kindly do something else
trying to figure this issue
nah, the buffers definitively log, apart from that it might be the pipe, but i dont get any feedback on that
all 3 of them seem valid
sends message, no files
400
you want a 200
😦
,
in jda we just send the byte array, can't u do the same in that lib?
like, instead of the stream
the buffer should be working tbh, which is the toBuffer() format, it should be sending it
toBuffer() returns Uint8Array<>
so you're getting no error but the file doesn't appear, right?
@cinder patio not d.js
ah
@quartz kindle the author told me the issue
key: is used for formData, not for the embed
i still need a filename key in there
lul
what are you using then?
detritus
so how's the final object look like?
files: [
{
value: e.toBuffer(),
filename: `chibis.png`,
},
],```
@quartz kindle
which makes sense when you notice it wasnt sending the filename
it WAS sending the data just fine
but there was nothing on the final payload to the api pointing to the filename it should be using
the formData() doesnt use the key at all
just the data to be appended
well, it does use it, just doesnt matter
in the end you just sending FormData with the data and a null key, but what discord uses is the data sent + the filename, thats all
shouldnt filename be here then?
hello Tim and Erwin
hello stinky
hello
Erwin I fixed the long list of embed shits, I changed it to a function
Is there a way I can make a manual disable command to disable commands lol?
still shit but thats cleaner, so i'll let it slide
what should I do next?
dont remember, i sent everything, gotta check chat
iirc the embed builders were too much for you
I still need help with my math homework 😢
"vote for us and get free primogems"
solid stereometry
that could be badly interpreted
fuck idk that
i would recommend recommend dropping out instead
thanks gboard
electronics is even worse
i spent 4 hours on a circuit, 1 of which was because my instruments were set on DC instead of AC :)
rip
how do I download my db from Could Firestore?
isnt the whole point of firestore is that you dont 
o_o
I know there are some node modules for that
don't know which one I should pick
those Google auth is bullshit, you have to install so many packages
back in brazil i had a small backup battery, typical UPS solution because 3rd world country electricity grid.
this battery was built with a 220->110v transformer, so i could only use 110v stuff on it.
Most desktop computers had PSU's with manual voltage switch, so once i was reparing a desktop, and i switched the voltage to 110v to plug it into the battery thing
i fixed it and gave it back to the client, but forgot to switch it back to 220v
you can image what happened
😬
you lived in brazil? or on vacation or something?
tim is ultimate brazil man
and you are 29?
yes
do you still live there?
he lives now in 127.0.0.1
so what you moved there at 14 then moved back 15 years later?
29 years ago
lol
you need to write a biography
besides like a year when i was a baby
I assumed you were like Swedish or something
You can not speak German
or where is it common
right_
sehr gut
#general-int for other languages
"because 3rd world country electricity grid"
couldn't describe brazil better
@glossy spoke it was just one expression
* Installation completed.
* Make sure you create the node within the panel and then copy
* the config to this node. You may then start the daemon using
* systemctl start wings
*
* Note: It is recommended to enable swap (for Docker, read more about it in official documentation).
* Note: This script does not configure your firewall. Ports 8080 and 2022 needs to be open.
######################################################################```
im tryna deploy pterodactyl but this happens
using cloudfare btw
ah wait nvm found the isue
actually it still doesnt work
:/
* Pterodactyl Panel successfully installed @ webnamehere
*
* Installation is using nginx on ubuntu
* Thank you for using this script.
* Note: If you haven't configured the firewall: 80/443 (HTTP/HTTPS) is required to be open!
##############################################################```
tim = brazil man
when someone submits a file with the submit file thing in html, how do i get the file
like it would be for images
i think you have to parse form-data
elements with type="file" let the user choose one or more files from their device storage. Once chosen, the files can be uploaded to a server using form submission, or manipulated using JavaScript code and the File API.
there should be enough examples on the page
mhm
how do i get the file tho
like do i get it using base64?
i need to download it
so how would i do that?
you didn't even read the doc page
i did
there's very cleary an example on how to use the image (or any file) through js lol
ik ik its not to use it thru js
i need to get it to flask and download it
i did read it
you still need to access it through js in order to send it to your api endpoint i think
unless you're using SSR
yep!
but how can i only accept png files with the api tho?
like what would i even send the api too?
like the image in base64?
im confuzzled
Read the examples
You can modify the input to only accept spefici file types, for example .png only
Then the user will only be able to select pngs
Only pngs will show in the box
the api endpoint should still be protected and allow only pngs though
Then lopk at the form example
in case someone manually hits the endpoint
The form has multipart-formdata as a type
So when submited, the files are sent as multipart formdata
Now in flask you have to look into how to read multipart formdata
Look at the flask docs
The application accesses the file from the files dictionary on the request object.
i mean the api would be in flask
and people can send anything thru it
imagine sync
Flask is surprisingly easy to scale
Better sync than async when it comes to webservers
Unless you wanna be like php and trash your cpu by creating a new thread for every connection
wait php does WHAT?
But well... Nginx also does that so...
I cant really say anything
I think nginx uses a worker pool tho
most webservers are async tbh
it lends itself incredibly well to it
when done right
though im referring to the more reasonable task scheduling system rather than a new thread on every request
Ye there are many ways of setting it up
There are multille different PHP engines as well
ye
What im using for my WS gateways is Rust with Tokio so i get 12 thread loadbalancing + task scheduling
I thin CGI was the one that created a new thread for every connection
Nice
WS load balancing is such a pain tbh
what would be good way to set up http listener for top.gg webhook (for detecting when people vote my server)
im already using discord.py and aiohttp
and a dedicated machine running the bot
asp.net core 
xD
does it please tell me more
Yeah it can be a right pain, cuz you either gotta implement something that relocates your connection or something that shares messages across workers
which is why i go with Rust and tokio because atleast you only need todo that per machine rather than per process worker
also top.gg does have its own lib for it btw
which does all this for you
I havent gone into rust yet so im staying with nginx+node for now
i was wondering which one is easiest. aiohttp seems reasonable
i will have to give the dedicated machines IP for the webhook URL right?
as i dont have nameserver
yes you gotta give the ip and port
Pretty reasonable
most of the shit ive been deploying recently has been in C#
asp also the docker files are a lil tedious compared to other langs
pretty nice eco system
is this simple server open to internet by default?
no
binds to localhost by default
also look at https://docs.top.gg/libraries/python/
i looked at that and it seemed pretty confusing
thats why i started looking into the aiohttp 😄
i have experience hosting web servers from ground already
(with python)
I mean its less confusing that what youre gonna be doing with aiohttp 
you might be right. im more familiar with the aiohttp approach
your choice ig
const Discord = require('discord.js');
module.exports = {
name:"help",
description:"Sends available commands you can use.",
aliases:"cmds",
usage:"-help",
execute(message, args){
const embed = new Discord.MessageEmbed()
.setTitle('MagicCord\'s Commands/Modules')
.setDescription('\nUse `-help <command>` for more info on a command.\n< > Means required.\n[ ] Means optional.\n\n**Magic**\nFor magic skills.\n`magic``learn``level``spells`\n\n**Battling**\nFor battling commands.\n`fight``moves`\n\n**Configuration**\nFor configuration settings.\n`channel`\n\n**Market**\nFor buying spells and items.\n`market``buy``sell``equip``unequip`\n\n**Bot**\nFor bot info.\n`invite``ping``profile``stats`')
.setColor('#0190B0')
.setFooter('MagicCord')
message.channel.send(embed)
}
}``` so i worked on a new bot but this sends nothing. no error, no message. why
well
Assuming you're command handler is
client, message, args
message is client
cleint.channel.send() isnt a thing
i did message.channel.send(embed) tho
Is there any known API that has (anime) NSWF content without minor content so my bot doesnt get declined cause of that
none of them can be minors
they may look young but they aren't minors
I would say my api but i cant be 100% 
http://shiro.gg/api or something
ty
shiro has no lolis
wait
yeah xig would get in trouble
is shiro yours?
not your bot lmao
ah, xig
Moderating 60,000 Images is hard 😔
i can do that
just check them before you get them lol
i do
well they're scraped
are they not
its like
nah xig checks them iirc
yes
@swift umbra knows more than I
meant chill
I scraped all mine
ty very much
yeah
but taken off a set of sites IK are very strict about content
Ping!
so ive only had to filter maybe a couple hundred out of the 60k
which in itself took a while todo but what ever
just use cloudflare to filter it 
bro u need time and mental health to mod 60k hentai pics
hell yeah
true warrior
just stared at my screen watching images fly by
what do u mean how
misses that one loli pic
i said hell yeah without realizing it's your name xd
oh xd
fbi looks at harddrive
scrape("*")
must have been ages ago then
those sound high quality
previewed the images on the site
then scraped all the packs
now they have a 10 hours limit between pack downloads though 
do you use like a webdriver or just requests?
i had to use webdriver
is it possible to open the aiohttp server to internet without using other libraries?
because of captchas
just use cookies
yikes
just bind to 0.0.0.0 ?
nah cuz you had captcha and JS rendering todo
also let me watch what was being scraped
also got that anti api scraping
cant incrementally scrape this shit boi
are those file names auto-generated
first part is a section of their base64 the second half is randomly seeded
const embed = new Discord.MessageEmbed()
.setTitle('MagicCord Ping')
.setDescription(`**Websocket Heartbeat**\n${message.client.ws.ping}ms\n\n**Roundtrip Latency**\nCalculating...`)
.setColor('RED')
.setFooter('MagicCord')
const x = await message.channel.send(embed)
setInterval(() => {
const embed = new Discord.MessageEmbed()
.setTitle('MagicCord Ping')
.setDescription(`**Websocket Heartbeat**\n${message.client.ws.ping}ms\n\n**Roundtrip Latency**\n${sent.createdTimestamp - message.createdTimestamp}ms`)
.setColor('RED')
.setFooter('MagicCord')
x.edit(embed)
}, 1000);``` it says `sent` is not defined
because you defined it as x
hey y'all,
i've been editing my bot's webpage a little and saw other bots have a ''server count'' in the overview section, but i can't seem to figure out how to properly make one, like making a custom background was easy and all with a tutorial, but as for this, i couldn't find much of it.
Anyone willing to help on how to incorporate this?
else if(db.get(`${message.guild.id}.channel`) === message.channel.id){``` when i seem to do this commands didn't work anymore. i have it set here
```js
db.set(`${message.guild.id}.channel`, channel.id)```
If you wish to post your serverstats from your bot, the api is for you: https://docs.top.gg
questions about the top.gg api in #topgg-api
thank you!
@feral wyvern check out this library if you're using js
https://www.npmjs.com/package/@top-gg/sdk#user-content-auto-posting-stats
else if(db.get(`${message.guild.id}.channel`) === message.channel.id){``` when i seem to do this commands didn't work anymore. i have it set here
```js
db.set(`${message.guild.id}.channel`, channel.id)```
hey
how would i create a c# function that would create a random string of 8 characters.
@ cry jk
have you tried googling it
is channel.id defined? i see you are doing message.channel.id in the elseif
yeah. im making a set command channel only thing
yup.
what part are you stuck on
huh
nvm i got it working.
good
System.Guid.NewGuid().ToString().Substring(0, 8)
because it was in the image
dont use linq
i have no idea
i actually already made one but it wasn't working at first.
best eval
could anyone tell me why my visual studio has light mode on
probably wants to make me blind or something
i reinstalled it twice 
i think the dark mode is a feature hidden behind a paywall
In the picture above, the texts are not scrolling down. but how do I keep it from slipping in the picture below?
thats bcs the text doesnt fit
The texts in the 2 pictures are the same
dont ping
I'm afraid you can't, this is just the how embeds are
hey
you can to some extent
so i have a program.cs program in visual studio
you're at the mercy of discord's css
how do i actually export it as an exe?
maybe the different width of the footer image is causing the text to wrap
i told you this 10 times already
i still don't get this
you can add invisible characters to force field titles to be longer, so the content also gets wider
it literally doesn't get simpler than running dotnet publish in your project directory
i sent you the docs for dotnet publish too
which you didn't read
yeah i am new to visual studio
it doesn't excuse the fact that i gave you docs two days ago
which are very detailed
and you didn't read them
having a look
also take a look at https://docs.microsoft.com/en-us/dotnet/core/deploying/deploy-with-cli
When I put a large picture, the area becomes smaller. How can I solve this problem?
what 
anyone wanna write a streaming server with in in rust 
what
Need to write some HLS and RTMP server
Uh
so my bot is in my 156 member server... and it sends this:
I also have a qustion, why does it say undefined?
my code:
module.exports = {
name: 'bot-info',
execute: async(client, message, binfo) => {
const Discord = require('discord.js')
const info = new Discord.MessageEmbed()
.setColor('#FF0000')
.setTitle('Smugy Fugy Bot Stats')
.addField("Prefix: ++")
.addField("Users with", client.users.cache.size, true)
.addField("Servers in", client.guilds.cache.size, true)
.addField("Channels I see", client.channels.cache.size, true)
.setFooter("", client.user.displayAvatarURL())
.setTimestamp();
message.channel.send(info);
}
}
wwaaiitt...
nvm
To make that field betwwen the words, how do I do that? Do I just place onather .addField(" ") and put nothing in there?
empty field?
add an inline field with both \u200b as value ig
you can't put just space or it'll error
use \u200b
@delicate zephyr @opal plank you guys still have the object cloning benchmark thingy? i have a new version of it xd
i sent my last one in chat
sure, lets break d.js embed builders
..
LOL
@opal plank ```js
function copy4(src, target = {}) {
const entries = Object.keys(src);
for(let i = 0; i < entries.length; i++) {
const key = entries[i];
const value = src[key];
if(typeof value === "object") {
target[key] = {}
handle(value, target[key]);
} else {
target[key] = value;
}
}
return target;
}
my timings went from 250ms to 130ms
wow
compared to 1300ms with JSON
looks hard..
What type am I getting in server1 and server2?
let server1 = message.guild,
server2 = bot.guilds.cache.get('123456789987654321');
sending the payload directly is roughly around 15ms
ye but like
measuring object cloning
for like
storing a prebuilt embed object and cloning it
instead of creating a new object
lets try it lut and see
for sure its gonna be slower, but it for deep cloning
im gonna bonk you tim
halp
MessageObject?
actually, gonna set as Object primitive
did discord go down sometime today?
like, 2h 30m ago?
🤔
interesting
does something like this would work:
i tried running a c# program
{ name:'User Count', value: client.users.cache.size, inline:true},```
it gave me this error: System.IO.FileNotFoundException: 'Could not load file or assembly 'Discord.Net.Rest, Version=2.0.0.0,
TIAS
you need to either copy everything from the publish directory or publish as self contained
hmmm... uhmm
i do the latter because not everyone has .net on their system
how would i publish as self contained?
send me the
docs
darling
i sent it above
i won't resend it everytime because you're too lazy to scroll lol
IK HOW U FEEL
@novel hollow root it
Wym
Can anyone help I’m trying to make my bot so you can have some features on in one server and off in another how do I do this ? Also I’m using python
Thanks
how does everybody here reliably intercept vote webhook requests? I'm using a free service called localtunnel to spare me from directly exposing my web server to the world, but it's not perfect. what's the best way to always be listening for webhooks? using nodejs.
consider this a survey, I know there's not one right answer
reverse proxying using nginx i guess
that's how i protected my web apps a few years ago
Wrong link
so i need to publish everything from its direcotry?
I don't really get this part tbh
that question does not make sense
you just run dotnet publish and run from the published directory, if you're going to copy files you need to copy everything from the published dir
Why in the world is it showing error with line 6 “run”?
you have no comma in the above line
Ohhh yeah, dumbass me
Thanks! 👍
M
I did do the
inline thing..
But still the same.
How do I make it go to the next line?
inline false?
like so:
OOOHHH
dang..
Im so dumb.
thanks.
thinking why did I do true in the first place...
Ohh damn, I’m missing {, ", lol and many other stuff smh
@opal plank ```js
function copy7(src, target = {}) {
for(let key in src) {
const value = src[key];
if(typeof value === "object" && value) {
target[key] = {}
copy7(value, target[key]);
} else {
target[key] = value;
}
}
return target;
}
save a copy of one of the raw embeds in your benchmark, then benchmark copying it with copy7(embed)
you're also using backticks everywhere for not goddamn good reason, tbh
True, now I see everything wrong. Lol, I’m blind
using backticks for a string is like doing ```js
setDescription( (() => { return "this is a description " })() ),
what
Lmao
no, its like doing ```js
setDescription(eval('"this is a description"'))
Backticks are for "template literals" which are basically a function being run on the contents to look for placeholders to run. So, it's literally "interpreted", as in, it has to be evaluated. Versus just using quotes which is not processed at all in any way
:^)
🙂 hello
HI
are you not running copy7 on this?
lmao
embed = rawEmbed()
right before the loop
isnt the point of this to be attached on client or somewhere to be used multiple times?
without the delay of declaration?
also
ye now its correct
but this scales with object size so
it will likely be much slower with bigger objects
@spare goblet ts hates everyone, dont sweat it, the whole purpose is being the coding equivalent of a https://www.youtube.com/watch?v=UXA0-YAoo9Q
The Kookaburra Call - A.K.A. The kookaburra laughing! Matilda the kookaburra shows off her talents in the education center of the San Diego Zoo.
This amazing call is sometimes called a laugh (hence the name, Laughing Kookaburra) but there's nothing funny about it. It's actually a pretty cool creature feature. Kookaburras use their trilling la...
how do I check if guildmember is a bot?
it screeches on every chance it has
member.user.bot
Thanks
so you're telling me that using JSON.parse(JSON.stringify(obj)) is some of the worst ways you can deep clone something?
interesting
basically the point is ```js
masterembed = {
title:"bla",
footer:"ok",
author: "lol",
thumbnail: "yes"
}
// everywhere else in the code
let embed = copy7(masterembed);
embed.description = "yes";
...send({embed})
yes
the JSON method is the easiest way to keep clone an object, but its very slow
oho interesting, i dont use it quite as often, but thats interesting to know
deep cloning is just there to ensure you dont accidentally modify the original object and cause issues in future accesses to the original object
has happened to me many times before
lmao
im usually very selfaware of that, so its hardly an issue
What's better?
.addFields(); or .addField();?
but it might be worth to attaching this to a file somewhere for quick access
my api for example, it sends a huge object in a POST request
and some functions require multiple requests using the same object with slightly modified parameters
theres isnt a better, the former is used for multiple, the latter for singles
and i screwed it up many times before by accidentally changing the original requests's object along the way
with caused tons of issues
yeah thats a thing i try to avoid as much as possible
thats why sometimes i use parse/stringify to deep clone
Using .addField(); for each field is more shorter, right?
the other way around
well, since we are talking about embed builders
how about you ditch it?

xD
@glossy spoke keep in mind they ALL do the same thing, theres 0 difference in the result, but look at the performance
Ow
@dense flare can you send the iframe code please
<a href="https://kudos.ml">Whatever</a>
<iframe src="https://kudos.ml" title="description">
<!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME--><!--FILLERS FOR IFRAME-->
const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(c => args.join(" ") && c.displayName.toLowerCase().includes(args.join(" ").toLowerCase()));
How can I make this work for id and display name Right now it isnt.
what was the problem again, it seems to be working
it doesnt load the iframe if i use this as longdescription
isn't this your bot description right now
as far as I can see, your iframe works
no its not i dont have the link right now
i added the link now but now my site is just the link
yes thats before the change
since i added the link the iframe disappeared
i will change it back to the iframe now, but the problem is still there
HMMMMMMMM
its a test shard that only works on my guild
client?
cheeky
tim tryna beat me in dossing big platforms
Why do pings only work when I set it to work with ids and members names,
const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(c => args.join(" ") && c.displayName.toLowerCase().includes(args.join(" ").toLowerCase()));
imagine the balls
activity part
use `` not ' '
erweins
?
can you help with my member
whats wrong with it?
total members from all guilds?
only works with pings
or only active members?
yes all members
you need to use guild.memberCount
you have to loop over all guilds or reduce them to sum all their memberCounts
tim
you said it only works with ids and member names before lol
ok
doesnt work with ids
likely the member is not cached
they were
so you need to fetch it
if they were, then you need to check your args
so want me to change get to fetch?
thats not how you use it lol, do you even know js?
wait waht
I'm trying to learn 🙂
you want to learn or want a code to copy and paste?
start with something small, do you know how to use variables in text?
do you know what a variable is?
Tim how do I fetch it
await guild.members.fetch(id)
client.on("message", async message => {
if (message.content.startsWith(prefix + 'setw') || message.content.startsWith(prefix + 'setwelcome')) {
let canal = message.mentions.channels.first();
if (!canal) {
message.channel.send("Debes mencionar el canal!");
return;
} else {
if (wdb.get(`servidor_${message.guild.id}`)) {
if (wdb.get(`servidor_${message.guild.id}` == canal.id)) {
message.channel.send("Este canal ya ha sido establecido como el canal de bienvenidas.")
return;
} else {
const cambiando = await message.channel.send(`Cambiando canal de bienvenidas de <#${wdb.get(`servidor_${message.guild.id}`)}> a ${canal}...`)
wdb.set(`servidor_${message.guild.id}`, canal.id)
cambiando.edit("Canal cambiado con éxito.", {timeout: 3000})
}
if (!wdb.get(`servidor_${message.guild.id}`)) {
const cambianduo = await message.channel.send(`Estableciendo canal de bienvenidas a ${canal}...`)
wdb.set(`servidor_${message.guild.id}`, canal.id)
cambianduo.edit("Canal establecido con éxito.", {timeout: 3000})
}
}
}
}
});
the code doesn't get executed when the db doesn't find the server
Well now my problem is tim if I try doing a string it does this DiscordAPIError: Invalid Form Body
user_id: Value "Ms." is not snowflake.
if (wdb.get(servidor_${message.guild.id} == canal.id)) this is wrong
its suppose to be an ID not a name
why?
MS is not part of snowflake
@opal plank yeah but shouldn't it stop and go to the other or?
Okay
mmm
so should I check if it is a number before I do it?
show code
me?
ya ik, but that's not the error, my issue is that this part doesn't get executed:
if (!wdb.get(`servidor_${message.guild.id}`)) {
const cambianduo = await message.channel.send(`Estableciendo canal de bienvenidas a ${canal}...`)
wdb.set(`servidor_${message.guild.id}`, canal.id)
cambianduo.edit("Canal establecido con éxito.", {timeout: 3000})
}
yes
because you have ```js
if (wdb.get(servidor_${message.guild.id})) {
if (!wdb.get(servidor_${message.guild.id})) {}
}
so it will never work
👍
Tim
?
YES
everything ported
havent tested everything
but everything is working
ish
no errors, so i assume its working
like a good dev
Anyone knows how to keep their bot 24/7 online, without showing the token like you do when you post it on https://repl.it~ ?
hosting it on an actual host
great idea
VPS
I cant keep my pc on 24/7..
o
h
$2 per month tho..
also
I get this error:
My code is..
const Discord = require('discord.js');
module.exports = {
name: 'server-info',
execute(message, guild, send) {
const Discord = require('discord.js')
const sEmbed = new Discord.MessageEmbed()
.setColor('#27FF00')
.setTitle('Server Infromation')
.addField(`Members in this server: ${guild.memberCount}`)
.addField('ID:', guild.id)
.addField(' ')
.setFooter('Type **++help** for help! Time:')
.setTimestamp();
message.channel.send(sEmbed);
}
}```
why cant it read wtf send is?
message.channel is undefined
read the message
if you cant read error messages as easy as that please learn how to
and wtf is your command handler
I have seen it change 20 times today
repl.it uses .env files to store sensitive data
I just change code IN it
.env cannot be seen by anyone except you
only privet mode does that now..
U need "hacker" plan to make privet ones.
Tim, the code works perfectly ;D
client.on("message", async message => {
if (message.content.startsWith(prefix + 'setw') || message.content.startsWith(prefix + 'setwelcome')) {
let canal = message.mentions.channels.first();
if (!canal) {
message.channel.send("Debes mencionar el canal!");
return;
} else {
if (wdb.get(`servidor_${message.guild.id}`)) {
if (wdb.get(`servidor_${message.guild.id}`) == canal.id) {
message.channel.send("Este canal ya ha sido establecido como el canal de bienvenidas.")
return;
} else {
const cambiando = await message.channel.send(`Cambiando canal de bienvenidas de <#${wdb.get(`servidor_${message.guild.id}`)}> a ${canal}...`)
wdb.set(`servidor_${message.guild.id}`, canal.id)
cambiando.delete({ timeout: 3000 }).then(m => setTimeout(function() {
m.channel.send("Canal cambiado con éxito.")
}, 100))
}
}
if (!wdb.get(`servidor_${message.guild.id}`)) {
const cambianduo = await message.channel.send(`Estableciendo canal de bienvenidas a ${canal}...`)
wdb.set(`servidor_${message.guild.id}`, canal.id)
cambianduo.delete({ timeout: 3000 }).then(m => setTimeout(function() {
m.channel.send("Canal establecido con éxito.")
}, 100))
}
}
}
});
u sure about that?
i just created a .env file in my repl.it and opened a private browser window, and i cant see the .env file
show me your command handler
ok.. its index..
did you just call your command handler index
no.
Its IN.
you dont know js
uh
command?
bro, there is not any problem by making your "hello world" program
arguments are passed by order, not by name
😦
if you do something(abc1, abc2, abc3) then inside the function, the first parameter will always be abc1, no matter how you name it
function something(bla, bla1, bla2) {
// bla is abc1, not bla
}
something(abc1, bla)
tim
if you want to pass an object and destructure it, yes
bruh... It cant define guild. I tryed that.
dude
read what i said
do let guild = message.guild;
please learn java script before talking here
I'm pretty sure people told you that yesterday too @quaint wasp . You're just gonna annoy people if you come in here with questions about basic js
also .env can only be comprised if ur apart of a project
alright. ill watch one of those 10 hour lessons.
Dude
Welcome.
Dude smug
10 mins is all ou need to learn the basics
Syntax isnt too hard
oh god
I watched like 6 of those.
then you need to actually do what they are doing and listen to them
its literally just var, let or const lol
or global.guild = "hi"
(not var tho)
var is trash

