#development
1 messages · Page 1640 of 1
Webhooks are apparently not affected by your bot's ratelimits
At least that's what I experienced yesterday
So did your bot's uptime got reset when it restarted? Or any sort of data that it was holding when up.
I think so.
My bot got 429 ratelimited, so I had to shut it down completely and wait an hour
Ah okayy, was there any message warning in console? (Assuming you have logging enabled)
if you enable the debug event you see for how long you are locked out
How to get a free website hosting with the domain? Bruh, I know idiot question but a lot of people get websites for their bots, so I just wonder
also there is a event for ratelimiting
that depends on how your lib handles it
A bunch of ratelimits which were hit on /channel/message and a bunch of 429 ratelimits, idk actually what caused it. Should've investigated further but I didnt
I use discord.py
const Discord = require('discord.js');
const db = require('quick.db')
const { defaultPrefix, deletionTimeout, reactionError, suggestionPending, suggestionApprove, suggestionDecline } = require('../../config.json');
module.exports = async (client, oldMessage, newMessage) => {
if (oldMessage.content === newMessage.content) return;
const logsmessageupdate = oldMessage.guild.channels.cache.find(channel => channel.name === 'suggestion')
if (!logsmessageupdate) return;
console.log(oldMessage)
const embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setTitle(`Un message a été modifié !`)
.addField(`Membre :`, `${oldMessage.user}`)
.addField(`Ancien message :`, `${oldMessage}`)
.addField(`Nouveau message :`, `${newMessage}`)
.addField(`Channel :`, `<#${oldMessage.channel.id}>`)
.setTimestamp();
logsmessageupdate.send(embed)
}
Hey, my event messageupdate.js has a lot of errors:
- the oldMessage is null and oldMessage.user is null too 😦
some domains are free, and free web hosts are googleable
Thank you
possible that the old message is not cached or an partial
Yeah it has happened to me before although the prime suspect was replit so i change my host to a better one.
changed*
my index.js have this: const client = new Discord.Client({ partials: ['MESSAGE', 'REACTION'] });
I delete partials?
you probably want to use them right?
partials only return the id nothing more, if you want to get the message you have to fetch it, but since it gets edited idk if its possible
but why others bots can? O_O
so its possible
but I don't understand their events
Its not the same like me
can somebody design good landing page or have some tips
d.js does some stuff in a weird way, other libs /languages do it different, possible that this also helps with this
so I can test to delete partials?
its your bot lol
❤️
can you tell me something about the library
Which library?
detritus? i can be the prophet if you wish(though im kinda busy irl rn)
Erwin too busy to preach about detritus? Preposterous
yes i just want to know the main features of the lib
WHAT, YOU ARE BUSY TO SIMP DERIUS
tf, never seen that in 15 years
hey no sore
(node:21066) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'content' of undefined
const Discord = require('discord.js');
const db = require('quick.db')
const { defaultPrefix, deletionTimeout, reactionError, suggestionPending, suggestionApprove, suggestionDecline } = require('../../config.json');
module.exports = async (client, message, oldMessage, newMessage) => {
console.log(oldMessage)
if (oldMessage.content === newMessage.content) return;
const logsmessageupdate = message.guild.channels.cache.find(channel => channel.name === 'suggestion')
if (!logsmessageupdate) return;
const embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setTitle(`Un message a été modifié !`)
.addField(`Membre :`, `<@${newMessage.id}>`)
.addField(`Ancien message :`, `${oldMessage.content}`)
.addField(`Nouveau message :`, `${newMessage.content}`)
.addField(`Channel :`, `<#${oldMessage.channel.id}>`)
.setTimestamp();
logsmessageupdate.send(embed)
}
I do what? 😦
line?
if (oldMessage.content === newMessage.content) return;
wait, if there is no change then how will there be a new and an old message?
remove that line
(node:21617) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
at line ```js
.addField(Membre :, <@${newMessage.id}>)
umm
newMessage is not defined
why did you add message back
i already explained to you how that part works
you just broke it now lol
everything, it every sense of the word i categorize it better than d.js
specially the commandClient
this is one example, but, you probably have a command handler for commands and the sort. probably implemented ratelimit, cooldown and some extra stuff right? Well, detritus has that out of the gate, with literally everything you can as for
check the commandOptions https://cdn.discordapp.com/attachments/272764566411149314/818351864910970900/unknown.png
https://cdn.discordapp.com/attachments/272764566411149314/818351915263066152/unknown.png
reloading commands? pff trivial
yes because with my script I have 3 errors, with your explications I have 17 errors
O_O
omega lul
instead of the old crappy ```ts
fs.scandir('./commands').foreach(command => const cmd = require(command))
its cleaner
its better
its faster
and it uses less ram
the ONLY reason you wouldnt want to use detritus is if you dislike typescript
that doesnt mean anything
since its made to be used with typescript mainly
do you have to change stuff like members.cache.get
you can have 1 error that prevents the rest of the code from running, so you only ever see one error because the others are never even reached
you could say its amost to the point where you'd change from v11 d.js to v12
its minor things that change
once you fix that error, and multiple more errors appear, then you know that part is finally working
who is the owner of the lib? you?
no, cake
why would there exist multiple methods for reading a directory from fs. fs.scandir, fs.readdir, fs.readdirSync, fs.promises.*
fs.readdir* and fs.promises.* makes sense, but why would scandir exist
i do provide feedback and questions, but im not a contributor of the project
i simply advertise it because of how good it is
ah, so can u explain me but better? I'm french and the english is not my better language
dafuq is scandir
okay i will check it
to put into context
let me write a big thing so i can copy paste for the future
one sec
okay lol
readdir?
btw my custom command bot is working fluent .I have fixed the bugs 😏
@quartz kindle O_O
i already explained how function parameters work
if you add message there, then message is oldMessage, and oldMessage is newMessage, and newMessage is undefined
so adding message there just makes everything worse, doesnt fix anything
Okay I deleted, now I test
yes ik djs
this is for detritus
what things change if i change from djs to detritus?
how is the resource usage of it?
commandClient is like a cluster, so instead of calling it directly, its within the shard that you would have your normal cline
oh
same bot
legit same bot
not a single difference
just ported
same bot in my status
wtf?
unliked d.js shitty design, you can customise caching
ayo what?
Error: MessageEmbed field values may not be empty.
My value: ${oldMessage}
d.js is retarded, and im not exaggerating
now its oldMessage undefined
tim can probably tell you the same
@quartz kindle feel free to call me out if im talking bullshit
d.js , on the docs themselves
tell you not to use this on -1 since it'll lead to massive edit backlogs
yet this is the default they use
its literally in the description
not only this, presence is cached automatically
and a lot of other useless shit
d.js is an unoptimised bulked lib for users that dont know much about development
scandir was what Erwin wrote. Usually, he knows what he's talking about, so I figured that was a real thing I must have overlooked
its made for small bots
they removed the message edit thing in master already after being called out on it
xd
exdi
thats the thing, partials, edits, presences, no cache customizable, its all shit
the more you look, the worse it gets
What was that about?
detritus supports and fixes all that out of the gate
wait, so if i start using detritus my bot will go wonders?
discord.js would cache message edits to infinity
How-
if you edit a message 500 times, you have 500 copies of it in the cache
amazing
not only that, presences are still cached
Is this correct?
message.author.flags```
LMFAO oh my god
d.js is made for small devs who dont give 2 shits about performance
it'll drink your ram faster than i drink vodka
I'm glad to be using a framework that doesn't have weird crap in it <3
and thats saying seomthing
For getting user badges like hypesquad or nitro badges
you can't get nitro/boosting flags
what, so if my bot is in 500 servers and if the message get edited like 4000000 messages per second, so it will cache all of them?!
oh no
No man.I mean in user info command the bot will tell how many badges the user has
same bot, mind you
just ported
no extra features
no extra fancy design
nothing
literally the same bot ran after a week uptime
its the 5th time in past 12 hours i am seeing that image from you -.-
that's what I said, it won't be accurate
i know, im annoying
Ohok
dont mind me, im a cultist
tell something new
Lmao every time I go to this channel I see that screenshot
i could screenshot it now
its just handy
cuz its on the detritus server
and nobody talks much there
no u are you only give good criteria
discord.js doesnt give you any control
not only that, the small control they give by default is shit
if you can control the lib, you can control the resources
discord.js is like apple
very expensive?
"it just works"
company*
breh, i am an apple using for past 7 years ;-;
it works™️
detritus is changing operating systems
people getting too annoyed already
going from mac to linux
i wonder what would happen if I started using it
does it support slash?
the world would explode
COOL
but the way you would do in d.js and detritus is the same
detritus exposes an api/gateway
so its really not that much to port
for slash you do not need any lib ,you only have to use the api endpoint
but anyway, i'll stop talking about our lord and saviour detritus before people start calling me JesusMan
ok JesusMan
@river panther detritus-client
detritus server when
"detritus-client": "^0.13.0",
"detritus-client-rest": "^0.9.4",
"detritus-client-socket": "^0.7.2",
"detritus-rest": "^0.7.0",
these are the ones i have installed
@slender thistle no u 
hmm
im the Jeovah Witness of detritus
i'll randomly show up on your door, uncalled for, and will start talking about our lord and saviour
i think I’m getting it
therefore we must save those sheep
looks interesting, but idk how some of the stuff i use will work with it.
does it support voice
you can use whatever entry point you want, that part is still .js
unrelated to the lib
i think it does, im not sure
ok pog I’ll play about
ask in their server, the devs are super nice
specially cuz its small, its cozy af
so you can just talk directly to them

Has anyone suggested actually describing stuff in their docs?
do i start with
const discord = require('detritus-client")
ok
ooh ts
Can one have typing from a TS package in a JS project?
Rather, would IDEs allow that?
wirus
sadly erwin where a few days to late with detritus, i will probably switch to C# entirely
How do i make a file into a rar file?
the commandClient just by itself is something worth praising
is it worth a try?
definitively
im usually the guy ranting about how shit things are
specially datatabses
yea but i will recode the bot anyways, why should i take a extra step in js before switching to C#?
How do i make a file into a rar file?
you're comparing langs, in that regard, c# should have better management with memory
why would you do that?
though, idk what C# libs will offer you in terms of functionality
detritus offers a great deal of shipped out functions
like the command client
use something like 7-zip to pack it to a rar file, if you use linux you can use buildin commands
ratelimits, cooldown, owner, aliases, everything that you would find that you normally would have to code, its shipped out internally
they are quite decent, also C# is a bit more resource efficent than JS
what’s the shite ones
yeah thats what i mean
c# would likely be more mem efficient
but idk any lib in C#, so i cant make the comparison
everything that isnt cassandra, redis or postgres 
for example super
got it
i probably will use dsharp plus
i posted before, but idk if you seen it
take a look at how much stuff its offered off the boo with the commandClient
those are options just for the commands
theres also options for the hanlder itself
wait, so like, in discord.js we do
const bot = new Discord.Client()
in detritus is it
const { CommandClient } = require('detritus-client');
dsharpplus is quite nice, also offers way more stuff than d.js
thats what i meant, i cant comment on c# since i havent used it
i can safely compare d.js and detritus since i used both
i havent touched eris, so i usually holdback on that too
thats just requiring, you need a new client too
but thats still JS
oh yes
use import instead
oh, ok ok
https://dsharpplus.github.io/api/DSharpPlus.CommandsNext.Command.html it offers a ton of stuff
why are there so many things?
How do i make it so my code cant be seen when they are running the code? @lusty quest
its all optional btw
exes can be compiled so i dont want that
its not like you have to use reverything
aight, i gotta take care of my aunt now
peace
ok cya
i just do
import ("detritus-client");
right?
no
no
=|
import {CommandClient } from 'destritus-client'
ok ok
here
one thing i love with dsharpplus is that you have a build in dynamic help command
function postTopGGServers(bot){
fetch(`https://top.gg/api/bots/583995825269768211/stats`, {
method: 'POST',
body: JSON.stringify({
server_count: bot.guilds.cache.size
}),
headers: { "Authorization": bot.config.botlists.topgg }
}
).then(console.log)
}```im getting 400 bad request, what did I do wrong? its node-fetch
what are you planning lol, why did you want to make your bot a rar file and then ask about a exe?
@lusty quest just did this
lalbe is the same as command name
label*
and description is what it does
but it also has a usage
compiling your bot as an exe?!
dsharpplus comes with a help command shipped, you can make your own, but having not to go throu making one is nice
fair
but making one is quite easy, so its not really something i would count
anyone please? i dont see anything wrong
you need to add the content type headers
{ headers: { "content-type": "application/json" } }
fuck you
Hey guys, what is the best VPS provider currently available for a bot that is mainly Google Cloud based and can be affordable?
google?
the big 3 are quite expensive
ah thnx
maybe look into galaxy gate or linode
I see
also if you need a certain size maybe look into Root Servers, at some point they are Cheaper with more power than VPS
Well my bots aren't really needing a lot of GB size anyhow
My database stuff has moved away from being localized
I'm looking mainly for the bandwidth and affordability I suppose
i where at the point where ive needed more Processing power, a VPS from Digitalocean that where Compute Optimized where at 40$/Month(2Cores/4GB RAM 25GB Disk), a root Server (6Cores/12Threads 64GB ram and 512GB NVME ssd) is about 55$
Oh my
yea i guess look into galaxy gate or linode they should be quite decent
is galaxy gate better than digitalocean
Gate seems to offer just as much as ocean for only USD $3/mo
@sick cloud did you want added to the team for the repo?
it actually still doesnt work 😦 js function postTopGGServers(bot){ fetch(`https://top.gg/api/bots/583995825269768211/stats`, { method: 'POST', body: { server_count: bot.guilds.cache.size }, headers: { "Content-Type": "application/json", "Authorization": bot.config.botlists.topgg } } ).then(console.log) }
[Symbol(Response internals)]: {
url: 'https://top.gg/api/bots/583995825269768211/stats',
status: 400,
statusText: 'Bad Request',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}```
oh my bad json.stringify :/
@quartz kindle For my messageupdate.js, I found, I just needed to add:
if(oldMessage.partial) await oldMessage.fetch()
``` XD
Lol
i remvoed it before dk why sorry for ping
what is bot.config.botlists.topgg
Probably a call to .env
my topgg token it works now forgot to stringify the data
I store all of my API tokens in a configuration file and read then
Similar thing I guess
yeah when you have time for sure
Standby
F
Worth noting that galaxygate has serious security issues the least of which is not wiping disks on termination
@quartz kindle umm, sorry for the ping, but from where can i learn how to use dev toold and if i change the colour of my discord stuff from the console is that against the ToS?
What are the others?
They have the most downtime of all VPS hosts (bar those shitty bullshit popup ones)
Their clustering is bad last I heard so an IP lockout is per cluster
But handing a customer another person's network disk is a serious breach in itself
I'd recommend hetzner instead. Based in Germany, but p cheap
Hmm
My VPS is rather picky because my bot focuses on a shit ton of synchronous HTTP communication with varied API services
So ideally i want the VPS to be hosting my bot near those locations as well
DO, Linode
And you can use the free trials on Azure, AWS or GCP as well. If you wish to scale, however, these may become pricey
OVH is also good, I used to use it before Hetzner
There's also this thing called Scaleway, which I've heard is decent.
Even if you do change the color from the console it will last until you restart discord
There's no danger of you being banned without warning cause you injected some CSS or whatever, but the fact is yes, this is against the terms of service.
hetztner got some issues with Discord, idk if im just lucky but its common that Hetzner IPs wont be able to host discord bots properly
yes in 2018 i think there where some issues
It works wonderfully actually
code: https://imgur.com/70JoeAb
error: https://imgur.com/dChJ4Mj
somebody to help ?
the error comes from line 12
hmmm
idk
message.channel.send({
embed: {
color: "GREEN",
title: " Added to the queue! ",
description: track.title,
url: track.url,
thumbnail: { url: track.thumbnail },
footer: {text: "The Suite"},
}
});
};```
how do I move the blue line to the description?
Uh
i think
So It's impossible to put the blue text to the description?
idk
You could just move those logos down
In description
So it could be align a bit i never tried custom emojis like that but i think you can
code: https://imgur.com/70JoeAb
error: https://imgur.com/dChJ4Mj
somebody to help ?
the error comes from line 12
No idea
wait
@broken sentinel but the error says that you didnt told properly to get the role
the code is wrong
i know that roles is not correct but i dont know how to replace it
Hacker
code: https://imgur.com/fYpZY3r
error: https://imgur.com/dChJ4Mj
somebody to help ?
the error comes from line 12
can you stop reposting your question
i repost it because i post the incorrect photo
Call it hyperlink ('
oof idk js
HTML and CSS <div class="ariel" style="font-size:40px; font-family: font-family: 'Oswald', sans-serif;"><span style="color: #ffffff;">my text</span></div>
why isn't it changing the font?
I guess I did everything right
oh ok nevermind
I understood
I just accidently wrote 2 font-family
you tell me whats wrong
i need help with line 12
const db = require("quick.db")
module.exports = {
name: "setwelcome",
category: "moderation",
usage: "setwelcome <#channel>",
description: "Set the welcome channel",
run: (client, message, args) => {
let channel = message.mentions.channels.first()
if(!channel) {
return message.channel.send("Please Mention the channel first")
}
//Now we gonna use quick.db
db.set(`welchannel_${message.guild.id}`, channel.id)
message.channel.send(`Welcome Channel is seted as ${channel}`)
}
}```
that no where near helps lol
have you read your error and code correctly
your error doesn't even match up with the code
how do i get the roles of the bot?
i mean i try to get the posotion of his highest role but this not work client.roles.highest.cache.position
😦
because that's a user, not a member
guild.me represents the bot on a guild as a member
@dark crest ^
THX
Does anybody know how to make it to check if member has react something in discord.js for example
if (react) ....
But this dont work
you could use the awaitReactions features
Or make a reaction collector
either/or, yeah
Or use on reactionAdded event
no thanks ;D
i will see thanks
i want to make it when user react a message to get role
If I were you.... and I was making reaction roles or something else I would use reactionAdded event
And check for guild config and roles
(requested by : ${track.requestedBy.username.mention})
it returns as undefined
user.mention is not a function ... its actually nothing
Use user.toString()
user to whaaaat?
Just do {track.requestedBy}
yes so remove .username.mention there
When a user is converted to a string via .toString (aka what template literals do), it's converted into a mention
i isnt user.react
ah
yes, use awaitReactions on sentMessage
You cant
Wouldn't that be temporary?
yes it would be
You're right I read purgeCommand at the top and thought...
why the fuck is this in the purge command

