#development

1 messages · Page 1592 of 1

obtuse jolt
#

Yes, exactly, that’s what I don’t understand

honest perch
#

Ah fair enough

quartz kindle
# obtuse jolt Yes, exactly, that’s what I don’t understand

answer from 2013:

When the sub domain is created, PLESK places the default index.html file in that folder. I uploaded the sub domain content via FTP but forgot that my default page was index.php (not .html) - this made both index files to be present in the sub domain root folder and PLESK was showing the .html file and not the .php file.

I simply deleted the .html file and it just worked perfectly.

quaint wasp
obtuse jolt
quartz kindle
opal plank
#

read the error

#

its not a function

#

its a property

quaint wasp
#

I know..

opal plank
#

you clearly dont

glossy spoke
#

So why did you write these ()

quaint wasp
#

duh..

#

cause

#

Thats what people always do/

opal plank
#

can you just cut the bs smug?

#

you want help, listen

quartz kindle
#

lol...

opal plank
#

yesterday you were on a whole troll streak

#

if you're gonna ask for help, at least listen

glossy spoke
#

People who knows about js doesn't use () on properties

quartz kindle
#

one would think after all this time you would at least learn what are functions and how do they work lol

#

adding () to something means its a function

glossy spoke
#

to call a function

obtuse jolt
#

Why did I have to get a secure domain (one of the urls pointed to my url shrinker)

glossy spoke
#

Also, functions uses () for their parameters

opal plank
#

though in fairness you dont always need that

sudden geyser
#

how do you even read that

#

so compact

opal plank
#
function bla() {}
setTimeout(bla, 100)
#

this is an example

quaint wasp
#

why do people think I troll.. I dont even really know what that means..

opal plank
glossy spoke
opal plank
quaint wasp
#

"several people typing"

opal plank
#

i've fowarded you the docs to learn js quite a few times by now

#

and you still stubborn on making a bot without knowing what you're doing

quartz kindle
mellow kelp
#

Well I think it's another matter

obtuse jolt
quartz kindle
#

xD

mellow kelp
#

Don't just learn js, you have to understand js

obtuse jolt
#

Tim are you any good at site analysis?

quaint wasp
quartz kindle
obtuse jolt
opal plank
quartz kindle
#

nah never done that

#

i only do performance testing

obtuse jolt
#

Damn

opal plank
#

its no shame to say i dont know how maps works

copper cradle
#

don't blame smug

obtuse jolt
#

Do you know how to sql inject?

quartz kindle
#

yes

quaint wasp
mellow kelp
opal plank
mellow kelp
#

Just type a '

opal plank
#

it also seems you've been blatently copying stuff

mellow kelp
#

And poof

obtuse jolt
copper cradle
#

he's not a native english speaker so you can't really blame them if they don't understand something

opal plank
#

thats on them, if you dont understand something, ask

#

i'll use a more simple syntax

obtuse jolt
quaint wasp
#

thats what I do. @opal plank

opal plank
#

theres no excuse if you dont say "i didnt understand"

glossy spoke
copper cradle
#

smug

quaint wasp
#

😐

opal plank
#

doesnt change the fact at all snails

quaint wasp
#

#Russia

quartz kindle
#

most people are not native english speakers

mellow kelp
#

Yeah

opal plank
#

im not native speaker either

modest maple
glossy spoke
mellow kelp
#

Same

copper cradle
#

I'm just tryna be on smugs side lmao

opal plank
#

how are we even suppose to know you didnt understand something if you dont say it? we dont read minds snails

glossy spoke
#

@quaint wasp if you don't understand something just say "i don't understand" don't make some stupid excuses

quaint wasp
#

alr.

#

well..

#

And I mean I do read those..

#

but still doesnt really help.

glossy spoke
#
mellow kelp
#

Yeah because you need to understand js first

#

discord.js is a library for js

glossy spoke
#

Yep

copper cradle
#

then don't spam him with https://discord.js.org/ as it's not gonna help them understand the lang

opal plank
copper cradle
#

and then

#

there's this thing

#

called

#

google

glossy spoke
#

And it uses advanced JS concepts so you must have a solid understanding of JS

opal plank
#

thats precisely why i said you should NOT start with a bot

quaint wasp
#

What does that do?

opal plank
#

debug means going thourhg the code to see why errors are happening

quaint wasp
#

It just gives you like 500 random errors..

opal plank
#

thats exactly what debug means

mellow kelp
#

De-bugging

opal plank
#

find WHY and WHERE errors are happening

mellow kelp
#

Removing bugs

glossy spoke
quaint wasp
#

Happens in index.js file line 40..

quaint wasp
#

yes..

opal plank
#

it points you where the error is

copper cradle
glossy spoke
copper cradle
#

and see what you got there

opal plank
#

go on the file, at line 40

#

and then check what the error says about it

#

thats debugging

#

fixing bugs

#

find bugs and fix them

#

thats called debugging

quaint wasp
# copper cradle then go check line 40

I did. I tryed memeber and members before tim told me to try again and I even tryed to add and remove some stuff.. And still didnt work so I came here.

opal plank
#

idk if you are translating, but bugs = errors

glossy spoke
#

on debugging console.log(); will be your best friend

opal plank
#

or unintended behaviour

quaint wasp
opal plank
#

then you are already debugging

copper cradle
opal plank
#

you know that functions are
something()

copper cradle
#

you coul've googled 'x thing is not a function, javascript'

