const {readdirSync} = require('fs')
const categoryList = readdirSync('./assets/commands')
let embed = new MessageEmbed()
.setTitle('Help')
for(const category of categoryList){
embed.addField(
`${category}`,
`${bot.commands.filter(cat => cat.help.category === category.toLowerCase()).map(cmd => prefix + cmd.help.name).join(', ')}`
)
}```
#development
1 messages · Page 1349 of 1
- use semicolons
- dont use interpolation like that
Define it
underlines are fun
Syntax errors be like
You might want to brush up your js knowledge before making a bot
whats wrong with it
capitalize color (Color)
also
put them on the same line
python doesnt like when you dont
if you really want them to be on different lines put a \ after the line above
That extra space before embed shouldn't be there.
^ theres a ton of problems there
A lot of unexpected indents in that code.
also you're using legacy code that isn't included in the library anymore.
You should see the documentation for how to use the library, because stuff like client.say and client.send_message don't exist: https://discordpy.readthedocs.io/en/latest/
Why are there quotes around Client?
That probably won't fix your problem.
- importing keep_alive wrong
- no need to use
pass_context = True, context is always passed now - put the arguments on the same line as the
discord.Embed discord.Colornotdiscord.color- no () at the end of
discord.Color.orange - change
inclinetoinline - fix unexpected spacing
@jade stirrup
it says project says uses requirement.txt
Client is a class of discord.js @earnest phoenix
const client = new Discord.Client();```
@earnest phoenix so many people have told you, please truly learn how js works
neglected we can't help you if you don't help yourself
capitalization matters in variables
Client and client are different variables.
your assigning to client but using Client
now completly different question does anyone here know hiow to make an app
nah it's just throwing a fit
bruh my thyings still not running
bruh my thyings still not running
@jade stirrup bruh did you do all the things i told you to?
dude
yes
i wrote you a whole list
i did those things
it doesn't look like you fixed any of the issues we pointed out
- importing keep_alive wrong
- no need to use
pass_context = True, context is always passed now- put the arguments on the same line as the
discord.Embeddiscord.Colornotdiscord.color- no () at the end of
discord.Color.orange- change
inclinetoinline- fix unexpected spacing
@jade stirrup
thats a old screenie
then you should give us the up-to-date one. Why isn't it working? We can't help you if we don't have enough info
- change
clienttobot(@client.command-->>@bot.command,client = commands.bot-- >bot = commands.bot) - instead of
client.send_messageusectx.send(embed=embed), you dont need author - instead of
client.sayusectx.send("text")
client.guilds.cache.reduce((a, g) => a + g.memberCount, 0) returns NaN
it worked up until an hour ago
goes on the ame line
@jade stirrupdiscord.Embed(color=)
i should change all the client to ctx or just that one
"ctx" means context so when you say ctx.send, it sends a message to the channel that called the bot
so change the two sending lines to ctx
how do you guys know this so well
🤷 we've just used it for a good amount of time
yes
but move the parentheses up
to the same line
you also should actually learn python before creating a bot..
Looks like this project uses requirements.txt. To install dependencies on Repl.it please use pyproject.toml or the built in packager.
well do you have a requirements.txt in your files?
i dont know
also you actually do need the parentheses to call the function: discord.Color.orange()
i was wrong about that
i dont know
@jade stirrup well look through your files and check then
@jade stirrup do you know python?
@drifting wedge
?
@hollow sedge i dont think i have it how do i get it
thats not whats its saying
@drifting wedge no
Well learn some
the point is that you shouldnt have it @jade stirrup
Then come back
how do i get it
i agree with 0Exe
Literally Search up, learn python YouTube
hmm a lright
Or maybe even watch a dpy tutorial
Even if u don’t wanna learn python
Learn dog
I'm not understanding if my code is working properly or no:
I require a file called cache.js in index.js, then I require that file again in bot.js.
I have a console.log() inside cache.js and it runs twice, shouldn't it only run once?
i dont mind learning im just afraid ill forget it
Ok lemme spoon feed ya, wut u need help with?
🥄 +
=
there, your coding problems fixed
client.guilds.cache.reduce((a, g) => a + g.memberCount, 0) returns NaN
it worked up until an hour ago
The reason behind this is that, one of the guilds are unavailable
time to go to my friend who helps and teaches and doesn't criticize like do you know a 13yr who just KNOWS java script?
@earnest phoenix yeah me
client.guilds.cache.filter(g => g.available).reduce((a, g) => a + g.memberCount, 0)```
agggh i dont have the brain compacity for this
Am I able to host a SQL database online instead of my own VPS? If so, how can I import it? Normally I import by using sql.open(./database.sqlite).
An sql database is always online
Except from sqlite ofc
Also it would be done through some connection string, read the docs of the db software you're using
Like right now, the database is hosted on the VPS the bot is on. Can I host the SQL database on an SQL server/host somewhere is and then import it instead of importing via file path.
There is no such thing as an sql server
Host it on my website then
Sqlite? No
Ah ok
Sqlite it local
You pass in a constructor if something is not a constructor 
Sqlite it local
@honest perch Alright, thank you.
Or show code of where you have this constructor problem
Its hard not to criticize someone's who is refusing to learn javascript and who is trying to make a discord bot which you should have the understanding of javascript and how nodejs works. You should start with simpler projects if you are not knowledgeable in js. By starting with a discord bot you will just get stuck, spoon-fed and you will learn nothing
Don't start with a discord bot
Do something simple
Like adding, functions
Requiring files
In javascript
@honest perch If I were to use Github to host the bot, what database could I use to automatically add new tables/rows/data to the database instead of manually editing the database?
@earnest phoenix "Enmap" => Enmap
Learn JavaScript
Heroku I mean, Github deploy method
If you have a vps
Man people refuse to learn
Use something like postgres
I didn't even link any sites 
And also you're copy pasting code which is something you shouldn't do while coding
I think I'm about to explode
Why did I learn js, whyyyy

I'm gonna do more go this week
I use json db, and host on heroku, and have my token as a bot command
My bots better than mee6
Ok let me show you an example neglected, when learning a language i do something like this https://github.com/Misly16/learning-go
Instead of making a discord bot
Did you even listen to anything we said
Learn js
Seriously
Don't make a discord bot
you can't really get HANDS ON with code
or typing
but sure let me build a model rq brb
also, every site is hands on.
its never recommended to copy paste code, you should be typing the code out yourself.
also, every site is hands on.
its never recommended to copy paste code, you should be typing the code out yourself.
@solemn latch uh oh
And not wrap everything that is not defined between quotation marks 
spooky
check the channel with the highest position
anyone got some fun suggestions to code ? I only know js / djs
how do i get the position?
like do i do get_channel
but like how do i specify the position?
@drifting wedge channels have a position parameter
check the documentation for the guild channel class
@commands.command()
@commands.has_role(name="Head Dealer")
async def dealers(self, ctx, user: discord.Member):
await user.add_roles(discord.utils.get(ctx.guild.roles, name="Dealers")
channel = discord.utils.get(ctx.guild.text_channels, name="coromodlogs")
await channel.send(f"`{ctx.author.mention}({ctx.author.id})` has given `{user.mention}({user.id})` the `Dealers` Role")```
https://media.discordapp.net/attachments/769367455616991298/770089559382949908/unknown.png
https://media.discordapp.net/attachments/769367455616991298/770089766648807455/unknown.png?width=1026&height=432
@quartz kindle Do you have any idea?
Read the error
What version of Python are you using
rewrite
bruh
python3 --version
python3 has its own executable?
i think mine is 3 since i use pip3
then do what paimon said
and i did
@quartz kindle its hayper
i dont know what the unkown thing is
Smh
since all my other commands work
yes and i dont know it
go to cmd
did you do what paimon said?
no its patrick
Lol
3.8.3
ok ty
Try using @asyncio.coroutine instead of async
And yield from instead of await
no its paimon
@quartz kindle Did you mean emergency food
no that's an old version
no bc all of my other commands have async def
Ok why yhe fuck
he's just missing ) at await user.add_roles(discord.utils.get(ctx.guild.roles, name="Dealers")
Oh
I am fuckin dumb
see why i was confused
the IDE is showing another error compared to the other screenshot
also im blind for not seeing that
which is pree funni
ty tho
@earnest phoenix wat
@earnest phoenix you're asking how to read the documentation?
go to https://discord.js.org
click documentation
Discord.Client shouldnt be null, unless you did something wrong
to find the Client class, look at the left side menu
there is a section called "CLASSES"
and in there you will find Client
if you're saying that Discord.Client is null, then you did something wrong
show your code
show your code
we were helping neglected earlier, he just needs to actually learn js
The problem is he put Client instead of client
Which is a problem we already addressed
Again, you can't just make it a string of it's undefined
We've already told you everything
You need to learn js
@hollow sedge maybe it isnt client
@hollow sedge maybe it isnt client
@earnest phoenix ik it is because we were helping him earlier
He had the same problem
it's already defined
You just put the wrong variable name
The problem is he put
Clientinstead ofclient
@hollow sedge
Also it's obvious you are copy and pasting
The comments
Spain without the S
We can't help you, you literally just need to learn js
on the top of your file, did you do client = new Discord.Client() or Client = new Discord.Client()?
You can't come here and ask about every single error/problem you have
can you show more of the code?
He changed it?
you could post it as a code block
it would be better to put the code into hastebin or pastebin or whatever bin
telling me the same thing over and over gain wont help
@earnest phoenix I'm not telling you, I'm telling Tim to stop helping you
@hollow sedge 'learn code'-Cloudfox
'learn code'-Cloudfox how about we repeat that A HUNDREN TIMES
@earnest phoenix how many of those times did you listen?
None
It's funny how your username is neglected when you neglect every person who actually tries to show you the right way to get started
.displayAvatarURL()
avatarURL() and displayAvatarURL() both do the same thing, but displayAvatarURL() falls back to a default avatar if the user doesnt have one, while avatarURL() doesnt
you defined your client as Client meaning you have to use Client with a capital C everywhere
anyway show more code
I think you also might be confusing what single quotes are used for sometimes.
your just turning things into strings to fix errors
which isnt fixing stuff
its just making it a string
i need to see where that code block starts
HOW LONG WAS I GONE FOR? stuff just went down when i was gone
should be client not Client
Lol
they're 2 different things.
🤦
where does that brace go to, is what tim is asking
Gl Tim
please put your entire code on hastebin and send it
you just keep posting pictures of the wrong parts of it
looks like an MessageEmbed Object
@umbral zealot thats exactly what it is
https://hasteb.in/ , paste the code here (REMOVE YOUR TOKEN), then do CTRL+S, and give us the URL that results with this.
and its not the only part of his code thats not inside an event
but i want to see the full code so i can show him
this is gonna be a case of learn js before making a bot I can smell it.
this is gonna be a case of
learn js before making a botI can smell it.
@umbral zealot if only someone already said this..
yeah I can definitely see where this has already gone and will keep going.
doesn't take a long stroll up the park to see this guy's a pure Tyler.
Idk how Tim has the energy to help this guy
Oh god this is... wow that's a mess.
Oh my
Oh god this is... wow that's a mess.
@umbral zealot cause it's copy and pasted
@earnest phoenix <#development message>
@umbral zealot omg that should be pinned
I know.
is that pinned? can we have that pinned please
@mint thicket
?
Look buddy it's clearly you have absolutely no idea how this code works. The solution to this is simple: Please take the time to learn javascript.
what the frick is going on here
pinned that message of the link that evie sent please, it is pin material
yall need to calm down
It'll take a few weeks, months, then you'll be able to do this on your own and not rely on everyone else doing this for you. It'll be very helpful to everyone.
can't, i am too hyper right now
@umbral zealot talking to you specifically
Why did you ping a mod?
youre probably right, but could you be less aggressive about it
Why did you ping a mod?
@faint prism to potentially pin the message
Uh...
Btw criticism help you improve....
Also bean i ping you about pin thingy you should pin that message
Same lmao
lmao
oh?
Eh, it's the "look, buddy" isn't it? Sorry bean. I'll tone it down.
oh im not touching this channels pins with an 8ft pole
lOl
i like this mod, he is pretty chill
You're code looks like an AI tried to make it from random sections of different GitHub repos, and failed, terribly... Sorry
It's just kind of incoherent
@earnest phoenix the unfortunate reality is that this entire code is just a mess of copy/pasted things that don't work together, placed in completely random locations. It can't work. We can't fix this, you need to take the time to learn javascript.
You mean the code is real??
its so messed up, hastebin thought it was php code 🤔
cloudfox, i wish i can tell you it is a dream, but i mean, can i really say that
cloudfox, i wish i can tell you it is a dream, but i mean, can i really say that
@vernal rivet'better' - sqlite3..like I just don't understand how that would help you find sqlite