Copypasta
No
?
have you considered learning javascript before making bots
instead of just mashing away at the keyboard like a noob
i had but i am begginer
Ok so go learn javascript first
i am tring
Don't try to make bots. Try to learn the language.
P.S. Discord bots are a bad idea to start learning programming
You would have to add it to a db and then check on reactionAdded event if the message id and channel id are same as of the panel and the reaction is same... then give the role.... this way it would be permanent
rr is not as easy as it seems...
Emoji name and stuff?
yeah
I was just trying to make a tutorial but I guess I also didn't have enough patience at the time
No, but you can ask your question here on this channel
No one can help until you ask your question
no help me in private
No
No. If you need help, ask here.
i need the script of music (javascript)
here's a tutorial https://www.youtube.com/watch?v=q0lsD7U0JSI
i am sorry but I didn't find the solution for it.
I am supposed to paste a guild key in the .env file for the bot, but I don't know where to find it
ok then!
| (requested by : ${track.requestedBy})
How do I make it so the output gives it in hi but that it doesn't give an error
Oh you mean code block
You can escape the backtick characters with \
``````hi``````
ah so I do ` and the after again
Do \ and then the `
yes
Yes
Whenever you want a backtick within the template litearl you put \ ` instead of just `
ok
damn it's hard to explain markdown in a markdown-enabled chat service.
Same
@umbral zealot if i say play (prefix) music the bot is join the room and disconnect
xd
follow the tutorial
are you using lavalink?
or ffmpeg
`````````
yes
ayy
they weren't asking for a full code block just a single code element
ok 👌
@earnest phoenix https://www.npmjs.com/package/discord-player try using this package, there is an example there
wrong ping
@earnest phoenix
i'm unsure if that package is good, never used it since i use lavalink and erela.js
Does someone know, how to bulkdelete on mongoose?
mongoose ? Read the docs
https://stackoverflow.com/questions/44467318/mongoose-remove-multiple-documents-in-one-function-call
This may help
I want to delete all which, does not have a specif value on the field
ok wait
<Model>.collection.updateMany({},
{ $unset: { PropertyToDelete: true } },
{ multi: true, safe: true }
);```
you can do something like that
thtas mongodb? and that does not delete lol
oh sorry, yes it does
yes with unset
you can do the opposite i assume by switching unset to set
also it should work if you eval it
what's wrong
Well I tried adding duration to it
but now it's not showing the link
it shows 4 duration but not the links
after ${track.requestedBy} there seems to be a back tick or something, try remove that
hmm im unsure about that
i only know how to delete a specific property from all users
@earnest phoenix
I removed the tick
manually delete 70000 documents 
seems like a time waste
that was a joke 
I know 
copy that line and send it here
i'll just do the syntax for you ig
embed: {
color: "GREEN",
title: "Server Queue",
description: `**Server queue - ${message.guild.name} ${client.emotes.queue} ${client.player.getQueue(message).loopMode ? '(looped)' : ''}**\nCurrent : [${queue.playing.title}](${queue.playing.url}) | ${queue.playing.author}\n\n` + (queue.tracks.map((track, i) => {
return `**#${i + 1}** - [${track.title}](${track.url}) | \`(requested by:\` ${track.requestedBy}) `duration: \`${track.duration}\``
}).slice(0, 5).join('\n') + `\n\n${queue.tracks.length > 5 ? `And **${queue.tracks.length - 5}** other songs...` : `In the playlist **${queue.tracks.length}** song(s)...`}`),
footer: {text: "The Suite"},
},
},
)},
};```
bruh
oh the line
xddd
``` return **#${i + 1}** - [${track.title}](${track.url}) | \(requested by:` ${track.requestedBy}) duration: \${track.duration}````
I can't really copy it as yeah
syntaxes frick up
use a array then join them lol
what
heh
fuck
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
tf am i doing with my life
rate it?
☮️
hey
why have i seen that before
yes 
it's decent
what is missing?
idk been a while since i've made my own dashboard
lol
hey ban