opal plank
#

it says its not a function

quaint wasp
#

I dont understand what function is now that I got that..

opal plank
#

thats why i sent you the docs before

copper cradle
#

that's like the most basic thing, even my sister can do it

opal plank
#

you NEED to know the BASICS of js

copper cradle
#

and she's like 5

craggy pine
#

That's where the repetitiveness of "Learn JS" keeps popping up.

opal plank
#

functions is some of the most basic features of js

modest maple
#

Properties vs functions mmLol

glossy spoke
#

a function is like a compressed block of code that you can call everywhere in your code

quaint wasp
opal plank
#

cuz size is a property of map

quaint wasp
opal plank
#

cache is a collection, basically a map

#

try console.log(cache)

glossy spoke
opal plank
#

console.log(guild.member.cache)

quaint wasp
#

What will that do?

opal plank
#

it will log all the members in your cache

copper cradle
opal plank
#

also that ^^

glossy spoke
opal plank
#

nah, i did that on mine a couple times

quaint wasp
#

lol I got a feeling it will grab there ids and then there users and tags and then somehow tokens or smth.

opal plank
#

got a good enough rig to handle it

#

you cant get tokens from anyone

craggy pine
#

^

opal plank
#

ids are public

#

717526789882380338

#

heres ur id

opal plank
copper cradle
#

I recommend giving up on your bot and learning the language first, the you may come back

opal plank
#

if tokens were that easy to access everyone would get hacked with people login in their accounts

modest maple
#

Most decent terminals also have a max size to stop 5he whole crashing issue

copper cradle
#

I usually set it at 500 lines

quaint wasp
modest maple
#

Oh baby

copper cradle
#

did you just copy the code

opal plank
#

you didnt show what appears before, so thats as far as i can show you

glossy spoke
#

He just restored the chat's health lmao

copper cradle
#

Trust me, if I wasn't on a good mood I would've dropped everything I got on this guy already

glossy spoke
#

We must be patients

glossy spoke
#

He's trying to make something that he likes

quaint wasp
#

what do you mean by that?

glossy spoke
#

Lmao

mellow kelp
#

Can I have some popcorn

craggy pine
#

🍿

glossy spoke
copper cradle
#

what are you even playing omg

quaint wasp
#

Im eating bread lol

mellow kelp
#

Thanks 🍿

toxic jolt
#

pls help me i how to start php on node.js

quaint wasp
#

Im trying to make a simple bot for fun... and idk.. help others moderate there servers?

quaint wasp
#

or node (file name)

toxic jolt
#

how

glossy spoke
#

We'll not stop you of making a bot, we are suggesting you to first learn and understand the lnaguage before going ahead with your bot

quaint wasp
#

go to terminal.

copper cradle
#

oh btw, how old are you smug

mellow kelp
dusky sundial
toxic jolt
#

oh okay

quaint wasp
toxic jolt
#

i how to open php :d

copper cradle
craggy pine
mellow kelp
#

You can download xampp to start a php server I think

copper cradle
#

@quaint wasp stop, they asked that as a joke

copper cradle
#

how are you supposed to run php on node?

quaint wasp
#

did you caunt or something @glossy spoke

toxic jolt
mellow kelp
#

node php.js 👍

quaint wasp
#

count

opal plank
#

npm i php

copper cradle
#

I'm leaving this place now

quaint wasp
#

ok

toxic jolt
glossy spoke
#

No, i just said a random number based on the SO MANY times we told you that

opal plank
#

no

#

DONT

#

i was kidding

#

that was a joke

#

@toxic jolt OYE

glossy spoke
#

"Oye"

mellow kelp
#

Spanish intensifies

glossy spoke
#

Lol

pure lion
#

can i make cf dns redirect to ip:port

craggy pine
#

Erwin what have you done

glossy spoke
#

@mellow kelp Wanna help me to teach @opal plank spanish?

mellow kelp
#

Are we allowed to swear in spanish tho

opal plank
craggy pine
quaint wasp
copper cradle
#

don't mess up with the whitenames like that smh

quaint wasp
craggy pine
#

We're joking about development mexShrug the spanish well.... ya

copper cradle
#

callao

mellow kelp
#

callao coolflushed

toxic jolt
copper cradle
#

did you define path

#

🤦‍♂️

craggy pine
#

Oh he totally did the php i

copper cradle
#

what have you done @opal plank

spice glade
#

Hello

toxic jolt
#

oh man php is so hard

craggy pine
#

@opal plank bonk

copper cradle
#

Pudocho, I'm sorry to break it for you, but that's not how php works

quaint wasp
#

@toxic jolt No offence but did you copy past?

copper cradle
#

I swear I'm loosing braincells

craggy pine
#

Don't lie. This chat is

mellow kelp
#

Wait there's a php view engine?

copper cradle
#

you're not the one to be talking about copying & pasting

craggy pine
opal plank
craggy pine
mellow kelp
#

What have you done

quaint wasp
glossy spoke
mellow kelp
#

chim pum callao slick

glossy spoke
#

I hope he will not understand

mellow kelp
#

a

opal plank
#

gonna get bonked with a -noes if you keep talking spanish in #development

mellow kelp
#

k im out

opal plank
#

is this minimoding? i feel like it is, but what'eves

#

anyway, back to detritus

copper cradle
#

aigh back to english

glossy spoke
opal plank
quaint wasp
#

what does that mean ?

#

Users online?

mellow kelp
#

