#development

1 messages · Page 1612 of 1

solemn latch
old cliff
#

meanwhile

#

my friends telling me to hide my html

whole warren
#

yeah lol

#

lol

#

i just minify everything and make sure there are no maps

#

especcially for javascript

old cliff
#

hmm still it can be copied

#

so I don't care

mellow kelp
#

i use source maps in production pepowot

lyric mountain
#

Why worry that much my boy

whole warren
#

ew

mellow kelp
lyric mountain
#

HTML without assets is just plain text

old cliff
#

but can we even hide assets ?

#

nope

lyric mountain
#

Yes

old cliff
#

yes ?

lyric mountain
#

I don't mean images

old cliff
#

css ?

lyric mountain
#

I mean actual back end stuff

old cliff
#

yesy

#

that is always hidden my boy

lyric mountain
#

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

old cliff
#

yes

lyric mountain
#

Don't think so

old cliff
#

or stinky ejs ?

lyric mountain
#

My react dev tools never lighted up on top.gg

mellow kelp
#

my react extension gets activated

lyric mountain
#

Wut

#

Mine never worked there

mellow kelp
#

hmm

#

wait it only works on bot pages

whole warren
#

i wish i could have got the verified bot developer badge

mellow kelp
#

huh

old cliff
stark abyss
#

is self hosting a discord bot bad

lyric mountain
whole warren
#

why?

lyric mountain
#

People didn't stop trying to get it

icy skiff
#

Cause DMs?

lyric mountain
#

Do you know how much bitcoins I got offered?

whole warren
#

lol

mellow kelp
#

lmao KEKW

whole warren
#

i would have taken them

copper cradle
#

lmao

stark abyss
#

dang then I wish I got it Smileweird

copper cradle
#

I got a lot of dms from people offering money for my acc

whole warren
#

ill pay you 50 bitcoins rn

stark abyss
#

Wow

whole warren
#

NOW

#

loll jk

stark abyss
mellow kelp
#

how much are 50 bitcones

#

lemme see

icy skiff
icy skiff
stark abyss
whole warren
#

who wants to host my discord bot for me lol

old cliff
#

what is top.gg certification program ?

whole warren
#

i hacked elon

lyric mountain
#

Just imagine 1 bytecoin

copper cradle
#

yeah

lyric mountain
#

Or 1 kilobytecoin

mellow kelp
#

teracoin

copper cradle
#

well 8 bitcoin then

icy skiff
copper cradle
#

1024 bitcoin

stark abyss
#

how much did you get offered kuuhaku

old cliff
#

I can give 1 bit coin

whole warren
#

i have doge coin

#

i mined it a long time ago

stark abyss
#

1 is like 50 grand AHWeirdChamp

whole warren
#

still wish i had that badge

old cliff
#

1 bit image coin

#

that is what I would give

lyric mountain
stark abyss
#

Jeez

whole warren
#

you can fr just go online and buy them lol

stark abyss
#

Doesn't sound like a bad deal though, you could make a business out of it KEKW

whole warren
#

yes

stark abyss
#

too late 😔

icy skiff
#

Not anymore since they dont give badges anymore

whole warren
#

just could have added 70 memebers to a team last year

lyric mountain
#

Gonna open a "money first, account later" business

whole warren
#

except the account never comes

stark abyss
icy skiff
#

Did people make u offers even when badges were still a thing?

lyric mountain
#

The offers were different back then

#

They offered stuff for being part of the team

whole warren
#

discord needs to come up with a rewards system for bot developers tho

#

server makers get one so why cant we

stark abyss
lyric mountain
#

Yeah, bot partnership when?

stark abyss
#

oh like server partnership?

whole warren
#

yeah

stark abyss
#

What vps do you guys use?

whole warren
#

heroku

#

lol

mellow kelp
#

google cloud kekw

whole warren
#

it is sad

stark abyss
#

😔

lyric mountain
#

Bot partners could get:

  • gif avatars
  • doubled ratelimits
  • a flamin hot cheetos
  • lite version of nitro
whole warren
#

yessssssssssssss

mellow kelp
#

yessss

#

i want cheetos

whole warren
#

but we should also get that hoodie

#

that would be nice

mellow kelp
#

we should get drip

whole warren
#

yes

mellow kelp
#

bot drip 😳

stark abyss
#

There would be too much hype for discord to handle

whole warren
#