@earnest phoenix im gonna be honest with you, your code has many many issues, all of them are 100% because you dont understand the language. You can keep trying and keep hitting your head, and you might eventually manage to get something working, but if you really want to make it work and avoid such issues in the future, you really should learn some basic javascript. That code you said about sqlite is not even valid javascript to begin with, and stuff like "message.channel.send"({}) is also not valid javascript, you're missing all the basic rules of the language itself
This is how a car would look like, if it was this code:
Too close to the real thing
the guides expect you to have decent javascript knowledge don't they?
yes.
yeah
tbh, thats probably more efficient than modern cars
||jk just want to make a joke||
It's fine everyone, he said he'd go learn, now we can stop screaming at him 😄
wait we were screaming at him?
It's fine everyone, he said he'd go learn, now we can stop screaming at him 😄
@umbral zealot yeah it's just hilarious tho
i didn't noticed
honestly, keep it.
I love looking at my early days code, some really bad things in it.
Same
should be in recycling bin :p
It's ok, all his code was posted here anyways 😆
oh yeah
we have backups
i tried working with an api in my first few weeks programming
it's cool it's still here, just put it in your favourites. https://hasteb.in/uharobex.php
i like to laughing at my old programs, and say "look at this idiot. its like he just crawled out of a hole, and started to program with a 1955 computer, and doesn't know what programming is"
everythings an api really.
"application programming interface"
The API is what you were attempting to interact with to do stuff with discord
if everything is an api, does that mean bamboo is an api?
its not really that good beyond very basic concepts
^^^
if i forgot that exist, then that means its not good to recommend to newer people
if you go into it understanding it will only teach you stuff like, what a variable is, what a function is, and what strings are its not that bad.
its like basic basic concepts
yeah they're all in the link I sent
this exist?
the one you said you "read multiple times"
thats discord.js docs. not javascript docs.
probably along with the guide
well now you have the proper links.
If you had listened you me, you could've been learning js instead of "making" your bot
cloudfox how do you like the vscode theme?
Development communities are always a bit harsh.
cloudfox how do you like the vscode theme?
@vernal rivet it's beautiful, it brings a tear to my eye just to think about it
Also I feel like it kind of has halloween colors
tbh best answer i seen yet
Which is cool
this is my host and my bot will go online for 1 second then it goes offline
@earnest phoenix I sent you w3schools js tutorial
my bot runs fine in vsc
idk
i don't do py
Show code
idk if it has the same thing that discord.net has with task.delay(-1);
if the code works fine in VSC but not the host, then the host is the problem 😉
yes but the host worked yesterday
huh
If something stops working and nothing's changed, something's changed
Oh you don't know what that is? Nvm then
That moment when your host has mood swings
cause syntax is how the computer reads. its similar to how we would read messages on discord
well you might throw an error for debugging purposes too
^^^^^
if you think that way, then yes. but errors means something is causing conflict, and preventing the program to execute.
@restive lily what's the full error btw?
even if its because you messed up, errors help you realize where you messed up and how you messed up
to debug
@earnest phoenix so you can get feedback on what to fix
in the above case, yes, thats an error for testing purposes
that and to prevent any kind of damage to the program
You want error messages to stop your bot the same way you want to shut down your car's engine when it starts making weird noises. It's a bad idea to keep things going when they're broken 🙂
that error only pop up for a few reasons, SSL, improper token, or deny_new error
it says deny_new at the bottom
this is the start up but in the console it says discord.py is invaid or something
thank you, when i update ill see if it works
why are you able to use pip but not python, wouldnt it be pip3?
yea might be pip3 if he's using python3
oki
@restive lily which one fixed the problem
first one stella said
yes... I really hope we're not going to get a step by step of your entire learning process every 5 minutes for the next 2 months.
not really.
{"331222209299349504":{"value":"test"},"719362069975138354":{"value":"test"}} how do i cycle through the user id's in this string? javascript
if its still a string, parse it as json first
then you can use Object.keys(parsedJsonHere) to get an array of keys
@earnest phoenix doesnt even pay my internet bill
One message removed from a suspended account.
thanks for the help tim
@sage bobcat oliy bucks are not worth anything anymore, since oliy left
now you have to pay me in veldbucks
One message removed from a suspended account.
if i recall correctly, it was 420 oliy bucks for 69 veldbucks
plus a mod warning for shitposting on #development
1 oliy * (69 veld / 420 oliy) = 0.16 veld
an external file is a file that is not the main file
there ya go
which part of the file do you want to show?
is it a js file?
it depends on the file type
js files are loaded through script tags, css files are loaded through link tags
show an alert with an external script
that means
you copy everything you wrote inside <script></script>
and you put it in another js file
then in the main file, you replace it with <script src="otherfile.js"></script>
so instead of having the js code inside the main file, you put the js code in a different file, and load it inside the main file
you create a js file
in the same folder where your html file is
and you put the alert code in there
then in the html file, you load this js file
using a <script> tag with a src attribute
<script src="thefileyoucreatedwiththealertcodeinside.js"></script>
Somethings wrong if you need a tutorial to do a tutorial
You might just want to do it again until you fully understand it
Somebody knows how change the bar color on a <progress> ?
When i try to change it, it just turn green