kinda

solemn latch
#

seperate presences no?

#

no way its 1 bil users

earnest phoenix
#

presences received ig

opal plank
#

@solemn latch its how mane presences has been parsed

#

in the past couple days

#

its 430k users

#

actually, 441K

#

so they are emit presences

#

that shows how many presences have been parsed from all those users in the instance of the bot

earnest phoenix
#

logging gateway messages be like

opal plank
#

for example, i started an hour ago, and its at 2.5 million presences parsed

#

each presence recived adds 1 to the counter

opal plank
earnest phoenix
#

I meant messages as in responses

opal plank
#

no idea what you mean but okay

#

i have that metric too

earnest phoenix
#

No, I meant literally discord gateway responses

opal plank
#

also, yes, i log every gateway intent i use

earnest phoenix
grizzled raven
#

you could say literally anything and erwin's probably logging it kekw

#

"how about # of times a 12 year old got banned from a server with 65,152 members" "yeah, right here"

glossy spoke
#

@opal plank do you log how many times people go to the bathroom?

mellow kelp
#

possibly

#

perhaps he's logging me coolflushed

opal plank
#

and how many times the bot blinks too

glossy spoke
#

😳

mellow kelp
#

blinks per second

sterile lantern
#
let bresponse = await axios.get(`https://api.blox.link/v1/user/${id}`)
          let bdata = JSON.stringify(bresponse.data)
           console.log(bdata.primaryAccount)```
tried this
```js
let bresponse = await axios.get(`https://api.blox.link/v1/user/${id}`)
          
           console.log(bresponse.primaryAccount)```
and this

-- neither work, both print undefined
#

once the request it sent it prints this

{"status":"ok","primaryAccount":"496986320"}
opal plank
#

@sterile lantern axios parses data for you

#

no need to stringify it

mellow kelp
#

axios returns a response object, not the data itself

sterile lantern
#

o

mellow kelp
#

you have to get bresponse.data.primaryAccount

opal plank
#

also

#

you're using it wrong

#

JSON.stringify returns a string

#

string.primaryAccount will error

#

cuz, well, strings

#

also, in the second case

#

its bresponse.data.primaryAccount

#

both snippets are incorrect

sterile lantern
#

ohh

#

alr

#

ty it works

opal plank
#

np

outer perch
#

but I'm still thinking, should I swap my bot's code to TS?

mellow kelp
#

yeah, it's really useful to catch errors ahead of time

#

also it provides a lot of auto completion

opal plank
#

let me get you a video

mellow kelp
#

let me guess

#

fireship?

opal plank
#

@outer perch

#

if you going to do a rewrite, i recommend using detritus, its a pure ts lib

#

and from what im seeing, a LOT better than d.js's

outer perch
#

🤔

mellow kelp
#

well you probably want to get the hang of ts first

#

shouldn't be too difficult

opal plank
#

if you know js, ts is fine

#

use lax at first

outer perch
#

goin' on to the next one

opal plank
#

aight

outer perch
#

that guy is godike

#

understanding everything so clear

mellow kelp
#

yes

#

his videos are so s m o o t h

crimson vapor
#

fireship yes

outer perch
#

😩 👌🏻 🔥 💯 💵

mellow kelp
#

only complain i got is that his website is a bit too big

outer perch
#

xD

#

upscaled

#

does the main file need to ALWAYS be index?

#

in TS?

mellow kelp
#

it's good practice to name your main file index.whatever

#

at least with js and ts

outer perch
#

it's a must in everything I know, but I already have the main file as 'bot.js'

mellow kelp
#

o

outer perch
#

well, yeah time to swap things up

#

it works cuz of package.json telling the main file is bot.js

mellow kelp
#

yeah package.json is cool

outer perch
#

he's a bro

opal plank
#

@outer perch take the considaration from what i said before

#

ditch d.js, ascend with us

outer perch
#

😮

opal plank
#

use detritus

#

not sponsored

#

if you plan on using ts, might as well use a full fledged ts library

mellow kelp
#

now i plan to switch to detritus

#

thanks erwin slick

opal plank
#

no preblomo, its unironically an amazing lib

outer perch
#

I still haven't got rid from d.js' embed builder 🙄

#

lazy bitch I am

opal plank
mellow kelp
#

aight thanks

opal plank
#

no preblomo

outer perch
#

I see the popularity

mellow kelp
#

gonna take a look

#

hm yes

opal plank
#

thats the thing, its an amazing lib but not well known

mellow kelp
#

really popular server

opal plank
#

the moment you look into their code you'll see the difference

mellow kelp
#

bad thing is discord.js gets a lot of free advertising with shitty youtube tutorials

#

i still am ashamed i started learning js with discord.js tutorials 😔

outer perch
#

hmm yeah, popular server it must be

opal plank
outer perch
#

I from d.js will get rid

#

send invite

mellow kelp
#

why am i reading your messages with yoda's voice

opal plank
mellow kelp
#

do i need help

outer perch
#

API

#

xD not that

opal plank
#

oh

mellow kelp
#

i just realized every DDoS attack ever is basically

#

"I used the api to destroy the api"

outer perch
#

ping www.destroy101.com -t with 100 PCs

#

😂

opal plank
#

funfact theres quite a few devs there with anti-raid tools

#

there hasnt been raids in quite some time

mellow kelp
#

that's pog

#

and now i got a question

opal plank
#

?

outer perch
#

wait a min. it's possible to use d.js with TS right?

mellow kelp
#

i'm using an ssh github action, but it's not running .bashrc, or .bash_profile

opal plank
mellow kelp
#

so i can't use yarn global commands

opal plank
#

no clue

mellow kelp
#

sad

#

my ultimate automation is failing

opal plank
#

git aint my fort

#

the moment you add yarn, thats a nono

mellow kelp
#

well when i say yarn just imagine it's npm

#

the thing is about the ssh thing not running .bashrc on login

#

guess i'll continue my search online

opal plank
#

prob better off google than me there

outer perch
#

I love how this gives you info before running into stupid errors

crimson vapor
#

what the fuck

outer perch
#

just by using :

crimson vapor
#

why would you do this?

pale vessel
#

to test ts

outer perch
#

I Ssd from the video

#

xD

mellow kelp
#

try generics

#

generics are really pog

pale vessel
#

SSD?

outer perch
#

not SSD

#

Ss -> Screenshot

pale vessel
#

Screenshotted, ok

outer perch
#

xD

crimson vapor
#

SSed

outer perch
#

sssssssssssD

#

Incredible, it's been a year since I started programming by myself

#

basically, 17th It'll be my bot's anniversary

outer perch
mellow kelp
#

depends on your tsconfig.json

outer perch
#

since it's just a superset

glossy spoke
outer perch
mellow kelp
#

if you have noImplicitAny enabled (which you should btw) you won't get errors i guess

glossy spoke
#

The windows ping is for a velocity testing, to eval the reponse time

mellow kelp
#

but you should enable noImplicitAny

#

it will force you to type function arguments that don't have a type

outer perch
#

yeah, to strict the values to it's type

mellow kelp
#

yea

#

another option i would recommend is strictNullChecks

#

it will treat null as another type entirely

#

so you'll have to explicitly say that a variable may be null or undefined

opal plank
#

and allowImplicityAny

#

cuz i think thats off by default

outer perch
mellow kelp
#

yeah noImplicitAny is disabled by default

opal plank
outer perch
#

eventually I'll learn Angular or React later, since i saw ppl use TS to work with those, I wanna learn TS too

mellow kelp
#

oh yeah angular uses ts

outer perch
#

React doesn't?

mellow kelp
#

it's not necessary

outer perch
#

I still don't know which should I stick to, Angular vs React

mellow kelp
#

but it's really useful

opal plank
#
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "out",
    "sourceMap": true,
    "strict": true,
    "allowJs": true,
    "esModuleInterop": true,
    "importHelpers": true,
    "strictNullChecks": true,
    "experimentalDecorators": true,
    "noImplicitReturns": true,
    "noImplicitAny": true,
    "lib": ["ES2019", "DOM"],
    "declaration": true,
    "watch": true,
    "baseUrl": ".",
  },
  "include": ["src/**/*.ts", "commands", "globals"],
  "exclude": ["node_modules", ".vscode", "emotes"]
}```
mellow kelp
#

