#development

1 messages · Page 1085 of 1

solemn latch
#

Yeah, 2.7 is diffrent

#

lmao

digital ibex
#

how else would i do it then?

delicate shore
#

lol

#

sry

quasi hearth
#

you might want to add more break; for each switch case

delicate shore
#

i didn't knew

digital ibex
#

wut

#

oh

#

yeah, i see now

#

i must've missed it, thank

pure lion
#

a

delicate shore
#

@pure lion i will see u in dms sooooon

opal plank
lusty quest
#

@delicate shore depending on your internet Speed / Speed of your machine it can take easy 30 minutes

quartz kindle
#

i mean, thats ts stupidity basically

#

i dont use ts

pure lion
#

@opal plank 37/10

opal plank
#

you prob right about having to cast type

delicate shore
#

@delicate shore depending on your internet Speed / Speed of your machine it can take easy 30 minutes
@lusty quest oooooooooooooooooh no 😭

solemn latch
#

So, typescript is js, just with types?

#

🤔

opal plank
#

though im trying to figure out howhavent used typeof nor declarations for this

#

@solemn latch yes

quartz kindle
#

basically yes, but it also has other features

digital ibex
#

the break fixed it, thanks @quasi hearth :)

solemn latch
#

Intresting

delicate shore
opal plank
#

newest features before they come to js too

sudden geyser
#

JavaScript but strict.

opal plank
#

im loving Es11

quartz kindle
#

if you're used to languages like c++, typescript will make js much more similar to what you're used to

opal plank
#

Js is like a pig, whatever you throw at its direction it'll eat it and yoink happily at you

quartz kindle
#

lmao

opal plank
#

Ts you gotta properly make sure everything is in place

solemn latch
#

Ah, so not for me.
Someone who throws stuff at a wall till it sticks

quartz kindle
#

same

lusty quest
#

i write sometimes overcomplicated code

misty sigil
#

How do I fetch user (using arrow functions)

lusty quest
#

like stuff you can solve in 1-3 lines

opal plank
#

its definetly fun to play with, specially cuz if gives you a good idea of statically types oobjects from other langs

delicate shore
#

this says successfully installed

quartz kindle
#

fetching has nothing to do with arrow functions

lusty quest
#

it will tell you when its done

delicate shore
#

ok

quartz kindle
#

you can fetch users with client.users.fetch()

opal plank
#

i was kidding about the any type but im really tempted now

delicate shore
#

i have to sleep i will go and set my status to online and come back when

#

someone pings me

quartz kindle
#

so you set your status to "online" when you go sleep?

delicate shore
#

ye

opal plank
#

make sense

quasi hearth
#

lol

opal plank
#

offline when online

#

online when offline

#

cuz fuck logic

solemn latch
#

When I'm asleep, that's my most online time.

opal plank
#

problem solved

cinder patio
#

ah yes, antipatterns

opal plank
#

too much headache for that one

#

problem is not knowing how to cast stuff

cinder patio
#
const Discord = require("discord.js");