Anyone have experience with the Patreon API? I noticed they're no longer maintaining it. Does it work correctly? Am I better off just letting the Patreon bot assign Patron roles in my support server or would it be worth my while adding it to my bot? Currently, I have a bot that unlocks Patreon tiers on my main bot for users depending on the Patreon roles they were given by the Patreon bot in my server. It's kinda hacky...
Why is my bot not on the server?
why would it be
@solid pendant it will be once its verified by a moderator
@ionic dawn who will verify me
Read my message
who will verify my bot@ionic dawn
A moderator
@ionic dawn Bots are no longer added to the DBL discord server if that's what you're asking.
My website comes if someone searched PGamerX website
But doesn't come if someone sesrch PGamerX
I have tried every thing
For SEO
@tame kestrel they aren't?, sorry then for giving him wrong information 
If I'm trying to host my bot on digital ocean and I'm using PostgreSQL (locally stored) how would I get the data from the database and put it into the hosting vps
@delicate shore try using google lighthouse
it has free SEO, site performance and all that jazz
press F12
then on the top click lighthouse
@rugged cobalt with locally stored you mean stored in your PC or the digical ocean host?
Hey i've never tried making a music command, which music package is the best?

like an npm package
@rugged cobalt with locally stored you mean stored in your PC or the digical ocean host?
@ionic dawn on my pc but I want to put it with the source code onto the digital ocean host. How would I do that
wHAT CAN I ADD MY BOT ON THİS SERVER
wHAT CAN I ADD MY BOT ON THİS SERVER
@earnest phoenix no
I don't know the exact process since I didnt use digital ocean but, if its a vps is just movin the database from your local machine to the vps
How would one manage a mongodb connection throughout the entire bot and reduce the load on the CPU said connections would make.
Yeah that's the part I don't know how to do
@rugged cobalt if you want to put your bot onto digital ocean as a host you can either use FTP or use github and git pull
But do I have to do anything special with the code or do I just upload it and the pg database will still work there
um you would likely need to setup the pg database on the host but the code should be a simple copy paste (Other than setting the ip for the pg database)
@rugged cobalt why not use an external server for the database
if you already have a server why use another one
^^ this too
good for what
asking another server for the information?
If you have a decent vps theres no problem in have your db on it
well idk why but i do it for my stuff
I mean... request to other servers just makes the server have a lil bit more delay
Can you upload your dB to a droplet on digital ocean and if you can how much space do you get for free
since you have to send the request and wait for the answer
and you depend on 2 servers
also i use google firebase realtime database so i absolutely have to store my stuff on the server for that and the fastest speed i can get between the two servers requesting stuff is to directly use firebase hosting