agreed

stark abyss
#

like badge

#

they had to remove it

whole warren
#

youtubers ruined it

lyric mountain
#

The issue with the badge was that it was fckin easy to get

whole warren
#

yes

old cliff
#

I use my raspberry pi which is kept in nasa's server room

lyric mountain
#

Like, 75 servers, an id photo and some questions

whole warren
#

they should make the requirement more like 1000 servers

lyric mountain
#

Really?

whole warren
#

or 5000

#

so it actually means something

delicate zephyr
icy skiff
mellow kelp
#

why do people want that badge so much

stark abyss
#

okay

mellow kelp
#

it's just stupid

old cliff
#

i don't give a fuk to badges

whole warren
#

because

solemn latch
#

to be special

whole warren
#

it is nice

stark abyss
whole warren
#

i am going to work on getting the bug hunter badge

lyric mountain
#

Dude, remember that people buy robux to dress a blocky character

old cliff
#

lol

whole warren
#

lol

lyric mountain
#

And you asking why the badge stuff?

stark abyss
#

lmao

old cliff
#

lmao i can get partner badge

#

if 100 more people join my server

stark abyss
#

How does that work?

solemn latch
#

gotta retain them

lyric mountain
#

Yeah, that's why this server ain't partnered yet

old cliff
#

it should have been

solemn latch
#

it never will be

lyric mountain
#

Even if top.gg is the reason discord is popular

old cliff
#

but eri bans too many people

#

so it can't happen

whole warren
#

lol

stark abyss
#

I like discord but don't think as much to buy hoodie or other things

whole warren
#

lol

lyric mountain
#

They could sell nitro scooters

whole warren
#

you know somebody would buy it

stark abyss
solemn latch
#

nitro scooters pog

lyric mountain
stark abyss
#

nice

old cliff
#

🔱

stark abyss
#

wait what is that

#

are these "stickers"?

old cliff
#

trident ?

#

yes

#

I don't have stickers in india

#

still I can send

#

casue discord dumb

stark abyss
#

hmm how do you use them

old cliff
#

I type sticker name in emoji picker

#

it shows

lyric mountain
#

Just press emote icon

stark abyss
#

oh

lyric mountain
#

And click stickers

#

Or type "no" for example

#

It'll popup

old cliff
lyric mountain
#

Wut

old cliff
#

yes

#

I type :

#

and then type sticker name

stark abyss
#

oh wait

#

I use discord on browser

solemn leaf
#

How good of a server do you think you would need for a music bot with 10k servers

old cliff
#

server with 1 member

lyric mountain
#

Try typing "no"

#

Without quotes

old cliff
lyric mountain
#

See if it pops

stark abyss
#

"no"

old cliff
stark abyss
#

no sticker option? thinkingLol

lyric mountain
#

No, type in the chat

stark abyss
#

:no:?

lyric mountain
#

A sticker suggestion should popup with certain keywords

#

At least for me it appears

stark abyss
#

so you wanted me to do :no

#

correct?

lyric mountain
#

Just no

#

Without anything else

stark abyss
#

yeah no doesn't work for me

lyric mountain
#

Btw, have u unlocked the starter bundle?

mellow kelp
stark abyss
#

what starter package

mellow kelp
#

what

lyric mountain
#

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

stark abyss
#

I gotta google this dafuqexit

lyric mountain
#

Oh my

mellow kelp
#

oh wait stickers aren't available on my country

#

not poggers

lyric mountain
#

Yeah, there's that too

stark abyss
#

I live in US thinkingLol

mellow kelp
#

"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."

stark abyss
#

ah

mellow kelp
#

who would have thought i would ever want to go to brazil

stark abyss
lyric mountain
#

Yay, brazil

stark abyss
#

You could pick Japan and you pick Brazil

lyric mountain
#

We finally got something before usa

mellow kelp
#

wait true

#

im going to japan

stark abyss
#

How disappointing 😔

lyric mountain
stark abyss
#

Nice but I don't think I have it lol

mellow kelp
#

😔

lyric mountain
stark abyss
#

Nice we don't got that

lyric mountain
#

weird

#

like, ain't discord's hq in usa?

stark abyss
#

I would assume so

mellow kelp
#

maybe they wanna test stuff out before giving it to their main audience

stark abyss
#

haha nice one

lyric mountain
#

But anyway, don't expect much, you only get one bundle for free