bad guy
sorry
do not ban me
my bot is under verification
then u can ban me
lol


this was a fake nitro,it did not exist

really?
and hacking maybe i should report it
NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
sorry
i will stop right now
plzzzzzzzzzzzz
then do a nitro drop
ok
take
done?
bye
no
it is fake lol
what type is afk_channel a text channel or a voice channel??
should be voice
Voice
VOICE
mmm so if i want to make a command to do afk i cant use afk_channel ??
"to do afk" ? what does afk do exactly in your mind?
setafk command, or something like that
how about let them answer
If they mention the bot, send a message saying that it is afk, but that only in a specific channel can you use that command
That would be something you'd have to track yourself with a variable.
🙈
okay thanks
hmmm
i typoed in my code... and this happened.
Posting webhook Host=https://discord.co Path=m/api/webhooks/818839012105912390/R1GB.....
note the hostname and path. I wonder what the probability is that some malicious person might reg typo domains like discord.co for stealing credentials that are accidentally posted to it.
arent the most popular domains bought from discord?
discord.co too?
but discrd ...... they did not buy such things
did you try to go on http://discord.co/ ?
no not yet, im too busy to follow it up, was just a passing thought
same
it literally goes to discord.com lol
Thanks for confirming what I've said, that's great 
const { MessageEmbed } = require("discord.js");
const fetch = require("node-fetch");
module.exports = {
config: {
name: "instasearch",
aliases: ["searchinsta", "sinsta"],
category: "info",
description: "Find out some nice instagram statistics",
usage: "[instagram username]",
accessableby: "everyone"
},
run: async (bot, message, args) => {
const name = args.join(" ");
if (!name) {
return message.reply("Maybe it's useful to actually search for someone...!")
.then(m => m.delete(5000));
}
const url = `https://instagram.com/${name}/?__a=1`;
let res;
try {
res = await fetch(url).then(url => url.json());
} catch (e) {
return message.reply("I couldn't find that account... :(")
.then(m => m.delete(5000));
}
const account = res.graphql.user;
const embed = new MessageEmbed()
.setColor("GREEN")
.setTitle(account.full_name)
.setURL(`https://instagram.com/${name}`)
.setThumbnail(account.profile_pic_url_hd)
.setDescription("Profile information")
.addField("**Username**", `${account.username}`)
.addField("**Full name**", `${account.full_name}`)
.addField("**Biography**", `${account.biography.length == 0 ? "none" : account.biography}`)
.addField("**Posts**", `${account.edge_owner_to_timeline_media.count}`)
.addField("**Followers**", `${account.edge_followed_by.count}`)
.addField("**Following**", `${account.edge_follow.count}`)
.addField("**Private account**", `${account.is_private ? "Yes 🔐" : "Nope 🔓"}`);
message.channel.send(embed);
}
}