Personally I'm using mongo (Just because I have used them before so I know what to do) But can anyone help me with configuring a single connection for the bot so it doesn't have to make a connection for each command that is run (Trying to reduce memory and CPU load)
@shrewd parrot just make one connection in the main bot file and pass the mongo instance to each command
so it doesn't have to reconnect
iirc
Like so?
const client = new MongoClient("mongodb+srv://username:password@cluster0.daswr.mongodb.net/bot?retryWrites=true&w=majority", {useUnifiedTopology: true});
const connection = await client.connect()
const database = connection.db("bot")
bot.on("messageCreate", (message) => {
require("./discordEvents/message").Run(bot, message, database);
})
@shrewd parrot exactly
hello
can you help me with code for command please?
ty @earnest phoenix (I'll give it a test now)
i want slowmode command
ah wait how would I do that asynchronously due to not being in a function?
I tried 5 codes but none of them worked
i want slowmode command
@cobalt sky which library are you using for your bot?
discord.js?
discord.js
you can do message.channel.setRateLimitPerUser(<milliseconds>) to change the slowmode
i have code but he dont work do you want to send you?
You could also use a set and then a timeout to make it a bit more interesting, but the setRateLimitPerUser is much easier to use and just pog c:
@abstract coyote you can't change the slowmode in djs without using TextChannel#setRateLimitPerUser
yeah
i type code
@cobalt sky Put all your code on their and press get link then send the link here
no
after you used the command?
thonk
wait you're not parsing the time as a Date
it gets passed to setRateLimitPerUser as a String which djs ignores
try adding parseInt(time) inside the setRateLimitPerUser @cobalt sky
try adding
parseInt(time)inside the setRateLimitPerUser @cobalt sky
@earnest phoenix i try but again not work
prefixslowmode 3

Can anyone tell me how I can set up a TF2 community server on my Debian Linux vps?
send your code
Can anyone tell me how I can set up a TF2 community server on my Debian Linux vps?
@pure lion you don't
wrong place to ask @pure lion
Channel for chatting about (bot) development
what
¯_(ツ)_/¯
send your code
@earnest phoenix https://paste.code913.repl.co/paste/qxpREUTtyo.html
@cobalt sky
the parseInt(time)should be inside the brackets around setRateLimitPerUser
lol
we don't talk about it ;-;
@cobalt sky :facepalm: the parseInt(time)should be inside the brackets around setRateLimitPerUser
@earnest phoenixmessage.channel.setRateLimitPerUser(parseInt(time))again not work
Um don't know why but all of a sudden since I added the code below
async function databaseLoad(){
const client = new MongoClient("mongodb+srv://among-us-bot:BW3Lb86EifZOiu3U@cluster0.daswr.mongodb.net/bot?retryWrites=true&w=majority", {useUnifiedTopology: true});
const connection = await client.connect()
const database = connection.db("bot")
return database
}
databaseLoad().then(data => {
database = data
})
setTimeout(async() => {
require('./services/prefixFetch').Run(database)
}, 5*1000);
The bot isn't starting (Well not getting a ready event)
pm don't ya dare meme on me
if its an active connection, does it need to be kept running in another thread or smthing?
shouldn't need to as it's just a state
not really sure though
oh um ok i'm stupid (I forgot to run bot.connect()) 🤣


@earnest phoenix
message.channel.setRateLimitPerUser(parseInt(time))again not work
@cobalt sky because it only accepts milliseconds of time
so if you type<bot prefix>slowmode 3000the bot will set the channel slowmode to 3 seconds
if you want to be able to do<bot prefix>slowmode 1 houryou'll need to parse it as aDateobject
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
(i don't know how to parseDateobjects sorry)
@cobalt sky oh wait you can just do nevermind the docs say it's not recommendedDate.parse(time)
Heya, I have a problem, I'm trying to write an ID in a json but it doesent write it :/ Can someone help me ?
my code : ```js
const fs = require("fs")
if(!users.list.includes(message.author.id)){
fs.readFile('./giveaway.json', 'utf-8', function(err, data) {
if (err) throw err
var arrayOfObjects = JSON.parse(data)
arrayOfObjects.list.push(message.author.id)
console.log(arrayOfObjects)
fs.writeFile('./giveaway.json', JSON.stringify(arrayOfObjects), 'utf-8', function(err) {
if (err) throw err
const embed = new MessageEmbed()
.setTitle("Inscription au Giveaway réussie !")
.setDescription(
"Votre inscription au giveaway à bien été enregistrée ! Bonne chance"
)
.setThumbnail(message.author.avatarURL())
.setColor("GREEN");
console.log('Done!')
console.log(users.list)
message.channel.send(embed)
})
})
}```
my console returns me for the first console.log the list of ID + mine
but the second one not
@woven sundial please don't send that big blocks of code in chat
use a paste service like mine: https://paste.code913.repl.co
or you can use hastebin if you want

CursePaste
Vous avez besoin de partager la configuration de votre serveur ou d'avoir un œil supplémentaire sur une erreur ? Collez-le dans le lien ci-dessus pour un partage facile !
this exists?
it exists
There’s hundreds of paste services lol
wrong place to ask @pure lion
@TheMystery#7755 🥚
that is just a worse version of hastebin
so, can someone help me please ? 
ok
idk why doesnt it write it in the json
it add it at the push line but not after the write one
I'm trying to write an ID in a json but it doesent write it
@woven sundial JSON DATABASE AAAAAAAAAAAAAAAAAAAAAA
It's just for a few IDs
JSON is NOT meant to be used as a database anyways
yep, but that's not fixing my issue tho 
@woven sundial if you are trying to save any sort of data dont try to use single files somewhere in your folders, build a proper db like mongo(nonSQL) or MySQL
you'll regret JSON databases later
yeah but for small things its good
use smth like mongo or SQL or (my recommendation) any of the two google firebase databases
yea, but does anyone have an idea why does it don't write the new datas in the json ? 🤔
it is :/
is it throwing any error?
no, it returns "done"
wait is the third parameter in fs.writeFile (async) the encoding or the callback?
wait I think I fixed it
I think fs is taking the root directory and not the current one
well... when you add ./ its talkin about the relative route
its using the route where the files is executed as root
this is just a plain ripoff of hastebin they didn't even change the favicon
if you dont use the ./ you have the give the full route
@earnest phoenix yeag it's callback
@pure lion then i think the error is that he's passing the encoding as the third param and the callback as the fourth
lemme go read node docs
@woven sundial yes what dice said is correct
you need to pass the callback as the third parameter
the second paramater can be an options object containing what data to write and the encoding
but how does this example work on node.js:
fs.writeFile('message.txt', 'Hello Node.js', 'utf8', callback);
Make them post to wherever
<a name="button_A">
Do that too
Assuming the buttons are a
I usually use form/submit to post to my server
In the form just do method="POST" action="/your/path/here"
In the buttons append a name="" and name them
y does it not send the msg? how do i do the id so it reads it

to prevent XSS on my site can I just convert all <,\ and > characters to their &5id4j9 blah blah form?
why do people use webhooks for logging?
If you get more than 1000 votes a month you cannot access all the vote data anymore through our API
Just the last 1000
:popcorngirl:
@ionic dawn thank you for helping, that explained it very well
ah i should've explained it better
i mean like this: https://img.rovi.me/ot9rHZJR87.png
Hm no idea
Yeah, the only reason i could think of would be if the ratelimit is higher for webhooks and it doesnt count towards the bots ratelimit
ah ok thanks
@ionic dawn thank you for helping, that explained it very well
@earnest phoenix Wasn't trying to
No reason to put the whole mention on the "", you can just check if the first mention has de proper ID lol

thanks
I have a complex question myself
My current code: https://paste.code913.repl.co/paste/jA37xCxfE-.html
Question
So right now whenever somebody requests the server to store the code, the server writes the content in ./public/paste/<random file name> with the HTML structure and the code goes in between. However, since the data is stored on the current server with the HTML structure using node.js' fs module. However, the HTML structure is the same for each paste and it takes up unnecessary space in saving it. An alternative would be to store each paste's code on an external database server like Firestore and fetch the data from it and send with the proper HTML structure to the user. So my question is, should I do it the database way or do it the current way?
||@quartz kindle||
Atleast have syntax highlighting
Use a data base
With https://6n.wtf/p/test its all database
The user logged in adds the paste, and has access to delete it
delete the .html after x time?
@earnest phoenix use passport
aren't they ment to be something temporal?
...why?
Because passport is the number 1 authentication module for nodejs
And is regularly updated
Mhm
that sounds like the passport IRL
im trying to use the npm package "humanize-duration". ive installed it, however i keep getting this error.
<script src="humanize-duration.js"></script>
<script>
document.getElementById('appopened').innerText = humanizeDuration(Date.now() - settings.opened, { round: true, largest: 3 })
</script>```
im trying to use the npm package "humanize-duration". ive installed it, however i keep getting this error.
you can't use npm packages on browsers unless they have a client-side version
how can i use it then?
if the package has a client-side version use that
they should mention it somewhere
probably in README.md
can anyone help me with the help.js command as it doesnt seem to respond
@earnest phoenix https://dontasktoask.com
lmao
Question
If I add a route /paste/** to my express server will it think of it as /paste/<any thing here is accepted>?
Example: https://paste.code913.repl.co/paste/ze3whrXfBE.html
hi need help
if (message.author.bot) return;
if (message.content.toLowerCase().includes("+avatar")) {
const { guild, channel } = message
const user = message.mentions.users.first() || message.member.user
const member = guild.members.cache.get(user.id)
let embed = new discord.MessageEmbed()
.setAuthor(`${message.author.username}`, message.author.displayAvatarURL)
.setTitle(`${message.author.username} Requested ${user.username}'s Avatar.`)
.setImage(user.displayAvatarURL)
message.channel.send(embed)
}
})
i dont get avatar of the person
client.on('message', message => {
if (message.author.bot) return;
if (message.content.toLowerCase().includes("+avatar")) {
const { guild, channel } = message
const user = message.mentions.users.first() || message.member.user
const member = guild.members.cache.get(user.id)
let embed = new discord.MessageEmbed()
.setAuthor(`${message.author.username}`, message.author.displayAvatarURL)
.setTitle(`${message.author.username} Requested ${user.username}'s Avatar.`)
.setImage(user.displayAvatarURL)
message.channel.send(embed)
}
})```
there u r
let me look
one sec

why are you just sending the whole piece of code again
so its in the javascript text
yes
need help
it just shows user
pls tell what i shoud try doing
??
@earnest phoenix https://highlightjs.org/
client.on('message', message => {
if (message.author.bot) return;
if (message.content.toLowerCase().includes("+avatar")) {
const { guild, channel } = message
const user = message.mentions.users.first() || message.member.user
const member = guild.members.cache.get(user.id)
let embed = new discord.MessageEmbed()
.setAuthor(`${message.author.username}`, message.author.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }))
.setTitle(`${message.author.username} Requested ${user.username}'s Avatar.`)
.setImage(user.displayAvatarURL)
message.channel.send(embed)
}
})```
that should work
@earnest phoenix https://highlightjs.org/
@honest perch I'm already highlighting the stuff you have JavaScript off or what?
highlightjs
Ah nice nice
and the highlighting is done in the client's browser
cuz yes
saves little bit of storage
@earnest phoenix did u see what i put
umm yes
checking
ight
@earnest phoenix
no
Question
If I add a route /paste/** to my express server will it think of it as /paste/<any thing here is accepted>?
Example: https://paste.code913.repl.co/paste/ze3whrXfBE.html
it work?
aint working
hm
let me think
yes
wait
it worked
with image
thanks
send a pic
Hello, is anyone here familiar with music bots? I built in a vote skip if x members are in a voice channel and want to skip a song. The role "DJ" is a special role which has the possibility to bypass voteskip and skip a song directly.
I'm a bit confused right now and don't know how to built that in, can anyone help me? So far I have the following:
@vale garden what's the purpose of the do{} in your code
@hollow sedge im late af lmao but the do {} adds each pokemon in the user's inv to the embed desc; im making a pokecord clone
Im assuming the rate limits are per access token?
So if i have a server with multiple people accessing data (with different access tokens) it would be fine
hi, i can't shrink my json file what to do?
const extra = require('...')```
try
const extra = require('./file.filetype')
isnt the same ./ to direct use a folder?
I've used it for regular json files
the problem is that I can't do it
same error
'module_not_found'
i would like to know the full route
how to explain wait