.then((message: Discord.Message => ...
opal plank
#

i did

#

thats when the whole nightmare started

sick cloud
#

say i have a date object, how do i work out if that date is within the last 24 hours of the current date
js

cinder patio
#

Yeah, discord.js is a pain to use with typescript

opal plank
#

fml im done with patching d.js libs

#

its the 12th patch i had to do today

lusty quest
#

@sick cloud compare it with the current time and if the difference is 24 hours do what you need to do.

sick cloud
#

i'm asking how though

amber fractal
#

get the ms

#

and add 1 day in ms to it

sick cloud
#

also that doesn't make sense, i only want it to match if the date object (which say is created 17 hours ago) is within the last 24 hours of the current date as in now

#

ok

amber fractal
#

if it's less than Date.now() it's in that time

cinder patio
#

you could also compare dates

amber fractal
#

or greater than*

formal drift
#

hi

sick cloud
#

i have an array of messages and basically only wanna filter them to ones that have been added in the last 24 h

formal drift
#

can I ask something ?

sick cloud
#

each msg in the array has the date prop which is when its added so

formal drift
#

How can I list accounts with early supporters with code?

#

user.flags ?

lusty quest
#

it should be a flag

formal drift
#

uhm

#

can you help me?

sick cloud
#

@amber fractal can you give me a rough idea on the logic i need for this, its 1 am so i get barely anything tbh

amber fractal
#

<Date in ms> + 86400000 > Date.now()

sick cloud
#

ok got it

amber fractal
earnest phoenix
#

@formal drift early supporter is a flag contained in UserFlags

#

You can check flags of a user by
<User>.flags.toArray()

formal drift
#

uhmm

#

thank u

sick cloud
#

am i doing this wrong somewhere

#

there's def messages in the array

#
activity.messages.filter((x) => (new Date(x.date).getTime() + 86400000) < now);```
amber fractal
#

use greater than

#

I messed up with lessthan

sick cloud
#

oh ok

#

ay worked

#

thanks

#

and the same logic would apply for say 7 days and 1 month right

pale vessel
#

yes

sick cloud
#

just +more time

earnest phoenix
#

isn't that just for cached messages

pure lion
#

*cries in how the fuck do I webserver*

solemn latch
#

I use express for my ejs webserver

pure lion
#

Same but how the fuck

#

Do I get the port of my vps

solemn latch
#

Port out of your vps?

pure lion
#

Into/out of the container

#

Btw the console doesn't return anything

solemn latch
#

What container engine are you using?

#

Docker?

pure lion
#

U h

#

Gimme a list and I'll probably pick the wrong one

sick cloud
solemn latch
#

If you dont know, your probably not containerized

pure lion
#

The assigned port is 6969

#

For the server

#

That I'm using

solemn latch
#

Have you tried going to the page?
Ip:port

quartz kindle
#

@sick cloud error MSB8036: The Windows SDK version 10.0.18362.0 was not found

sick cloud
#

and how do i fix that lol

quartz kindle
#

try repairing your vs installation, or install/reinstall windows-build-tools
vs 2019 might not be supported yet

delicate shore
#

@lusty quest now ?

#

should I go check it ?

fathom herald
#

.

sick cloud
#

i don't have any VS on here

#

i think

quartz kindle
#

wt

#

running in admin powershell right? any logs?

sick cloud
#

yea in admin

#

and logs as in

#

where it says?

tight plinth
#

Try without

#

Sometimes it works without

quartz kindle
#

why it could not install lol

sick cloud
quartz kindle
#

check the log files in that folder

tight plinth
#

Maybe it will do no difference, but try in cmd

#

Powershell broke my npm

sick cloud
#

there's no logs in that folder relating to build tools

rocky hearth
#

Hey Tim, Can you suggest me a free chatbot api, that can respond to the user's messages?

tight plinth
#

Free? No

quartz kindle
#

@sick cloud do you have any visual studio installed?

rocky hearth
#

yes

quartz kindle
#

@rocky hearth idk i never used any chat api

sick cloud
#

i dont

#

i uninstalled all these things earlier by accident because i ran out of hdd space

delicate shore
#

running in admin powershell right? any logs?
@quartz kindle
Hey it's been over 40 mins almost and it is still showing same thing saying successfully installed python 2.7

sick cloud
#

@quartz kindle no idea how to fix this anyways, is there something i can install

#

read the rules

#

we don't spoonfeed code

pure lion
#

@solemn latch yeah, returned timeout

delicate shore
#

@solemn latch yeah, returned timeout
@pure lion
E

#

how much time

#

Does it takes

#

I am tired

#

Yeah

lusty quest
#

@pure lion did the guy who host you the Docker Container allocated the port? and added it to the firewall of the host Machine?

delicate shore
#

super rain

#

Superbrain

#

Should I leave it

#

For downloading

#

And see tomorrow

lusty quest
#

it can be stuck or it still works

pure lion
#

@lusty quest I'll look i to that

delicate shore
#

it is stuck

#

Not even moving a little

#

But

lusty quest
#

its possible that your CPU is just super slow

delicate shore
#

;-;

lusty quest
#

or abort it and try again. it should recocnize python as installed

delicate shore
#

ok

#

What was code again ?

lusty quest
#

press the up arrow

earnest phoenix
#

just to make sure your prefix can't have capital letters, right?

delicate shore
#

It's not allowing

#

Me to scroll up

#

It brings me back down

restive pebble
#

rip

lusty quest
#

arrow key

delicate shore
#

There are 3 powersheel

#

Which one I have to run

#

Maybe I was running wrong

lusty quest
#

the one where you run it first

delicate shore
lusty quest
#

did you closed it?

delicate shore
#

Yws

lusty quest
#

i dont say close it i said abort it.

delicate shore
#

What is abort ?

lusty quest
#

scroll up in the channel and see what Tim wrote

delicate shore
#

I saw

#

Should I again run the same line of code

lusty quest
#

CTRL+C closes the process

#

yes

delicate shore
#

Will it take

#

Whole time

#

Again

lusty quest
#

yes

delicate shore
#

Fuck

#

Why did I do that

#

;-;

lusty quest
#

bcs it compiles some stuff

delicate shore
#

Wait

#

It said

#

All done

lusty quest
#

it will not install python

delicate shore
#

That is it

#

It said all done

lusty quest
#

well then it was just a bug

delicate shore
#

Ok

#

Thank god

lusty quest
#

what language?

opal plank
#

didnt i send you docs for it?

#

i think it was someone else

lusty quest
#

im not sure want to know what language before firing with Docs

opal plank
#

assuming its d.js

earnest phoenix
#

can you put multiple prefixes in config.json?

{
  "prefix": ""
}
opal plank
#

make a map with all prefixes

#

check on every msg event

earnest phoenix
#

alright

#

thx

opal plank
#

np

delicate shore
#
    at Object.readdirSync (fs.js:872:3)
    at Object.<anonymous> (C:\Users\Harjap\Downloads\accurate-thin-mango-2020-07-25_134817 (extract.me)\app\index.js:67:4)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\Users\Harjap\Downloads\accurate-thin-mango-2020-07-25_134817 (extract.me)\app\server.js:1:1)
    at Module._compile (internal/modules/cjs/loader.js:1133:30) {
  errno: -4058,
  syscall: 'scandir',
  code: 'ENOENT',
  path: './gifs/'
}
PS C:\Users\Harjap\Downloads\accurate-thin-mango-2020-07-25_134817 (extract.me)\app> ```
#

i don't even need the

#

gifs folder

opal plank
#

then dont require it

#
#

assuming its d.js

earnest phoenix
#

i think A I is useless for Discord Bot

lusty quest
#

lol you just dont think on a large enought scale

calm saddle
#

it is useless is some way but usefull in other

earnest phoenix
#

Dude it is so slow

restive pebble
#

ffmpeg

sweet dust
#

hi

solemn latch
#

music is a complex subject

sweet dust
#

I am not supposed to be here

opal plank
#

@earnest phoenix it says in the guide

#

continue reading the link i sent you

#

all info is there

azure quail
#

I need help

#
    if(!coins[message.author.id].coins ){
      return client.music.sendEmbed(message, "Test numéro 1.")
    }

    let pUser = message.guild.member(message.mentions.users) || message.guild.members.get(args[2])
      
    let pCoins = coins[pUser.id].coins;
    let sCoins = coins[message.author.id].coins;

    if(sCoins < args[2]) return client.music.sendEmbed(message, "Erreur 1")

    if(sCoins > args[2]) {
      coins[message.author.id] = {
        coins: sCoins - parseInt(args[2])
      };
      
      coins[pUser.id] = {
        coins: pCoins + parseInt(args[2])
      }
    }
    client.music.sendEmbed(message, `${message.author} a donné ${args[2]} a ${pUser}.`)
opal plank
#

help with.....?

lusty quest
#

some context would be nice

azure quail
#

[25/07/2020] [Error] TypeError: Cannot read property 'id' of undefined

opal plank
#

WHICH id?

azure quail
#

yes

opal plank
#

author or pUser

#

what?

lusty quest
#

does it say what line?

opal plank
#

that wasnt a yes/no question

#

im assuming its pUser

lusty quest
#

let pUser = message.guild.member(message.mentions.users) || message.guild.members.get(args[2]) i think you want here message.member

#

but you dont really need the member property user does the job too

#

and for mentions you probably want message.mentions.users.first()

earnest phoenix
#

Any tips for advertising our bot?

misty sigil
#

auctions ?

lusty quest
#

add it to Top.GG and apply for auctions -> they are not Free

#

but adding it alone give you some advertisement

earnest phoenix
#

Not paid

misty sigil
#

welp

#

just add it

lusty quest
misty sigil
#

and get it approved

earnest phoenix
#

I have a better method zoom2

#

A pro gave it to me

opal plank
#

wdym? its the second topic

#

l.reload globals

#

fuck wrong channel

solemn latch
digital ibex
#

oh boy

#

sir!,!!@

opal plank
#

im leaving this one to someone

#

the examples are bare bones already

digital ibex
#

why have u got 2 message events yikes

#

thats not the issue, ur just gonna get a memory leak

#

but that code goes in the if statement

misty sigil
#

use if/else

opal plank
#

what could go wrong if i attach all my 130 commands with an event each?

misty sigil
#

what could go wrong if i attach all my 130 commands with an event each?
@opal plank everything

solemn latch
#

nothing, everything will be perfect

opal plank
#

naaah tis fonna be foone

misty sigil
#

or even switch/case if you're feeling efficient

digital ibex
#

nothing would happen 🤔

#

with one if/else, nothing is gonna change

misty sigil
#

yea

digital ibex
#

but that code goes in the if statement
@digital ibex

opal plank
#

we can help you, we wont spoonefed you tho

#

the docs give a pretty good example

solemn latch
#

music is complex, youll have to do a lot yourself

misty sigil
#

music v. complex

earnest phoenix
#

how to get more ideas about command ?

#

i have no creativity

warm marsh
#

Look at other bots also it's not really a "development" question ask in off-topic for ideas.

opal plank
misty sigil
#

judging by the fact that you are using 2 message events you probably shouldn't be making a music bot

earnest phoenix
#

sad

digital ibex
#

why?

opal plank
#

agree with jeremy

digital ibex
#

doesnt really change anything about how the bots gonna perform / functions

misty sigil
#

i mean, you can just use if/else / switch/case / command handler

#

apart from the memory leaks, @digital ibex

digital ibex
#

still doesn’t change anything tho

#

yes

#

still not gonna really change what the bot can do tho

opal plank
#

wdym

#

he copied the snippet dude

digital ibex
#

lol

opal plank
#

he doesnt seem to know js at all

misty sigil
#

yea

#

and it seems much like a first project

#

which shouldn't be music imo

digital ibex
dusty leaf
#

hi

opal plank
#

making a bot itself doesnt seem like a good idea in that case

#

prob w3school snippets first to at least get a hang of js

misty sigil
#

ye

pure lion
#

Don't be like yandere dev - use switch case unless it's an openGL app that for some reason can't read keys dynamicly and it's retarded

dusty leaf
#

i need help, dm?

pure lion
#

No send here

digital ibex
#

i mean

pure lion
#

This is literally the purpose of the channel

misty sigil
#

send here.

digital ibex
#

make a bot with no coding experience sure

pure lion
#

I did that

misty sigil
#

same

pure lion
#

Now I know node

#

Be like dice

#

Retarded

digital ibex
#

making a bot with no coding experience and just being stubborn no

pure lion
misty sigil
#

well a bit of coding experience actually

#

i had made some unity games

#

with some js

pure lion
#

@earnest phoenix my iq haheyyy that was a joke

misty sigil
#

and a few websites

digital ibex
#

thats a bit hypocritical, jeremy yikes

misty sigil
#

altho it was mainly copypaste KEKW

earnest phoenix
#

unity 🚮

pure lion
#

Use C

#

And opengl

#

You won't regret it

earnest phoenix
#

unity got better recently but unreal engine still easily tops it

#

i don't know if you all saw the UE5 trailer

#

but holy shit that is powerful

digital ibex
#

yeah

#

its so hot

earnest phoenix
#

in UE5 you'll be able to use movie grade assets with no performance cost

solemn latch
#

can you ask the question

digital ibex
#

that make me wanna start game dev

earnest phoenix
digital ibex
#

its hot af

misty sigil
#

can you ask the question instead of saying Can someone help me?

earnest phoenix
#

How i can send Embed :))