whats the error?
new Date(X).getTime() - new Date(Y).getTime()
or use a library like moment.js
with that it's easier to get years, months, days and so on because it does the math for you
well it works
uhm
moment().diff() is a thing I think
search that in the docs
yes and then use moment.duration("the difference here")
bro u dont know how happy i am that my bot got verified lmfao
it took sooooooooo long
;c
nice congrats
thank you <:
does this mean in the future all bots get verified
or is it just the one?
Oh, rip
yes, every bot you make has to be verified, no matter how many verified bots you already have
ooooooooooooof
thats going to be an annoying process, but you shouldnt have more than 3 you want verified anyway
are you planning to do 100 bots or what?
nope! just wanted to see if that was a thing lol
?HELP
const diff = moment("first moment here").diff("second moment here");
const diffDuration = moment.duration(diff);```
@earnest phoenix
then u can use diffDuration.days()
and so on
I think so... I only use days, hours, minutes and seconds
just check the docs
uhm
yes
lmfao
uhm
well for me it always works...
and what if you try Date.now()
instead of new Date()
idk if that makes a difference tbh
probs not
but worth a try
also wait
why are you subtracting it
isn't the createdAt already the timestamp u need
you don't have to subtract it pretty sure
what exactly does createdAt contain then?
this is 2 and a half years old right
that's already the time... I don't understand why you subtract it from now
yes
then u have to do the difference between 2018 and now
right?
so just use the createdAt timestamp in the one parameter
and Date.now() in the other

let diff = moment(user.createdAt).diff(Date.now());
let diffDuration = moment.duration(diff)
console.log(diffDuration)```
just try it
did it work?
because I got to go now
nice!
no problem
do you also understand the logic behind it?
Is it right that mobile users have Problems moving roles and channels?
Problems in what sense
that they cant move channels up and down, drag them in category ......
You can't "drag" channels in the server view from mobile no. you have to go into server settings
But this is #development
¯_(ツ)_/¯
Time to make a bot for it 
that mobile users can move channels lul
for (let i = 0; i < Object.keys(guildInfo).length; i++) {
if (!client.guilds.cache.get(guildInfo[i].id) { continue; }
await client.guilds.cache.get(guildInfo[i].id).members.fetch(requserid)
if(!client.guilds.cache.get(guildInfo[i].id).members.cache.get(requserid) continue;
if(client.guilds.cache.get(guildInfo[i].id).members.cache.get(requserid).permissions.has("MANAGE_GUILD")) {
guildinfo2.push(guildInfo[i]);
}
}
what is the efficient way?
I mean it's not like you can make a bot to modify the features in Discord Mobile app
use a variable for the member instead of getting them from the cache 2 times
actually i am fetching a member in a guild
yes, store it in a variable
it isnt, It is help for the users like: !move #development [under/above] #memes-and-media
i am really confused what should i do with the var then?
Use it instead of getting the member in the cache twice
client.guilds.cache.get(guildInfo[i].id).members.cache.get(requserid) you using this two times
you can just do const member = await client.guilds.cache.get(guildInfo[i].id).members.fetch(requserid)
and then use member instead of client.guilds.cache.get(guildInfo[i].id).members.cache.get(requserid)
ah okay thx
I think fetch throws an error when the id is invalid so make sure to catch it
permissions: 104189505, how can i transfer this to a permission like "MANAGE_GUILD"
Can someone help me with a currency system
use mongo eco
what do you mean by "transfer"? Add MANAGE_GUILD to 104189505?
i want to check if the bitfield includes 104189505 "Manage.." perms
(bitfield & bit) === bit
so it will convert this to a string?
no it will tell you whether the bitfield include the bit
a number
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
thx
You can also do 1 << position_of_permission instead of those ugly hexadecimal numbers
for BAN_MEMBERS it'd be 1 << 2 cause it's the 3rd permission in that table
noice it works
for (let i = 0; i < Object.keys(guildInfo).length; i++) {
if (!client.guilds.cache.get(guildInfo[i].id) { continue; }
guildinfo2.push(guildInfo[i]);
}
then i only need this
You can also do
const length = Object.keys(guildInfo).length
for (let i=0; i < length; ....)
Also what is guildInfo? Why are it's keys numbers
that is same xD
.But i have to till double login on my client since i need the channels :c
req.user.guilds.forEach(async (o, i) => {
if((o.permissions & 0x00000020) == 0x00000020 )
guildInfo.push(o);
});```
it's not really the same. i < Object.keys(guildInfo).length here you're getting the keys and length on every iteration
You shouldn't be using .forEach
ik for each is really bad
any solution for this?
Can you rephrase your question
give some seconds
I mean you can simplify this with map() but forEach isn't "bad"...
oh wait no not map. filter(), rather
guilds.filter(g => (g.permissions & 0x00000020) == 0x00000020)
I have to login to my client so I can use the channels for the dashboard(like for setup) .Since bot and website are hosted separately ,I have double login :c
-_-
huge security risk
someone can easily steal your bot token
Instead, just communicate with the backend via HTTP requests
yes
you can use HTTP requests to communicate with your bot, but you'll have to create an express server on the bot's side as well
that is thing I do not want to
You can also set up a TCP/UDP connection between the two servers
1000 ws Events are allowed 
I wouldn't say it's terrible, but I think the stuff I mentioned is a better solution
I like how it's Object.<K extends string | number | symbol, V>, but Object.keys returns Array<string>
If the bot and the server are hosted on the same server, just a different process, you can make the server spawn the bot process and then you can exchange data between the two
1000 identify calls. Resume and other gateway ops don't count towards that bucket. They have their own buckets per socket connection
I need only cached things like role and channel for the page
You still need to setup a solid communication method
Same host - IPC
Different hosts - HTTP/TCP/UDP
but till thx for the advice! 🤗

I need to start saving gateway sessions and seq in db so I can resume instead of identify every time I restart. Shouldn't matter since I store all my data in a db
Objects cannot have numbers as keys, so they get turned to a string, and symbols don't show up at all when you do Object.keys, so it makes sense that it returns a string
Objects can be keyed as numbers

but they get turned into a stirng
how can i use redirect uri for bot invite
&redirect_uri=URL_ENCODED_SITE at that to the url
https://discord.com/api/oauth2/authorize?client_id=this&permissions=268561655&scope=bot&redirect_uri=https%3A%2F%2Fccommandbot.ga%2Fdashboard```
returns me a error invalid redirect_uri
where are you getting this error??
Does the redirect uri even work with bot invites
i saw bots which has it
You can access object properties with numbers since get and set do coerce the key to a string if necessary.
For all intensive purposes, you can key Objects with numbers
Did you add the URL here? https://traps-are.gay/
ah forgot it lol...
Yeah, but internally, object keys can only be strings, that's why Object.keys returns only strings
and not strings or numbers
works thx
i did not got redirected
weird
the client has to handle 307 status codes
Is it possible to redirect all content of console to like a function?
I'm trying to make a write stream but not a fs one
(Node.JS btw)
not without wrapping the entire app inside another app that captures STDOUT
pain
what does this do?
nothing you should worry about
I don't even know why that's still there
never seen ANYONE find a usage for that
It requires a user to be authenticated through oauth2 on your website and given a code grant before they are able to invite the bot
okay 🤣
you can use it to restrict who invites your bot
premium bot 🤔
not like that...

imagine you make a super op bot that can only be invited if people pay monthly
genious EAdea
lmao
™️
The painful part is figuring out what "super op" entails
You've got some bots that specialize and some that do it all
?
wow ok
@round cove
lol?
do u realise u dont have perms to ping everyone
oh man
people can dream 
netfilx but as a discord bot
LOL
cloud gaming on discord
you know what could realistically be made into a bot
social media manager
one of those platforms where you post to 20 social medias at once
just do it from a discord command
Sounds like HLS to me 
omg yes
more like pain
True. It would be pretty convenient to do that from Discord as well if you're on it all the time
would you give username and password or just authenticate through it?
i mean
Some websites might not allow it since some oauth scopes don't allow message creating
we're talking about premium bots that need code grants to invite
so oauth2 is a given
No I meant how would the bot send messages as the user
make it part of the oauth flow
put the bot invite at the end, after authorizing everything
Okay so who's doing it 
doesn't sound all that difficult
Though, you may need to contact some of the social meds to get permission to ask for sending permissions
Why not just organize a dev team consisting of people here.
Consider the fact that front end work is not fun
hmmmm
also, bot could be completely stateless. That's pretty poggers in terms of memory usage
yeah all it needs is to listen for messages. Could also use slash commands to completely get rid of the websocket connection
i want to notify 76000 server owners of a new bot feature thats in all of our advantages (the server owner, and us) to enable. it involves them giving the bot manage webhooks permission to make it work.
Whats the best, non-spammy way to spread the word to them all about why they should enable the role on the bot to allow a new feature to work?
If they did, they'd be able to customise the bots pfp and name on a per channel basis, and it would eliminate tons of lag.
I've sorted out new users going forwards by changing the permissions the bot requests when invited.
Thoughts?
maybe tell them when they use a certain command?
Perhaps advertise the feature through general command usage
Use the existing "Announcement Channel" feature.
let people subscribe to your news instead of forcing it on them.
Then you don't even need to worry about publishing oyu just post to a channel and publish. boom.
But what if only a very small amount of guilds are subscribed
That's their problem honestly
If someone doesn't want updates, they don't want updates.
Make best effort by adding links and information to commands and such.
Maybe add a command for bot updates or new features or changelog or wahtever
link that to your server and announcement channel
Using the presence activity within its rate limit to display a short text of "new stuff" etc will also be noticed by a few guilds, surely not all
What about... just advertise it through general command usage like Papi said, but only show the advertisement if the person using the command has the power to add the permission, and also don't show it every time, maybe once or twice and then stop
That would require some tracking which is 
Bots like Dank Memer uses this method
Hmm to remove the tracking you could make it chance-based
That's pretty reasonable
Could also implement other "tips" to make it seem more inconspicuous
Good idea... just like a command timeout.
Adding a property to the guild with a timestamp of the last sent notice about the new stuff been triggered by any command just as additional message or embed, send once every hour(s) only for the next 7 days
@green kestrel
it grants you coding prowess
No the invite code grant
The code grant system is that the user must log in with oauth on your website and you give them a code grant, for them to invite the bot
Interesting...
does someone know how express-validator works?
bc I want to know if it's possible to clear the validationResult errors after they are shown
please
i need help to this
is it possible to omit an @ everyone ping from webhooks
like im using zapier
for google forms -> discord
but i dont want @ everyone to be a valid response
and i already have one reg expression
allowed_mentions?
im not using a bot though so rip
right
im using zapier



yeah I don't understand am dumb

