#development
1 messages · Page 1612 of 1
yeah lol
lol
i just minify everything and make sure there are no maps
especcially for javascript
i use source maps in production 
Why worry that much my boy
ew
i mean my projects are open source anyways so
HTML without assets is just plain text
Yes
yes ?
I don't mean images
css ?
I mean actual back end stuff
Yes
You can copy everything from the site, but look at top.gg's newly found copy
It's just that
No interaction at all
Don't think so
or stinky ejs ?
apparently it does
my react extension gets activated
i wish i could have got the verified bot developer badge
huh
is self hosting a discord bot bad
No, you're thankful you didn't get it
why?
People didn't stop trying to get it
Cause DMs?
Do you know how much bitcoins I got offered?
lol
lmao 
i would have taken them
dang then I wish I got it 
I got a lot of dms from people offering money for my acc
ill pay you 50 bitcoins rn
Wow

Most of the cases yes
a LOT
who wants to host my discord bot for me lol
i hacked elon
Just imagine 1 bytecoin
yeah
Or 1 kilobytecoin
teracoin
well 8 bitcoin then
8 bitcoins?
1024 bitcoin
how much did you get offered kuuhaku
I can give 1 bit coin
1 is like 50 grand 
still wish i had that badge
About 6 bitcoin offers, 1 nitro offer and 1 $400 offer
Jeez
you can fr just go online and buy them lol
Doesn't sound like a bad deal though, you could make a business out of it 
yes
too late 😔
Not anymore since they dont give badges anymore
just could have added 70 memebers to a team last year
Gonna open a "money first, account later" business
except the account never comes

Did people make u offers even when badges were still a thing?
The offers were different back then
They offered stuff for being part of the team
discord needs to come up with a rewards system for bot developers tho
server makers get one so why cant we
wait what do they get?
Yeah, bot partnership when?
oh like server partnership?
yeah
What vps do you guys use?
google cloud kekw
it is sad
😔
Bot partners could get:
- gif avatars
- doubled ratelimits
- a flamin hot cheetos
- lite version of nitro
yessssssssssssss
when ?
we should get drip
yes
bot drip 😳
There would be too much hype for discord to handle
agreed
youtubers ruined it
The issue with the badge was that it was fckin easy to get
yes
I use my raspberry pi which is kept in nasa's server room
Like, 75 servers, an id photo and some questions
they should make the requirement more like 1000 servers
Really?
now it's rare and people literally out here stealing accounts for it
Galaxy gate
why do people want that badge so much
okay
it's just stupid
i don't give a fuk to badges
because
to be special
it is nice
Yeah, like it looks cool and all but too much hype over it
i am going to work on getting the bug hunter badge
Dude, remember that people buy robux to dress a blocky character
lol
lol
And you asking why the badge stuff?
lmao
How does that work?
gotta retain them
Yeah, that's why this server ain't partnered yet
it should have been
it never will be
i know what i need but i dont think i have the strength to do it: https://www.ebay.com/itm/DISCORD-PARTNER-HOODIE-MINT-CONDITION-SIZE-MEDIUM/265061617564?hash=item3db6e74f9c:g:eGIAAOSwNrdgMcV2
lol
I like discord but don't think as much to buy hoodie or other things
lol
They could sell nitro scooters
you know somebody would buy it

nitro scooters pog
nice
🔱
trident ?
yes
I don't have stickers in india
still I can send
casue discord dumb
hmm how do you use them
Just press emote icon
oh
Wut
How good of a server do you think you would need for a music bot with 10k servers
server with 1 member
Me too, except on the phone obviously
Try typing "no"
Without quotes
See if it pops

No, type in the chat
:no:?
A sticker suggestion should popup with certain keywords
At least for me it appears
yeah no doesn't work for me
Btw, have u unlocked the starter bundle?
same here
what
It's in the bottom left corner of the emote menu
A store icon
Click it
There'll be a starter bundle there
For free
Oh my
Yeah, there's that too
"This is currently only available in Brazil, Canada, and Japan for the soft launch of this feature! We're slowly rolling out this feature in order to collect feedback from our community."
ah
who would have thought i would ever want to go to brazil

