#development

1 messages · Page 1157 of 1

timber plume
#

im making a website

earnest phoenix
#

i thought it is js

pale vessel
#

maybe

earnest phoenix
#

fuck

timber plume
#

for my bot

earnest phoenix
#

cool

timber plume
#

how do you make a button

opal plank
#

i think its JS, but he's loading it in java at least the console part

karmic compass
#

<button>Text</button>

#

i think

pale vessel
#

style a or use <button> with js

timber plume
#

<button>yes</button>

karmic compass
#

there are more attributes

earnest phoenix
#

sir, may i offer you this magical thing called https://google.com

#

He is loading JSON in java

pale vessel
#

<button> is wack, use <a>

karmic compass
#

uh

#

the mod is in java

earnest phoenix
#

@earnest phoenix the js is being interpreted in java

timber plume
#

how do i put the link in

earnest phoenix
#

no

opal plank
#

you using JS in Java?

karmic compass
#

the module is supposed to be in js

earnest phoenix
#

what

#

huh

karmic compass
#

aka all of the docs are in js

timber plume
earnest phoenix
#

how do i put the link in
@timber plume
sir, may i offer you this magical thing called https://google.com/

karmic compass
#

or the guide is to the minimum

timber plume
#

button there

karmic compass
#

i asked the wrong place eyesblur

pale vessel
#

use javascript

opal plank
#

should prob wait for someone who knows Java tbh

#

to debug that

earnest phoenix
#

some mods and hacked clients expose javascript apis since it's easier to work with than a full java environment (and people are stupid)

opal plank
#

the syntax looks for to me in JS

earnest phoenix
#

it is js

#

oh my god

pale vessel
#

<button onclick="location.href = 'somewhere.com'">

earnest phoenix
#

my dudes, that is js, the js is being interpreted into java from the mod

opal plank
#

im not sure he CAN compile js in java though

earnest phoenix
#

my dudes, that is js, the js is being interpreted into java from the mod
@earnest phoenix

opal plank
#

yeah thats what i mean

timber plume
#

yes

timber plume
#

imagine using pbt

opal plank
#

imagine bitching about which build i use

karmic compass
#

waiit

#

lmao

earnest phoenix
karmic compass
#

foudn some sort of module

#

inside of this module

#

that has a settings feature

#

let me see if that works

opal plank
#

aight

earnest phoenix
#

i dont think that the mod supports full ES6 syntax which is why it's breaking

solemn latch
#

A module in a module in a module

#

in java

#

In minecraft

earnest phoenix
#

very fast ™️

opal plank
#

stable => goes down every outtage
canary => full of new bs rn, gotta update every 10 minutes
ptb => nobody uses, stays up a lot of times theres an outtage

solemn latch
#

Lol

pale vessel
#

development :^)

earnest phoenix
#

haha imagine thinking discord devs are competent

opal plank
#

that could be the case too cry

#

@karmic compass try this var a = () => {console.log('test')}

#

put this high up in your module export

#

as high as possible actually

karmic compass
#

why?

opal plank
#

arrow functions are es6 syntax

sudden geyser
#

var

opal plank
#

its a good way to test

#

@sudden geyser thats my phrase btw

karmic compass
#

i mean

opal plank
#

just check it

#

add that as high as possible

karmic compass
#

oh i've alr been using it

opal plank
#

arrow functions?

karmic compass
#

and that command works

opal plank
#

then it shouldnt be es6 problems

#

hmmm

#

im out of ideas tbh

karmic compass
#

its probably nothing wrong with js

#

or json

#

its prob just the thing im using

#

might just have in the file at the very top const thingEnabled = true and the user can turn it true/false

opal plank
#

require() should resolve just fine

karmic compass
#

manually

#

yeah

#

i did it in another thing and it worked

#

its probably just with this thing

opal plank
#

you could try import

#

import/export is es6 syntax aswell

karmic compass
#

it looked as if nothing was wrong in my main file

opal plank
#

not in the main file

#

in the config

#

whatever you are importing

karmic compass
#

its in json doe

opal plank
#

you can export just the same

karmic compass
#

i maen

opal plank
#

export object

karmic compass
#

sorry for dumb coder language here

#

but

opal plank
karmic compass
#

it looked as if the error was in the colon, not anywhere else

#

oh let me view that

opal plank
#

its an alternative for require()

#

newer even

#

and much better since you can name your exports and export multiple files at once

#

declare the object with your config and then export it in the bottom. then on your index, import it

karmic compass
#

hmmmm

#

this might fix my error?

#

also can i even export in json?

delicate shore
#

Hey

opal plank
#

instead of ```js
//config.json
{
"a": 1
}
//index
const a = require('./config.json')

do 
```js
//config.mjs
export config {
 "a": 1,
}

//index.js
import config from 'config.js'
delicate shore
#

Good morning fellow developers

karmic compass
#

config.mjs?

opal plank
#

mjs is a delcared extension for es6

karmic compass
#

oh

opal plank
#

so you dont have to switch modules

karmic compass
#

errror?

opal plank
#

check what i just sent above

#

save the file as mjs

karmic compass
#

ye, still appears to be an error tho

#

it is config.mjs

opal plank
#

.js prob wont work

karmic compass
opal plank
#

hmm

earnest phoenix
#

mjs?

karmic compass
#

do i have to have the thing installed?

opal plank
#

mjs is es6 stuff

karmic compass
#

or is it prein there

#

oh ok

#

then why am i g etting an error?

opal plank
#

hover over it

#

does it tell you?

karmic compass
opal plank
viral iris
#

how to fix this ???
no1 told me to do const mongoose = require("mongoose");

karmic compass
#

same with the colon

opal plank
#

thats really odd

earnest phoenix
#

@viral iris your code is

opal plank
#

try

