#development
1 messages · Page 1357 of 1
@little meteor 1.5.1
do you have intents?
if I am not wrong on that version you need to enable guild and members intents
nope
check the link
lemme check

hi how can i sent this file witch embed
try removing data, from setImage()
How do I deal with:
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
what did you do
uh
usually that happens when you .toString() an object
let requests = []
let pages = (await axios(`https://api.hypixel.net/skyblock/auctions`)).data.totalPages
for (i=0; i<pages; i++){
requests.push(axios(`https://api.hypixel.net/skyblock/auctions?page=${i}`))
}
let done = await Promise.all(requests)
console.log(done)
fs.writeFile('./request.txt', done)
You're pushing an object to the array
?
axios returns a Promise object
ok..........
actually no i got it wrong
@pale vessel imma head out explain em what this does
try console.log(done);
do you want to get the response
writeFile
Because the console can display the stuff inside it
(from axios)
fs takes a string
try removing
data,from setImage()
@pale vessel its not working
when it tries to convert it to a string the object Object occurs
fs takes string
wtf
@carmine summit do you think you'll write objects to a text file
@little meteor btw i cant use intents if my bot is in less than 100 servers?
You can
But after 100 servers you need verification to use them
oh ok
@carmine summit do you think you'll write objects to a text file
@earnest phoenix I made it to .json, it still outputs as [Object object]
?
the file extension can be anything but the data you WRITE to the file has to be string
the file can STORE objects in JSON but the JSON data you pass to fs to WRITE to the file must be JSON
so i have to make the object into a string
@carmine summit yes
JSON.stringify
Error: Converting circular structure to JSON
--> starting at object with constructor 'ClientRequest'
| property 'socket' -> object with constructor 'TLSSocket'
--- property '_httpMessage' closes the circle
@quartz kindle
Also, I want it so that it will push the auctions array,
So instead of
requests.push(axios(`https://api.hypixel.net/skyblock/auctions?page=${i}`))
I wanted something like:
let response = axios(`https://api.hypixel.net/skyblock/auctions?page=${i}`)
requests.push(response.data.auctions)
But it always returns undefined
@weak parrot
ads
when i pushed them into the array
because it is not await
and im not allowed to await it because it needs to be concurrent
you could make a promise object that awaits the request
but i still don't see where the undefined is
@coral trellis ads
someone will come eventually, i don't really recommend pinging multiple mods for this one ad 
@carmine summit map the responses to their data
since the resolved data is an array of axios responses
responses.map(x => x.data)
that would be an array of string
Once I hear the word map, me: Holy **** this is gonna be confusing
nahhh
after that you can just JSON.stringify() the mapped data and use fs to save it
#development message
so add done = done.map(x => x.data); after defining it and change done to JSON.stringify(data) in writeFile()
Wat
what
.map() return Array.
over there
.map()return Array.
@unkempt marsh yes
Things that make me scared:
- Export/Import
- Maps
- Collections
- Promises
- Mongoose
show code
wait
wait
let requests = []
let pages = (await axios(`https://api.hypixel.net/skyblock/auctions`)).data.totalPages
for (i=0; i<pages; i++){
requests.push(axios(`https://api.hypixel.net/skyblock/auctions?page=${i}`))
}
let done = await Promise.all(requests)
done = done.map(x => x.data.auctions);
console.log(done)
fs.writeFile('./request.json', JSON.stringify(done))
what does it show up as in console?
how do i like get cmds from commands/{folders}
like
i can make categories in my commands folder
so cmds folder can have moderation, utility, fun, etc
ewewe
so I have something like:
[
{
"Seller": "Guy A",
"Price": 4
}
{
"Seller": "Guy B",
"Price": 10
}
{
"Seller": "Guy C",
"Price": 3
}
]
```I wanted to get the lowest price, and return `Guy C` and `3`
I know how to do it but its gonna be long / bulky / spaghetti code
Just sort the array by it’s object property price
They return new array.first()
Or last... depending on sorting it ASC or DESC
Just sort the array by it’s object property price
@boreal iron How exctly can I do that
array.sort
map xd
map
sort and map
sort by price, map it by seller and price
you can even use reduce() and don't even need .map()
like array.reduce((x, y) => y.Price > x.Price ? y : x).Seller
wtf
the ? and : is gonna confuse someone

reduce is a bit more efficient than sort right
@carmine summit Easy example:
let test = [{seller: "Guy A",price: 4},{seller: "Guy B",price: 10},{seller: "Guy C",price: 3}];
test.sort(function(a, b)
{
if (a.price < b.price) return -1;
if (a.price > b.price) return 1;
return 0;
});
result => [ { seller: 'Guy C', price: 3 },
{ seller: 'Guy A', price: 4 },
{ seller: 'Guy B', price: 10 } ]```
Ternary operators are important to understand
yeah
fun to use tbh
annoying to figure out what a long variable is sometimes tho
poggers
test which is faster
wtf
the reduce should be faster because it doesnt have 2 if statements, only 1
Hi,
my bot project has 3 node programs, running on different vps. that is 1. the bot 2. the backend and 3. the website. I update the code to the servers via git.
is it ok to have all three programs in separate git repositories? or should i put it in the same repository? Make a branch per program? What is best practice in such a case?
@carmine summit Mines will return the <whole> sorted array. Sorting ASC in my example. test[0] will be the "smallest" val of obj.price
Project vs solution kinda?
different vps? I would use different repos, I can't say I know which is the best practice
especially since they have different functionalty
Right now, I have two seperare programs and they are in diffrent repos
For the one bot
But the major versions are always the same to make sure they work together.
test.sort((a,b) => a.price < b.price ? return -1 : return 1))
Honestly would have been easier to put them in one repo, and just consider them multiple projects in one solution
@carmine summit Nope, a.price and b.price can be equal, too
@carmine summit you can just use (a,b) => b.Price - a.Price