Yay, brazil
We finally got something before usa
How disappointing 😔
Nice but I don't think I have it lol
😔
Nice we don't got that
I would assume so
maybe they wanna test stuff out before giving it to their main audience
haha nice one
But anyway, don't expect much, you only get one bundle for free
Rest is either paid or nitro-only
I see
Cya guys
cya
Yeah good night
What are the rate limits for changing your own bots nickname? I can’t find any specific time
how can i choose an initial method for the password in filezilla?
how do you guys deliver errors in unique ways https://i.imgur.com/xJVwaSq.png
embeds. if not, add a custom emoji to make it look nicer etc.
fix your capitalization
whats wrong with capitalization there?
Error twitter user not found

Error: Twitter user not found.
❌ Twitter user not found.
Twitter user not found.
not this ^
f
everybody gangsta until someone sends an actual embed to demonstrate
is there anything i can use in the docs to learn how to loop stuff so like have multiple activitys cycle over a certain amount of time
Docs? What programming language/library?
Try using this https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html, they included a helper for it
DOEs anyone here know how i can add a discord login to my website? I wanna make it so people can view their account online
You can use indexes to determine which activity to set while having it in a loop
oauth2
you need a backend server for this
Ok, thx
Which one is better for writing discord bots javascript or py
Py is easier
can any one help me make my server
Whichever you are more familiar with
Yeah I agree but someone told me that there are more resources for javascript. @sour anchor
So whichever you know better use
Discord.py is way easier to code in tho
There is a support server
difficulty is subjective
I know py but planning to learn javascript
use whatever you prefer
If you know neither, then dont start with making a bot
Hm
this
I hate making websites.
I made a few websites
Does anyone know a good html tutorial?
Can't you just download html themes and edit it according to your taste
can any one help me make my server
I could, but id rather know what im doing
Will save you a lot of time
For free? No.
no i give nito after work
I am sorry can't help you with that.
@modern sable someone is spamming invite links
If I may is too. gg affiliated with discord in anyway?
no
Oh I see
Depends
If you've never coded in your life then go for discord.py (Learn Python first)
If you've already have experience with C like languages then go for discord.js
If you are running on low RAM then go for Eris
I suggest you go for discord.js
I feel like more people use it and if you're new its much easier to get help
I also dont find js very difficult
"" == false
true
lol
like yt tutorials stuff like that
@near stratus Python is the only language I have experience with it's just a friend of mine told me to learn javascript to build discord bots cause there are a lot more resources with java script than there is for py and for the record I don't know C or C++ but I did learnt some java back in the day C:
@devout notch that's what my friend actually said
Java is also a C-like language
Use py if u know it
If you know it then go for discord.js
Js is hard imo
Yeah I did made a basic bot with py @sour anchor
to be honest Python is hard when you use it in large scale
||I like python btw||
the thing is Java has like different arrays, you have to define their dimensions
That doesn't occur in javascript
Java is a nightmare
@near stratus I think Python is easier than most language too btw like your pfp (had a huge crush on Asuna xD)
python is easier and that's why it's hard to write or debug
I only know basic java
lol me too
Hmm that makes sense
Java is cool smh
damn, bubblesort, insertion sort, recursive functions, Java sure is fun
Just to make sure are you saying you had a crush on Asuna too xDDDD or you just meant you know basic java like I do @near stratus
what
I haven't taken computer science
The first two are sorting algorithms that aren't related to java
and every major language has recursive functions
Tf is so bad about java 😔
They aren't strictly related to Java but I thought you guys also had to code search algorithms in school (in Java)
just me ?
Maybe
Not in java, no
And I'm not in university yet but in high school we wrote almost everything in C++ / VB
thats nice, better than Java for sure
What's so bad about java lmfao
Thoughts? The logo also has an animated gradient but you can't see that. The header/footer gradients aren't animated
Should they be animated 
Yea probably
Make the animation subtle though
Don't make it attract too much attention
What is a good size for the card?
well that depends on what the card is supposed to show
The gradient looks so weird when it's in a gif but it looks way smoother irl trust me
I should probably make the colors a bit darker
I meant I know basic Java
||Rem is my waifu (sorry)||
🤣
why does replaceAll() doesn't work in my node.js?
You're most likely not using it correctly
Hej
or you're using an old node.js version
Mówi ktoś po polsku ?
no
First show code
Second use .split().join()
i use it as written in the developer.mozilla.org
How does it not work? Are you getting an error is it just not outputting the right result
Bruh
we can't read minds
show that fuqing code where you use it
be more specific
Run node -v
can you wait
And tell us the output
i know what im talking about
we don't
"hello everyone brace is here and brace is ready".replaceAll("brace", "idiot")
for example
it's supposed to show "hello everyone idiot is here and idiot is ready"
And... what's the actual result
It returns a modified string as opposed to modifying the original one, right?
yeah
yea iirc
but shows error
Old node.js version
because it’s an old node version
you have an old node.js version too
how to update then
bruh 14 is old ?
that's repl-it?
yes
that is
no mine is on my virtual machine
I wasn’t speaking about yours
anyway
Maybe node.js isn't using the V8 version which implements .replaceAll yet
I wasn't replying to you
but you were replying to someone who was reacting to my message
Can't you provide regex to .replace for it to act as .replaceAll?
you can use .replace(/brace/g, "idiot")
yea you can
But i was answering HIM not you ?
oh i forgot we can use regex
fucking hell
you're still using .replaceAll
.replace not .replaceAll
done 17 lines canvas code
i did
What's wrong here client.users.cache.find( user => user.tag === "user#1234" )
What happens when you run it? Any errors? Unexpected results? Elaborate
@cinder patio return undefined
try == instead of === just out of curiosity
== will compare === will compare of the same type
types man
user.tag is nullabale, it doesn't always have a vale
value
the equal operator is not the issue
Is there any way to get all users of same name
filter the users / members cache
But before that you'll have to fetch all users/members, which is hard to do because you can't fetch all of them at once
Is there a way to save a function to mongo?
Someone said to save it as a string and eval it, but what if I need parameters?
The Function constructor will come in handy
const func = new Function("x1", "x2", "return x1 + x2");
func(1, 1);
You just have to know the names of the parameters
The function constructor has some quirks, tho, I believe the function gets executed in the global scope
hey! I had some background page and api issues and was told that it would be fixed yesterday. Why are they still not working?
and yes, i've read the site news tab.
there is no way
HUH
There is a way and I showed it in my message...
anyone?
who can help me pls?
this:
/app/index.js:51
client.login(config.token);
SyntaxError: Unexpected end of input
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
show me your code
like bin it or something
const Discord = require('discord.js');
const client = new Discord.Client();
const fs = require('fs');
const config = require('./config.json');
// Init discord giveaways
const { GiveawaysManager } = require('discord-giveaways');
client.giveawaysManager = new GiveawaysManager(client, {
storage: "./database.json",
updateCountdownEvery: 3000,
default: {
botsCanWin: false,
embedColor: "#FF0000",
reaction: "🎉"
}
});
modules.forEach(function(module) {
fs.readdir(`./commands/${module}`, function(err, files) {
if (err)
return new Error(
"Missing folder of commands! Example : Commands/<Folder>/<Command>.js"
);
files.forEach(function(file) {
if (!file.endsWith(".js")) return;
let command = require(`./commands/${module}/${file}`);
console.log(`${command.name} Command Has Been Loaded - ✅`);
if (command.name) client.commands.set(command.name, command);
if (command.aliases) {
command.aliases.forEach(alias =>
client.aliases.set(alias, command.name)
);
}
if (command.aliases.length === 0) command.aliases = null;
});
client.commands = new Discord.Collection();
/* Load all commands */
fs.readdir("./commands/", (_err, files) => {
files.forEach((file) => {
if (!file.endsWith(".js")) return;
let props = require(`./commands/${file}`);
let commandName = file.split(".")[0];
client.commands.set(commandName, props);
console.log(`👌 Command loaded: ${commandName}`);
});
});
// Login through the client
client.login(config.token);
wtf theres a discord-giveaways library
guess I've been living under a rock this entire time
Wot.
Chadoxi is using it
Is there an evaluation code where I can cache a user and check mutual servers from the bot?
Wot.
For example, I can check my mutual servers with a user, but instead from me, from the bot. Is that possible?
Yes
you need to have guild members intent
I have that, no worries.
I'm performing it using the !eval command, privately.
You can use something like guilds.cache.filter(({ members: { cache } }) => cache.has(id))
Yes, map the collection
Aight!
I see
no
I was just about to :(
you gotta filter it
Ah.
[...guilds.values()].reduce((x, { name, members: { cache } }) => (x[name] = cache.has(id), x), {})
God what have I done
oof

🥄 bad
Hey discord I have a problem my bot was in 32+servers but it's now in 1 server and in my server he is also but it's showing that my bot only in 1 server and watching 8members but my server has more than it sob I created it with my time but got destroyed
did you leaked your token?
I edited it again
Checking...
node got bad parsing, try to parse it to json
(only for console outputs)
tfw you cba to make a command for it
What?

One second...
guilds is the collection
its a giveaway bot
so I need this
I know I just never knew there was something like that
well what I would do is
const config = JSON.parse(fs.readFileSync('config.json'));
client.login(config.token);
and the JSON file would look like this
{
"token": "YOUR_TOKEN"
}
In config.json I have this:
{
"token": "",
"prefix": "$",
"everyoneMention": false,
"hostedBy": true
}
just define config as JSON.parse(fs.readFileSync('config.json'));
maybe that will work I dont know
you dont need to parse json. JS is smart enough for it to get recocnized
or don't use config.json use the actual path to your config file
change it to ./config.json or whatever the actual path is
else if (username.length < 4) setError("Username length must be at least 5 characters");
//.. More checks
if (error) delete registerData.username;
vs.
else if (username.length < 4 && delete registerData.username) ...
//..More Checks
Which do you guys find more readable 
I'd say first snippet is more readable
I agree
fuck readability, less code, fuck whoever comes next
make sure to comment //May god have mercy on your soul, shouldnt have fired me in the bottom too
you're my long lost brother / sister
lmao
would this work to make a notifs when join guild?
const Discord = require('discord.js');
const webHookclient = new Discord.WebhookClient('ID', 'Token')
exports.run = async(client) => {
client.on('guildCreate', guild => {
const embed = new Discord.MessageEmbed()
.setTitle('Some Title')
.setColor('#0099ff');
webHookclient.send('Joined Server', {
username: 'Server Join',
avatarURL: 'image',
embeds: [embed],
})
});
};```
Try it and see
I wanted to ask first before to testing
so do you know if it'll work now? 
u shldnt be registering new events every time the command executes
@frosty valve you using Visual Studio Code?
this test bot is on glitch.com for I dont have VSC on my school pc
You're at school ?
fuck, i even had the link on clipboard
My school gave me a Chromebook and it's fuggin useless
catch errors as needed
second
as uwu? said
dont register new events everytime
make sure you only run that ONCE
you actually didn't define client
its defined in the command handler I use
oh
thats inbuilt into the core of the command and event handler
wait you can run a event listener in a export function ?
gotta try that
of course
you're passing an object
its reference at least
it manipultes the object itself
in this instance, client
which extends event emitter
I am maybe using the event handler the wrong way so it doesnt register it
and this is why i asked if you were using VSC
so you could look at this
and properly debug it with a breakpoint
ooo It works I just tried the client.on("join" in a function and it works
thanks for the info
doesnt matter where you run it as long as you make sure its running
as in: calling in the function
require('module').run(client)
or you can declare it on ur index too
¯_(ツ)_/¯
(assuming you define client on ur index)
the core file is index
(Not really, the index just redirects to the core file. There all the main stuff happens)
the index file is literly just
const Client = require("./core/Client.js");
const client = new Client();
const { Intents } = require("discord.js");
client.setup({ ws: { intents: Intents.ALL } });```
wrapper™️
oof
isit?
that just redirect the bot start to Client.js insteed of starting in server.js
watt
thats not how it works
we have no idea of knowing how you registered your events
I am just gonna wait then until one of my team members gets online to help me insteed then :)
ok then theres nothing much to do for now
gl
Hi
Hello! There is an event containing "async" in my "bot.js" file. But this event doesn't work without using a command containing "async". Does anyone know the solution?
oi
does anyone know how to use robloxpy
what?
I have an event like this.
and what does async have to do with events?
If someone opens a role without using this command, this event does not work.
@opal plank am using audit log in command.
it means the function you're passing is asyncronous
aka it doesnt run in sequence
if your function is not passing, its related to your logic or code you wrote
not related to async
if you're using intents make sure to include the guilds intent
otherwise you will not receive the event at all
it might also be partials
good call, i completely missed
debug i guess
Not Found
You clicked on a link that doesn't exist. This is probably not where you were trying to go.
any solutions
reading #site-status
it says that they fixed it
no it doesn't
okey well
We haven't finished migrating infrastructure just yet so you might continue to experience other issues for the time being.
One message removed from a suspended account.
oh no
All this because I added joi as a dependency
without joi my bundle is 200 kb
Welp I guess I'll be doing the validation myself
if someone could help me with this id appreciate it, im trying to use wait_for to get a user's reaction response to my bot's message for tic tac toe, this is my current statement here, are there any obvious errors in it? reaction = await client.wait_for('reaction_add', check=reaction_check)
reaction_check is a function i defined above which takes reaction as a param, compares it to predefined reactions in if statements, returns True if an accepted reaction is detected. am i doing something wrong or is there a better way to do this? if anyone needs to see the code for reaction_check let me know but its a little long so i didnt want to include it here (discord.py rewrite btw)

@earnest phoenix please do not ghost ping users, thanks.
So Umm, my bot is firing this error, and I know it sounds dumb but, I think its API bug. I removed it from all of the guild it's in restartedd it, changed its token and everything, and it still fires.
(node:24) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'user' of null
at module.exports (/home/container/resources/events/guildDelete.js:15:46)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:24) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
I did find a solution and it's to change the bot's client id, creating a new bot and a new api, only then it works. And I don't want to sacrifice my verified bot that took like 4 weeks to verify, so if there's any other solutions, please?
No I mean, it works fine on another account
And I don't see why the code is a problem
It's firing on guildDelete event
Which for some idk what reason is fired on startup
The other account probably doesn't have the same intents enabled in the dev portal
The code is still relevant
Show us the guild delete event file.
Allright then
module.exports = async (client, guild) => {
const Discord = require('discord.js');
const Essentials = require("../utils/essentials.js");
// Send Message to Owner //
var guildIcon = guild.iconURL() || client.defaultAvatarURL;
const owner = await client.users.cache.get(client.owner)
const embed = new Discord.MessageEmbed()
.setAuthor(client.name, client.avatar)
.setColor(client.color.red)
.setTitle("Guild Left")
.addField("**Guild Name**", guild.name)
.setThumbnail(guildIcon)
.addField("**Guild ID**", guild.id)
.addField("**Guild Owner**", guild.owner.user.tag)
.setFooter(client.footer, client.avatar);
owner.send(embed).catch(err => Essentials.error(err))
};
Here you go
So, guild.owner.user.tag is the problem. The guild owner isn't cached. You need to fetch it.
But the event is not supposed to be fired?
It's fetch () to do that, not get()
It throws the error on startup
Hmm
It was working fine until a few days ago
I had to remove all the guilds it was in just to make sure it isn't there
And sure enough it isn't and the event was fired properly when I removed them
Try to add if(guild.unavailable) return; at the very top of that event.
But the error persists on startup
Okay one sec
Error persists @umbral zealot
But it's now firing at the next line
A differrent line, but the error persists and still the exact same
Can you add a console.log(guild) at the top
Sure
To know what guild data triggers this
Guild {
members: GuildMemberManager {
cacheType: [class Collection extends Collection],
cache: Collection [Map] {},
guild: [Circular]
},
channels: GuildChannelManager {
cacheType: [class Collection extends Collection],
cache: Collection [Map] {},
guild: [Circular]
},
roles: RoleManager {
cacheType: [class Collection extends Collection],
cache: Collection [Map] {},
guild: [Circular]
},
presences: PresenceManager {
cacheType: [class Collection extends Collection],
cache: Collection [Map] {}
},
voiceStates: VoiceStateManager {
cacheType: [class Collection extends Collection],
cache: Collection [Map] {},
guild: [Circular]
},
deleted: true,
available: false,
id: '810990219281039391',
shardID: 0
}
Oh a guild deleted
I Did
Then it shouldn't error out.
It can't be both, if available is false, it returns, and never reaches the line that causes the error.
Do you not mean available == false?
Oh! Shit, yes you're right. It's (! guild.available)
Okay one sec
I wonder if that changed, I remember it being unavailable... But maybe this is a partial.
Aight thx it works now somewhat, I changed it a bit to allow for a little error
if (!guild.available || guild.deleted) return;
No no, deleted is normal
Yeah, just in case Imma bit paranoid now
This error haunted me for like days
ok but no, now your bot is "in a guild that's deleted"
you don't want to return on guild.deleted
Though admitedly that's pretty strange to get this particular event
Yeah that's why I got confused xd Thanks a lot for the help
Glad I could assist! 
hello, how i can make server votes log?
message.channel.send("This command is a test command, are you sure you want to run it?").then(async msg =>{
msg.on("collect", r => {
switch(r){
case "yes":
msg.delete();
return true;
case "no":
msg.delete();
return false;
}
})
})
``` I wrote this, but it doesn't seem to work, can anyone tell what is wrong with it?
anybody got an idea how to use a string as dynamic var name?
let's say Array ["session"] is given and I would like to push array[0] as var name, for example this.#private_property.push({ array[0]: anyvalue });
(without eval())
[array[0]]: anyvalue
np!
With the verification process, can the bot have temporary admin just to setup, and then revert it's access down again?
I noticed rule 6. I was hoping temporary access to make roles/channels wouldn't hurt
Make roles: Requires MANAGE_ROLES permissions
Make channels: Requires MANAGE_CHANNELS permissions
nothing requires Admin permissions.
Admin perm is for lazy people that can't bother setting up proper permissions and permissions checks. Don't be lazy, do it right.
hi
print("check entered")
return user.id == msg.author.id
try:
reaction, user = await client.wait_for("reaction_add", timeout=30, check=check)
print("reaction found")
except asyncio.TimeoutError:
await ctx.send('👎')
await msg.remove_reaction(reaction)
print(str(reaction.emoji))
i cannot for the life of me figure this out, i believe that the problem has something to do with the check call, ive checked out the docs and their example works in my bot when i stick it in the main.py function. however, im using cogs, and i believe that could be the problem. can anyone see some error with this code that i havent caught? already spent so long on this im wondering if anyone's had a similar issue theyve solved
my prefix command is embeded but it asks for an argument? so like !prefix <embed> for some reason.
```python
@commands.command()
async def prefix(self, ctx, embed: discord.Embed):
self.ctx.send(
embed=discord.embeds(
color=discord.Colour(0xff0000),
title="This servers prefix is:",
decription="!",
footer=f"This command was executed by {message.author.id}",
timestamp=datetime.now()
))
(node:1624) UnhandledPromiseRejectionWarning: Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.
how to fix it ?
your prefix command is requiring an argument embed which is type discord.Embed in the 2nd line, just get rid of that
Ok, Thanks!
yw! i hope it helps
Wtf is discord.embeds
¯_(ツ)_/¯
@cinder patio need to bother you again, same question, different method
#obj = { test1: Promise, test2: Promise }
wanna call an object key by a function
{
console.log(this.#obj.key);
}```
will throw an error since, `obj.key` doesn't exist
obj[key]
Same issue i am having
Are you sure that's how you did it? It should work
Maybe the key doesn't exist on the object in general
even then, obj[key] would return undefined if key was undefined
Do you need to add the hashtag when accessing it?
good question
maybe it doesn't work for private fields
nah the string I enter in the function getObject(key_name) exists in the object
I've never played with those
And the field is private?
if it is, try making it public to see if it'll work
the var is private
hello again, how i can make server votes log?
the issue is the function - for example this.#getObject(test1) -
{
console.log(this.#obj.key);
}```
doesn't check if the property `test1` exists, it checks if `#obj.key` exists, but `key` should again be the property name I am passing the function as argument
We already told you to use obj[key]
but #obj = { test1: Promise, test2: Promise } exists like so and is of course accessible in the function #getObject()
manually calling console.log(this.#obj.test1); - inside #getObject - will return the property
i removed the presence intent from my bot and the cpu usage of the vps went from 15%-ish to 1-2% lol
random statement btw
hmm maybe @quartz kindle has an idea
hi
hi Tim
get rid of embed: disord.Embed in the function definition line and change discord.embeds to discord.Embed
@quartz kindle if that doesn't explain enough, a few messages above there're more details
im so confused
you can't use a variable as an index
UNLESS
you do obj[variable]
obj.variable would be the same as { variable: 1 }
Look at the image I sent earlier, it's exactly what you want to do, right?
it works
How to do this? My own bot also has / as prefix but doesn't show up there...
well ty anyways... reading more carefully is on my list 
thanks I'll take a look at it
hi Tim
Anyone have any experience with google captcha v3?:
const googleRes = await fetch("https://www.google.com/recaptcha/api/siteverify", {
method: "POST",
body: JSON.stringify({secret: config.captchaSecret, response: body.captcha}),
headers: {
"content-type": "application/json"
}
}).then(res => res.json()) as GoogleCapthcaResponse;
For some reason I'm getting these [ 'missing-input-response', 'missing-input-secret' ] errors, but they're both there, I guess I'm not sending the body correctly but on their site it explicitly says URL: https://www.google.com/recaptcha/api/siteverify METHOD: POST
Lol Xyoyu has a feminised version of Verified Dev in her(ig?) status
Sigh google docs back at it again
rip it's chinese for me I'm new at programming lol idk what to do with those scripts
How to get emoji ID?
Turns out the secret and response are query params ........
thanks for not telling me that google docs
copy its link and get the number on the link
https://cdn.discordapp.com/emojis/<ID>.png?v=1
Thanks
guess need to bother you again, lmao
const Database = require("./src/database.js");
const Converter = require("./src/converter.js");
const SQL = new Database();
const Lookup = new Converter();
how would I access the class Database in class Converter without extending classes?
pass the database instance to the constructor of Converter
would be one version, isn't there a method like in PHP using globals/super?
Passing SQL to the Converter constructor is definitely your best option here
hmm alright, js is still weird, but ok
You could theoretically assign arbitrary properties to Objects, but that's not recommended as that breaks whatever type safety JS does have.
aye it is, but the class access is public and all private methods are private and save
Google Capthca 
😳 oop
Are you using dbl.js?
That's deprecated
my bot is in 75 servers, now what? how do i get it verified?
use top.gg/sdk
Keep in mind it works a little differently with webhooks - it gives you an express middleware function
you'll have to create the express server yourself
wait I just realised
you weren't even using the official deprecated lib
Can't test my code currently, otherwise I wouldn't ask, but,
I'm trying to make a multipart request method for sending files to Discord.
This used to work before I moved from axios to centra. I made sure to copy all of the proper headers and even checked if centra had form-data compatibility and I'm 99% sure it does. I don't get a Promise rejection from the function for some reason so I'm not sure what the issue might be. Am I missing specific headers or anything?
The typedef for this.options.headers is headers: { Authorization: string; "User-Agent": string; }
/**
* Execute a multipart/form-data request
* @param endpoint Endpoint to use
* @param method Http Method to use
* @param data data to send
* @returns Result of the request
*/
private async _multiPartRequest(endpoint: string, method: HTTPMethod, data: any): Promise<import("centra").Response> {
const formData = new FormData();
if (data.file.file) {
if (data.file.name) {
formData.append("file", data.file.file, { filename: data.file.name });
} else {
formData.append("file", data.file.file);
}
delete data.file.file;
}
formData.append("payload_json", JSON.stringify(data));
// duplicate headers in options as to not mutate the state.
const newHeaders = Object.assign(Object.create(null), this.options.headers);
Object.assign(newHeaders, { "Content-Type": `multipart/form-data; boundary=${formData.getBoundary()}` });
return c(this.apiURL, method).path(endpoint).header(newHeaders).body(formData, "form").send();
}
Some relevant commit info as well to see what it looked like previously
https://github.com/AmandaDiscord/SnowTransfer/commit/bcfe575590a484d002248401c36b58b0905f4733#diff-1745dedfb7aec56bc9a7dfff2554f9ca59e30c20a68ca09d6054a65bd1d3b17dL182
anybody got experience working with bigint in JS?
just ask your question
Need to get the modulo of a bigint value.
for example 99561197960265770 % 2
won't work since it's bigger than MAX_VALUE
BigInt(id) % 2n
nope
That should do it
test it yourself, it's always 0
BigInt? more like BigConfusing
The ID needs to be a string
oh yeah, makes sense, thanks
It's 0 because the number is even, no?
0 would be the correct output
but not 99561197960265771 % 2 for example
but nvm... forgot to convert into a string
you shouldn't have it be an integer in the first place, otherwise, JS would already have done funny stuff to the number if it was greater than it's max integer
is this normal btw ?
or
Is this what site issue they're talking about in #support ?
yes
Regarding my question, it seems as though Discord thinks I'm sending an empty message even tho everything should be correct. Was checking docs and it might be that I'm missing the Content-Disposition header
Hi guys
Am I the only one who has this issue?
The userUpdate event doesn't work
I'm using discord.js v12
client.on('userUpdate', async(oldUser, newUser) => {
console.logs('test')
})
i tried this
What are you doing to test this event?
That would be the guildMemberUpdate , not the userUpdate
Also note that I'm pretty sure you need to have one or both privileged intents for this to trigger.
oh.. it worked

userUpdate
Emitted whenever a user's details (e.g. username) are changed. Triggered by the Discord gateway events USER_UPDATE, GUILD_MEMBER_UPDATE, and PRESENCE_UPDATE.
i don't get it

and thx btw :>
yeah I'm not sure why that mention is there. it's a bit weird.
guildMemberUpdate comes exclusively from GUILD_MEMBER_UPDATE
not sure what's up with userUpdate
i'd have to dig through the source
i think userUpdate is emitted when user data is present from the guildMemberUpdate event and is different from what's cached (possibly presence update too but idk)
seems to trigger regardless, https://github.com/discordjs/discord.js/tree/stable/src/client/actions/GuildMemberUpdate.js#L13-L15
it just forwards a user object instead of a member object
🚮 design
it’s discordjs what do you expect
actually makes sense
i remember discord's gateway being incredibly stupid and sending user updates through GUILD_MEMBER_UPDATE sometimes
that almost makes sense
because, if you're in a server and you receive a guild member update for a user from that server, you can obviously update the user data
but either way a separate user update would probably be better and make the most sense
the thing is
actually

Bots are no longer in this server, and the Top.gg Verification Center is only during testing, it gets removed after testing, yes.
lol, my bot has been aproved 6 months ago
Can someone help me?
Then it's not on any of our servers
any server you find that's called "top.gg" something is a fake server.
someone was adding bots to a server with the same name as our testing server.
812662820507353138 is this the id?
no
your bot got ratelimited
it left, thats way lol
thx 
a
b
Hello
I'm not exactly the best at developing a discord bot
How would I make a bot that sends a message every hour?
in a select channel
Javascript
setInterval(() => { ... }, 60 * 60 * 1000)
how would I get the bot to send a message?
channel.send
fetch the channel and send the message
😆
example?
use client.channels.fetch(<id>)
the channel id?
it's a promise, so you'll have to await it
setInterval(() => {
<channel>.send(whatever you want)
}, ms(time))
the channel name is 🔱status
and the id is: 814214619236270090
I'm not sure where to insert?
this
inside the ()
use the channel id
bot.channels.cache.get("id')
🙄 / kk
It is telling me that client isn't defined, how do I define?
client is your bot
do I change that to bot?
idk
channel is always cached
change it to whatever you named your bot
Status X
oh alright
i mean your bot variable
not sure what it is
I prefer Lua i'm just doing this as a side project
you still have to learn js
You don't have to make the bot in JS I'm sure there's a lib for discord bots for Lua
yeah
ok
its the same concept
thanks
lua is cringe
I get this for the stats poster:
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'size' of undefined
from the poster, or a variable your putting into the poster?
I use this
const AutoPoster = require('topgg-autoposter')
const ap = AutoPoster('topggtoken', client) // your discord.js or eris client
// optional
ap.on('posted', () => { // ran when succesfully posted
console.log('Posted stats to top.gg')
})
i use my token
for dbl
are you using djs v12?
What is this error?
nah v11.5.1 im too lazy to update lmao
well, thats why
"Cannot delete a channel required for community servers" seems pretty clear to me
autoposter is v12 only
i never understood
Can I get help
cannot delete a channel required for community servers
🥺
MAybe you're trying to delete the welcome/rules channel?
or an announcement channel
Welp looks like im gonna merge to v12
hmm
but nothing about channel deletion in the bot
wdym the apk?
thats so weird
Clearly that's wrong
you can't get this error if you don't try to delete a channel.
setInterval(() => {
api.postStats({ stats });
}, 30 * 60 * 1000)
ez
i have created topgg-autoposter
lol
😳
console.log(`I was kicked/banned from: "${guild.name}" :(`);
client.users.fetch("601446917007736832").then((user) => {
user.send(`I was kicked/banned from: "${guild.name}" :(`);
});
});
Can anyone help me on this
making things by hand without just using a libs example code is hard 
thanks @solemn latch
np 😄
lmao
reinventing the wheel is the best thing to do in the world