#

what isn't working

#

we do not have a crystal ball

pure lion
#

@digital ibex check my GitHub repo of my first game it's the ray caster thing and it's shit but it's my baby and I love it so much aaaaaaaaa

misty sigil
#

p.s. people in development channel != crystal ball woman KEKW

digital ibex
#

whats ur github?

pure lion
#

Wait I'll grab the link

#

Nvm

#

alebot-dev

digital ibex
#

full stack dev 👀

#

ew

earnest phoenix
#

java style brackets 🤢

#

officiallylost? more like officially lost all my respect

sudden geyser
#

if (true)
println("hi")

digital ibex
#

D:

#

nvm actually

lusty quest
#

... i have a brainfart rn, cant think of a way for having a number stored in a value accesable in mutiple files that can also be updated (updating the guild count without restarting)

digital ibex
#

use a databsae?

lusty quest
#

its overkill

#

but probably the way i go

digital ibex
#

how is it 🤔

earnest phoenix
#

if you don't need it to be persistent

solemn latch
#

multiple files, as in exports?

lusty quest
#

was thinking on collections but for some reason i have a brainfart with how to allocate it

earnest phoenix
#

just pass the variable around through functions

digital ibex
#

oh

#

quick question if anyone knows, im getting this error: js FetchError: invalid json response body at <url here> reason: Unexpected end of JSON input