i can hear ben awad approaching

outer perch
opal plank
#

angular works amazing with ts btw

outer perch
#

still not sure

mellow kelp
#

@opal plank do you run your bot with source maps on prod?

gilded raven
outer perch
#

isn't there a 2020 already?

mellow kelp
#

kinda curious if it brings performance issues

opal plank
#

shouldnt be much of a hit, cuz sometimes i do debugging in prod

mellow kelp
#

oh alright

opal plank
#

@outer perch there is, but i use 2019

outer perch
gilded raven
#

Help me fix with that $mentionedname thing i need to hide that

opal plank
#

check the target

#

i cant tell you since i dont remember, but i recall needing a specific version

#

i thinnk it was related to bigInt

mellow kelp
#

holy crap i just used cat on the node executable

mellow kelp
#

ew

opal plank
#

where did i see cat?

#

wasnt it git related?

mellow kelp
#

linux command

opal plank
#

i think i was checking that just a couple hours ago

mellow kelp
#

shows a file's contents

opal plank
#

oh, right

mellow kelp
#

got lots of question mark boxes

outer perch
#

the youtube binge loop is sucking me in!!
https://youtu.be/fsVL_xrYO0w

Learn how object-oriented 🎁 and functional ❄️ programming are awesome in their own ways. Also, get infallible answers answers to questions like "composition over inheritance?", "GIF over JIF?", "Is a hotdog a sandwich?" and more!

Special Thanks to Patrick Mullot - you rock!

Functional Cake Recipe https://probablydance.com/2016/02/27/functio...

▶ Play video
mellow kelp
#

I � unicode

outer perch
#

he said that's wrong

#

but functional is the wrong answer wrong too

#

opinions are all trash

#

just do you

mellow kelp
#
export default class Main {
    public static main(args: string[]): void {
        console.log('Hello, world!');
    }
}

i have created typescript java

outer perch
#

wai- whaaaaaaat?

opal plank
#
export abstract class _Main {}
export default Main extends _Main {
  constructor() {
    super()
    public readonly hello: 'Hello, World!'
  }
  run:((this) => {console.log(this.hello)})()
}
#

@mellow kelp beat mine

crimson vapor
#

Why do You need to call super or there is no constructor?

gilded raven
crimson vapor
#

...

glossy spoke
#

Ok so we don't know about bdfd's language

#

Try looking for someone that uses that app

opal plank
#

cuz bad code

crimson vapor
#

bruh

#

optimize your bad code

#

smh