wut
test.sort(function(a, b) { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? -1 : 1)); });
test.sort((a, b) => { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? -1 : 1)); });
if they are equal just pick a random one
We don't pick an item, we sort the array
javascript is harder than i expected
Nah, just a lot of basic concepts
nah javascript is english but with .s and ()
it makes it easier to learn tho
I disagree with that opinion
I think it leads to more runtime and logic errors
especially for beginners
btw. just had one extra ) ... typo
from what I can tell the most issues people have are from not reading errors and just asking other people
Runtime errors are part of the fun
Runtime errors are part of the fun
@solemn latch Pure evil lol
from what I can tell the most issues people have are from not reading errors and just asking other people
@crimson vapor Types allow the compiler to warn you primitively before it becomes a runtime error So it doesn't crash and burn mid execution
@carmine summit u got it? array.sort((a, b) => { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? -1 : 1)); });
ok
even if i dont understand how it works
can be in DESC order also, switching -1 and 1
im kinda curious about this one tho (a,b) => b.Price - a.Price
Hi
ASC test.sort((a, b) => { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? -1 : 1)); });
DESC test.sort((a, b) => { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? 1 : -1)); });
thanks
I don't see a mention
wdym
An array of arrays?
super jagged
no thats not quite an array
2d array
it's not just 2d
im very well confused on how it
it's 6d
ended up ther
how is it 6d?
An array of arrays?
Would be [[], [], []]
good luck conceptualizing that jagged array
how do you make a 3d array?
With blender
[],[],[]
LMAO
welcome to JS where associative arrays doesn't exist
ok
tim lmao
just bc it's trash
why do you hate JS lmao @boreal iron
Associative arrays are basically objects
aye, but not associative arrays
whats the issue lol
?
Does it log "webhook runnibg at..."?
instead of doing
js for(...) { result = await axios(...) ... }you do something like this ```js
let requests = [];
for(...) {
requests.push(axios(...))
}
let done = await Promise.all(requests)
...
@quartz kindle This.... Is not concurrent I think.
@quartz kindle yes
yes
It is concurrent
it spent the same time
isn't it supposed to say 0.0.0.0?
as if it were not concurrent
oh nvh
9 seconds
thats hardcoded
0.0.0.0 is hard-coded too
no that won't change anything since I didn't realize you had it hardcoded
@crimson vapor its my vps
:/
@carmine summit do axios(...).then(r => {console.log(i); return r})
Where i is the number the for loop is increasing
You should see the differencr in how they load in the logs
Is the port 2727 allowed through your firewall @latent ocean
Is there someone in charge
Is there someone in charge
@earnest phoenix what
yes and no
IDK
@delicate shore what version of d.js are you on?
12
12 dot what?
@solemn latch NO ERROR
I was talking about pgamers error
Did you let 2727 through your vps's firewall @latent ocean
12 dot what?
@quartz kindle
Idk I can't login to my vps
But I remember installing discord.js yesterday as I shifted my bot on new vps
just eval it
What command caused the error? Jail?
my intel xeon is ultrafast
Im Bots Server Add Dm Please ?
Wat
lol
lmao... I'm tree - water me please
He's a bots server? omg it's the singularity the bots are finally awake!
Quick, call John Connor!
Call john cena
I don't get the joke
What command caused the error? Jail?
@quartz kindle
Every command
pls explain
vine memes incoming
None of the command except help is working
@crimson vapor go watch Terminator.
@delicate shore do all commands send an embed? Do all embeds set an image or author avatar?
oh that makes sense
its open
Ban command which is without embed is working
All commands without embed and images are working
did cdn.discordapp.com finally go away?
Huh
Your embeds are trying to set an invalid image
Wait what
@solemn latch its open
No cdn.discordapp wont go away
It was working today morning
Suddenly how ?
Did they change something in intents
Like getting user of
Pfp*
Is it an privileged intent now ?
nah pfp should be static unless you are fetching a user
No, but if youre trying to get a user from the cache it might not be cached anymore
I don't get it
Show your embed code
is it on github?
ok
Windows vps ah
@boreal iron So what happens is, If it has the same price, It turns into an array,
Spooky stuff
[[[][][]][][]]
is windows server more efficient in ram than windows 10?
because I could not imagine running a vps on windows
Most sites restrict windows vps's to 4GB+ just for windows
Crazy ram usage still afaik
let member = msg.mentions.members.first() || msg.member,
user = member.user;
let avatar = user.displayAvatarURL({ dynamic: false, format: "png" });
let image = await canvacord.Canvas.jail(avatar);
let attachment = new Discord.MessageAttachment(image, "jail.png");
return msg.channel.send(attachment);```
my code
for jail command
Gimme a second, Cwickks
@delicate shore console.log avatar
my bot went off