#

Rest is either paid or nitro-only

stark abyss
#

I see

lyric mountain
#

Cya guys

mellow kelp
#

cya

stark abyss
#

Yeah good night

errant perch
#

What are the rate limits for changing your own bots nickname? I can’t find any specific time

swift cloak
#

how can i choose an initial method for the password in filezilla?

teal vault
pale vessel
#

embeds. if not, add a custom emoji to make it look nicer etc.
fix your capitalization

teal vault
#

whats wrong with capitalization there?

pale vessel
#

Error twitter user not found

#

Error: Twitter user not found.

#

❌ Twitter user not found.

#

error Twitter user not found.

pale vessel
safe creek
#

f

pale vessel
#

everybody gangsta until someone sends an actual embed to demonstrate

safe creek
#

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

pale vessel
#

Docs? What programming language/library?

safe creek
#

py

#

my bad

#

for not saying

pale vessel
small oar
#

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

pale vessel
#

You can use indexes to determine which activity to set while having it in a loop

safe creek
#

i see

#

ty

earnest phoenix
#

you need a backend server for this

small oar
#

Ok, thx

bitter juniper
#

Which one is better for writing discord bots javascript or py

jaunty quartz
#

can any one help me make my server

small oar
bitter juniper
#

Yeah I agree but someone told me that there are more resources for javascript. @sour anchor

small oar
#

So whichever you know better use

sour anchor
#

There is a support server

earnest phoenix
#

difficulty is subjective

bitter juniper
#

I know py but planning to learn javascript

earnest phoenix
#

use whatever you prefer

small oar
#

If you know neither, then dont start with making a bot

bitter juniper
#

Hm

small oar
#

I hate making websites.

bitter juniper
#

I made a few websites

small oar
#

Does anyone know a good html tutorial?

bitter juniper
#

Can't you just download html themes and edit it according to your taste

jaunty quartz
#

can any one help me make my server

small oar
#

I could, but id rather know what im doing

bitter juniper
#

Will save you a lot of time

small oar
jaunty quartz
#

no i give nito after work

bitter juniper
#

I am sorry can't help you with that.

summer torrent
#

@modern sable someone is spamming invite links

bitter juniper
#

If I may is too. gg affiliated with discord in anyway?

summer torrent
#

no

bitter juniper
#

Oh I see

near stratus
devout notch
#

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

near stratus
devout notch
bitter juniper
#

@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

near stratus
#

If you know it then go for discord.js

sour anchor
#

Js is hard imo

bitter juniper
#

Yeah I did made a basic bot with py @sour anchor

near stratus
devout notch
#

the thing is Java has like different arrays, you have to define their dimensions
That doesn't occur in javascript

devout notch
#

yeah

#

int array = new int[] or something like that I dont even know

bitter juniper
#

@near stratus I think Python is easier than most language too btw like your pfp (had a huge crush on Asuna xD)

near stratus
bitter juniper
#

I only know basic java

near stratus
bitter juniper
#

Hmm that makes sense

mellow kelp
#

Java is cool smh

devout notch
#

damn, bubblesort, insertion sort, recursive functions, Java sure is fun

bitter juniper
#

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

devout notch
#

you guys didn't have to code that in comp. sci.?

#

you're lucky lol

mellow kelp
#

I haven't taken computer science

cinder patio
#

The first two are sorting algorithms that aren't related to java

#

and every major language has recursive functions

mellow kelp
#

Tf is so bad about java 😔

devout notch
#

They aren't strictly related to Java but I thought you guys also had to code search algorithms in school (in Java)

#

just me ?

mellow kelp
#

Maybe

cinder patio
#

Not in java, no

mellow kelp
#

I'm only 14 so nah

#

Would be cool if they taught us programming at school tho

cinder patio
#

And I'm not in university yet but in high school we wrote almost everything in C++ / VB

devout notch
#

thats nice, better than Java for sure

mellow kelp
#

What's so bad about java lmfao

cinder patio
#

aaanyways

#

back to my website design

mellow kelp
#

pog

#

how's it going

cinder patio
#

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 thonkku

mellow kelp
#

Yea probably

#

Make the animation subtle though

#

Don't make it attract too much attention

tired panther
#

What is a good size for the card?

earnest phoenix
#

well that depends on what the card is supposed to show

cinder patio
#

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

near stratus
bitter juniper
#

🤣