opal plank
#

i improved it

#
export abstract class _Main {}
export default class Main extends _Main {
  public readonly hello!: string
  run!:() => void;
  constructor() {
    super()
    this.hello = 'Hello, World!'
    //@ts-ignore
    this.run = (():void => {
     return console.log(this.hello);
    })()
  }
  
}```
#

there we go

#

thats a functional console.log('hello world')

quartz kindle
#

you still need to run new Main() no?

opal plank
#

yeah

mellow kelp
#

ah yes

#

functional typescript java

outer perch
opal plank
#

thats the most retarded hello world i can think of, with shitty advanced code

mellow kelp
#

wait shouldn't line 8-9 throw a type error

#

you're assigning void to a function that returns void

opal plank
#

it ran

#

¯_(ツ)_/¯

mellow kelp
#

o

#

yeah i think ts-node doesn't throw typescript compiler errors

dire obsidian
#

oh fuck yeah i need some of the basic help again because im a fucking retarded

#

well

#

someone know how to host a domain with a express app?

opal plank
#

like a chad

mellow kelp
#

the most elegant solution to a typescript error

quartz kindle
#

using ts-ignore in ts is like using if-else in a command handler

mellow kelp
#

"oh no! anyways-"

dark heath
#

@green echo see you later

opal plank
#

stuff like remote eval with puppeteer require it btw

#

you cant have document.getClass for example inside ts

#

since it gets evaled inside a browser

#

stuff like this is valid syntax

gilded raven
#

Ummmm

opal plank
#

shhh, no tears, only dreams

crimson vapor
#

no

#

tears and dreams

lyric mountain
#

Java script be like

Car pet

gilded raven
#

What is $eval and how to use it?

dark heath
lyric mountain
#

It is what you made it be

gilded raven
#

I made my bot from mobile

lyric mountain
#

I'm sorry for you

dark heath
gilded raven
#

NO

dark heath
lyric mountain
#

Botghost, dbd or dbm?

gilded raven
lyric mountain
#

Botghost, dbd or dbm?

dark heath
#

türkmüsün

lyric mountain
#

Ah, bdfd

dark heath
#

türk varmı burda

lyric mountain
dark heath
#

ı from turkey

gilded raven
#

Im from India'

sage bobcat
#

One message removed from a suspended account.

mellow kelp
#

you just got dad'd

gilded raven
lyric mountain
#

No, not finally

gilded raven
#

....

lyric mountain
#

I just wanted to know which maker was

mellow kelp
#

well my nitro free trial ended today

#

goodbye sans dans

lyric mountain
#

You'll probably not find a single maker dev here

lyric mountain
mellow kelp
#

nooo

old cliff
gilded raven
#

But i heard someone is coding in mobile here...

lyric mountain
#

Coding in mobile != bdfd

gilded raven
#

IK

lyric mountain
#

You can write code on mobile

#

It's just.....meh

gilded raven
#

Wdym

lyric mountain
#

Small screen, small keyboard, etc etc

#

But it's doable

gilded raven
lyric mountain
gilded raven
#

Ummmm

#

Those are my bot commands

lyric mountain
#

"the bot will say the n word"

#

Really?

gilded raven
#

Not rlly

#

Lol

#

Wanna check it yourself?

lyric mountain
#

No

gilded raven
#

Ok

glossy spoke
gilded raven
#

I will show u the screenshot then

lyric mountain
#

But anyway, what's the issue?

mellow kelp
#

serif do be ugly doe

#

sans-serif ftw

gilded raven
#

To hide the $mentionedname when i dont mention someone

lyric mountain
#

If it was raw js, all you'd need was a simple if-else clause

#

See if bdfd has some kind of logical decision

gilded raven
#

This is what it says

#

Instead of "the n word"

lyric mountain
#

Awful

#

But whatever

crystal wigeon
#

hey umm

gilded raven
#

😭🔫

crystal wigeon
#

discord oauth isnt returning access_token but it returns the user object wtf

#

it used to work until last night

mellow kelp
#

what

crystal wigeon
#

yeah

#

like wtf

#

i get the code

#

i send it to /oauth2/token

#

it returns the user obj without access token wth

mellow kelp
#

are you sure you're in the /api route?

crystal wigeon
#

yeah

#

wait

#

im stupid

#

holy shit

solemn latch
#

👀

crystal wigeon
#

i feel dumb yow tf bruh

stark abyss
#

message.guild.roles.cache.get(role id).id is this a good way to make sure the role id user inputs is actually a role in the server?

solemn latch
#

i would use role mentions

#

oh wait

#

nvm 👀

stark abyss
#

wait what nephehL

#

can you tell me if that's the right way?

#

I want to make sure that the role id they give me is actually a role in the server

solemn latch
#

yeah, i was being dumb, yeah i dont see why that wouldnt work

#

probably a cleaner way, but i dont know it

stark abyss
#

what if the role isn't in cache?

solemn latch
#

it should be in cache right?

stark abyss
#

idk not good at djs

solemn latch
#

well, i thought roles are part of the guild data thats sent

#

same as channels

stark abyss
#

okay I am just gonna go with that if it gives an error they can always ping the role or i can fix it later

#

ty

earnest phoenix
#

def get_prefix(client, message): ##first we define get_prefix with open('prefixes.json', 'r') as f: ##we open and read the prefixes.json, assuming it's in the same file prefixes = json.load(f) #load the json as prefixes return prefixes[str(message.guild.id)] #recieve the prefix for the guild id given

got a key error for line

return prefixes[str(message.guild.id)] #recieve the prefix for the guild id given

solemn latch
#

probably not a good idea to use a json db

earnest phoenix
gilded olive
#

Don't do this

earnest phoenix
#

k

gilded olive
#

Hm I smell swas.py's JSON as a DB videos

earnest phoenix
#

no

gilded olive
#

I told you beforehand to use postgresql

earnest phoenix
gilded olive
#

Or sqlite

earnest phoenix
#

i dont know how to

nimble kiln
#

MySQL/MariaDB?

earnest phoenix
nimble kiln
#

👀

solemn latch
#

mongo is fine too, pretty simple

gilded olive
#

async or no

earnest phoenix
#

!?

gilded olive
#

well is there an async variant for pythonn

#

Yea don't do that

earnest phoenix
gilded olive
#

Just maybe 2 weeks ago you told me you'll stop with this JSON as a DB thing and learn sql, guess not

lyric mountain
#

Oh oh, lemme give my 2 cents too

#

Stop using json db

drowsy grail
#

yea i agree

glossy spoke
#

Sql is still better

#

For everything

lyric mountain
#

Nah, json is only for read-only data AT MOST

misty sigil
#

NO

#

JSON IS NO

mellow kelp
#

json is yes

#

for configs

lyric mountain
#

Aka read-only files

glossy spoke
#

Imagine adding economy for a bot with 2.5k+ guilds with a json db

nimble kiln
lyric mountain
#

Every write you mean

nimble kiln
#

a minute of data loss is acceptable

#

for me at least

lyric mountain
#

Don't let users hear that

glossy spoke
#

For big bots a minute of data loss is a big data loss

mellow kelp
#

big data loss

#

really big

earnest phoenix
#

I have a command Called Play But when I run It I expect to have the bot play music ||ofc lmao|| But when I run it I get this error:

    at Object.run (/home/runner/Music-Canary/commands/music/play.js:25:43)
    at module.exports (/home/runner/Music-Canary/events/message.js:46:17)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:89) 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)
(node:89) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
everything else works even changing prefixes but I just can't get the  commands working 
Play command:https://sourceb.in/vA8nknkTzd
Queue command if it is the problem: https://sourceb.in/QIx5Imxxa6
misty sigil
#

it shouldn't be that hard

earnest phoenix
#

ah one sec

#

yea for some reason I just don't understand

opal plank
#

client does not have a property queue @earnest phoenix

#

client exists

#

client.queue doesnt

#

whats so hard about that?

misty sigil
#

i've seen that code on so many fucking websites

#

its 10000000% guaranteed they copy pasted it

queen needle
#

I can tell you one place where most people copy it from

opal plank
#

i can tell you 5

solemn latch
#

oh i bet its on github

#

mind reading powers

queen needle
#

I know know a github it's on

opal plank
#

here, stackoverflow, discord.js guide, some github repo, "my friend dm'd me"

misty sigil
opal plank
#

5 best sources

solemn latch
#

this guide actually explains some really basic stuff 👀

queen needle
#

I don't understand why people copy and paste code especially that code its not even that good

solemn latch
#

actually nvm, it explains nothing

#

nothings commented

#

best guide na

#

oh wait, one section is commented, woah

misty sigil
#

wOAH

#

COMMENTS?!

solemn latch
#

amazing for that one section

sudden geyser
#

not using comments 🤢

solemn latch
#

especially in a guide

sturdy gazelle
uncut swallow
#

    //luego creamos el mensaje embed
      const welcome = new Discord.MessageEmbed()
      .setAuthor(member.user.tag, member.user.displayAvatarURL())
      .setTitle(`Bienvenido a ${message.guild.name}`)
      .setDescription(`Hola ${member.user}, disfruta del server`)
      .setColor("RANDOM")
      .addField(`Ahora somos ${message.guild.members.cache.size} usuarios`)
      .setThumbnail(client.user.displayAvatarURL());
    //y hacemos que el bot mande el mensaje embed al MD del usuario
      message.author.send(welcome);

    })```