var a = { "a":1};
export a as config;

earnest phoenix
#

const mongoose = require("mongoose ");
^

#

there's a space

opal plank
#

see if that throws your linter offguard again

earnest phoenix
#

so remove the space and it will work

viral iris
#

const mongoose = require("mongoose ");
@earnest phoenix which file?

earnest phoenix
#

ready.js

#

event.js

#

server.js

#

read logs

#

logs give you all information

karmic compass
#

same thing

earnest phoenix
#

isn't export like

karmic compass
#

"peak or declaration" thing

earnest phoenix
#

exports.config = config;
something like this?

karmic compass
#

nah

earnest phoenix
#

exports.<Name> = <Object>;

opal plank
#

hmmm

karmic compass
#

wait

#

wait

#

no errors?????

opal plank
#

nah you can export declared too

viral iris
#

how to fix this ?

karmic compass
#

then how i import?

#

wait

opal plank
#

my bad, you cant export directly an object aparently

karmic compass
#

wait

#

then i cant use import outside mjs?

earnest phoenix
#

you just require the file

opal plank
#

without compiler, nah

#

require() isnt working for him somehow

#

offering a different solution

karmic compass
#

nono

earnest phoenix
#

import

karmic compass
#

its the colon

#

all wrong with the colon

#

atleast the error says so

#

oh and btw do i have to change my file to mjs