#

the code is just: ```js
body: { "content": "${content}", "username": "${webhook.name}", "avatar_url": "${avatarURL}" }

earnest phoenix
#

it's not what you're sending

#

it's what you're receiving

digital ibex
#

oh

earnest phoenix
sudden geyser
#

^ Also, why not just create an object then use JSON.stringify instead of entering the raw JSON like that

digital ibex
#

how can i make it format the json response properly then?

earnest phoenix
#

because stringifying an object is slow

sudden geyser
#

hmm

#

but wouldn't it be safer

earnest phoenix
#

sure it would

digital ibex
#

any ideas?

cinder patio
#

Maybe you aren't getting JSON as a response

digital ibex
#

it returns an object

celest schooner
#

in order for discord.js-light to save ram, does cache in the .fetch methods have to be false

solemn latch
#

i dont think object is a content type

lusty quest
#

@celest schooner yes

#

but then it will not cache the fetched object

celest schooner
#

but if its in a

#

command

#

will fetching it every time

pure lion
#

officiallylost? more like officially lost all my respect
Lol its my code roast me or you cant biiiTch

digital ibex
#

returns a json

celest schooner
#

save more ram than cashing

solemn latch
#

doesnt djsL have ways to clear cache? thats the main benifit

celest schooner
#

¯_(ツ)_/¯

#

ill look into it

digital ibex
#

i've already told u..

solemn latch
#

multiple people have

celest schooner
#
pure lion
#

coneaczon.pley(emm pee three file)

lusty quest
#

@celest schooner d.js-light also clears the cache from users /channels that where not used for 24 hours (not sure if you manually need to use the function for this)

celest schooner
#

got it

lusty quest
#

if you want to save more use jemalloc

celest schooner
#

oka

digital ibex
#

or make ur own :p

lusty quest
#

in the longrun it can cut down on ram usage

solemn latch
#

yeah, likly will increase steadily for the first 24 hours then level out

celest schooner
#

u mean like

#

client.sweepUsers(lifetime)

solemn latch
#

I need to swap to djs-l

lusty quest
#

yea this is for doing it manually

celest schooner
#

does it do it auto matically?

pure lion
#

Woo do it you gotta

lusty quest
#

idk

celest schooner
#

automatically

lusty quest
#

but i guess

#

i have it running in a timer for good measure

celest schooner
#

@quartz kindle does discordjs light sweep cache automatically?

solemn latch
#

tim has a server

pure lion
#

Omfg

celest schooner
#

oh

solemn latch
#

i can find the link if ya want

celest schooner
#

yes pls

pure lion
solemn latch
#

🤔

#

does that work wth

#

lol

#

got me

#

cant pm ya, gotta open dms for a second @celest schooner

celest schooner
#

kk

#

its on

lusty quest
#

@celest schooner you need to manually sweep

celest schooner
#

oh

lusty quest
#

but its easy to make

#

make a timer that runs every like 24 hours and this calls the 2 sweep functions

pure lion
#

petition for Tim to make an inside.me with just a rick roll

solemn latch
#

could you run it every hour and clear things that are 24+ hours old

#

🤔

pure lion
#

setInterval({}, 1 hour in ms)

#

360000

#

I think

stray wedge
#

How do I remove the Bot ghost thing

pure lion
#

The what

celest schooner
#

ik

lusty quest
#

will also work but it has both the same effect. since it will anyways do it every 24 hours if not changed

celest schooner
#

'

How do I remove the Bot ghost thing
@stray wedge you code a real bot

stray wedge
#

Ugh

solemn latch
#

well, if you only clear things that are 24 hours old, and only once every 24 hours.
things could live for 48 hours

#

theoretically

#

well, will

lusty quest
#

also im not sure what is more rescource heavy. a functions that does something every 24 hours called every hour or called once in 24 Hours

digital ibex
#

buy the premium version to remove the status

solemn latch
#

clearning once ever hour will use more cpu

#

clear more ram tho

celest schooner
#

what about once every 24 hours clear

lusty quest
#

i have it running like this

solemn latch
#

both, imo, are valid methods

#

just different tradeoffs

lusty quest
#

since it doesnt make a difference bcs everything starts to get cached when the bot starts. i start the timer when the bot starts

solemn latch
#

right now, i have excess ram, so id go once every 24 hours, and have stricter caching cleanup if needed down the line

lusty quest
#

did you got this much stuff running that you need to cut down this much?

solemn latch
#

oh, i hardly use any ram in my actual bot

#

just, hypothetically

lusty quest
#

i runn currently ~95MB ram with about 180 Guilds

solemn latch
#

i use 5x that just running assisting programs

celest schooner
#

im running a bot 448 servers 100 ram not even

#

optmized

#

that doesnt include everything else tho\

#

like node

#

and stuff

lusty quest
#

the 95MB is just the node process

cinder patio
#

Poor Tim

solemn latch
#

I heavily optimized for cpu. some of my commands are some of the heaviest cpu using commands of any bot i know

lusty quest
#

calculating gogol?

solemn latch
#

yus

lusty quest
#

yep

celest schooner
#

is there a way to sweep guilds

lusty quest
#

this is why the timer

#

nope

#

guilds are not really heavy

celest schooner
#

what about channels

#

*roles

solemn latch
#

if you click that link, it takes you to the two sweep methods

#

channels and users

earnest phoenix
#

I want to replace all /t in a string. So I tried <string>.replace(/[/t]/g, ' '), but that doesnt seem to work -- since it adds 2 spaces for some reason. Anyone knows why this happens?

lusty quest
#

roles are not that heavy too

opal plank
#

users are the worse to cache,. no?

#

while you would have 400 guilds cached, you'd have over 300k usuers cached

lusty quest
#

@earnest phoenix your replace the /t with 2 spaces

earnest phoenix
#

where?

solemn latch
#

and maybe 5k roles

#

which isnt that bad

lusty quest
#

, ' ')

earnest phoenix
#

thats one space innit

opal plank
#

i havent fucked with cache, but im politely assuming users would be the biggest chunk by far

solemn latch
#

Tims endgoal is to make it be able to be cacheless.
which i presume, in time more things will be sweepable

dire pagoda
#

i need help clearing invites in my server

#

ive tried not wotking

lusty quest
#

its already without caching exept Guilds (default)

dire pagoda
#

working*

honest perch
#

wait, tim made djs-light

lusty quest
#

yes

solemn latch
#

yeah

opal plank
#

yus

honest perch
#

o

quartz kindle
#

lul

earnest phoenix
#

thats one space innit
@earnest phoenix

honest perch
#

@quartz kindle big brain

lusty quest
#

ahh yes by bot just random Errors with the message: null. ive added to every catch function a way to determine where the error appears but i cant find this one

torpid edge
#

YAY I FINALLY GOT MY BOT TO MAKE EMBEDS
I just made one mistake
i just wrote one word wrong

quartz kindle
#

@lusty quest looking into it, so far no idea

lusty quest
#

me neither

#

its also possible thats somewhere in my code

#

its nothing critical but a red message in the logs is a bad sign.

celest schooner
#

How can I use .map() on discordjs light .fetch() things

#

since .fetch returns an object

quartz kindle
#

fetch returns a promise

celest schooner
#

oh

quartz kindle
#

what do you want to map over?

celest schooner
#

i want to map all the guildmembers IDs

quartz kindle
#

you'd need to fetch all members first

celest schooner
#

u mean

#

guild.members.fetch()

#

?

quartz kindle
#

guild.members.fetch().then(members => members.map(...))
or
(await guild.members.fetch()).map(...)

celest schooner
#

got it

quartz kindle
#

or use the fetchAllMembers client option

celest schooner
#

got it

#

thanks

quartz kindle
#

if you dont want to cache the members when fetching, you can do .fetch(false)

celest schooner
#

if you cache it, does .fetch() fetch from the cache or

#

discord

solemn latch
#

it tries cache first, then discord

celest schooner
#

got it

feral aspen
#

Hey guys

#

can someone send me a code of the following

#

I want it where that if someone doesnt have a specific role in a specific server, it will return

#

if it doesnt have the role id = roleid

#

can anyone send me the code for what I said, as I couldnt figure out how to do it.

celest schooner
#

@feral aspen we cant spoonfeed you

#

also we dont even know what lang

feral aspen
#

discord.js

misty sigil
#

or lib

lusty quest
#

get the roleid of the role you want

#

store it

feral aspen
#

I got it

#

then

lusty quest
#

and then call it your function where you want to check the role

feral aspen
#

idk how, sorry.

#

thats why I needhelp

#

if someone doesnt have a specific role in a specific server, it will return

lusty quest
#

did you know the id of the role?

feral aspen
#

Yes

lusty quest
#

or the name?

feral aspen
#

I know the id role

#

its for my premium commands.

solemn latch
#

some returns true/false of arrays.
or the array of someones roles.

feral aspen
#

if()

lusty quest
#

then just check make a if check for the guild and inside the check make a check for the command author if he got the role or not

feral aspen
#

then just check make a if check for the guild and inside the check make a check for the command author if he got the role or not
@lusty quest I said idk how the code is.

misty sigil
#

||

solemn latch
#

||

misty sigil
#

it’s ||

feral aspen
#

||

#

yes

earnest phoenix
#

||

#

or

#

||

solemn latch
#

lol

feral aspen
#

can anyone tell me how?

earnest phoenix
#

how what

feral aspen
#

the code for it.

misty sigil
#

no.

feral aspen
#

if someone doesnt have a specific role in a specific server, it will return

earnest phoenix
#

na we don't spoonfeed unfortunately

misty sigil
#

did you even read the rules?

solemn latch
#

usersroles.some()

earnest phoenix
#

have you tried testing it

#

why do I see two d's?

#

at the end

misty sigil
earnest phoenix
#

oh wait nvm

solemn latch
#

let the man enjoy his double d's

earnest phoenix
#

0.0

solemn latch
#

oo mee6 down again

#

unexpected

split nova
#
@client.command(pass_context=True, hidden=True)
async def setprefix(ctx, *, nprefix):
    nprefix = nprefix.strip()
    if nprefix != "":
        try:
            prefix = nprefix
            await commands.Bot(command_prefix=prefix)
        except:
            await ctx.say("`Error: no prefix entered.`")
        else:
            await ctx.say("`Prefix has been changed to:` **{}**".format(prefix))  

I get the error ERROR asyncio Unclosed client session

earnest phoenix
#

@earnest phoenix that wouldn't work tho

#

Bruh

lusty quest
#
    if(message.member.roles.cache.includes("roleid")){
      //your code
}
}
``` @feral aspen something like this
earnest phoenix
#