what file are you trying to require it in?
"extra.json"
yes

wait in the commands or the main file?
in the "main.js" file (the main file) it works
I want to require the json in my command
oh thats easy: ../data/extra.json
that should be good
you leave the command dir and go into the data


../ = move back
../../data
From the commands subfolder, up to folders, in the data folder. That's where your json file is.
When I use sharding, does discord.js create a separate thread for the shard number 0 too?
ah! it seems to work wait
Not that you should use json as a database, that's very dangerous and not very function in the long run.
it works with "../../data/extra.json" thank you
Consider not using json as a database.
You'll lose your entire data one day for sure.
it's not something super important don't worry
Still.
When I use sharding, does discord.js create a separate thread for the shard number 0 too?
if anyone know ping me thanks
Route: /files
cd ..
Route: /
still thinking why ../../
if its assets/{commands - data}
because require() is relative to the file it was called from.
They'll figure out soon enough why require() isn't valid in this case 😛
My website is - https://sheep.pgamerx.com
If you are on mobile open it and it'll just show white screen
But if you do show desktop version it works fine
Can anyone help me figure the problem ?
you have a css that acts on screen width?
you have a css that acts on screen width?
@ionic dawn
No I don't think so
it's a website builder lol
need help
with?
bot.on('ready', () =>{
console.log('This bot is online');
bot.user.setActivity('Total Guilds'`${bot.guilds.cache.size.toLocaleString()} `,'|Total Users'`${bot.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}` ({
type: `WATCHING`
})
)})```
I want to say how many guilds my bot is in and total users
of all guilds added up
you just did...
but
${bot.guilds.cache.size.toLocaleString()}
is coming up with errors
and the total guilds and total users
say they arent functions
keep it under one string
why are you adding commas
`Total Guilds ${code} | Total Users ${code}`
make it under one string
you can't just... throw strings together like this
mhm
perhaps you should learn javascript before trying to make a bot? This looks like random button mashing, not programming.
what im saying is
The metas
Whatevers inside <head>
Whatevers inside <head>
@ionic dawn
I have separate files
For style
That's why you should never use website builder
It makes everything tough
I'm regrettins using it
@earnest phoenix trying to make in the status total guilds and total users
https://GitHub.com/pgamerxdev/sheepnew
@ionic dawn for time being I'm redirecting all mobile users to normal Verizon of website which means old one
learn javascript also
bot.guilds.cache.array().length
bot.users.cache.array().length
What? Why would you do that. discord.js has a .size property on colections it's perfectly valid
Yeah but that's doing an entire conversion operation for absolutely no reason.
wasted CPU cycles.
map itself has the property size
Anyway something be wrong with it.
And flexbox + CSS Grid makes it easier
Because that shoudl work fine
it's not that bad
The problem is that the entire code you have is wrong, @earnest phoenix . It's just random bits thrown together. You're missing concatenation or commas or something but it's definitely not valid syntax you have there. It's a wonder it even runs
if you use fn`string` it's going to execute the function with string being the first argument inside an array
bismillah
But @ionic dawn did you find the error tho?
so what do i do?
How can I see which
Learn javascript, would be the best thing to do right now
What's id and why are you dividing it by 4194304 ?
And why are you dividing an ID by this number? what... purpose does that serve?
why not just use the created timestamp?
Yeah that would make a lot more sense
I mean, that still doesn't answer what the heck 4194304 is and why you're dividing a snowflake by it?
the ID doesn't contain the creation date
yeah but not divided by 4194304 😂
Not that javascript can handle this size of integer without using BigInt in the first place.
@low orbit try Date.now() - ((id/ 4194304) + 1420070400000)
add parentheses next time to avoid any errors

yeah, i play some counter strike
And im just making a online audio player
Probably with the yt api to search for the audio, but i need a "volume var"
Also dark green and purple/white dont look pretty good
Thanks flazepe that is now flaze but with anime pfp
I used a website builder as I was feeling lazy
How can I fix this issue
Any way I can over write existing CSS of page width
Like website builder made CSS in different folders
Is there any way I can do something in html file that it over writes the one in folders
How do I get the link of a rich presence asset?
I have the application ID and the image id
Some help please? Trying to get my bot to delete its message but it just.. won't. Code:
.then(reaction => reaction.message.react('735903836727935098'))
.then(reaction => reaction.message.react('750759552542310410'))
.then(reaction => reaction.message.delete(5000))
.then(msg => console.log('Message Deleted!'))
.catch(err => console.error);```
everything works fine but it doesn't get deleted which is annoying
whos good with mongodb
def not me






nobody will talk about it

no