opal plank
#
{
 "welcomer": true

}
``` is valid
karmic compass
#

from js to mjs or

opal plank
#

depends on your compiler

earnest phoenix
#

just store it in json lol

opal plank
#

wait

karmic compass
#

said : was invalid

#

scroll up for error

opal plank
#

post your thing again btw

#

your require and json

karmic compass
#

{
"guildWelcomeOn":true
} in json

#

const misterConfig = require('./misterSettings.json')

timber plume
#

e

opal plank
#

json is fine

karmic compass
#

according to my console

#

it isn't

#

i mean the ide says its fine

viral iris
karmic compass
#

the only problem is with the semicoon

opal plank
karmic compass
#

colon*

opal plank
#

do a console.log(misterConfig) right after the require

#

just to make sure its that whats error ing

karmic compass
#

since the only way i can functionably run the file is with

#

minecraft

#

i have to make it in another js file

#

brb

opal plank
#

aight

#

thats an object

#

obj.owo

stark abyss
#

oh ok ty

opal plank
karmic compass
earnest phoenix
#

obj['owo'] mmLol

opal plank
#

that works too ^^

#

@karmic compass now do console.log(misterConfig.guildWelcome)

karmic compass
#

funny thing is

#

i removed all uses of it in the other file

#

and it sitll gave me an error

#

then i removed require and it worked

opal plank
#

hmmm require() is somehow breaking it

#

are there other things you are requiring?

karmic compass
#

nada

opal plank
#

hmmm

#

its likely that require() is breaking it then

#

not specifically that json

#

that function

earnest phoenix
#

you can just use fs

dire obsidian
#

guys what type of embed use discord?

earnest phoenix
#

huh?

opal plank
#

fs also an option too

#

fs.ReadFile(path, option, callback) iirc

#

lemme double check

karmic compass
#

fs got deleted lmfao

opal plank
karmic compass
#

wait brb ping me for answers

opal plank
#

eeeeeey

karmic compass
#

wait

#

so

#

how do i use fs?

#

/require/install/use it?

opal plank
#

fs is in node already

earnest phoenix
pale vessel
#

owo.owo mate

stark abyss
#

oh

pale vessel
#

use let {owo} =

karmic compass
#

do i ahve to do have do have do const fs = require('fs')?

#

jesus that engirhs

opal plank
#

hmmm

earnest phoenix
#

@.everyone hey will this work?

#

i'm not sure if the mod is going to provide fs lol

stark abyss
#

ok

opal plank
#

im out of options

karmic compass
#

i mean

#

i'm probably only ognna be using this

opal plank
#

just load the config in the file dude, fuck it

karmic compass
#

what

#

hey are you oka--

opal plank
#

let config = {
welcomer : true
};
in the index

#

on the top

#

fuck it

karmic compass
#

WOOHOO

#

FUCK IT

opal plank
#

as long as it works eh?

karmic compass
#

yeah

#

im only using this

#

or for now

opal plank
#

require()? No
import ? No
fs? No

karmic compass
#

so it shouldn't matter if anyone has to go in and

#

change

opal plank
#

fuck it, just append on the index

karmic compass
#

wtf is append mean

opal plank
#

add it

#

atach

karmic compass
#

WATCH THIS

#

WATCH ITS NOT GONNNA WORK

#

AHAHAHAHA

#

IT WORKS

opal plank
#

if variables dont work on your code, throw the code and the machine away

karmic compass
#

if variables dont work on your code, throw the code and the machine away
@opal plank lmao

#

just gonna add a few notes for any users that come into contact with this garbage and bing bang boom

earnest phoenix
#

just take out the config, fuck it, it's an autocracy your users aren't allowed to have an opinion

karmic compass
#

fair

ionic dawn
opal plank
#

@ionic dawn typo btw

ionic dawn
#

where, my eng isnt so good

opal plank
#

guils

ionic dawn
#

the all the

#

jesus my grammar

opal plank
#

im not native speaker either, dont worry

#

just pointing out for ya to fix it, not kink shaming your grammar

ionic dawn
#

I know, thank you hehehe

opal plank
karmic compass
#

you're only a professional coder if you've said that you speak more than one language and stated that one of them is a programming language

earnest phoenix
#

i speak in js and java

karmic compass
#

primary language: windows command prompt

opal plank
#

if (true) reply('Haha, can related!')

#

message.reply('My first lang was js too :D')

#

i just regretted posting that much cringe

karmic compass
#

i was born and my mom began teaching me discord.js, i now fluently speak in the node module "english"

opal plank
#

nowadays im just racist

#

fairly racist actually

#

i use Typescript

#

||if you didnt get the joke, Typescript is basically racist JS, since you have to declare the type of the variables||

ionic dawn
#

I used to speak fluent linux prompt

#

now im trying to learn more about js, node etc so I can really do something interesting

#

almost a year doing shitty ass scripts with Bash at school

earnest phoenix
#

So whats that make C#? @opal plank

faint prism
#

Did someone mention dotnet? 🙂

opal plank
#

A Nazi

earnest phoenix
faint prism
#

Oh yeah

#

i agree with that

opal plank
#

not only is it racist, its like 10 steps further

faint prism
#

type-ist

#

explicit, strict, abstract, polymorphic, etc

earnest phoenix
#

I tried to get into C# before, having to declare variable types was one of the many things that threw me off from it

faint prism
#

You can use var

earnest phoenix
#

I'm a Python user, & I like my white spaces

#

It feels so dirty though

faint prism
#

But, being explicit is one of my favorite things about C#

#

That and the abstractions

earnest phoenix
#

but you see, in typed languages, you don't get dumb people thinking that the language will automatically fill properties with whatever they're thinking of ie. user.NicknAMeFrOMMyGuiLD

#

i love it when people make up their own properties and then wonder why it doesn't work

faint prism
#

also C# intellisense is amazingly fantastic

earnest phoenix
#

vs*

#

but yes

faint prism
#

VS ^ yeah

earnest phoenix
#

i've been looking into switching to rider

#

vs is just a mess

faint prism
#

wb kite?

#

And VSC

drifting wedge
#

Is. Along a dashboard hard?

opal plank
#

Get stuck into Vim

#

even better

earnest phoenix
#

never heard of kite and VSC intellisense is limited, omnisharp sucks ass

faint prism
#

eh

#

it's okay

drifting wedge
#

Is making a dashboard

earnest phoenix
#

Is. Along a dashboard hard?
@drifting wedge that is like asking "is writing a book hard", a book about what? what genre? what language?

#

your question needs to be specific

solemn latch
earnest phoenix
#

there've been multiple people here thinking that d.js will magically fill their own made up properties

solemn latch
#

Thats actually crazy to me

#

How

pale vessel
drifting wedge
#

I mean I’m using python

earnest phoenix
#

How
@solemn latch people who never took cs

#

see the roadmap i sent you 0Exe, most of the things listed there are required for making a secure and an efficient dashboard

solemn latch
#

Whattttt

pale vessel
drifting wedge
#

Is a dashboard important tho?

#

Or do commands work

earnest phoenix
#

is mcdonalds important?

solemn latch
#

Do you think users will use your dashboard if you make one?

earnest phoenix
#

i can't answer what's important for you

#

you decide

#

lol

drifting wedge
#

But like is it really important

#

Or can I grow my bot without it?

#

I’ll prob make one in the future

solemn latch
#

No.
Most bots don't have a dashboard

drifting wedge
#

Ok

#

Coooool

solemn latch
#

Many do have a website, but thats also commonly optional.

earnest phoenix
#

chances are you won't even be able to grow your bot because oversatuation of generic bots mmLol

drifting wedge
#

Yep

solemn latch
#

I hit 44 servers today pogey

drifting wedge
#

chances are you won't even be able to grow your bot because oversatuation of generic bots mmLol
@earnest phoenix well I mean it depends

#

My bot has been like added to 26 servers so far

#

So it’s pretty good

#

Only like 1 and a half Weeks

earnest phoenix
#

if your bot isn't anime themed and doesn't provide tiddies for kids whose moms blocked pornhub, good luck growing

solemn latch
#

Lmao

drifting wedge
#

Well my bot is@really good@lol

ionic dawn
#

So i finally send the bot verification

drifting wedge
#

Well I mean it’s not too used much

#

But I’m working on it

solemn latch
#

Bot market is so oversaturated rn.

ionic dawn
#

the bot dev badge is coming soon I guess, my simple bot is already in 81 true servers

earnest phoenix
#

also, guild count is mostly irrelevant, what's relevant is interaction and participation with your bot

#

a 2k guild bot is worth jackshit if no one's using it

ionic dawn
#

its used

solemn latch
#

True true

ionic dawn
#

its a minecraft bot and its used in minecraft discords so people can have some stuff popping, i mean its regularly used

earnest phoenix
#

discord is promoting already established huge bots and kicking off smaller independent bots

slate wigeon
#

k

earnest phoenix
#

remember that drama with the bots tab in guild settings

slate wigeon
#

e

sonic lodge
#

really? why

earnest phoenix
#

discord straight up promoted a specific selection of bots, mee6 and a few others without any notice that other bots exist

#

they're, or at least were, promoting mee6 on their own website

#

that isn't fair in every aspect

#

they're giving exposure to already huge bots but then ignoring smaller bots

sonic lodge
#

damn

#

that's kinda stupid

earnest phoenix
#

though with this bot verification thing in place, they might be building their own bot marketplace

#

like they did with server discovery

#

Which will be shit compared to something like DBL, like you said, they'll only show off large bots

#

like DBL doesn't already

#

DBL is targeted at big bots who have money to spend

faint prism
#

@earnest phoenix Alright, so I want to add a LeaveGuildHandler and purge uncommon guild users from my DB when my bot leaves a guild, and also on startup for the bot.
I'm aware that if I attempt to use client.GetUser(userId) it can return null if they are not online for a large guild. Is AlwaysDownloadUsers = true in the config all I need? I need to be careful implementing this one

sonic lodge
#

that's what i was thinking

earnest phoenix
#

yes, that will cache all users in the guild auger, but your memory usage is going jump up a lot

faint prism
#

hmm

#

Well I only need to call it for that function

earnest phoenix
#

AlwaysDownloadUsers downloads all users in the guild regardless of what you want to do with them

#

it starts downloading as soon as the guild is available

faint prism
#

Right, I've got memory to spare. But, can I call a downloadAll for just the scope of the purge function? Just so the GC can maybe clean up afterwards

earnest phoenix
#

yes, but it'll take time to finish

#

for context, i ran a 2.5k guild bot which was in here, discord api & discord bots (3 very large guilds) on d.net with all members cached at around 150-300mb ram depending on how many guilds were cached at the time

faint prism
#

Well for the guildLeave event, I only need to download all users for that guild

#

And on the ready event, I want to also run the purge function, which would iterate through every guild

faint prism
#

Hm

earnest phoenix
#

oh

#

users get purged from memory before the event fires

faint prism
#

So, I suppose my approach would have to be:
DownloadAllUsers
if user exists in db that is no longer in the fully download cache
delete user from db

#

Seems resource (memory) heavy

earnest phoenix
#

is your goal to check if the user is in the guild?

faint prism
#

I want to remove user records that the bot no longer shares a mutual guild with

earnest phoenix
#

oh, yeah, you have to download all users in all guilds then

faint prism
#

Essentially so I can clean up junk data

drifting wedge
#

How many servers that I own can I have my bot in?

earnest phoenix
#

if it was guild specific, you could fall back onto a REST request

drifting wedge
#

It’s not verified yet

earnest phoenix
#

keep it minimal

#

don't boost your guild count

drifting wedge
#

I’m not

faint prism
drifting wedge
#

But like I own a server with like 1000 ppl so I have it there

#

And a support server

faint prism
#

whoops

earnest phoenix
#

that is some slow code

faint prism
#

not using that one variable

earnest phoenix
#

why are you doing ToList()

#

and ForEach is really slow

#

memory intensive too

faint prism
#

Fine, I can rewrite it to a proper iteration lol

earnest phoenix
#

also i don't think that's going to do anything since like i mentioned above, d.net clears the user cache before it returns the guild to you in the event

faint prism
#

mm

#

Yeah, that'd be a null collection then, huh

earnest phoenix
#

empty, not null

faint prism
#

gotcha

earnest phoenix
#

you'll have to make your own d.net fork if you want to override this behaviour

faint prism
#

nah, I can work around it

#

I'd probably implement my own api lib helper if I needed to do something custom, which i don't need to do for this

viral iris
earnest phoenix
#

you don't have permission

viral iris
#

that's my repo ????????????

faint prism
#

I wouldn't modify from the web page either lol

earnest phoenix
#

do you have a branch selected

viral iris
#

do you have a branch selected
@earnest phoenix idk wdym

earnest phoenix
#

literally what i asked

faint prism
#

try cloning the repo, modifying the file, commit, push commit

earnest phoenix
#

you just need to have a branch selected

#

lol

#

it even tells you that when you hover over it

faint prism
#

Apparently that's eluding him

viral iris
#

nvm fixed it

earnest phoenix
faint prism
#

lol

#

@earnest phoenix do I need to DownloadAll in the config if this is available?

#

If not, I'll just do this on a as-needed basis

earnest phoenix
#

no, the option in the config does just that

#

keep in mind that it's a blocking method

faint prism
#

Sweet, that might make this whole operation a have a bit lighter of a footprint

crisp yarrow
#

discord jda java api throws an ssl peek connection timeout

#

any ideas?

#

peer*

opal plank
#

why not ask Minn in dapi?

#

@crisp yarrow

crisp yarrow
#

Who's Minn?
I have a little problem with understanding things at this time

earnest phoenix
#

?

opal plank
#

im fairly certain minn is in charge of jda

#

join and click ^^

crisp yarrow
#

thanks!

viral iris
#

can any1 help ?

opal plank
#

with picking a proper hosting service? sure we can help you

#

heroku ISNT a bot hosting platform

sand condor
#

goes into the discord.js server and asks

opal plank
#

lmao

#

@viral iris biggest issue you should be fixing rn is getting out of glitch, your bot might be terminated if you using glitch for hosting bots

worthy glacier
earnest phoenix
#

don't use json as a database

worthy glacier
#

what should i use instead

earnest phoenix
#

any proper database, you can do some research, i personally work with sqlite for small scale, there's a ton of other databases out there though, ie. mongodb for nosql

faint prism
#

what does this mean
@worthy glacier Means your JSON file has been corrupted because there is a syntax error somewhere in it
Use a proper database instead of serializing an bunch of objects

worthy glacier
#

ok got it

#

any difference i should know selecting between cloud providers for mongodb?

#

besides region

faint prism
#

I mean, just whatever is free and preferably near you for lowest latency

#

@earnest phoenix Looks like it may work, any thoughts?
I added the deletionList just for debugging.

earnest phoenix
#

slow

#

just check for IsBot directly in the foreach loop

#

or, FirstOrDefault*

#

you're effectively doubling the memory that's used to store the guild members

faint prism
#

I mean, I don't even need to check for bots, since my db will not include them

earnest phoenix
#

i guess you're doing it to prevent extra calls

faint prism
#

but the sorting overhead for the .Where may not be worth it

earnest phoenix
#

also i told you this before, DownloadUsersAsync is blocking

faint prism
#

since it's an entire extra iteration

earnest phoenix
#

you probably want to run each guild in its own task so it can execute in parallel

faint prism
#

This task is spawned from the event handler and doesn't await it

#

mmm, true

earnest phoenix
#

what's the workaround for the GuildLeft purge btw

#

if you had figured it out yet

faint prism
#

Nah, I'd need to store a guild a user is in for the user record

#

and since the socketGuild the handler passes contains an empty user list there isn't a way rn for me to not just go through every guild ||what a terrible sentence. lmk if you need me to clarify||

earnest phoenix
#

yeah i got it, id suggest falling back onto REST to see if the user is in the guild or not but that's arguably more expensive than going through all members in all guilds in cache

faint prism
#

I'll rewrite it to spawn off it's own task for each guild. But other than that, lgtm. Ty btw

#

Actually, I can't spawn off their own threads
Again, since I'm not keeping a user's guild in their record

#

Because of that, I need to have a big list of every user in every guild and just go through that...
Maybe I should consider storing a user's guild in their record lol

drifting wedge
#

For example, if I’m to add modules

#

Do I have to write a help command for all the modules?

#

Or can I like make one help command and pull from db? Also, how do I make an image, like the level system picture!

#

?*

faint prism
#

I'm sure you can override the default help command for your lib.
Mine just reads from a text file

earnest phoenix
#

I've been having trouble getting named links to show up

#

I thought the format was text but every time my bot sends it it doesn't get converted

worthy glacier
#

wahst the replacement for bot.users.get

sonic lodge
#

@worthy glacier read the error

worthy glacier
#

yes ik

#

but what do i use instead of bot.users.get

sonic lodge
#

these are two separate problems

#

are you on d.js 11?

worthy glacier
#

no im on v12

sonic lodge
#

bot.users.get doesn't exist

#

you probably mean bot.users.cache.get

worthy glacier
#

that doesnt seem to work either

earnest phoenix
#

client.on("message", A7O => {
if (A7O.content === "69spam") {
setInterval(() => {
A7O.channel.send("A7O");
}, 1000);
}
}); am code a ba kar det bo spam

pale vessel
#

no

earnest phoenix
#

Spam Codepuma puma waitWhatSpin

sonic lodge
#

what's the error now

worthy glacier
#

it still says "bot not defined" when i do console.log(bot.users.cache.get(user.id);

sonic lodge
#

yes, this "bot is undefined" problem is unrelated to "a replacement for bot.users.get"

#

show the code where the error occurs

worthy glacier
pale vessel
#

use message.client instead of bot

sonic lodge
#

you can't use bot because it isn't provided as an argument to the execute function

pale vessel
#

add cache if you're on v12

worthy glacier
#

ok thank you

grizzled raven
#

is there a reason for fetching discord users to take unnecessarily long?

slender thistle
#

API down or ratelimit handler waiting for ratelimits to reset

glossy elk
#

TypeError [INVALID_TYPE]: Supplied overwrites is not an Array or Collection of Permission Overwrites.

#
  message.channel.overwritePermissions(message.channel.id, {
                    SEND_MESSAGES: false
                })```
