#development
1 messages ยท Page 1809 of 1
A command for a bot (e.g. !ping), or a command for your command-line interface?
did you tried to logout and login again? maybe some caching issue
bot
You may be interested in <#502193464054644737 message>.
In order to create a command, you need to create a bot. In order to create a bot, you need a programming model. There's a lot to learn in the programming world.
mhmm, and tried reloading bash shiz
so it isn't in your path
pm2 status also gives you the same error?
then there is probably an error in your script
what did you try to start with your script?
thats not really relevant
maybe you could just use a ecosystem.config.js
hello, I made my bot from glitch, but in an error that only happened today, my bot was only online, so it seemed to be broadcasting, now it just doesn't respond to online commands, please help
@round cove sorry for the tag, can you see if there is a solution to my problem, please?
ah yes pinging random mods for help
I know nothing about glitch.
no
ok sorry
this is the one thing im confused with could anyone hel;p?
It's asking you to create a folder for your bot.
what do they mean my folder
For example, you could create a folder called bot on your desktop.
If you can access it, that works.
oh im dumb
you can just open powershell
You want to try following the article as best as you can. A lot All of your questions can be answered by Google.
damn
Shift + Right mouse button as it says. There will be an option to open command prompt
command prompt was replaced with powershell like a while ago
you need to edit regedit files to bring back the cmd prompt option
that's the part where they got confused at ig
oh my god
LOL
is that even a token
yes
no
regen the token
ok imma stop being dumb
lol
ok even when im not dumb i still dont know what to do
powershell is so much more better than cmd
combine it with ohmyposh and winterminal and you've got heaven
...Or just use VSC or at least Notepad++
I have VSC
That's probably a lot easier than trying to use powershell
pray to discord gods
๐
why aren't you following the article
i am
idk how to save it
Use VSC
uh, powershell isnt an editor
ok
if you pray enough it can be
Real devs take screenshots of their code and save them as PNGs, then they run them from there!
red means it worked
you forgot to name the file index.js.py.cpp.cs
not sure what this means
i-
my screenshot was sarcasm
don't copy what i did there without knowing what it is lol
First 500 people will get 2 months of Skillshare free: https://skl.sh/polymatter4
Patreon: https://patreon.com/polymatter
Twitter: https://twitter.com/polymatters
Reddit: https://reddit.com/r/PolyMatter
Discord: https://discord.gg/polymatter
Itโs become popular to encourage anyone and everyone to code. But there simply wonโt be unlimited deman...
ok damn
it means it didnt expect >> in the location you put it.
rule 1 
you're throwing yourself in the lion's den, creating a bot obviously needs skills that you lack, you should probably familiarize yourself with CS basics first
AYYYY I DID IT
congrats
Ayy congrats
i didnt download discord.js
thats why
i geuss i just skipped over it
lol
face palm
Lol
So...you're doing library-less?
Ignored 
ok
I'm assuming he's not doing library-less
judging by this ^
He said he skipped installing d.js, that's why I asked
Yeah, I think he just meant he forgot to install it
I mean i didnt see it untill i went back
rip
Do bots need the ATTACH_FILES permission to set the image in an embed?
uhm
only if you're the one uploading the image
afaik you don't need it for external links
...
I might be wrong tho
Alright
that's something you need to ask yourself
yeah, embed images just use a url
has anyone here worked with webrtc?
ok i am being dumb again
oh hell
eternal hell
oh hey timotei
use 1 command event
dante would be proud
Don't use 3 separate event listeners for the same event
And those arrows just allow you to collapse the code within the brackets, it's nothing to do with functionality
i am confusion
tf does that mean
you should learn javascript before trying to make a bot
you're skipping many steps
you should probably learn some language basics before working with sockets
why my bot use so much ram!!!
And this too ^^
use detritus
๐
me
me ;-;
nbm
I count 3
I count dracula
@earnest phoenix you should learn more about Javascript before attempting to make a discord bot
if you want to
You'll get confused sooner or later, it's better to learn the basics of the language first.
sooner in this case
uhm...
do you know what javascript is?
internet
^^
guides, courses
i tought so
codecademy codacy etc
w3schools, mozilla, baeldung
wouldnt recommend hopping into js if its your first day. discord.py should be much easier to digest
x doubt
Personally I like to make something, then when I encounter problems I look for solutions online. It's important that you don't just copy paste everything a site says, and that you actually understand WHY it works.
how so
Both libs will fuck you if you dont know what you're doing
if you dont know python d.py will fuck you even more
of course, that applies for everything
how so?
python is reeeeeally different from pretty much any other lang
Syntax
Python's async system is far more complicated than JS
for example, if you start learning C you automatically understand the syntax of most available langs
that's because the syntax is really close to each other
look for javascript if you want to use discord.js
python is....unique
ok
so i should do explore on my own?
I mean learning syntax takes less than an hour tbh
its the fundamentals that take time
and those fundamentals can be used from language to language
wait, so dayo has past programming exp?
If you've learned any programming language before, then yes
no
Personally I just dislike python due to the fact that indentation controls the behavior of the language
10/10 wouldn't recommend js as a starting programming language
I think js is a great place to start
i wouldnt recommend js to start off with.
I mean you should be using indentation like Python's regardless of the language you're using
Just not building a discord bot
9/10
I recommend java
python
although I might be biased
we shouldnt be the ones telling which language to learn
we should tell them what to learn
i mean, i have coded a bot using C++, it wasnt too good
If they just want to code a bot
i say JS
just because its more baby proof as a language
can you list out WHY js, rather than saying js?
The issue is all these languages set you up to fail, and the ones that don't aren't beginner-friendly.
JS doesnt give a fuck about 90% of the stuff that Python will beat you for
f js go for py but I won't say why
Yes, C. Or Python, or even Java
if you plan on making a resource intensive and scalable bot, c# and python are you best choices
otherwise
Eh
it literally does not matter
go lang is ehhhhhhhhh
I'm not sure if starting off with Java and those types of languages is a great place, because of concepts like encapsulation that can get confusing to a beginner
I made one in go it was quite good
go is interesting, i didn't benchmark it though
Great principles but some really awful design choices that made me stop using it along with work
- js is arguably simpler to understand
- js is by far the most popular lang, which means tons of resources and help available
- easy transition to web development and other specializations
Well put!
debatable
starting with C was the biggest mistake I remember
you don't really need to fiddle with encapsulation until you feel the need for it
they had us start with CPP in high school
as with almost all langs, you can start with only the basic stuff
Yeah
when you feel "something is wrong here" then it's the time for the next step
i.e. "print this to console!" and "do math operations!"
They had us start with Java in high school
I CAN HAZ STDIO
Yall are forgetting QBasic
Best language of 2021
- Complete web development without using any other languages
In reality I litterally dont think it matters whether you pick JS or Python
why are we mixing discord bot with web development?
They had us start with C in first year
then Cpp and Java in second year
just wait till astro framework releases actual documentation
why they start w those
I do not understand
theoretically, discord bot deving is web development 
like f u
you're connecting to the web
Because people think the web is everything when it's not
its like saying, go for python..why? tensorflow my dude
well, it's technically an api development so yeah, kinda web dev
every tried using raw websocket ?
yes
i literally wrote a websocket server with asp.net core a month ago for my finals lol
lol
rate the hardness
1 2 3 4 5 6 7 8 9 10
js obviously as tim said
js is like a 2 lol
lel
it's mind numbing how much the ws package handles for you
I think alot of the complexity comes down to if you're actually writing your own protocol handler and IO handler
I wish people read rule 4
the ws package has so many unnecessary things
this
you can easily write a discord ws client without ws
although i wouldn't ever write websocket servers in js simply because you can't thread easily
you can always use uwebsockets
I tried learning ws and was like "Yeah sure see you in 6 years"
websockets are pain I'd rather use socket.io
in reality you can write the protocol and IO handler in < 1000 lines if you really try
the websocket specification has this dumb rule that you have to xor mask your data on every single message
but you can easily xor by 0
i'm going to pick up rust within the next few weeks, some rust HTTP server libs are one of the fastest ever and that's what's been picking up my interest for a while
HAI 1.2
I CAN HAZ LOLCORDE
GIMMEH TOKEN
BTW BOT SHUD RUN
I HAS A NUMBAH GUILDS
KTHXBAI
Do you actually need any of the performance though
nah, it's just to toy around with
Like when i see people going with actix web just because 'speed' without realising that they're sacrificing tokio's perfect parallel load balancing
in an actual production case, as long as your language is capable of threading, it doesn't matter what you use as your HTTP server
do people still use nginx proxies when using rust servers?
because what's going to be slow is your and the client's internet speed, not the code
generally yes
because often you're still running more than one server setup or more than one domain and want the reverse proxy side
although My setup i use Kong which wraps Nginx to add a bunch of QOL stuff
i am dumb help please
Recent times though been working on a reverse proxy written in rust that works off QUIC tunnels 
last time i tested adding nginx made everyting 3x slower compared to exposed node.js server
do be speed
it is
Nginx and Apache are actually pretty limiting if you're server supports HTTP/2 and want to make use of that multiplexing
Nginx and Apache will only proxy pass HTTP/1.x or HTTP/0.9 and pipelines which cuts a reasonable amount of concurrency performance
although 3x still seems a lil high
um
Like, Kong adds 4ms latency
didnt even test ssl yet
what was your nginx setup and node setup?
pretty barebones
fresh installs, node was like a fixed text response
nginx had a few optimizations from some researching
what did you use to test the thoughput?
oof
thats what i see most people use
Yeah
Real shame we're still using tech that was designed 8 years ago for the web 8 years ago
lel
schools using dev-c and eclipse: am I a joke to you?
its not even that
Its the fact that people take wrk's numbers as gosphel even though it still uses a system that has been removed from modern clients for the last 8 - 10 years
like Pipe lining is dead, stop using it, support HTTP/2 
Just 12,000 images left to process
does anyone know cli?
for?
have i introduced you to the --help flag?
what am i doing wrong lol
wait
oh ok
wait
no
im not doing it right
HELPPP
Is that.... a dick in your activity
wtf
lol
What are you even supposed to do there
Hello How can I make premium commands and connect my patreon page so that when a user subscribes they will get all premium commands?
codecademy
am i doing this right
yes that will work
Did you try it?
yes 100%
but its not
looks like it did
wut
in the screenshot
add ' ' before and after the number ones
ok
but it says to print the number
true
oh u probs have to put '20.49'
u forgot a ' after 20.49
oh wait thats not right
Bro
I tried to use github
To make my bot
And I cannot make the bot leave the voice channel
And now he can't enter
forget what i said and remove the ' before and after the number ones then correct the spelling for the 3rd line
Because he hosting time ended
Hey, can someone pls help me in this?
uhm what
does the templates folder exist?
yea, see i sent the pic
looks right
it wont let me pass
add ; at the end of all of them
i did
oh im stupid
ok it worked
@obtuse stone
D:\D\ ?
it might be that
idk why?
it isnt in my code
@obtuse stone this is the vid i am using
This video will show you how easy it is to build your own CLI using Node.js. It's based on a blog post by Dominik Kundel over on the Twilio blog: https://www.twilio.com/blog/how-to-build-a-cli-with-node-js?utm_source=youtube&utm_medium=video&utm_campaign=node-cli-howto
Command-line interfaces (CLIs) built in Node.js allow you to automate repeti...
and manually putting the options with default value in options object
why not make a defaults object and use Object.assign
bruh
anyone help me
ask the question or no one can help bud
add a back slash
\thing\
@plain talon so sorry to bother you but its not working
show me the full line of code
line and entire file are two different things
ok
snake_case for variable names :(
lemme try
oh yeah its working
thank you so much
mb
no problem
@rustic nova
@zinc fable yeah that was a ban now lmao
wait
oh you got it pog
what happened ๐
limรฃo
Javathon
Is it just me or does IntelliJ have the worst UI
...if you tell us whatโs wrong yeah
ok ther
lร je developpais mon deuxieme bot discord
mais jfais une pause
et toi?
Can you send the code along with it
you are requiring a non existing file
You might have the wrong path, or it might not exist altogether
Iโm going to assume it doesnโt exist
Sure
...?
Ok I guess
Is it API abuse to change the bot status every 30000 milliseconds?
@drowsy crag nitro alert
wat
it's like, the other way around
plus you can always change themes
I feel it's too bulky and shoves a lot of stuff in your face. 75% of the actions I can perform on screen, for example, are stuff I'm not going to use. In comparison, editors like VSC display like 10-20% of features I won't use (even if browsing their settings is a pain) and try to minimize them (grayed, small, and in the bottom/top).
Heck, even the editor window is small. It's like half the screen as opposed to other editors getting you 70-90%. I feel IntelliJ just puts a lot of stuff you probably won't use in your face, even if you can try to hide/disable them. I use Material to clean up the actual look, but that's about as far as it goes. I just see it displayed awfully. Even Xcode is much better to actually use and so many features are missing.
The rate limit for presence is 5 times every 20 seconds
So. You have plenty of head room
i defined m but still gave me an error
Where did you define it?
^ scope is important
interface is editable
you can remove most stuff
Where do i get the dbl_token for webhooks?
Bot Page > Edit > Webhooks
404
Try refreshing the page
ah dang, i see. thank you
Uh - what exactly do i put here? ๐
Alright - Would this be my IP-adress, if the bot is being hosted on my own desktop?
yes, correct
Alright, cool, thank you ๐

clustering and sharding happens on professional scale as well. Redis is a popular database and offers clustering which takes the form of multiple slave instances performing I/O OPs while the master acts as a central connection hub and governor of the slaves
the result is vastly increased performance which is very scalable horizontally which is much cheaper and doable than vertical scaling
is the module installed you try to run?
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import 'bootstrap/dist/css/bootstrap.min.css';
import './index.css';
ReactDOM.render(
<App />,
document.getElementById('root')
)```
Why this is giving me error?
Because nodejs uses require function for importing modules by default
Webpack should have fixed those errors but it didn't
Are you running your code directly in node? @flat copper
In repl
PS D:\DATA FOLDER\ETHAN\School\Coding\Test NPM> create-project typescript --git
ERROR Invalid template name
[Error: ENOENT: no such file or directory, access 'D:\D:\DATA%20FOLDER\ETHAN\School\Coding\Test%20NPM\templates\typescript'] {
errno: -4058,
code: 'ENOENT',
syscall: 'access',
path: 'D:\\D:\\DATA%20FOLDER\\ETHAN\\School\\Coding\\Test%20NPM\\templates\\typescript'
}
PS D:\DATA FOLDER\ETHAN\School\Coding\Test NPM> ```
https://pastecord.com/elanizozaj.js
detritus uses less memory usage
and detritus is probably better anyways
just haven't used it myself really
in an actual bot
a discord lib
for?
discord bots
its a discord lib just like discord.js is
it has the same purpose
interacting with the discord api
lol
javascript
imma try that out 
do it ig
Guide = tutorial 
flaze
yt vid*
is it me or detritus is kinda like a command handler but from a package 
It has a built-in command handler, that's why
what r u trying to do/whats ur code?
Or typescript!
Detritus is actually great though
Iโll become an advocate for it just like Erwin
Gladly
im trying to make a leaderboard command for a economy system, and im not sure how to make it check what users are in the guild, then output them using map
using mysql
i have a table named user, then a column named 'user_id', and the money they have is another column 'networth'
i thought of making another table and having it log the guild id, but i cant have people having different networths in different servers, its supposed to carry over
so basically i just have to check what users are in the guild, then get the data from those user_id's, but im not sure how to do that
depending on the configuration they perform memorywise relatively simliar (detritus and d.js V13) but detritus gives you some stuff that d.js dont, like Sharding is easier, build in command handler and some other nice features.
I run cron jobs every 30 seconds (really demanding jobs) and pull data from the database. Do you think the performance of the application will increase if I cache and pull from the cache instead of pulling from the database?
I noticed that when I close these things and run the app, I get lower ping
If it slows down the performance and if caching would also work, why not try it?
Pulling from cache will definitely be faster. It might consume a lot of RAM depending on how much data you store
If it's too much data to store in RAM you can even try to build it so it stores it in a temporary file.
I'll have to try anyway, but if it doesn't work after writing long code, it would be a bit annoying so I wanted to ask
You could to some tests before putting a lot of time into it right?
I don't know what you are trying to do exactly obviously but I'm sure you can do something temporary to see if it increases performance.
It's true but I don't understand why you are so obsessed with me asking
lol just trying to help
My friend you don't know the real difference between help and obsession
I guess I didn't use the right expression :
oh sorry mate my bad
Probably ยฏ\_(ใ)_/ยฏ
Hii
Yes caching really works :>
It doesn't make sense to pull an average of 5k data from a database every 10 seconds.
When I do this the ping goes up to 5000ms
That the longest code line I've made so far, thanks to the subcommand
Why oh why does my site and bot have such high response times, usually about 1,000 ms but the bot response instantly when you use it (status.eternaltesting.xyz)
seems about right
your site taking about 800ms to even load the raw content
742ms for aws bucket holy fuck
The fuck is going on there
XD
The actual website is just a html js template
The php is badly written tho I havent coded since 2007
Also it's a cheap host. $3/mo
why would you do this without caching at all?
I don't know what I was thinking when I wrote the code ๐


i was an idiot when i had a public bot and i barely cached any data
um
prefixes weren't one of those things
so i made a call to my database on each message in a guild
does cache means temporary info or something
yup
ooo 
you have to find some middle ground with caching, not enough and the app will feel sluggish /unecessary API / database calls. to much and you waste resources.
a example would be probably caching discord Presence, most people dont need it, and it takes a fair amount of memory to be cached.
free ram is wasted ram 

Hey guys is anyone having issues when clicking on the announcement button when editing your server or it's just me ?
I guess JetBrains IDEs really think that
but why can't they allow me to use over 4GB though ๐ค
How can I fix this ?
src/res/db.ts18 - error TS2339: Property 'db' does not exist on type 'typeof Database'
well db does exist
export class Database {
private readonly dbName: string;
private readonly db: Db;
constructor(_db: Db, _dbName: string){
this.db = _db
this.dbName = _dbName;
}
How do I get the number of text channels, voicchannels and roles in a server?
.cache.size ?
Hypocrisy
hihihi i just joined
Is the error happening at this.db = _db?
msg.guild.channels.cache.size.filter(channel => channel.type == 'TEXT')?
Youโre trying to filter the cache size?
Filtering 1000 for example seems to be a weird step. 
(the value 1000)
how to upload a npm package from github?
How can I get the number of channels in v13?
let textChannels = (await guild.channels.fetch()).filter(c => c.type === "TEXT").size
let voiceChannels = (await guild.channels.fetch()).filter(c => c.type === "VOICE").size
This does not work because it always returns 0
It doesn't work for private properties since they're meant to be used inside the class itself
Also it's keyof Database
pretty sure channel types are not uppercase
They are now in master https://discord.js.org/#/docs/main/master/typedef/ChannelType
lol more unnecessary changes
Oof
GUILD_TEXT and GUILD_VOICE
doenst work too
pretty sure they are
Can you try logging the channels types?
console.log(new Set((await guild.channels.fetch()).map(({ type }) => type))) Maybe this is too extreme
why new set?
Yes
lol
This is not a good way to debug at all
Best way is to just log everything and check them manually
I'm being a clown
Or well, use the damn debugger
(which I have never done)
I agree
whats a debugger
Imagine using the debugger keyword instead of just console.log() 
That'll error out
dis is de wey
const plsWork = console.log;
function spy(arg) {
console.log(arg)
return arg;
}
spy(spy(spy(spy(await message.guild.channels.fetch()).deeply()).nested()).insertions())
big brain move

function log(arg) {
console.log(arg);
return log;
}
log(1)(2)(3)("abc")("haha")
sorry I'm late
No it's not at this.db = _db
It occurres at
this.db.collection("Users")
~~
Full code
export class Database {
private readonly dbName: string;
private db: Db;
constructor(_db: Db, _dbName: string){
this.db = _db
this.dbName = _dbName;
}
async GetUserByID(_id: string): Promise<User> {
return new Promise ((resolve: any, reject: any) => {
const users = this.db.collection("Users")
// Some useless code here
})
}
}
I am calling it from inside the class.
Also turning it public dosen't work either

nvm I used .bind() and it works now
An id named avnoor(dev- id 732137013620244512) wasn't able to vote the bot can you tell me why?
An error occurred? They didn't want to vote for your bot? Their computer died? All the possible possibilities and yet we don't know.
what should i fill here??
uff
What if they died
then they died
Or simply they were using Adblocker
ram goes nom
You can but you wil have to wait a few second before the button will appear
yo anyone know how to fetch server in JavaScript
I did message.client.guilds.cache.get('Guild ID') but its not working
I tried to removed message aswell
very bad idea
There's no point in "fetching" a server because your bot gets all the server objects on startup
anyone got any bot ideas
cuz i added a level system and all to mine and now idk what else to add to it
Set(3) { 'category', 'text', 'voice' }
That's odd
bruh it was rly the different between TEXT and text
Ah, wait
it works when i write it lowercase
You are using the master branch, right? I recall you asking a question about it
File ".../venv/lib/python3.7/site-packages/discord/gateway.py", line 582, in poll_event
raise ConnectionClosed(self.socket, shard_id=self.shard_id, code=code) from None
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4011
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fcf5b1d1f10>
anyone know how to debug this error? which discord gateway domain should I check?
suddenly my bot stopped working on live env, probably due to some network problems
Are you using the latest Discord.py?\
yes
it's related to network things, anyone know the domain?
i can run it on my local machine
bruh its ur internet problem
yeah I know
it cant connect to session
it terminates unexpectedly
kinda the ERR_CONNECTION_CLOSED u see on chrome
when u disconnect
4011 says sharding required
you literally not answering my question lol, i know it's networks problem, I want to know the discord gateway domain or ip address so I can debug
Or at least Discord opcodes page says so
bro u didnt enter a shard id
prolly u copied the code
Not helpful at all
and forgot to change shard id
In any way, shape, or form
nah, my bot been running for nearly a year
or ur shard system failed
recently it's stopped due to some network problem on live server
omg lol
maybe it couldnt connect to shard
Try sharding
i didn't ask code-related question
i asked maybe if someone knows discord gateway ip adress
You send a request to /gateway and get the URL to connect to
Discord may have removed it at some point last week though, not sure what's going on with that
Are you using the sharded client?
my code is giving an error:
import fetch = from 'node-fetch';
Typescript
import fetch from 'node-fetch'
How can I filter user? So bots wont be countend.
let user = members.filter(m => m.user.user).length
// returns 0
is giving the same error
ยฏ\_(ใ)_/ยฏ
!m.user.bot
ah i see, my bot reached 2500++ servers, i need to shard it
show error?
message.guild.members.cache.filter(x => x.user.bot).size
this will return bots
";" expected```
oh wait !x.user.bot*
try reading it
u need a ; at the end
and = isn't a thing
so I draw the =?
THAT!
google translator is crap
yay
It worked
@earnest phoenix @summer torrent tysm
i dont even use ts lol
Discord docs have a page specifically for opcodes and status codes
Might be helpful in the future
yes yes, thanks @slender thistle

How to make the bot send a message to a channel when restarting. Is it possible?
ready event
ye
mmmmmmm
In your restart command, you could send the message beforehand. e.g. ```js
restart((message, args) => {
message.guild.channels.get(...).send(...);
// ...
});
If you wanted to send the message when your bot starts, you'll just need to send it on the ready event.
READY event would be after
im getting pissed rn
${user.username} user is set as my ID under a "let user = ID" (So if my nickname is changed in the server the bots in itll show my username but the username in user.username returns undefined
because it's probably a string/number instead of a user instance
o, what do i need to change to get it to show the username
you need to get the user instance
there are a lot of ways
e.g. bot.users.fetch(...) returns a promise resolving to a user
so id need to client.users.fecth(300695488414351362)?
ahh
The Class Middleware has a constructor, which contains app, which I can access with this.app. Why doesnt this.tokens work?
I tried with Middleware.tokens, but does not work too
so like this: let user = client.users.fetch("300695488414351362")
still getting undefined
show middleware class
fetch returns promise iirc
what do i need to alter
The Function is in the Middleware Class
You could write your own.
this is the full code:
const Discord = require('discord.js')
exports.run = (client, message, args) => {
let guild = message.guild
if (!message.member.permissions.has("ADMINISTRATOR"))
return message.channel.send("You Have Been Denied Use Of This Command ~ Have A Nice Day!");
message.channel.send('Getting Admin Commands...').then(sent => {
sent.delete().catch(console.error);}).catch((e) => guild.channels.cache.find(i => i.name === 'crystal-crash-logs').send('Error: ' + e));
let user = client.users.fetch("300695488414351362")
let embed = new Discord.MessageEmbed()
.setColor("#2F3136")
.setTitle("Administrational Commands List")
.setImage("https://google.com")
.setFooter("Commands Last Revised 11/07/21 By " + `${user.username}`)
message.channel.send(embed).catch((e) => guild.channels.cache.find(i => i.name === 'crystal-crash-logs').send('Error: ' + e));
message.delete({timeout:10});
}
Write your own, you have full control of it
Full control is not everyone's goal
oh wow ty
If you just want one, you can use Eris's command framework via CommandClient. However, just because you don't how to make one doesn't mean you can't learn. Many people who use Discord.js learn to copy write their own primitive command handlers.
client.channels.get("channelId").send("np");
no I mean when it is restarting
cause that's the one locate the channel
like opposite of this
Hey!
I have a problem, when I do this:
fs.readdirSync('./Commands/Misc').forEach((file) => miscCmds += `${prefix}${file.slice(0, file.lastIndexOf('.'))}, `);
console.log(missCmds)
the bot send this: s!botinfo, s!botsuggestion, s!bugreport, s!invite, s!ping, s!support,
and I want the last , was removed :/
You could map all the commands into an array and .join(", ") it.
Or you could get the index and original array from .forEach and see if the last element has been reached.
@sudden geyser so sorry to bother you but I don't understand this
The restart((message, arsg) => {...}) bit is an example.
it cant ready args
I put .join(", ") where?
You'd need to map the strings to an array
e.g. .map instead of .forEach and no miscCmds += or ending ,
let files = ["what.js", "you.js", "know.js", "about.js", "rolling.js", "down.js", "in.js", "the.js", "deep.js"];
files.map((file) => `${prefix}${file.slice(...)}`); // This is an array of strings. Now you can call `.join(...)`
wait
files are this: fs.readdirSync('./Commands/Misc')
no?
yes
You may benefit from https://www.javascripttutorial.net/javascript-array-map/.
This tutorial shows you how to use the JavaScript Array map method to transform elements in an array based on a provided function.
May I ask how much experience you have with JavaScript?
Then your function named restart isnโt defined
no cause Klay said I should add that
I only know the basics
Except this restart thing hahahaha

Then you may want to spend more time learning via other sources.
I'm learning from here
It's not an efficient source of growth.
ah
ellooo
I figured it out now
I recommend you read https://developer.mozilla.org/en-US/docs/Web/JavaScript for an excellent source of resources to learn it.
JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat. JavaScript is a prototype-based, multi-paradigm, single-threade...
ty
I figured it out now ty tho

How do I get the text "Urushi" in the following HTML code using JavaScript?
<h1 itemprop="name"><b class="color-90">Urushi</b></h1>```
change of value name
Define an ID for the element, get the element by it's ID, append your value to it
๐คฆโโ๏ธ
Where did you even get that from
If you're scraping (there would be no way to add an ID), try js document.querySelector(`h1[itemprop="name"]`).innerText;
Only works if there's only one element
Unless there's multiple of them but you want the first one, that would also work
thanks
OwO
The typescipt compiler API is so annoying ๐ฉ
I'm just a noob, I didn't see any documents so I came here to ask

The facepalm was for somebody else who has deleted his message.
boiz how can i make it so that if a message is sent in a particular channel the bot dm's the person a message?
What lib
.js
You want to dm the author of a message in a particular channel, right?
my brain no work today
ye
Do you know the channel ID?
ye
i gave up and ended up just putting m name down
If you do, you can fetch the channel through its ID, check the channel id containing the message, and if they match, then you can dm the author of the message using message.author.send()
i did fetch the channel but it just dosent work ;-;
Are you getting an error?
no error ;-;
Are you actually checking if the ID matches
mmm wait let me retry
Assign a variable, like mychannel to the channel that you fetch, then see if mychannel.id matches the channel where the message is coming from
Iโve encountered a similar problem before
omigod it worked thx
Np
how can i advance to a exact second in a song using the dispatcher
what Discord.js version are you use and are you using @discordjs/voice
im using @discordjs/opus in v12
You can't seek using the Dispatcher. You have to re-call connection.play and pass in the seek option to the streamOptions https://discord.js.org/#/docs/main/stable/class/VoiceConnection?scrollTo=play
This would require you to restart the stream to the audio as well
thats what im using, but i want a command that jumps to a exact second of the video
I don't think you can since audio data is sent in chunks
depending on how large your stream buffer is, your precision may be off
while running my bot I got this error
TopGGAPIError [Top.GG API Error]: 403 Forbidden (You don't have access to this endpoint)
how to resolve this?
Oh but I did insert the token
#topgg-api would probably have people that know what to do for that error
Ohk ty lemme post it there then
which token? also show code
guild id or any id is a string or BigInt?
`${bigint}` /s
I am trying ts... just tell is it by default string or bigint
string
ok
thats a string yes
whats the code to get the total member count from every server?
javascript discord.js btw
Map your guild collection to the memberCount property https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=memberCount
Where can i find the migrating guide for discord.js v13?
is djs 13 even out yet?
unofficial on Master Branch
They have this guide preview,which i am searching for
migrating to a WIP is quite a risky move
You can take a look at this @earnest phoenix https://github.com/discordjs/guide/pull/680/commits
thx
If v13 get released then time will come where v7 API is deprecated by discord
still, many thing can change before official release
and deprecation doesnt mean it'll instantly stop working
that will be a pain to edit 400 files :C
laughs in intellij migration tools 
migration tools?,How does that work?
it detects deprecated methods and help you migrating to replacements
like, earlier JDA replaced sendMessage(<MessageEmbed>) with sendEmbeds(<MessageEmbed>...)
all I need to do is replace where it was used, and intellij grabs to me where they are
nice
On master rn sory for late
doesnt say
or i dont get it
@tired panther
You can just recieve them as webhooks
The Api as it own wont work
but doing a call on the Endpoint gives you some info
no i ean
mean
how do i even get the values from that
idk how to use json
do u have some course
here some examples of http requests:
no i mean
how do i use the api with that
yeah you fetch on the given link with a auth header
can u please show an example
i dont get it
sorry for being dumb @tired panther
ive never done anythign like this before
json
nvm got it
anyone here used express-rate-limit package before, need help with it
hey Tim u here
whats your problem
i keep getting this error : 0|index | Error: listen EADDRINUSE: address already in use :::9999
when trying to create my server
use a different port or end that one
how do i end it?"
@royal portal
example is
with node
var server = app.listen(9999);
server.close();
let e = require("../../database/models/simulator.js")
e.findOne({usuario: message.author.id}).then(async x => {
await x.update({
reencarnacion: 0
})
})
You know why I don't add the property to the DB?
but wouldnt that close the server im trying to use?
didnt you want to end it
but if it ends how will i use it after