#

what is wrong?

#

pd: the embed has send in md user sorry for my bad english

mellow kelp
#

do you have the guild members intent?

uncut swallow
#

in that way?

uncut swallow
mellow kelp
#

se

uncut swallow
#

ohh

#

the command has to send the person who entered the private, that's why the guildmemberadd

mellow kelp
#

yeah, but you need the guild members intent to receive the guildMemberAdd event

uncut swallow
#

I did tests with the members but it didn't work, that's why I ask here

#

hello?

mellow kelp
#

i'm asking you

#

do you have the guild members intent?

#

if not, you need to enable it on the developer portal

uncut swallow
#

as so intention?

mellow kelp
#

um no

pale vessel
uncut swallow
#

ok

pale vessel
uncut swallow
#

ok

#

What do I have to do there?

pale vessel
#

Make sure that "Server members intent" is turned on

uncut swallow
#

is turned on

lament rock
#

Without it, you can only fetch up to 100 I believe?

pale vessel
lament rock
#

Thanks flaze amandacomfy

uncut swallow
pale vessel
#

hrm, wait

uncut swallow
#

no, it just doesn't send the embed

pale vessel
#

Actually, you tried using message.author but message was never defined...

#

Either it somehow swallowed the error or the event didn't trigger at all

uncut swallow
#

uhmmm the event never turned on