that moment when the ping doesn't ping

solemn latch
#

🤔

#

includes or some here?

feral aspen
#

Yess.

#

Thanks

misty sigil
feral aspen
#

I will try! 😛

lusty quest
#

not sure if it will work tho

feral aspen
#

oh god

lusty quest
#

but it gives you some pointers in how to do it

earnest phoenix
#

what else gives you pointers? the docs

solemn latch
#

read docs

earnest phoenix
#

v12?

solemn latch
#

🤔

feral aspen
#

but it gives you some pointers in how to do it
@lusty quest question

#
    if(message.member.roles.cache.includes("roleid")){
      //your code
}
}``` In the id = premium guild
#

what do I replace the premium guild with?

#

with this id = 'serverid?'

lusty quest
#

this is the spezific guildid you wanted

solemn latch
#

the docs explains how to use createchannel

earnest phoenix
#

Pointer explanation:

== Is for comparing everything
=== Is for comparing an string with an string or number with a number or object with an object``` @feral aspen
feral aspen
#

😐

lusty quest
#

you need atleast 2 = for comparing the guildid

opal plank
#

1 = 1 // sets 1 to 1
1 == 1 // 1 equals 1
1 == '1'// number 1 is equal to string 1
1 === '1' // number 1 is NOT equal to string 1 (different types)