tribal siren
#

why does replaceAll() doesn't work in my node.js?

cinder patio
#

You're most likely not using it correctly

novel orbit
#

Hej

cinder patio
#

or you're using an old node.js version

novel orbit
#

Mówi ktoś po polsku ?

tribal siren
#

no

near stratus
tribal siren
cinder patio
#

How does it not work? Are you getting an error is it just not outputting the right result

near stratus
cinder patio
#

be more specific

misty sigil
#

Run node -v

misty sigil
#

And tell us the output

tribal siren
#

i know what im talking about

cinder patio
#

we don't

tribal siren
#

for example

misty sigil
#

can you run

#

node -v

tribal siren
#

it's supposed to show "hello everyone idiot is here and idiot is ready"

misty sigil
#

and tell us

#

the output

cinder patio
#

And... what's the actual result

slender thistle
#

It returns a modified string as opposed to modifying the original one, right?

cinder patio
#

yeah

misty sigil
#

yea iirc

tribal siren
#

but shows error

cinder patio
#

Old node.js version

misty sigil
#

because it’s an old node version

near stratus
cinder patio
#

you have an old node.js version too

tribal siren
#

how to update then

near stratus
misty sigil
cinder patio
#

that's repl-it?

tribal siren
#

yes

misty sigil
near stratus
misty sigil
#

I wasn’t speaking about yours

near stratus
cinder patio
#

Maybe node.js isn't using the V8 version which implements .replaceAll yet

near stratus
misty sigil
#

but you were replying to someone who was reacting to my message

slender thistle
#

Can't you provide regex to .replace for it to act as .replaceAll?

cinder patio
#

you can use .replace(/brace/g, "idiot")

misty sigil
#

yea you can

near stratus
tribal siren
#

oh i forgot we can use regex

misty sigil
#

fucking hell

tribal siren
#

i will try

#

still doesn't work Pensive

cinder patio
#

you're still using .replaceAll

near stratus
tribal siren
#

damn

#

yes now it works

#

thans

earnest phoenix
delicate shore
#

i did

earnest phoenix
#

What's wrong here client.users.cache.find( user => user.tag === "user#1234" )

cinder patio
#

What happens when you run it? Any errors? Unexpected results? Elaborate

earnest phoenix
#

@cinder patio return undefined

lusty quest
#

try == instead of === just out of curiosity

#

== will compare === will compare of the same type

earnest phoenix
#

It works

modest maple
#

types man

cinder patio
#

user.tag is nullabale, it doesn't always have a vale

#

value

#

the equal operator is not the issue

earnest phoenix
#

Is there any way to get all users of same name

cinder patio
#

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

stable eagle
#

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?

cinder patio
#

The Function constructor will come in handy

stable eagle
#

Oh lol

#

Ok

cinder patio
#
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

eternal osprey
#

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.

cinder patio
#

There is a way and I showed it in my message...

earnest phoenix
#

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

eternal osprey
#

like bin it or something

earnest phoenix
#
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);
devout notch
#

wtf theres a discord-giveaways library

#

guess I've been living under a rock this entire time

feral aspen
#

Wot.

feral aspen
#

Is there an evaluation code where I can cache a user and check mutual servers from the bot?

fluid basin
#

Wot.

eternal osprey
#

and at which line was it giving issues?

#

line 51? What line is that in code?

feral aspen
#

For example, I can check my mutual servers with a user, but instead from me, from the bot. Is that possible?

pale vessel
#

Yes

fluid basin
#

you need to have guild members intent

feral aspen
#

I have that, no worries.

fluid basin
#

and you need check which guilds is the user in

#

yeah

feral aspen
#

I'm performing it using the !eval command, privately.

pale vessel
#

You can use something like guilds.cache.filter(({ members: { cache } }) => cache.has(id))

fluid basin
#

:spoon:

feral aspen
#

😋

#

Is there a way it can return as json based?

pale vessel
#

Yes, map the collection

feral aspen
#

Aight!

devout notch
#

dont you have to use JSON.stringify or something?

#

nvm

feral aspen
#

Hm..

#

It returned with my entire bot's server list instead with True & False

pale vessel
#

I see

feral aspen
fluid basin
#

no

pale vessel
#