Lel
ye
No pls canvacord is easy
so is canvas
Isnt canvacord based on canvas anyway?
yeah, but still
imo its better to create your own functions
unless they need to be heavily optimized
Sure just make a discord bot without a wrapper
Sure just make a discord bot without a wrapper
@solemn latch easy ngl
But mostly no one does it
I was trying to get a canvas function to rotate an image pi/2 radians and I could not figure it out
tbh
so I see why people don't like canvas
@carmine summit
let array = [{seller: "Guy A",price: 4},{seller: "Guy B",price: 10},{seller: "Guy C",price: 3},{seller: "Guy D",price: 10}];
array.sort(function(a, b) { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? -1 : 1)); });```
It doesn't add priceses `10` to an array
Result is
```js
[ { seller: 'Guy C', price: 3 },
{ seller: 'Guy A', price: 4 },
{ seller: 'Guy B', price: 10 },
{ seller: 'Guy D', price: 10 } ]```
why isnt this working
my goodness you're still on about this
missing )
))
Your missing a )
oh
Lmao

did vsc not get mad at you for that?
Okay too many cooks, ima actually do work
I forget a semicolon and vsc kills me
@carmine summit It sort the array array
not more, not less, ASC or DESC as u like to
Im confused on what changes you have made
no change
i've been trying to get the ping for the mongodb, but i can't really figure out the right way. i tried this but it would only return it's status
mongoose.connection.db.admin().ping
would return { ok: 1}. Is there something that i'm missing? 
just copied my message I sent u 10 mins ago
you are using mongoose?
yes
yeah and the first one found in your original array, will be on top of the sorted array
like in my example, both have a price of 10, will be at the end of the array (DESC)
u probably didn't send the correct array/obj pattern to me, hmm?
i've been trying to get the ping for the mongodb, but i can't really figure out the right way. i tried this but it would only return it's status
mongoose.connection.db.admin().pingwould return
{ ok: 1}. Is there something that i'm missing?
Any help would be appreciated. thanks
Hmmm
its likely that all it shows is the status
I could not find the docs on admin().ping
I dont think there is a built in way to get ping, but you can easily measure it yourself
most people just measure the time it takes to do a findOne() iirc
Yes define somthing as Date.now() then ping the service with an await then subtract
Ah got it. will try 
iirc you need to use microseconds because ms is too big
but it really depends on how you have your db setup
Microseconds....
@carmine summit Send me an example of the array ure using for real instead of a placeholder and tell me what's wrong again
Lmao
Lmao
about what?
Microseconds is a bit smaller than a milisecond
yes
yeah but date.now only does 1ms so if your db takes 1.5 ms it will either round up to 2 or down to 1, which isnt really representing much
that would be like 1.5 seconds might be 1 sec might be 2 sec
but ik what you mean
How do I say which servers is the bot in? All the servers it's in!
what do you mean ^
Use floating numbers to represent then
To say which servers it is in
well what language, lib, and intents
I speak Romanian but I use translation on google
How would I check if a user (fetched from a specific ID) shares a server with my bot without using the user cache?
(discord.js, no intents)
yeah but date.now only does 1ms so if your db takes 1.5 ms it will either round up to 2 or down to 1, which isnt really representing much
Assuming he tried to say, useperformance.now()instead ofdate.now()
token
perhaps. I'm not keeping up with the convo
no I was backwards
401 usually means the Authentication header is incorrect
yeah and I was backwards thinking that was the password in dbl settings that was wrong
but that would make no sense
How do I see how many members the server has? $?????
@late scaffold you're not specifying what library you're using
How do I see how many members the server has? $?????
@late scaffold privileged intents
since this month
thats dumb
broke a lotta bots
I'm use discord. Bot list
I have bot on dbl
iirc its message.guild.memberCount
Google Translate is weak with this one
yeah lol
anyone know how to make a discord bot on scratch?
uh
huehue
simply use a JS websocket
simply manage ur actions based on the response (OP Codes)
that's it already
simply 
well it's easy but of course a few lines more code than just including a library
could show u an example
could show u an example
@boreal iron made one already
it's not hard at all, yes
just cba to maintain it
just cba to maintain it
Errr... no? Nothing u need to edit due a lib update or anything related
no thanks
imagine
good for you, you do you
using a scratch user to host your discord bot
"oh, i do this, you should too, it's not hard at all"
huh
I'm just anwsering the question
anyone know how to make a discord bot on scratch?
does anyone have a project that already has the code written?
idc what ever u do or how, just saying, yes it's possible and very easy and easy to maintain, instead of a lib
does anyone have a project that already has the code written?
Can show an example if u like to
which ide is that?
dude
spooky highlighting
The Discord docs will explain how to deal with OPcodes and the responses at all
i thought million meant that "scratch "
no I did
oh lmao
lel still notepad++
it's good
always used vsc
aye it's just pure hardcore
it's not that bad
not much difference then coding with the Windows editor but works well
i use the portable one
i thought million meant that "scratch "
May I missunderstood him, thought he meant building a bot from scratch (without a lib)
it's not that bad
Aye it's good enough, comes will a hella lot of settings, but the default mode is just... eww like the Windows editor, purly nothing
i'm used to it
i never used vsc for coding
i literally only used npp
some people were mad at me for that
but eh
¯_(ツ)_/¯
and npp's verbose backup is cool
aye, made fun me, too, but I wanna say it's for experienced coders, just like hardcore :P
i'm used to using command line
and npp's verbose backup is cool
aye
idk why people care about what editor others use
does anyone know
how do i get the event for when a reaction is added to a bot message? message.awaitReactions wont work and if i wanna use the "messageReactionAdd" event how do i get it work only for that particular message with a timeout?
?
i wanna trigger an event when user reacts to my bot replies
message.awaitReactions wont work
why not
idk why people care about what editor others use
hmm I'm with u
but for some reason its not triggering the events
message.awaitReactions wont work on a bot message
yeah
hang on
const filter = (reaction, user) => {
console.log(user.bot)
return ['👍', '👎'].includes(reaction.emoji.name) && (!user.bot);
};
message.channel.send("hello").then(message => {
message.react('👍').then(r => {
message.react('👎');
});
})```
so this part
sends the message and adds the reaction
this is my "bot sent message"
now when i react to this
its not getting triggered on message.waitReactions
with await
.then(collected => {
const reaction = collected.first();
console.log("INSIDE REACTION")
if (reaction.emoji.name === '👍') {
message.reply('you reacted with a thumbs up.');
}
else {
message.reply('you reacted with a thumbs down.');
}
})
.catch(collected => {
console.log(`After a minute, only ${collected.size} out of 4 reacted.`);
message.reply('you didn\'t react with neither a thumbs up, nor a thumbs down.');
});```
this never triggers if i react on a bot sent message
also, you should change message to something else
maybe sentMessage
since it will only confuse you with the original message
yeah you can ignore the first part. all i need is the second part where i get the reactions on a bot message
sent message?
how i do status to bot?
can we like get on a voice channel or something?
yeah?
activity: {
name: `s`,
},
});``` @earnest phoenix you can do something like this
sure
im joining the general
vc
thank you
oh, nah i can't do vcs
you should simplify your code first
yeah i know
there's a lot of unnecessary code that you can clean up
but for now im trying to get it work
yep
all i want it to do for now is when i react to a bot message
it needs to trigger
the event
so basically INSIDE REACTION never goes inside the console?
yeah
why it don't find???
because client is never defined
@earnest phoenix you need to first const client = Discord.Client()
ok
and the example doesn't work anyways
new
@pale vessel that would be easier if i shared my screen and showed you
and now?
client = new Discord.Client() iirc
right
the message events are triggered properly
non bot devs can't stream
Didn't we agree glitch was a bad place to host bots?
can't tell you since I use object desctuctoring
You aren't streaming?
I might be wrong but are you supposed to include the await before message.awaitReactions
@crystal wigeon
Dont see the [LIVE]
how to change the name of voice channel?
haha
client = new Discord.Client() iirc
@crimson vapor i need do it?
can i share my server link here?
nope
okay lemme share some screen shots
Can we make group variables like I make on type of group and it has all the values of which I type in it?
Python
what are you trying to do
ok
I am basically making a fitness bot rn
now? (and ping me)
im not sure
im not sure
@crimson vapor ok
@earnest phoenix dude, require discord
ignore most of the code part for now i'll clean up later
can you put your code inside https://hasteb.in ?
but basically, when i react to the "thumbs up" on the bot
it doesnt trigger anything
@earnest phoenix dude, require discord
@hollow sedge oh
but when i react to a user message
thats when
it triggers
but not when reacted to a bot message
that's from the messageReactionAdd event
the fuck?
That's required if u don't include the status.js in a different location where require discord is defined already
That's required if u don't include the
status.jsin a different location whererequire discordis defined already
@boreal iron sure?
also, you didn't put the message.awaitReactions() inside the .then()
@earnest phoenix why are you putting them on the same line?
so it's listening for reactions for the original message
@hollow sedge no same line?
Ah
which is your message
yes
<#development message> yes, same line
that makes sense
you can remove the await too, you're using .then() (for awaitReactions())
@earnest phoenix idk ur code, if u just include the status.js inside an index.js for example and included Discord.js already, no u don't need to include the lib again
@boreal iron tank you
OH MON DIEU!!! LA MAMIE DE PANINI A ETE TROUVEE!!!! BLOQUAGE EN COURT!!!!
:x: | Vous devez mentionner un utilisateur
so what should i do here?
ah yes french?
do i move the message outside?
but running the status.js as standalone file, u will have to require the lib again if u wanna access it, of course
nah
you put the whole awaitReactions() code inside the send().then(message => { here })
Ahh
again, i recommend changing message to another variable since you'll get confused with the original message
it's a good practice
:x: | Vous devez mentionner un utilisateur
that worked!!
wait
it worked haha
i had been scratch my head for 6 hours
?
"why is this shit not working" 😂
"why is this shit not working" 😂
@crystal wigeon idk!
@pale vessel thanks a lot mate!
LOL
❤️ flaze
@earnest phoenix dude, u need to include discord.js >>>>>>>>> B E F O R E <<<<<<<<<< USING IT
all good mate
i want fuck glitch
@earnest phoenix dude, u need to include
discord.jsB E F O R E USING IT
@boreal iron ok
mega hunter watch some tutorials 😂 @earnest phoenix
or just somene pasting an error
Does this look good
@kindred river
looks decent
@kindred river yes
this fuck
it might look funky once you start adding commands though
A
it might look funky once you start adding commands though
@pale vessel i do have them.
what are you trying to do @earnest phoenix
now Fake want kill me
they seem to be separating them into different help commands
@kindred river I would use fields with the command as title and the description as value
^
oh okay
if that is a command why are you creating a new client
@crimson vapor
what are you trying to do @earnest phoenix
@crimson vapor idk \
i want status to my bot
is it a command
and this not work
and what does it do?
@kindred river I would use fields with the
commandas title and the description as value
@boreal iron you could do that, but keep in mind that there's a limit of 25 fields
i want do status to my bot
if a message has been deleted, is there any way i can get it back?
who can help me
depends on what language and librar you're using
im not sure how you are planning to accomplish what you are doing
@hollow sedge aye but looks better especially on mobile
@boreal iron embeds look trash on android either way
@earnest phoenix perhaps you should learn the basics of javascript first
😦