feral aspen
#

its says its not a function

earnest phoenix
#

roles.cache is a collection, not an string or array

#

So roles.cache.has("role id")

feral aspen
#

?

opal plank
#

wiggly

feral aspen
#

oof

opal plank
solemn latch
#

lol

#

tiniest screenshot

earnest phoenix
#

Bruh lemme get my telescope

feral aspen
#

😂

opal plank
#

open link, chrome at 950% zoom

solemn latch
#

lool

opal plank
#

we know what it is

#

but its still tiny af

earnest phoenix
#

tf

#

he has two message listeners

opal plank
#

imagine harcoding tokens

earnest phoenix
opal plank
#

wanna see my token?

solemn latch
#

my index is still 440 lines

#

gosh

earnest phoenix
#

Here with 6300 lines

#

Bruh

solemn latch
#

oh good, im not the worst one KEKW

earnest phoenix
#

my token is config.token please don't steal it

opal plank
#

here

#

config.token

#

imagine not parsing your eval output

solemn latch
#

inb4 your bot gets banned from top.gg

haughty igloo
#

Hello

#

Pls help

earnest phoenix
#

my index is 29 lones bruh

haughty igloo
#

Fixed

lusty quest
#

in a older version i had a reply to fuck you bot

haughty igloo
#

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit

#

Please help

earnest phoenix
#

@earnest phoenix bro lemme show you to my special regexp,lol

#

holy shit

solemn latch
#

use one listener

earnest phoenix
#

you have 11 message listeners

solemn latch
#

no need for more than that

haughty igloo
#

@earnest phoenix i am from turkey

opal plank
#

why is it always 11?

lusty quest
#

@haughty igloo Glitch ?

opal plank
#

are they copying from somewhere?

haughty igloo
#

@lusty quest yes

earnest phoenix
#

Madara Uchiha looking ass

haughty igloo
#

@earnest phoenix XD sure

solemn latch
#

they add them one by one i presume, hit 11 and it breaks

#

since 10 works

earnest phoenix
#

@haughty igloo o bir hata değil

lusty quest
#

and you try to play music?

haughty igloo
#

@earnest phoenix napmam gerek

earnest phoenix
#

Birşey yapmana gerek yok

haughty igloo
#

Ama bot çalışmıyor

#

Onun yüzünden

earnest phoenix
#

@earnest phoenix wot, you're talking to a RegExp proficient, let's see it anyway

#

lol

#

ok

lusty quest
#

@haughty igloo did you try to play music?

feral aspen
#

@lusty quest it works, thanks

haughty igloo
#

Bro bot offline

earnest phoenix
#

bro thats mad he gave you the "lol ok" expression

#

Bruh moment

haughty igloo
#

Not use bot all commands

earnest phoenix
#

Not use bot all commands
agreed

haughty igloo
#

Please hell

lusty quest
#

@haughty igloo your un out of Memory this is why you get the error

haughty igloo
#

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit

solemn latch
#

lol

#

so many examples erwin

haughty igloo
#

@lusty quest dm pls

opal plank
#

its always 11 listeners

slender thistle
#

Erwin, most Turkish bots on top.gg are poorly modified templates

opal plank
#

i mean, clearly, still though where they taking this source from?

earnest phoenix
#

@haughty igloo that would always happens of your boy is running low on memory

slender thistle
#

Don't even bother trying to find out why

opal plank
#

lmao fair enough

slender thistle
#

Some Turkish tutorial that's very popular

lusty quest
#

nope

#

yay my internet is dying i get like 30 seconds delay in the chat

solemn latch
#

lool

crystal socket
#

"hello how do i get badge" - 90% of new devs in top.gg

haughty igloo
#

@slender thistle wdym bro pls help

earnest phoenix
#

that would always happens of your boy is running low on memory
boy

haughty igloo
#

@earnest phoenix

earnest phoenix
#

Lol

solemn latch
#

gib badg plx

haughty igloo
#

Pls help

slender thistle
#

Start using if statements instead of multiple events in your code.

earnest phoenix
#

no dank memer here sorry

#

jk

lusty quest
#

@haughty igloo your Glitch project runs out of memory, you need to shave down on it or get a proper VPS