I was just about to :(

fluid basin
#

you gotta filter it

feral aspen
#

Ah.

pale vessel
# feral aspen

[...guilds.values()].reduce((x, { name, members: { cache } }) => (x[name] = cache.has(id), x), {})

#

God what have I done

feral aspen
#

oof

pale vessel
fluid basin
#

🥄 bad

feral aspen
pale vessel
#

Wait that's filter

#

😩

#

map, there

feral aspen
#

What.

real geode
#

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

lusty quest
#

did you leaked your token?

pale vessel
feral aspen
lusty quest
#

(only for console outputs)

fluid basin
#

tfw you cba to make a command for it

pale vessel
feral aspen
#

One second...

pale vessel
#

guilds is the collection

earnest phoenix
#

so I need this

devout notch
#

I know I just never knew there was something like that

earnest phoenix
#

so whats the problem with the token?

#

the token is valid

devout notch
#

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"
}

earnest phoenix
#

In config.json I have this:
{
"token": "",
"prefix": "$",
"everyoneMention": false,
"hostedBy": true
}

devout notch
#

just define config as JSON.parse(fs.readFileSync('config.json'));

#

maybe that will work I dont know

earnest phoenix
#

:/

#

rip

lusty quest
#

you dont need to parse json. JS is smart enough for it to get recocnized

devout notch
#

or don't use config.json use the actual path to your config file

devout notch
lusty quest
#

also you dont need a readFileSync for it

#

you can just require it

cinder patio
#
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 slonk

wary flame
#

I'd say first snippet is more readable

cinder patio
#

I agree

opal plank
#

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

near stratus
opal plank
#

lmao

frosty valve
#

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],
  })

  });
};```
pale vessel
#

Try it and see

frosty valve
#

I wanted to ask first before to testing

fluid basin
#

so do you know if it'll work now? dboatsYeetus

frosty valve
#

didnt work. What could the problem be

#

didnt even return a error

fluid basin
#

u shldnt be registering new events every time the command executes

opal plank
#

@frosty valve you using Visual Studio Code?

frosty valve
#

this test bot is on glitch.com for I dont have VSC on my school pc

near stratus
opal plank
#

fuck, i even had the link on clipboard

frosty valve
#

yes

#

break

opal plank
#

first, you arent cacthing errors

#

send() is a promise

near stratus
opal plank
#

catch errors as needed

#

second

#

as uwu? said

#

dont register new events everytime

#

make sure you only run that ONCE

near stratus
frosty valve
#

its defined in the command handler I use

opal plank
#

its a function

#

he's passing client akio

near stratus
frosty valve
near stratus
opal plank
#

of course

#

you're passing an object

#

its reference at least

#

it manipultes the object itself

#

in this instance, client

#

which extends event emitter

frosty valve
#

I am maybe using the event handler the wrong way so it doesnt register it

opal plank
#

and this is why i asked if you were using VSC

#

so you could look at this

#

and properly debug it with a breakpoint

near stratus
#

ooo It works I just tried the client.on("join" in a function and it works

#

thanks for the info

opal plank
#

i told you it would lmao

#

i use it too

frosty valve
#

I could run it too in the Core file insteed of it as a event

#

would that work?

opal plank
#

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)

frosty valve
#

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 } });```
opal plank
#

wait what

#

what is Client.js?

#

are you not using d.js's client?

fluid basin
#

wrapper™️

opal plank
#

oof

fluid basin
#

isit?

frosty valve
#

that just redirect the bot start to Client.js insteed of starting in server.js

fluid basin
#

watt

#

thats not how it works

#

we have no idea of knowing how you registered your events

frosty valve
#

I am just gonna wait then until one of my team members gets online to help me insteed then :)

fluid basin
#

weirdsip ok then theres nothing much to do for now

worldly heron
#

gl

ruby igloo
#

Hi

true cosmos
#

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?

shell spindle
#

oi

oblique mist
#

does anyone know how to use robloxpy

true cosmos
#

I have an event like this.

opal plank
#

and what does async have to do with events?

true cosmos
#

If someone opens a role without using this command, this event does not work.

opal plank
#

thats unrelated to async

#

async just allows you to use await basically

true cosmos
#

@opal plank am using audit log in command.

opal plank
#

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

earnest phoenix
#

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

opal plank
#

good call, i completely missed

earnest phoenix
#

debug i guess

true cosmos
#

ok

#

i will test.

junior fjord
#

Not Found
You clicked on a link that doesn't exist. This is probably not where you were trying to go.