@sonic lodge i dont have power
any ideas?
you don't need power to learn something
ok
you need DETERMINATION
who hear Hadar Hashuh?
@hollow sedge but however, since there's a larger line-spacing between title -> value and title again, it looks a little better in my opinion
doesn't mean ur opinion is the same
@hollow sedge but however, since there's a larger line-spacing between title -> value and title again, it looks a little better in my opinion
@boreal iron yeah, i agree with you
dude, that's #development not #general @earnest phoenix
Guys, here is my mod help
cool
</>
Use code tags for example on the commands
^
+hackban description looks better in my option
?
definitely
oh yh
ban someone not on the server?
if you separated them using fields, you wouldnt have to do that
Easier to see the difference between cmd and description
you could just put the command name in the title
ok
we're not gonna talk about how someone has the power to ban someone they don't know
anyone have any ideas about my question?
still learning 😂
Anyone knows how to group a bunch of variables under a same name?
Language - Python
I just started code
@kindred river U can use markdown like in Discord
you cant, sloth
yh
Anyone knows how to group a bunch of variables under a same name?
Language - Python
@sick fable search up lists
For embded and messages etc.
wut?
My age is 17 so yh
@kindred river lmao mine is 13.8 yo
I am learning coding very late
Those teachers taught me html. Still dumb in that shit
you cant define two different things with the same name
async def on_ready():
#starting the loop
status_change.start()
#changing the status of the bot and activity
await client.change_presence(status= discord.Status.online,activity=discord.Game("BEING CODED BY A GOD"))
print ('the bot is online')
(this for status?)
?
anything?
no one said html was a coding language O_O
you're coding in javascript and that's python
lol
anyone have any ideas about my question?
@digital ibex which?
the actual status object needs a type
ok
can't see
my homie pls learn javascript
what happened to OOPLED
if i can get a message after its been deleted @pale vessel
@sonic lodge give me video
lol it's a long story
@kindred river lmao mine is 13.8 yo
@sick fable o
in eabrw
There are a few activitiy types u can select: https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
3 WACTHING
@earnest phoenix https://www.youtube.com/watch?v=DLzxrzFCyOs
@digital ibex i know what is
you liar
?
its a javascript beginner crash course
if i can get a message after its been deleted @pale vessel
@digital ibex probably not
you can only catch it being deleted, which i don't think is what you want
hello
INTERACTIONS ENDPOINT URL
You can optionally configure an interactions endpoint to receive interactions via HTTP POSTs rather than over Gateway with a bot user.
what does this mean?
members can directly trigger your endpoint without going through discord's gateway
i guess
An endpoint u can define
your api endpoint, just anything
nah
Like an endpoint u can set up for the DBL webhook
where does that show up?
@sharp thicket through a POST request
when ever ur endpoint been requested, check if( isset( $_POST['what_ever_the_field_is'] ) ) ...
sry PHP flashback
how i do status to bot?
when they mention about it in #site-status
how i do status to bot?
Your question got answered already
What would be the best way to get ranks from a database and sort them into a leaderboard embed?
u mean a connector like mariadb (for example)?
I'm using sequelize
how to make a non caps sensitive string in javascript?
string.toLowerCase() == "lower string"
if(command == 'shutdown') { //shutdown
if(!message.member.hasPermission('ADMINISTRATOR')) {return message.reply('This command can only be used by admins!')}
else {
console.log(`Shutdown initiated by ${PersonWritingCommand.tag}. Terminating bot.`)
message.channel.send(`Shutdown initiated by <@${PersonWritingCommand.id}>. Terminating in 5 seconds...`)
const serverGuild = message.member.guild
const CHANNEL = serverGuild.channels.cache.find(x => x.name === "log")
if(!CHANNEL) {return}
const shutdownEmbed = new Discord.MessageEmbed()
.setColor('1AE5C3')
.setAuthor(`${PersonWritingCommand.tag}`, PersonWritingCommand.displayAvatarURL())
.setThumbnail(PersonWritingCommand.displayAvatarURL())
.setTitle('A Shutdown was Initiated!')
.setDescription(`A Shutdown was Initiated by <@${PersonWritingCommand.id}> in ${message.channel}!`)
.setField('')
await CHANNEL.send({embed:shutdownEmbed})
setTimeout(() => {
client.destroy()}, 5000)
}
}
``` this is probably inefficient but it works for my purposes so whatever. I'm having a problem all of a sudden (I didn't change any of the code in this section) where it says (node:2712) UnhandledPromiseRejectionWarning: TypeError: (intermediate value).setColor(...).setAuthor(...).setThumbnail(...).setTitle(...).setDescription(...).setField is not a function
EDIT: Found the issue, had a blank field in .setField(' ')
duh
how to make a non caps sensitive string in javascript?
@dreamy thistle
refeared to for example use !HELP !hElP !hElp
string.toLowerCase() == "!help"
quoting myself
thank you
Anyone know how to make a bot page backround just 1 color?
talking about the description?
The entire page
huh... nah u can style the description only afaik
Then how do people-
you can style the whole page
You can style the whole page
huh
ctrl shift c and find the selectors that you need
u should have told me that earlier
You're just not allowed to remove: ads, navigation elements, and important buttons/info (like the report button)
you need basic html and css knowledge though
what is importain RAM/CORE ?
for bot vps
both
depends on how optimized your code is
Yeah I just want to change the colors
so for example 2ram 2 core is good ?
and what language you use
or 1 ram 4 core
2gb?
ye
for just a discord bot yes
1gb is enough if you have a small bot
but it will grow up
unless your bot uses more than 1 shard
so ram is not importain for new bots ?
well it depends on your code but for mine, no
You can style the whole page
lol u really can, thanks for the tip
why didn't I discover that earlier lel
@pale vessel that's ur fault u didn't tell me that! shame on u
sorry my man

@weak parrot #details div.longdescription can't be changed, hmm? the theme overwrites my value
speaking about a background-color
!important
lmao ik
the theme overwrites my value
@slender thistle Test it yourself #details div.longdescription { background-color: #ffff00 !important; }
Man can I enjoy my Arma 3 time
haha lol... King of the Hill?
@boreal iron try to edit .longdescription .content
And nah I'm more into milsim
KOTH can go kiss my fifth place atm. Maybe someday

try to edit
.longdescription .content
nope, still being overwritten by the theme
tried any element already
hmm probably a browser issue
gonna clear the cache and test again later
aye... working now, my bad I forgot to clean the cache
@slender thistle sorry 4 ping but is arma good? i have 2 on steam but never played it
#general
i didn't see mb
Well since I'm not using a library I'm gonna replace the Others a element with No library
Hopefully that should break any rules...
how to fetch the status of a user?
of a single user , I mean if online or offline
the user is a bot xD
then client.user.presence.activities[0].status iirc (i assume u on js since u didnt say which)
djs speficically
djs yes
then client.user.presence.activities[0].status iirc (i assume u on js since u didnt say which)
@restive furnace I mean , my beta bot will fetch the status if online or offline for the alpha bot and then will send a message if the alpha bot is offline
[Visual Studio Code] In vscode/, I have my launch.json script. Running my app works as expected, but re-running my app keeps the output from the last session in the integrated terminal. How could I clear the terminal beforehand?
@restive furnace any idea? or do u need for that process intent
track presence updates
const users = await Users.findAll();
await users.forEach(u => userList.set(u.user_id, { osu_name: u.osu_name, rank: u.std_rank }));
console.log(userList);
message.channel.send(
userList.sort((a, b) => b.rank - a.rank)
.first(10)
.map((user, position) => `${position + 1} ${user.osu_name}: ${user.rank}`)
.join('\n'),
{ code: true },
);
Anyone got an idea why it isn't sorting?
What isn't working about it.
It's correctly sorted if those are the only two entries.
If you want it ascending, swap b.rank - a.rank for a.rank - b.rank
np
Now to turn it into an embed and dress it up lol
let botself = message.guild.members.fetch('735147814878969968');
botself.presence.status```
will this work?
Did you try it?
If you try it, you should get an error like Cannot read property X of Y because .fetch(...) returns a promise.
let botself = client.guilds.cache.get("734707332163829780").members.cache.get('735147814878969968');
botself.presence.status
``` made this ==> giving a error : Cannot read property 'presence' of undefined
@sudden geyser
the member wasn't found in the cache
do you need server members intent for .fetch()?
members.fetch() fetches all members from the server, so yes
you can specify a query which doesn't need the intent
make sure you're using Node.js v12
@sudden geyser i need to change it in packaje?
u forgot
no
}catch (error){
go to package.json and change the Node.js engine browser
Meister it's a library's source code.
You need Node.js v12 to use Discord.js
You need Node.js v12 to use Discord.js
@sudden geyser yes
}catch (error){
@tired panther had one day ago the same problem , in my bot.js file
how can i find the last hello word of 1024 length.
"name": "Reva",
"version": "3.0.0",
"description": "-_-",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"canvas": "^1.6.10",
"discord.js": "^12.4.0",
"ascii-table": "0.0.9",
"discord.js-musicbot-addon": "^1.10.3",
"moment-timezone": "^0.5.31",
"math-expression-evaluator": "^1.2.17",
"google-translate-api": "^2.3.0",
"discord-anti-spam": "^1.1.2",
"express": "^4.16.3",
"simple-youtube-api": "^5.2.1",
"finalhandler": "^1.1.1",
"fortnite": "^3.0.0",
"ytdl-core": "^0.20.2",
"fs": "^0.0.2",
"get-youtube-id": "^1.0.0",
"superagent": "^3.8.3",
"jimp": "^0.2.28",
"moment": "^2.22.1",
"ms": "^2.1.1",
"node-opus": "^0.2.7",
"opusscript": "0.0.6",
"python": "0.0.4",
"request": "^2.85.0",
"great": "^0.0.4",
"router": "^1.3.2",
"snekfetch": "^3.6.4",
"sqlite": "^2.9.1",
"youtube-info": "^1.2.0",
"js-beautify": "^1.13.0",
"node-cmd": "^3.0.0",
"util": "^0.12.3",
"common-tags": "^1.8.0",
"mongoose": "^5.9.25"
},
"engines": {
"node": "8.x"
}
}```@tired panther
I use this package
xD
@tired panther what i need to change ?
show me client.js
How is Python a dependency
@tired panther i don't have a file by client.js
#development message is this error coming again?
@tired panther yup
engines": {
"node": "8.x"
}
} ur node version is to old
it must be higher then 10
@solemn jolt
@tired panther i need change to 11?
how can i find the last hello word of 1024 length.
@earnest phoenix
var string = "what the fuck am I doing here, hello?";
var idx = string.lastIndexOf("hello"); ```
Will return the posititon `hello` starts
@solemn jolt no problem
I didn't mean it.
@boreal iron
var string = "ahah xjxjx qlkl d hello kasdksk";
like
not the last word in the paragraph.
wut?
var string = "what the fuck am I doing here, hello?";
var idx = string.lastIndexOf("hello"); ```
Will return the posititon `hello` starts
@boreal iron U could use regex
or split it
you want the last hello within 1024 length?