opal plank
#

you only need one client.on('message')

#

cant be more clear than that

haughty igloo
#

you only need one client.on('message')
@opal plank me?

opal plank
#

yes

earnest phoenix
#

yes

opal plank
#

only ONE

#

not 11

haughty igloo
#

bot.js?

earnest phoenix
#

yes

opal plank
#

yes

earnest phoenix
#

@haughty igloo there's 2 reasons that would happen

2- Nested events```
haughty igloo
#

1 min

earnest phoenix
#

bet he's gonna add another message listener

#

due to this language barrier

opal plank
#

i said ONE in caps lock

#

if that doesnt get thru idk what will

earnest phoenix
#

deez nuts

#

jk

opal plank
#

gottem

solemn latch
#

oof

#

api abuse warning

earnest phoenix
#

how to make 10 message spam command
@earnest phoenix no

solemn latch
#

inc

earnest phoenix
#

no

haughty igloo
#

i try

earnest phoenix
#

Api abuse UWOT

opal plank
#

spamming = api abuse = ban

haughty igloo
#

but not online

slender thistle
#

Spam is against Discord ToS

haughty igloo
#

Bot

earnest phoenix
#

Guys its says bot waiting in approval

#

i told u

#

he added another one

#

I made the bot using DBD

slender thistle
#

@haughty igloo Show your code

opal plank
#

token incoming

haughty igloo
#

client.on('message') @slender thistle

earnest phoenix
#

Bruh he went to add another listener

#

@earnest phoenix what

#

Guys its says bot waiting in approval
@earnest phoenix u wait lmao?

haughty igloo
#

i write but not online bot

opal plank
#

im.... going watch a youtube vid

haughty igloo
#

Pleasee help

earnest phoenix
#

please be quiet

#

we are helping

opal plank
slender thistle
#

Be nice

opal plank
#

read that

lusty quest
#

did we got someone here who could tell him in his native language what is wrong? i guess this here will not work

earnest phoenix
#

Be nice
wdym i am

slender thistle
#

@haughty igloo and you, calm down

misty sigil
#

token incoming
@opal plank kekw

earnest phoenix
#

lol

opal plank
#

you need to know js before attemping to get a bot done

slender thistle
#

stfu

opal plank
#

at least a bit

earnest phoenix
#

Omg this channel's confusion is more worse than api abuse

haughty igloo
feral aspen
#

Help

earnest phoenix
#

shivaco being rude

opal plank
#

You need to know Javascript (Programming language) to make bot @haughty igloo

earnest phoenix
#

not nice

solemn latch
#

yeah, thats why i stopped talking, too many people needing help at once

earnest phoenix
#

@earnest phoenix help me. how to make 3msg reply command
@earnest phoenix no

#

that's api abuse

solemn latch
#

5 people have asked a question

haughty igloo
#

@opal plank bro i know but i not look this code

opal plank
haughty igloo
#

@opal plank u help my bot?

lusty quest
#

@solemn latch usually they smell when someone needs help so they can jump with in the convo to maybe get some help too

haughty igloo
#

100k user and +75 server

#

Pls hell

opal plank
#

no spoonfeeding

#

aight im out

earnest phoenix
#

bro 75+ servers

opal plank
earnest phoenix
#

how

haughty igloo
#

Oof

#

@earnest phoenix my bot

solemn latch
#

send one message, with all the content of the 3 messages @earnest phoenix

earnest phoenix
#

api abuse

haughty igloo
#

but offline because have fix

earnest phoenix
#

okay

#

so u have

#

11 message events

#

11

misty sigil
#

use else if

haughty igloo
#

Yes

earnest phoenix
#

UWOT wtf is even happening

haughty igloo
#

what i do?

earnest phoenix
#

use if statements

#

and use one message event

haughty igloo
#

use if statements
@earnest phoenix wdym pls hell

#

Help*

earnest phoenix
#

im not hell

#

dont be rude

#

Here shivaco going on a mute spree

haughty igloo
#

bro i need help

#

because i bot fixed

earnest phoenix
#

learn basic js

#

¯_(ツ)_/¯

misty sigil
earnest phoenix
#

Hey, so I am discord.py. I want to make a command to get the server boost status of a server. How would I do this?

#

shivaco it's your time

haughty igloo
#

Bro

slender thistle
#

@haughty igloo

// What your code is supposed to look like
client.on("message", function(message)
{
    if message.content.startsWith("!command")
    {
        // do stuff when !command is ran
    }
    if message.content.startsWith("!second")
    {
        // do stuff when !second is ran
    }
})
// WHAT YOUR CODE ACTUALLY LOOKS LIKE
client.on("message", function(message)
{
    if message.content.startsWith("!command")
    {
        // do stuff when !command is ran
    }
})

client.on("message", function(message)
{
    if message.content.startsWith("!second")
    {
        // do stuff when !second is ran
    }
})
}```
haughty igloo
#

@slender thistle bot.js?

earnest phoenix
#

oh no

misty sigil
#

yes

earnest phoenix
#

no

#

no

#

By the way. Python is better then Js

#

he's gonna add it

haughty igloo
#

where is it?

misty sigil
#

or index.js whatever it’s called

slender thistle
#

Can this chat calm down for a second

earnest phoenix
#

yessir

haughty igloo
#

index.js?

earnest phoenix
#

Python on top

#

Shivaco yours is somehow also wrong tho

slender thistle
#

@earnest phoenix stop

misty sigil
#

k I’m out, I’ll see yall later.

earnest phoenix
#

sorry

#

Python on top
@earnest phoenix do u need help or what

#

ahaha

#

Yes

#

if statement incorrect

#

ok

haughty igloo
#

@earnest phoenix bro index.js?