#

any solutions

rustic nova
junior fjord
#

it says that they fixed it

rustic nova
#

no it doesn't

junior fjord
#

okey well

rustic nova
#

We haven't finished migrating infrastructure just yet so you might continue to experience other issues for the time being.

sage bobcat
#

One message removed from a suspended account.

cinder patio
#

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

warm junco
#

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
umbral zealot
#

@earnest phoenix please do not ghost ping users, thanks.

pale vessel
neat harness
#

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?

earnest phoenix
#

it isn't an api bug

#

it's your code

#

if you share it you'll probably get help

neat harness
#

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

umbral zealot
#

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.

neat harness
# umbral zealot The code is still relevant

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

umbral zealot
#

So, guild.owner.user.tag is the problem. The guild owner isn't cached. You need to fetch it.

neat harness
umbral zealot
#

It's fetch () to do that, not get()

neat harness
#

It throws the error on startup

umbral zealot
#

Hmm

neat harness
#

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

umbral zealot
#

Try to add if(guild.unavailable) return; at the very top of that event.

neat harness
#

But the error persists on startup

neat harness
#

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

umbral zealot
#

Can you add a console.log(guild) at the top

neat harness
umbral zealot
#

To know what guild data triggers this

neat harness
# umbral zealot 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

umbral zealot
#

Available is false

#

You clearly didn't add the line I said you should add...

umbral zealot
#

Then it shouldn't error out.

neat harness
umbral zealot
#

It can't be both, if available is false, it returns, and never reaches the line that causes the error.

neat harness
#

Do you not mean available == false?

umbral zealot
#

Oh! Shit, yes you're right. It's (! guild.available)

neat harness
#

Okay one sec

umbral zealot
#

I wonder if that changed, I remember it being unavailable... But maybe this is a partial.

neat harness
#

Aight thx it works now somewhat, I changed it a bit to allow for a little error
if (!guild.available || guild.deleted) return;

umbral zealot
#

No no, deleted is normal

neat harness
#

This error haunted me for like days

umbral zealot
#

ok but no, now your bot is "in a guild that's deleted"

#

you don't want to return on guild.deleted

neat harness
#

Hm

#

True

#

Ok

#

I just started learning 10 months ago so I'm not that good

umbral zealot
#

Though admitedly that's pretty strange to get this particular event

neat harness
umbral zealot
#

Glad I could assist! thumbs_up

earnest phoenix
#

hello, how i can make server votes log?

ancient nova
#
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?
boreal iron
#

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())

cinder patio
#

object["property"]?

#

not sure what you're asking

boreal iron
#

array[0] = "session" (string)

#

this.#private_property.push({ array[0]: anyvalue });

cinder patio
#

[array[0]]: anyvalue

boreal iron
#

oh

#

god damn, it's so easy sometimes... thanks

cinder patio
#

np!

long marlin
#

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

umbral zealot
#

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.

deft lark
#

hi

warm junco
#

      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

celest bone
#

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()


    ))
pliant nymph
#

(node:1624) UnhandledPromiseRejectionWarning: Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.

#

how to fix it ?

warm junco
celest bone
#

Ok, Thanks!

warm junco
#

yw! i hope it helps

celest bone
#

¯_(ツ)_/¯

boreal iron
#

@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
cinder patio
#

obj[key]

boreal iron
#

well yeah didn't work

#

working inside a class

cinder patio
#

Are you sure that's how you did it? It should work

#

Maybe the key doesn't exist on the object in general

umbral zealot
#

even then, obj[key] would return undefined if key was undefined

lament rock
#

Do you need to add the hashtag when accessing it?

umbral zealot
cinder patio
#

maybe it doesn't work for private fields

boreal iron
#

nah the string I enter in the function getObject(key_name) exists in the object

cinder patio
#

I've never played with those

cinder patio
#

if it is, try making it public to see if it'll work

boreal iron
#

the var is private

earnest phoenix
#

hello again, how i can make server votes log?

boreal iron
#

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
cinder patio
#

We already told you to use obj[key]

boreal iron
#

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

icy skiff
#

i removed the presence intent from my bot and the cpu usage of the vps went from 15%-ish to 1-2% lol

boreal iron
#

hmm maybe @quartz kindle has an idea

quartz kindle
#

hi

cinder patio
crimson vapor
#

hi Tim

warm junco
boreal iron
#