pale vessel
#

Go to https://ziad87.net/intents/ and select all the intents/events you need and provide the number generated to your ClientOptions (new Discord.Client({ ws: { intents: <here> } }))

heavy marsh
#

So in d.js verison 12.5.1
Embed.setThumbnail can not be null

To fix this ...
Can we fetch the results and see if the result == null and set it to a default image?

pale vessel
#

You can use setThumbnail(result || "default URL")

uncut swallow
#

oh

heavy marsh
#

But some times the result == null

#

Then i didnt get the defult image

pale vessel
#

Yes, and that is falsey, which will fallback to the default image

uncut swallow
#

oh i delete the thumbnail

heavy marsh
#

I mean i get it as "null"

uncut swallow
#

ok i try

pale vessel
#

result === "null" ? "default URL" : result

lament rock
#

I'd prob go a step further and do
(!result || result === "null") ? "default URL" : result

pale vessel
#

or just eval(result) ? "default URL" : result

#

no

lament rock
#

XD

heavy marsh
#

So ...

let NP_StationIcon = (!StationInfo.amgArtworkURL || StationInfo.amgArtworkURL === "null") ? "https://cdn.discordapp.com/attachments/701169235526680696/811104671527600128/Unknown_Stream.png" : StationInfo.amgArtworkURL;
uncut swallow
pale vessel
#

Make sure you select GUILDS too

uncut swallow
#

ok

lament rock
#

What I highlighted, you could remove

heavy marsh
lament rock
#

yup

#

looks great

heavy marsh
#

Thank you

uncut swallow
pale vessel
#

Do you have the number?

uncut swallow
pale vessel
#

2?!

uncut swallow
#

yeah

#

or do I choose all?

pale vessel
#

You need GUILDS, GUILD_MESSAGES and probably more

#

Check again

#

Check the ones you need

#

If you don't see an event that you need, you need to select the correct intent

#

If you need to fetch guild bans, make sure you select GUILD_BANS, if you need emojis, select GUILD_EMOJIS, etc.

#

GUILD_MESSAGE_REACTIONS for reactions

uncut swallow
#

ok

pale vessel
#

You definitely need GUILDS or your bot won't get its guilds

lament rock
#

I fail to understand the necessity for OP 0

uncut swallow
lament rock
#

You also need GUILDS

#

1 << 0

uncut swallow
#

ok

pale vessel
#

If you need to get members' presences (like their status, online, idle, etc.) you need GUILD_PRESENCES too

#

Once you get the number, provide it to your Client constructor

uncut swallow
#

constructor client?

pale vessel
#

Yes

lament rock
#

new Discord.Client

#

Client constructor

pale vessel
#

new Discord.Client({ ws: { intents: <intents> } })

uncut swallow
#

ok

#

line of code must be at the top?

pale vessel
#

Wherever you put it initially

uncut swallow
#

uhmm

#

So if I want to do the event I have to put the client.constructor at the beginning?

pale vessel
#

Do you have new Discord.Client() somewhere in your code?

uncut swallow
pale vessel
#

Just add { ws: { intents: <intents> } } as the first parameter I guess

#

With <intents> being the number

uncut swallow
#

I replace it to discord.client or just make it a place?

#

hello?

pale vessel
#

Provide the object as the parameter

uncut swallow
#

ok

#

what its wrong?

opal plank
#

you dont add <>

uncut swallow
#

ok

opal plank
#

i wonder what would happen if i were to tell them to use detritus instead of discord.js

#

🤔

pale vessel
#

Come on

opal plank
#

look, just for science

uncut swallow
pale vessel
#

The docs are way harder to navigate through than Discord.js

opal plank
#

they arent reading the docs anyway

pale vessel
#

fair lmao

#

You'd have to look in the source for types

#

If you had trouble trying to upload a file, I don't know how they can manage to use the lib itself

uncut swallow
#

ok how do I relate intents to events?

opal plank
#

relate?

uncut swallow
opal plank
#

thats a client

#

not intents

pale vessel
uncut swallow
#

oh

opal plank
#

new Discord.Cliet

#

i mean, you can name it intents if you want

#

makes 0- difference

uncut swallow
#

ok

opal plank
#

but since you're new, it'll likely confuse the fuck out of you to have it named that

uncut swallow
#

yeah its sure

pale vessel
#

Try it out

#

You still use message in your code

#

Use member.guild, not message.guild

uncut swallow
#

sorry its much message.guild

pale vessel
#

Change it to member.guild

#

That's the equivalent

#

After that, try testing it, join a server that your bot is in using your alt, etc.

uncut swallow
#

ok, but i replace all message.guild with member.guild?

pale vessel
#

Yes

uncut swallow
#

ok

pale vessel
#

By the way, some users have their DMs disabled. Make sure to catch your send method member.send(welcome).catch(() => handle);

uncut swallow
pale vessel
#

That should work

#

You never know until you try

uncut swallow
#

ok

#

but , i can try with other users?

pale vessel
#

What do you mean?

#

It should work for all users, if that's what you mean

uncut swallow
#

oh

#

thanks

#

the event not turned on