earnest phoenix
#

Hey, so I am discord.py. I want to make a command to get the server boost status of a server. How would I do this?
@earnest phoenix

#

bro

#

Im working with java

#

x)

slender thistle
#

@earnest phoenix Asking too much from someone who doesn't use JS on a daily basis

earnest phoenix
#

Makes sense

haughty igloo
#

@haughty igloo

// What your code is supposed to look like
client.on("message", function(message)
{
    if message.content.startsWith("!command")
    {
        // do stuff when !command is ran
    }
    if message.content.startsWith("!second")
    {
        // do stuff when !second is ran
    }
})
// WHAT YOUR CODE ACTUALLY LOOKS LIKE
client.on("message", function(message)
{
    if message.content.startsWith("!command")
    {
        // do stuff when !command is ran
    }
})

client.on("message", function(message)
{
    if message.content.startsWith("!second")
    {
        // do stuff when !second is ran
    }
})
}```

@slender thistle where is it i write code

slender thistle
#

If you are willing to contribute, feel free

misty sigil
#

You only put the top half

earnest phoenix
#

he speaks turkish

haughty igloo
#

@earnest phoenix yes

#

İ am turkish

earnest phoenix
#

so he probs doesn't understand

haughty igloo
#

Yes

#

u right

earnest phoenix
#

ill explain

slender thistle
#

@haughty igloo You replace ALL your client.on("message") stuff into ONE event

earnest phoenix
#

o

#

Any turk here to help this guy out

digital ibex
#

im ded

slender thistle
#

You have more than one

haughty igloo
#

@slender thistle event where is it?

earnest phoenix
#

@haughty igloo Sorun ney :d?

slender thistle
#

client.on("message") = "message" event

haughty igloo
#

@earnest phoenix ya kanka

#

Ne digorlar

slender thistle
haughty igloo
#

Şunu şura yapıştır diyorlarda

#

Nere yapistirxam

#

Anlamitorum

earnest phoenix
#

Coding java is better than js

solemn latch
#

assembly better than all

#

pls no mute shiv

slender thistle
#

I'll just put this here

#

-langwar

gilded plankBOT
#

Language wars are unproductive. All languages have their purposes and uses. You may have your personal preferences or opinions, but arguing accomplishes nothing. Civil conversations discussing languages without getting emotions involved is ok, just shitting on something is not. Those involved in language wars will be muted.

earnest phoenix
#

It was joke

#

yes shivaco finally did it

#

haha funny

#

x)

misty sigil
#

thank you shivaco

slender thistle
earnest phoenix
#

Kk

#

Im new

#

ok good job

haughty igloo
#

Bro

#

Dm @slender thistle

earnest phoenix
#

no

#

no dm helping

pure lion
#

😔

slender thistle
#

Well, God help my soul

earnest phoenix
#

ill pray for u shivaco

#

No dm help especially a literal mod

opal plank
#

my prayers and condolences to you shivaco

young patrol
#

Hey I am new here

slender thistle
#

Gotta love how people decide whether you help in DMs for you

earnest phoenix
#

Hey there, need help? @young patrol

young patrol
#

Kinda

earnest phoenix
#

kinda?

#

elaborate

#

Go ahead and tell us the issue then

opal plank
#

👀

#

i saw that

young patrol
#

It says that my bot needs approval and I have no clue what to do :/

earnest phoenix
#

e

digital ibex
#

anyone got any ideas how to fix this error? ```js
FetchError: invalid json response body at <url> reason: Unexpected end of JSON input

opal plank
#

wait

earnest phoenix
#

It says that my bot needs approval and I have no clue what to do :/
@young patrol you need to wait

opal plank
#

actaully

#

where

misty sigil
#

It says that my bot needs approval and I have no clue what to do :/
@young patrol wait

opal plank
#

approval here or in discord?

earnest phoenix
#

there are bots in the queue too

#

@young patrol you just have to wait 3-4 weeks

misty sigil
#

3+

#

angrybirb 3+

opal plank
#

are the 100 limit in place?

young patrol
#

.-.

slender thistle
#

3 or more sounds more appropriate currently

opal plank
#

not sure if discord already pushed the required verification yet

#

for 100+ servers

lusty quest
#

in october

sudden geyser
#

OfficiallyLost for experimenting, you could fetch it, convert it to raw text (.text()), and log it to see what you get.

solemn latch
#

october 7th

opal plank
#

7th?

lusty quest
#

6.10.2020

opal plank
#

oh same as d.js?

solemn latch
#

6th?

opal plank
#

deprecation

solemn latch
#

i thought everything was updating 7th

young patrol
#

And how do I get the not developer role? Just asking

lusty quest
#

6th is the last day you can use it

misty sigil
#

bot approved

lusty quest
#

7th everything more than 100 needs to get approved to get more guilds

split nova
#

congrats

young patrol
#

And how do I get the not developer role? Just asking

opal plank
#

bot*

solemn latch
#

get bot approved

lusty quest
#

you need to add a bot and get it approved

young patrol
#

Autocorrect

#

Mkay

obtuse jolt
#

my website now live update guilds users and channels

solemn latch
#

be careful with that

#

privacy concerns and whatnot

#

cant just let anyone see that in any guild

opal plank
#

yeah you cannot post info about guilds/channels to people that arent in it

#

privacy breach

amber fractal
#

counting your guilds isnt a privacy breach

#

it's literally displayed when people add your bot

opal plank
#

counting? no

solemn latch
#

he didnt say counting 🤔

opal plank
#

displaying info about guild, ids, messages, members, updates, status, is

earnest phoenix
#

yh that is a privacy breach

#

a big one

amber fractal
#

If it's in your privacy policy you can do it