@quartz kindle if that doesn't explain enough, a few messages above there're more details

crimson vapor
#

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 }

boreal iron
#

I know but doesn't work with a var inside a class

#

nvm

cinder patio
#

it works

boreal iron
#

nah actually didn't read carefully

#

aye accessing obj[property_name] works

wide wharf
#

How to do this? My own bot also has / as prefix but doesn't show up there...

boreal iron
#

well ty anyways... reading more carefully is on my list KEKW

wide wharf
icy skiff
#

hi Tim

cinder patio
#

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

wide wharf
#

Lol Xyoyu has a feminised version of Verified Dev in her(ig?) status

cinder patio
#

Sigh google docs back at it again

wide wharf
knotty quartz
#

How to get emoji ID?

cinder patio
#

thanks for not telling me that google docs

icy skiff
knotty quartz
#

Thanks

cinder patio
#

\emoji

boreal iron
#

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?

cinder patio
#

pass the database instance to the constructor of Converter

boreal iron
#

would be one version, isn't there a method like in PHP using globals/super?

cinder patio
#

Passing SQL to the Converter constructor is definitely your best option here

boreal iron
#

hmm alright, js is still weird, but ok

cinder patio
#

using globals is bad in every language

#

and super unnecessary in this case

lament rock
#

You could theoretically assign arbitrary properties to Objects, but that's not recommended as that breaks whatever type safety JS does have.

boreal iron
#

aye it is, but the class access is public and all private methods are private and save

pale vessel
#

Google Capthca amandathink

cinder patio
#

Are you using dbl.js?

#

That's deprecated

sturdy gazelle
#

my bot is in 75 servers, now what? how do i get it verified?

cinder patio
#

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

lament rock
#

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();
}
boreal iron
#

anybody got experience working with bigint in JS?

stark abyss
#

just ask your question

boreal iron
#

Need to get the modulo of a bigint value.

#

for example 99561197960265770 % 2

#

won't work since it's bigger than MAX_VALUE

pale vessel
#

BigInt(id) % 2n

boreal iron
#

nope

cinder patio
boreal iron
#

test it yourself, it's always 0

void moss
#

BigInt? more like BigConfusing

pale vessel
#

The ID needs to be a string

boreal iron
#

oh yeah, makes sense, thanks

cinder patio
#

0 would be the correct output

boreal iron
#

no no, didn't passed it as string

#

the example I posted would be 0

cinder patio
#

I see

#

weird

boreal iron
#

but not 99561197960265771 % 2 for example

#

but nvm... forgot to convert into a string

lament rock
#

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

near stratus
#

is this normal btw ?
or
Is this what site issue they're talking about in #support ?

summer torrent
#

yes

lament rock
earnest phoenix
#

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

umbral zealot
#

What are you doing to test this event?

earnest phoenix
#

but for some reason it doesn't work

#

changing my nickname on a server

umbral zealot
#

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.

earnest phoenix
umbral zealot
earnest phoenix
#
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

earnest phoenix
umbral zealot
#

yeah I'm not sure why that mention is there. it's a bit weird.

earnest phoenix
#

guildMemberUpdate comes exclusively from GUILD_MEMBER_UPDATE

#

not sure what's up with userUpdate

#

i'd have to dig through the source

grizzled raven
#

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)

earnest phoenix
#

it just forwards a user object instead of a member object

#

🚮 design

misty sigil
#

it’s discordjs what do you expect

grizzled raven
#

when the user data is different from what's cached

#

yeah

earnest phoenix
#

actually makes sense

#

i remember discord's gateway being incredibly stupid and sending user updates through GUILD_MEMBER_UPDATE sometimes

grizzled raven
#

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

earnest phoenix
#

the thing is

grizzled raven
#

actually

earnest phoenix
#

it already exists

#

it just isn't used (by discord) most of the time

#

👁️ 👄 👁️

grizzled raven
tired panther
#

Is top.gg removing Bots from their approval server?

umbral zealot
#

Bots are no longer in this server, and the Top.gg Verification Center is only during testing, it gets removed after testing, yes.

tired panther
dawn acorn
#

Can someone help me?

umbral zealot
#

Then it's not on any of our servers

#

any server you find that's called "top.gg" something is a fake server.

solemn latch
#

someone was adding bots to a server with the same name as our testing server.

tired panther
solemn latch
#

no

umbral zealot
#