#

    //luego creamos el mensaje embed
      const welcome = new Discord.MessageEmbed()
      .setAuthor(member.user.tag, member.user.displayAvatarURL())
      .setTitle(`Bienvenido a ${member.guild.name}`)
      .setDescription(`Hola ${member.user}, disfruta del server`)
      .setColor("RANDOM")
      .addField(`Ahora somos ${member.guild.members.cache.size} usuarios`)
      
    //y hacemos que el bot mande el mensaje embed al MD del usuario
    member.send(welcome).catch(() => handle);

    })```
#

:c

#

whats wrong?

#

its on

#

aha

#

How do I relate the intentions to the event?

#

ehh ok

#

yes

#

uhmm what it?

#

i am frustated

#

const intents = new Discord.Client({ ws: { intents: 4895 } })

#

How do I put this in the event?

#

:c

#

how?

#

i am triying a welcome event but send embed in md user

#

ok

fresh verge
#

Which IP would I have to use? Link Local IPv6, IPv6 address, IPv6 DNS servers, IPv4 address, or IPv4 DNS servers?

snow sundial
#

Lol, i thought that was your real IP.

opal plank
#

@fresh verge what init said

#

search whats my ip online

lament rock
#

I wish ipconfig showed your forward facing ip

#

wait

#

I forget if it shows your gateway's IP

#

I know, but I check ipconfig when I'm setting up a web server anyways

uncut swallow
#

I think the problem with my event is how it should be sent to the user's md. I think there is the problem if not, please tell me how I set the intention in the event if it is with const or with let me tell.

pale vessel
uncut swallow
#

...

#

the a not appeared

#

xd

pale vessel
#

@opaque fern fuck, that presence

uncut swallow
#

I better say goodbye to the welcomes

#

i give up

#

thanks for the help

pale vessel
#

F

uncut swallow
#

better tomorrow I try another command but the event command does not come out

fresh verge
#

It keeps saying error: 401 Uneuthorized whenever I try to use the webhooks.

sudden geyser
#

is the token correct

fresh verge
#

Yes.

sudden geyser
#

are you sure

fresh verge
#

Yes.

sudden geyser
#

Can you debug what method call is triggering the error

lament orchid
#

Why?

#

Wokeh

earnest phoenix
#

How to send nitro emoji by bot without having Nitro on user

vernal moth
#

How do i prevent my bot getting errors called "Missing Permissions" when it tries to SEND A MESSAGE and it CLEARLY has send message permissions in the bot invite link?

earnest phoenix
#

@vernal moth can you send me test server link

vernal moth
#

on dms?

earnest phoenix
#

Yes

vernal moth
#

I use embed

#

okay

earnest phoenix
#

Yes

#

In py

#

K

#

Got it

#

Thanks bro

lost cove
#

Anyone know how to dissect a Rider profiling to see which parts of a command's code are taking the longest?

near stratus
jolly seal
near stratus
#

discord.js

jolly seal
#

hmmm

#

I forgot how to do this type of things lol, let me search

#

i have one bot with the same code wait

#

Oh sht lost my data

#

well i can't help you, sorry

near stratus
#

nvm I googled and I think I should use setPresence

#

and it's still not working

robust solar
near stratus
#

it used to work for me too but it's now messed up

nocturne parrot
#

maybe this? sorry i’m on mobile rn client.user.setActivity('insert status here', { type: 'LISTENING' });

#

like all on the same line?

honest perch
#

It doesnt matter if its on the same line or not lol

#

It could be 1000 lines down and it would work

nocturne parrot
#

o sorry, i tried it with my bot before and it only worked if it was on the same line

crystal wigeon
#

hey umm
"name":"FetchError","code":500,"method":"post","path":"/channels/806445805791477820/messages","level":"error"}
what error is even this
i keep getting this

thorny flume
#

Can anyone help me create shards? my bot is growing and i want to add new features to improve the communication of each command to each server if anyone can help me can call me in pv or even in chat

valid wadi
#

Can anyone help me to add my own icon to my bot?

crystal wigeon
#

its discord bot TT

wise dock
#

How can I put my google css font in the bot description? I know it is html but it doesn't work

slender thistle
#

How did you add it?

wise dock
#

puff i can acces to the bot description of my team the top.gg web page is changing

#

<html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Lobster&amp;display=swap" rel="stylesheet"> <style> body { font-family: 'Lobster', cursive; } </style> <title></title> </head>

slender thistle
#

What does Inspect Element show?

wise dock
#

sorry im from spain ¿Inspect Element? the preview?

pale vessel
toxic jolt
#

guys please hellppp

#

Quick.db data has been deleted! I was uploading with one drive, I realized it was gone. The data is currently in the bot, but if I restart it will be completely deleted! How can I recover? There is an eval command.

pale vessel
#

Try exporting all the data to JSON through eval

slender thistle
#

Use the bot's cache system and save all the data via eval

toxic jolt
#

I'm dying of fear

pale vessel
#

I've never used quick.db, but you can check their docs on how to get data

slender thistle
#

Well how do you store your data

pale vessel
toxic jolt
#

im using quick.db

pale vessel
#

Try evaling that

toxic jolt
#

im trying db.all() for console

pale vessel
#

If it returns what you've saved, use fs and JSON.stringify() to store it

toxic jolt
#

oh yes its here

pale vessel
#

poggers

#

you're so lucky

toxic jolt
#

OMGG UwU

#

I will never use one drive

pale vessel
#

oof

toxic jolt
#

what can i do now

#

Can't I do it as a sqlite

pale vessel
#

Doubt it

#

You have to reimport everything back on a new database

toxic jolt
#

its so hard

#

if there is an error, econnreset or internet goes i'm done.

pale vessel
#

Just save it to JSON first