#

xwait

#

tf

#

why did i overright permissioons for channel

#

I want to overwrite it for everyone

#

howtf do i do it for everyone

earnest phoenix
#

I am

glossy elk
#

how can i filter

formal scarab
#

!play

#

how I play music?

twilit rapids
#

And ! is common prefix

glossy elk
#

is this incorrect

#
let modLog = message.guild.channels.cache.get(r => r.name == message.settings.modLogChannel)
formal scarab
#

thanks

strange trout
#

Recommend using ID instead of name

glossy elk
#

..

#

im trying to find a channel

#

by the name

strange trout
#

Ah

glossy elk
#

either way

#

this isnt working

twilit rapids
#

.cache.filter() instead of .cache.get()

glossy elk
#

.find

#

i can use that too

twilit rapids
#

Or that

glossy elk
#

just realized that

#

that was me being dumb

#

i promise i smart

strange trout
#

find is probably better for your case

tardy hornet
#
  message.channel.send(giveaway).then(message => {
    message.react("🎉")
    message.react("🗑️")
  })
  const filter = (reaction, user) => {
    return reaction.emoji.name === '🗑️' || user.id === 743582307545382932;
};

const collector = message.createReactionCollector(filter, { time: 5000 });

collector.on('collect', (reaction, user) => {
    console.log(`Collected ${reaction.emoji.name} from ${user.tag}`);
    message.delete({ timeout: 0 })
  .then(msg => console.log(`Deleted message from ${msg.author.username} after 5 seconds`))
  .catch(console.error)
});

  break;