no the only server we have is 333949691962195969

#

Yours is fake.

#

leave it.

solemn latch
tired panther
dawn acorn
#

a

umbral zealot
#

b

earnest phoenix
#

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

solemn latch
#

a timer, or schedueler

#

the exact method depends on the language

earnest phoenix
#

Javascript

mellow kelp
#

setInterval(() => { ... }, 60 * 60 * 1000)

earnest phoenix
#

how would I get the bot to send a message?

solemn latch
#

channel.send

mellow kelp
#

fetch the channel and send the message

neon jay
#

😆

earnest phoenix
#

example?

mellow kelp
#

use client.channels.fetch(<id>)

earnest phoenix
#

the channel id?

mellow kelp
#

it's a promise, so you'll have to await it

neon jay
#

setInterval(() => {
<channel>.send(whatever you want)
}, ms(time))

earnest phoenix
#

the channel name is 🔱status

#

and the id is: 814214619236270090

#

I'm not sure where to insert?

mellow kelp
gilded olive
#

inside the ()

mellow kelp
#

use the channel id

neon jay
#

bot.channels.cache.get("id')

mellow kelp
#

wouldn't recommend cache tho

#

fetch checks the cache first anyways so

neon jay
#

🙄 / kk

earnest phoenix
#

It is telling me that client isn't defined, how do I define?

mellow kelp
#

client is your bot

earnest phoenix
#

do I change that to bot?

mellow kelp
#

idk

solemn latch
mellow kelp
#

change it to whatever you named your bot

earnest phoenix
#

Status X

mellow kelp
mellow kelp
earnest phoenix
#

not sure what it is

mellow kelp
#

um ok

#

do you know what a variable is?

earnest phoenix
#

I am a pea brain

#

not really

mellow kelp
#

well uhh

#

i hate to be that guy but

#

learn js before trying to make a discord bot

earnest phoenix
#

I prefer Lua i'm just doing this as a side project

mellow kelp
#

you still have to learn js

cinder patio
#

You don't have to make the bot in JS I'm sure there's a lib for discord bots for Lua

mellow kelp
#

yeah

earnest phoenix
#

ok

solemn latch
#

lua also has variabled

#

variables

mellow kelp
solemn latch
#

its the same concept

earnest phoenix
#

thanks

crimson vapor
#

lua is cringe

severe patio
#

I get this for the stats poster:

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'size' of undefined
solemn latch
#

from the poster, or a variable your putting into the poster?

severe patio
#

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

fast edge
#

Hello there

#

I need help

#

Can anyone elp me?

earnest phoenix
#

What is this error?

solemn latch
severe patio
solemn latch
#

well, thats why

umbral zealot
#

"Cannot delete a channel required for community servers" seems pretty clear to me

solemn latch
#

autoposter is v12 only

earnest phoenix
fast edge
#

Can I get help

solemn latch
#

cannot delete a channel required for community servers

fast edge
#

🥺

umbral zealot
#

MAybe you're trying to delete the welcome/rules channel?

#

or an announcement channel

severe patio
#

Welp looks like im gonna merge to v12

earnest phoenix
#

hmm

severe patio
#

Here comes days of pain

#

lmao

solemn latch
#

or just dont use the autoposter

#

and use the apk

earnest phoenix
severe patio
#

wdym the apk?

earnest phoenix
#

thats so weird

umbral zealot
#

Clearly that's wrong

#

you can't get this error if you don't try to delete a channel.

solemn latch
mellow kelp
#
setInterval(() => {
  api.postStats({ stats });
}, 30 * 60 * 1000)
#

ez

#

i have created topgg-autoposter

solemn latch
#

lol

earnest phoenix
#

b-b-but

#

need to use lib for everything 🥺 👉 👈

mellow kelp
#

😳

fast edge
#
    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

solemn latch
#

making things by hand without just using a libs example code is hard eyes_shaking

severe patio
#

thanks @solemn latch

solemn latch
#

np 😄

severe patio
#

lmao

restive furnace
#

reinventing the wheel is the best thing to do in the world

umbral zealot
# fast edge

console.log(guild) and see what it is. Sounds like a partial or unavailable guild. You should add this to the top of that event: ```js
if(!guild.available) return;

#

Seems to be a fairly common problem these days, could be an API problem.

fast edge
#

Ok But

#

Like

#

it is synchronous with the client starting