its not deleting the message when i react with \🗑️

#

its not deleting the message when i react with \🗑️

opal plank
#

723081690792067143

#

guess what

#

THATS your id

#

not 743582307545382932

#

you put your filter with someone else's id

tardy hornet
#

can i make it that the user that send it is the only one that could delete that?

opal plank
#

of course

#

message author

tardy hornet
#

message.author?

#

k

opal plank
#

you need id to match btw

#

also dont put message author id there

#

i'll break cuz you obfuscated your original parameter @tardy hornet

tardy hornet
#

so how do i make it that it will delete the message?

opal plank
#

i told you

#

use author

#

but not in the scope

#

cuz you obfuscated it

tardy hornet
#

no now its should work?

opal plank
#

this

#
let message = a;

function(message) {
console.log(message) //this message isnt tied to the message up there cuz you obfuscated it
}
``` @tardy hornet
tardy hornet
#

i put that instead of something ?

opal plank
#

either that or clone the original to something non blocked

earnest phoenix
#
  message.channel.send(giveaway).then(message => {
    message.react("🎉")
    message.react("🗑️")
  })
  const filter = (reaction, user) => {
    return reaction.emoji.name === '🗑️' || user.id === 743582307545382932;
};

const collector = message.createReactionCollector(filter, { time: 5000 });

collector.on('collect', (reaction, user) => {
    console.log(`Collected ${reaction.emoji.name} from ${user.tag}`);
    message.delete({ timeout: 0 })
  .then(msg => console.log(`Deleted message from ${msg.author.username} after 5 seconds`))
  .catch(console.error)
});

  break;

its not deleting the message when i react with \🗑️
@tardy hornet message is getting defined twice wtf

#

Your command handler uses message and inside the .then you also use message use smth like msg inside the .then

pale vessel
#

or not

#

that won't even work since you're comparing a string to a number using ===

carmine summit
#

HELP

#

my bot dont wanna go online

#

but there is no errors

golden condor
#

Please explain further?

carmine summit
#

uhm

#

k?

#

nvm it was the hosting site that was wrong

golden condor
#

ok

carmine summit
#

i put the code into my computer and it worked

golden condor
#

Ok

restive furnace
#

and the "hosting site" is glitch?

faint prism
#

Do js devs just hate making standalone functions or something? I see so much lambda

earnest phoenix
#

How i can get all GuildId in my database using Mongoose

#

You have given us nothing to work with

#

You select the collection and document and list it all

#
const mongoose = require("mongoose");

const guildSchema = mongoose.Schema({
    guildId:String,
    autorole: {
        "roleId":String, "enable":Boolean
    },
    warn: [
        {"userId":String, "times":Number, "reason":String}
    ]
})

module.exports = mongoose.model("Guild", guildSchema);
#

This is the model

#

i want to get all guildid

pale vessel
#

use model.find()

#

and then map by guildId

earnest phoenix
#
701141875628835000
264445053596991500
#

how i can Array this

cinder patio
#

what do you mean? Join them jn an array?

earnest phoenix
#

ye

cinder patio
#

const ids = [id, id]

slender thistle
#

Is that a string?

earnest phoenix
#

yes

slender thistle
#

Do you mean programmatically or manually?

cinder patio
#

Oh it's 1 string

earnest phoenix
#
Map {
  '701141875628834906' => { logs: undefined },
  '264445053596991498' => { logs: undefined },
  '739395982206435408' => { logs: undefined },
  '702171250843189278' => { logs: undefined },
  '714780705208401942' => { logs: undefined },
  '738159964727541851' => { logs: undefined },
  '733706979029024888' => { logs: undefined },
  '716406704350167042' => { logs: undefined },
  '728842019795107840' => { logs: undefined },
  '728310017333395517' => { logs: undefined },
  '697244506881392713' => { logs: undefined },
  '724408456185905164' => { logs: undefined },
  '584256963907682304' => { logs: undefined }
}
Map {
  '701141875628834906' => { logs: undefined },
  '264445053596991498' => { logs: undefined },
  '739395982206435408' => { logs: undefined },
  '702171250843189278' => { logs: undefined },
  '714780705208401942' => { logs: undefined },
  '738159964727541851' => { logs: undefined },
  '733706979029024888' => { logs: undefined },
  '716406704350167042' => { logs: undefined },
  '728842019795107840' => { logs: undefined },
  '728310017333395517' => { logs: undefined },
  '697244506881392713' => { logs: undefined },
  '724408456185905164' => { logs: undefined },
  '584256963907682304' => { logs: undefined }
}
#

this will happend

slender thistle
#

Thata map where the key is the ID

#

There's probably something like .keys()

earnest phoenix
#

yes

#
guild.map(async(g) => {
            await bot.log.set(g.guildId, {
                logs: g.log
            });
            console.log(bot.log)
        })
#

this was the code

#

output is up there

cinder patio
#

You'll have to do [...map.keys()] to get an array though, map.keys() returns an iterator

earnest phoenix
#

what does sync and async mean

#

You'll have to do [...map.keys()] to get an array though, map.keys() returns an iterator
@cinder patio i still didnt get it

#

wdym ?

weak rain
#

do anyone know why my glitch is not opening

#

it says internal server error

#

but opens in incognito window

earnest phoenix
#

@weak rain glitch suck now

weak rain
#

ik

#

4000 hours wtf

#

but how should i host my website

#

if i cant open glitch

earnest phoenix
#

Stop using Glitch, & get a VPS or what not

weak rain
#

i have a host]

earnest phoenix
#

Which host? @weak rain

weak rain
#

dan

#

its nice

earnest phoenix
#

Ehh? Idk that host

#

Anyways, which language?

weak rain
#

that host is underground

#

Js

earnest phoenix
#

Ahh idk about JS, just Python, sorry I can't help

weak rain
#

u know anything about websites

earnest phoenix
#

Why?

weak rain
#

ok

#

how did u make this @earnest phoenix

earnest phoenix
#

@earnest phoenix damm ur hentai

#

I used Python, & Django

#

:))

#

nc pics

weak rain
#

hm

#

i mean which host

#

@earnest phoenix

earnest phoenix
#

VPS

#

it is a HOST

#

virtual private server

weak rain
#

can we make website on VSC?

#

Lmao

earnest phoenix
cosmic robin
#

message.guild.channels.delete();
how would i use this command correctly to delete the channel that the message triggering this line was sent in

earnest phoenix
#

@cosmic robin message.delete() ?

cosmic robin
#

to delete the channel

earnest phoenix
#

:0

#

no

#

wait let me check docs

slender thistle
#

message.channel.delete()?

cosmic robin
#

idk what i missed when checking docs but channel create and delete wasnt there

earnest phoenix
#

maybe it will help

cosmic robin
#

thx

slender thistle
#

What's your d.js version?

cosmic robin
#

shivaco it worked 😄

slender thistle
#

eyy nice

weak rain
#

is their any other site where we can make websites

earnest phoenix
#

yes

weak rain
#

where

earnest phoenix
#

but they will gives u subdomains

weak rain
#

hm like?

#

any good

earnest phoenix
#

top.gg

#

wut

#

nah

#

ye

#

better

weak rain
#

can we change domains their

#

like we can change on glitch

earnest phoenix
#

yes but u need to pay

#

Yep

#

yes but u need to pay
@earnest phoenix no

weak rain
#

i need free

earnest phoenix
#

some sites

#

u need to pay

#

You need to pay the other guys where you bought the custom domain

#

try this

weak rain
#

ohk

#

i have to just add the code?

#

right

earnest phoenix
#

yes

#

in github

#

and it will auto deploy

weak rain
#

ohk

#

if i import project from glitch will that work

earnest phoenix
#

or u can simple drag files

#

and deploy

weak rain
#

if i import project from glitch will that work

earnest phoenix
#

u mean from glitch project ?

weak rain
#

hm

earnest phoenix
#

idk u have to commit and push files to github then netlify will auto change the site

weak rain
#

hm ok

earnest phoenix
#

Anyone know how to hide use name?

#

u can't

#

এন

#

huh ?

#

No

#

bengali

#

pls english

#

u can't
@earnest phoenix no

#

-nobeng

#

What?

#

I am Hide my profile picture

#

MegaThonk but how to hide use name

#

Please tall me

#

You can't

#

wait

weak rain
#

@earnest phoenix use _

#

only

earnest phoenix
#

Also your english is a little bad

weak rain
#

or ,

earnest phoenix
#

@weak rain thank you

weak rain
#

Also your english is a little bad
@earnest phoenix lol

earnest phoenix
#

And you're not supposed to ask those kinds of questipns in #development

weak rain
#

lol

earnest phoenix
#

google it by ur self

#

100000 IQ

#

development ain't for LOLing around too

#

unless you are LOLing about development stuff

#

he said 2 lol times

weak rain
#

i said 2nd lol

#

for

#

And you're not supposed to ask those kinds of questipns in #development
@earnest phoenix this

#

xD

earnest phoenix
#

@earnest phoenix pls give a name that we can talk normaly

#

for example

#

hey thunder

#

hey code913

#

hey fuckboi69

#

ok then

#

imma wait for QA

#

can you generate png images

#

wdym ?

#

@weak rain bengali?

#

@earnest phoenix maybe i saw my friend made a photoshop sofware with c++

#

Is there any npm thingy for generating png images

#

idk google it

#

pnggenerator

#

I wanna make cool profile card

pale vessel
#

canvas, jimp, imagemagick

earnest phoenix
#

see

#

My name not hide

sterile thicket
#

how to disable user mention?

earnest phoenix
#

MegaThonk
@earnest phoenix why the f are you asking those questions in here

#

Sorry

sterile thicket
#

as a bot

#

-_-

earnest phoenix
#

@sterile thicket wdym ?

sterile thicket
#

How do I make my bot @ a user but the user won't be mentioned

pale vessel
#

allowedMentions in client options or allowedMentions on the send method

#

refer allowedMentions, not disableMentions (this one just adds a zero width space and nothing else)

#

for example send("content", { allowedMentions: { users: [] } }); can't ping any member or roles

sterile thicket
#

kk, thanks

pale vessel
#

that's that i use for my noembed commands

sterile thicket
#

ikr

#

i saw that

honest perch
#

Flaz

pale vessel
#

sup

honest perch
#

Wrong channel

earnest phoenix
#

misly

#

wait what

#

i thought u are bot dev ?

pure lion
#

People can develop without uploading their work :l

cosmic robin
#

I'm making a command that creates a new channel then sends a message in that channel, how would i find the id of a channel that i just made with a custom name


    const args = message.content.slice(PREFIX.length).trim().split(/ +/g);
    const command = args.shift().toLocaleLowerCase();
    if(command === 'new') {
        message.guild.channels.create('ticket-' + message.author.username, {
            permissionOverwrites: [
                {
                id: '736325193689071667',
                deny: ['VIEW_CHANNEL'],
                },
                {
                id: message.guild.id,
                deny: ['VIEW_CHANNEL'],
                },
                {
                id: message.author.id,
                allow: ['VIEW_CHANNEL'],
                },
            ],
        });
            message.channel.send('Your ticket has been created')
            
            const Embed = new Discord.MessageEmbed()
            .setColor(0xe44f28)
            .setTitle(':palm_tree: Thank you for creating a ticket :palm_tree:')
            .setDescription('Please state what you need help with and our Staff will be right with your shortly.')
            .setThumbnail('https://media.discordapp.net/attachments/743405345812250674/743506547639844874/WINTERFALL_TRANSPARENT_icon.png?width=751&height=677')
            client.channels.get().send(Embed)```
pure lion
#

Await the creation of the channel and then do <channel>.send

cosmic robin
#

the channel will use a different name per command, so i cant just use that, is there a way to find the id of the newest channel?

tardy hornet
#
message.channel.send(`Deleted __${args[1]}__ messages.`).then(msg => message.delete({timeout: 2000}));

why is not deleting the message?

pure lion
#

Wdym you cant use that

#

@cosmic robin that's what awaiting does

cosmic robin
#

sorry im not sure what awaiting is

pure lion
#

basically it waits for shit to be done

#

let channel = await <promise>

cosmic robin
#

so i use await then i use the same way i made the name to find that channel?

pure lion
#

No

#

Basically

earnest phoenix
#

u stop the code until the function done

#

u wait a function

pure lion
#

Yes that

cosmic robin
#

so what do i put in promise?

quartz kindle
#
// option 1
let created = await message.guild.channels.create(...)
await created.send(...)

// option 2
message.guild.channels.create(...).then(created => {
  created.send(...)
})
pure lion
#

Don't use then uwu

#

Then is messy and spagoot

quartz kindle
#

option 1 requires an async function

earnest phoenix
#

imma take notes about that

quartz kindle
#

client.on("message", async message => { ...

cosmic robin
#

my head hurts lmao

earnest phoenix
#

why ?

pure lion
#

I don't see how async is hard to understand tbh

#

Phil, all async is is waiting

cosmic robin
#

no like the whole code sent

pure lion
#

Ah

cosmic robin
#

im quite new to js so i dont know much

quartz kindle
#

the await keyword lets you wait for things to complete and then continue

#

but the await keyword requires a special context known as an "async function"

#

all you need to do to create this context, is to add the async keyword to where the function starts

earnest phoenix
#

async(message)

quartz kindle
#

all functions that return a Promise require awaiting in one way or another, unless you dont need the return value, but even then its better to await so you dont get unhandled errors

#

if you head over to the docs, you can see which ones return a Promise

#

for example

earnest phoenix
#

@quartz kindle are u a teacher who teach ppl in university ?

#

cuz u explain things so good

quartz kindle
#

if you check the docs for channel create, you see this

#

you scroll down, and you will see this

#

that means the create function returns a Promise that contains the created channel

#

which is kinda the same thing as let createdChannel = message.guild.channels.create({options here})

#

but since its a Promise, you need to add the await keyword to it

#

let createdChannel = await message.guild.channels.create({options here})

cosmic robin
#

so i do client.on('message', async message =>{

quartz kindle
#

yes

#

this will make everything inside this code block behave asynchronously, and this enable the usage of the await keyword

#

asynchronous means the code can do many things at the same time

#

so it will still respond to other commands while its waiting for the channel to be created

cosmic robin
#

so then i use await created.send(Embed) to send the embed to the new channel?

quartz kindle
#

yes

cosmic robin
#

let created = await message.guild.channels.create(...) do i use this line when i create my channel as a replacement or after its made?

earnest phoenix
#
created.send(embed);
console.log("This is working in one time")

////

await created.send(embed);
console.log("This will work after the bot sent the embed")
quartz kindle
#

@cosmic robin you use the same code as you already have

#

you just add the await keyword before it

#

and assign the result to a variable

cosmic robin
#

ok

#

it works now tysm

earnest phoenix
#

How can i add Tic tac Toe game to my bot?, i made bot in js

#

someone has code Pls ping me

#

we won't spoonfeed

#

I do have ckde

#

Of dank memer

#

@earnest phoenix

#

Thanks a lot!

#

Lmfao that's not my code

#

Just see their code

#

And figure smth out

#

Should I make my own npm package bois?

grizzled raven
#

API down or ratelimit handler waiting for ratelimits to reset
@slender thistle but this seems to never end

slender thistle
#

Weird

grizzled raven
#

like it could be fetching for 10 minutes until it finally gets a response

slender thistle
#

Are you sure your library isn't fucking itself up by any chance?

grizzled raven
#

this only applies to /users/:userId, everything else seems to be fine

#

perhaps

#

i'll maybe check if /users/:userId has a queue and/or fetch using node-fetch myself

earnest phoenix
#

wait dank memer is a open source bot ?

tight plinth
#

no

earnest phoenix
#

No

tight plinth
#

99% of dbl certified bots (aka the biggest discord bots rn) are private source

grizzled raven
#

dankmemer used to be open source

earnest phoenix
#

Dank memer has his code available with a license

grizzled raven
#

okay what is this, i fetched yesterday night and went to bed because it took too long, 2 HOURS and 46 minutes HOW

cinder sandal
#

how to make a disocrd.js bot say the current time?

sacred pewter
#

I need a code to hug someone both using id and ping

wary flame
#

what language

#

@next horizon

#

Whoops, sorry you had the same nickname :|

#

what language
@sacred pewter

sacred pewter
#

JavaScript

#

@wary flame

wary flame
#
let userId = (msg.mentions.members.first()) ? msg.mentions.members.first().id : args[0] //If a guildmembers has been mentioned get his id else default to first arg
#

@sacred pewter

earnest phoenix
#

that wont work, will it? also don't spoonfeed

#

you need to use the ternary operator

wary flame
#

Why wont this work?

earnest phoenix
#

if there are no mentions first will return undefined, using id on it will throw an error

wary flame
#

Good point,

earnest phoenix
#

thats an O(n) lookup btw, bad code

#

store the result of first in a variable to prevent looping over it again

#

also again avoid spoonfeeding

#

yoo

#

i just need youtube video info module

#

I'll use it to get a picture of the video.

cosmic robin
#

channel.get('744497498881654784').send(Embed); can anyone help me correct this code, im sure im just missing something obvious

earnest phoenix
#

do you have any suggestions I could not find

#

there's this magical thing, https://google.com

#

cry i did

wary flame
#

Isn't YTSR able to do that?

#

Not sure

earnest phoenix
#

ytsr?

wary flame
#

Yes, its on npm

earnest phoenix
#

link please.

wary flame
#

You should have found it if you looked trough ALL modules

earnest phoenix
#

you just dont know how to use google
@earnest phoenix not works

cosmic robin
#

dark mode

earnest phoenix
#

all wants video id

wary flame
#

It should be in the first couple

earnest phoenix
#

lmao

cosmic robin
#

what kinda criminal r u

earnest phoenix
#

im trying to get video id + thumbnail

cosmic robin
#

channel.get('744497498881654784').send(Embed);
can anyone help me correct this code, im sure im just missing something obvious

wary flame
earnest phoenix
#

send full of code bruh

wary flame
#

send full of code bruh
No

#

It isnt hard

earnest phoenix
#

@wary flame ytdl-core gives thumbnail? you know?

#

no one is going to write code for you

wary flame
#

This isnt ytdl-core

earnest phoenix
#

unless you pay them that is

wary flame
#

This is ytsr

earnest phoenix
#

i just asked bro

wary flame
#

Oh nvm misunderstanding

#

Dont think ytdl-core does

earnest phoenix
#

sad

wary flame
#

It makes sense

#

It is purely for downloading/streaming youtube

quartz kindle
#

it does

earnest phoenix