#development

1 messages · Page 1173 of 1

fluid basin
#

which means it will most likely not even connect to the gateway

#

or only for 100+server bots

#

idk, forgot which one was it

#

So if we modify it
We can still use it
well yes, but I don't see the point

glossy elk
#

Um

#

Used to v11

fluid basin
#

there isn't much difference except .cache from v11 -> v12

glossy elk
#

That’s false

thick gull
#

embeds too

fluid basin
#

and they even made a well-documented migration guide

glossy elk
#

Fetching message too

fluid basin
#

embeds too
@thick gull who even uses the embed builder? /s

thick gull
#

crying irl

#

I know you can use embeds in other ways but I literally do not know how

fluid basin
#

theres embed builders/visualisers out there

#

some of the code generated is those without OOP

low phoenix
river thistle
#

Just read the error

#

You supplied a wrong audio format

#

I guess

low phoenix
#

yes i don't know how can i fix it. i play a mp3 stream

earnest phoenix
low phoenix
earnest phoenix
#

oh fr?

#

🙂

fluid basin
leaden rover
#

How can a bot check if the user has his/her DMs on?

fluid basin
#

you can't, discord will only give an error if you cannot send a dm message to a user

leaden rover
#

Ok

#

How does Dyno send an error if the users DMs are off?

fluid basin
#

discord will only give an error if you cannot send a dm message to a user
you process that error and send another message in the channel?

leaden rover
#

ok

zenith terrace
#

I dont think dyno does send errors about dms

leaden rover
#

No, I mean in a message to the author

zenith terrace
#

Are you saying about sending errors to message.author in dms

small prairie
#

tf happened to discord?

#

soo many bots being flagged by discord

zenith terrace
#

Oh?

#

Idk

oak cliff
#

They implemented a new spam filter.

zenith terrace
#

Fun

#

So if the bot spams in anyway?

small prairie
#

Sigh

#

the new system is dead

#

is contacting them any luck?

oak cliff
#

no its like, how fast it gets added to discords or how many times it sends a dm or something

#

not sure exactly

#

you have to file a support request afaik

small prairie
#

no its like, how fast it gets added to discords or how many times it sends a dm or something
@oak cliff wdym?

#

first part

zenith terrace
#

How fast the bot gets added to guilds

oak cliff
#

like if you suddenly get your bot added to a thousand guilds in one day when previously you were only getting like 5

small prairie
#

okay so my bot hasnt been added to any server in 100 years
private bot

#

;-;

#

its a custom bot for a big server and still sigh

#

the new system officially killed half the bots

#

Wait i think its only effect on unverified bots

#

Coz my other bots which legit do work more then the one being flagged isnt flagged

viral iris
#

any1 know canvas?

thick gull
#

canvas for me was: fiddle around with it till you get it

#

and I literally do not know how to explain it

viral iris
#

@thick gull can i ask u something?

thick gull
#

Yeah?

viral iris
#

line 68

pure lion
#

Thats not a question

viral iris
#

i'm trying to add image at the end

#

Thats not a question
@pure lion -_-

#

i'm trying to add image at the end
but the image highest not enough i guess

#

is there a way to make the image highest auto fill or something ?

thick gull
#

hastebin is a little buggy on mobile

viral iris
#

send the code here ?

thick gull
#

nah

pure lion
#

I think you can use vh/vw if that's a thing

#

It's a measurement of the percentage of the dimension of the canvas

viral iris
#

i think i did it

#

but i won't change it eveytime

still merlin
#

I'm getting a error about code I've never written- Can someone help please? (D.js)
error

Error: val is not a non-empty string or a valid number. val=null
    at module.exports (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\ms\index.js:34:9)
    at BaseClient.SpiderBotUptime [as Uptime] (C:\Users\Jon\Desktop\SpiderBot Project\index.js:47:14)
    at Object.<anonymous> (C:\Users\Jon\Desktop\SpiderBot Project\index.js:52:26)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
PS C:\Users\Jon\Desktop\SpiderBot Project>```
#

My code worked fine a few days ago, And all of a sudden I get the error

pale vessel
#

something you're trying to parse using the ms package is not a valid number

#

read the trace

still merlin
#

I've never used ms

earnest phoenix
#

should I use mongoose to have server specific configs for custom prefixes etc?

still merlin
#

Nevermind I've used ms once and its never been a problem

pale vessel
#

never used ms but it's in your node_modules folder bruh

viral iris
wanton anvil
#

I am getting missing permissions error even if i gave my bot adminstrator permission

#

what is wrong

carmine summit
#

How can I read 4 values in each 212 arrays without having 1k+ lines?

tight plinth
#

missing permissions with admin = you’re probably trying to access another server that your bot isn’t in

#

How can I read 4 values in each 212 arrays without having 1k+ lines?
@carmine summit what

#

can you use a better translator

slender thistle
#

I am getting missing permissions error even if i gave my bot adminstrator permission
@wanton anvil what exactly are you doing to get that error?

wanton anvil
#

@slender thistle can you join my server pls

#

I'll show you

slender thistle
#

Why not just explain it here

wanton anvil
#

it's a bit though

carmine summit
#

I want to read 4 values inside 212 arrays without having 1k+ lines of codes

slender thistle
#

inside of 212 arrays?

carmine summit
#

yeah

#

in each array i want to read 4 values inside it

slender thistle
#

Is there any specific filter you need to use?

carmine summit
#

no filters

slender thistle
#

🤔

#

so just random values?

carmine summit
#

random numbers

slender thistle
#

Hold on. Do you mean 4 values inside of each array?

carmine summit
#

yeah

#

EACH

slender thistle
#

And how do you want to.. well, store them?

carmine summit
#

nope

#

i mean store them

tight plinth
#

why do you want to do that

carmine summit
#

i want ot store them

tight plinth
#

what

carmine summit
#

all i want is to store them then put it inside variables

tight plinth
#

you want to store random numbers from 212 arrays into something?

carmine summit
#

yyeah

#

and if the bots detect something like (buyPrice < sellPrice)

#

it will message.channel.send

tight plinth
#

why are you using arrays

carmine summit
#

its an API

tight plinth
#

bruh

carmine summit
#

JSON formatted

tight plinth
#

wait

#

json is not array

#

and

carmine summit
#

k

tight plinth
#

you’re using an api to do a merch system?

carmine summit
#

perch system?

#

its a game

#

with an economy

#

and if the bots detects a price crash

#

it will send it

#

thats why i have 212 arrays to search

#

and 4 values to get

#

in each array

tight plinth
#

can you send one array here

#

so i’ll be able to see what they look,like

#

and help u

eternal osprey
#

is this a good way to make sure a comamnd can only be used by admins?

#

because for some reason it doesn't work

carmine summit
opal plank
#

thats not how it works

#

thats a class @eternal osprey

#

you need A guildmember, not GUILDMEMBER

eternal osprey
#

owh

opal plank
#

if that makes sense

tight plinth
#

looks like you copy pasted a awful discordjs guide

opal plank
#

not even that

#

just general lacking of understanding of Javascript

eternal osprey
#

nvm i got it already

opal plank
#

you're importing a class

slender thistle
#

lack of understanding of OOP in general

opal plank
#

that too

eternal osprey
#

i should get the id of my guild

zenith terrace
#

What the hell did I just read about a command not working +_+

tight plinth
#

that’s not an array, that’s an object

sterile thicket
#

I have 15 .addField() but I only want 10 to show in one embed page.
how do I maintain the number limit?

carmine summit
#

ohhh

tight plinth
#

remove 5 add fields

carmine summit
#

sorry i dont know the difference

slender thistle
#

there's the option of if (x % 10 !== 0) addField() in a for-loop

carmine summit
#

huh

slender thistle
#

no wait

opal plank
#

i've never used that operator, so ngl, dont even know how it works

slender thistle
#

... ofc I forget about cases like 9 % 10 where 9 is returned

carmine summit
#

i want to read object.products.BROWN_MUSHROOM.quick_status.buyPrice

#

and it not just BROWN_MUSHROOM i want to read

#

there are 211 more

opal plank
#

oh i see

#

that operator can be quite handy

#

though i usually just cast into an object with a while loop

carmine summit
#

the other object is same.. all i want to change isbrown mushroom

opal plank
#

set that value

#

since it has is in it, i assume its a bool

#

wait, i think theres a typo there and i misunderstood

#

what do you want to change in brown_ mushroom?

slender thistle
#

How do you do integer division in JS if // is comments?

opal plank
#

i thought you meant is_brown_mushroom

carmine summit
#

all other

#

that is 211

opal plank
#

@slender thistle wdym shiv?

#

/

#

thats the operator for division

carmine summit
#

"BLAZE_ROD","BLESSED_BAIT","BONE","BROWN_MUSHROOM","CACTUS","CARROT_BAIT","CARROT_ITEM","CATALYST","CLAY_BALL","COAL","COBBLESTONE","COMPACTOR","DARK_BAIT","DIAMOND","EMERALD","ENCHANTED_ACACIA_LOG","ENCHANTED_BAKED_POTATO","ENCHANTED_BIRCH_LOG","ENCHANTED_BLAZE_POWDER","ENCHANTED_BLAZE_ROD","ENCHANTED_BONE","ENCHANTED_BONE_BLOCK","ENCHANTED_BREAD","ENCHANTED_BROWN_MUSHROOM","ENCHANTED_CACTUS","ENCHANTED_CACTUS_GREEN","ENCHANTED_CAKE","ENCHANTED_CARROT","ENCHANTED_CARROT_ON_A_STICK","ENCHANTED_CARROT_STICK","ENCHANTED_CHARCOAL","ENCHANTED_CLAY_BALL","ENCHANTED_CLOWNFISH","ENCHANTED_COAL","ENCHANTED_COAL_BLOCK","ENCHANTED_COBBLESTONE","ENCHANTED_COCOA","ENCHANTED_COOKED_FISH","ENCHANTED_COOKED_MUTTON","ENCHANTED_COOKED_SALMON","ENCHANTED_COOKIE","ENCHANTED_DARK_OAK_LOG","ENCHANTED_DIAMOND","ENCHANTED_DIAMOND_BLOCK","ENCHANTED_EGG","ENCHANTED_EMERALD","ENCHANTED_EMERALD_BLOCK","ENCHANTED_ENDER_PEARL","ENCHANTED_ENDSTONE","ENCHANTED_EYE_OF_ENDER","ENCHANTED_FEATHER","ENCHANTED_FERMENTED_SPIDER_EYE","ENCHANTED_FIREWORK_ROCKET","ENCHANTED_FLINT","ENCHANTED_GHAST_TEAR","ENCHANTED_GLISTERING_MELON","ENCHANTED_GLOWSTONE","ENCHANTED_GLOWSTONE_DUST","ENCHANTED_GOLD","ENCHANTED_GOLDEN_CARROT","ENCHANTED_GOLD_BLOCK","ENCHANTED_GRILLED_PORK","ENCHANTED_GUNPOWDER","ENCHANTED_HAY_BLOCK","ENCHANTED_HUGE_MUSHROOM_1","ENCHANTED_HUGE_MUSHROOM_2","ENCHANTED_ICE","ENCHANTED_INK_SACK","ENCHANTED_IRON","ENCHANTED_IRON_BLOCK","ENCHANTED_JUNGLE_LOG","ENCHANTED_LAPIS_LAZULI","ENCHANTED_LAPIS_LAZULI_BLOCK","ENCHANTED_LAVA_BUCKET","ENCHANTED_LEATHER","ENCHANTED_MAGMA_CREAM","ENCHANTED_MELON","ENCHANTED_MELON_BLOCK","ENCHANTED_MUTTON","ENCHANTED_NETHER_STALK","ENCHANTED_OAK_LOG","ENCHANTED_OBSIDIAN","ENCHANTED_PACKED_ICE","ENCHANTED_PAPER","ENCHANTED_PORK","ENCHANTED_POTATO","ENCHANTED_PRISMARINE_CRYSTALS","ENCHANTED_PRISMARINE_SHARD","ENCHANTED_PUFFERFISH",

slender thistle
#

integer division

carmine summit
#

"ENCHANTED_PUMPKIN","ENCHANTED_QUARTZ","ENCHANTED_QUARTZ_BLOCK","ENCHANTED_RABBIT","ENCHANTED_RABBIT_FOOT","ENCHANTED_RABBIT_HIDE","ENCHANTED_RAW_BEEF","ENCHANTED_RAW_CHICKEN","ENCHANTED_RAW_FISH","ENCHANTED_RAW_SALMON","ENCHANTED_REDSTONE","ENCHANTED_REDSTONE_BLOCK","ENCHANTED_REDSTONE_LAMP","ENCHANTED_RED_MUSHROOM","ENCHANTED_ROTTEN_FLESH","ENCHANTED_SAND","ENCHANTED_SEEDS","ENCHANTED_SLIME_BALL","ENCHANTED_SLIME_BLOCK","ENCHANTED_SNOW_BLOCK","ENCHANTED_SPIDER_EYE","ENCHANTED_SPONGE","ENCHANTED_SPRUCE_LOG","ENCHANTED_STRING","ENCHANTED_SUGAR","ENCHANTED_SUGAR_CANE","ENCHANTED_WATER_LILY","ENCHANTED_WET_SPONGE","ENDER_PEARL","ENDER_STONE","FEATHER","FISH_BAIT","FLINT","FOUL_FLESH","FUMING_POTATO_BOOK","GHAST_TEAR","GLOWSTONE_DUST","GOLDEN_TOOTH","GOLD_INGOT","GRAVEL","GREEN_CANDY","GREEN_GIFT","HAMSTER_WHEEL","HAY_BLOCK","HOLY_FRAGMENT","HOT_POTATO_BOOK","HUGE_MUSHROOM_1","HUGE_MUSHROOM_2","ICE","ICE_BAIT","INK_SACK","INK_SACK:3","INK_SACK:4","IRON_INGOT","LEATHER","LIGHT_BAIT","LOG","LOG:1","LOG:2","LOG:3","LOG_2","LOG_2:1","MAGMA_CREAM","MELON","MINNOW_BAIT","MUTTON","NETHERRACK","NETHER_STALK","OBSIDIAN","OLD_FRAGMENT","PACKED_ICE","PORK","POTATO_ITEM","PRISMARINE_CRYSTALS","PRISMARINE_SHARD","PROTECTOR_FRAGMENT","PUMPKIN","PURPLE_CANDY","QUARTZ","RABBIT","RABBIT_FOOT","RABBIT_HIDE","RAW_BEEF","RAW_CHICKEN","RAW_FISH","RAW_FISH:1","RAW_FISH:2","RAW_FISH:3","RECOMBOBULATOR_3000","REDSTONE","RED_GIFT","RED_MUSHROOM","REVENANT_FLESH","REVENANT_VISCERA","ROTTEN_FLESH","SAND","SEEDS","SLIME_BALL","SNOW_BALL","SNOW_BLOCK","SPIDER_EYE","SPIKED_BAIT","SPONGE","SPOOKY_BAIT","STOCK_OF_STONKS","STRING","STRONG_FRAGMENT","SUGAR_CANE","SULPHUR","SUMMONING_EYE","SUPERIOR_FRAGMENT","SUPER_COMPACTOR_3000","SUPER_EGG","TARANTULA_SILK","TARANTULA_WEB","UNSTABLE_FRAGMENT","WATER_LILY","WHALE_BAIT","WHEAT","WHITE_GIFT","WISE_FRAGMENT","WOLF_TOOTH","YOUNG_FRAGMENT"

opal plank
#

/

#

just a single one

carmine summit
#

pick one

slender thistle
#

Python:

>>> 5 // 2
2
>>> 5 % 2
1

JS:

>>> 5 / 2
2.5```
opal plank
#

thats an array cwic

#

that % operator i just looked at

#

Modulus (division remainder)

#

it divides by that number and then returns the extra

#
10 / 3 = 3.33333

10 % 3 = 1 (9 which is maximum whole divisor of 3, then 1 which is extra)
 

slender thistle
#

The maximum divisor operator

carmine summit
#
10 / 3 = 3.33333

10 % 3 = 1 (9 which is maximum divisor of 3, then 1 which is extra)
 

@opal plank im confused about this

slender thistle
#

it's not directed at you

opal plank
#

^^

carmine summit
#

ah

opal plank
#

for normal operation of division its /, % is for modulus

#

though

delicate lance
#

Hey

opal plank
#

i think i know what you mean

#

lemme see if theres an operator for that or if you have to use that

slender thistle
#

I gave you a fucking Python script as an example KEKW

opal plank
#

i just noticed what you meant

#

lemme check rq

slender thistle
#

goose

delicate lance
#

My music bot is working perfectly but it's not going deafen like other bot like groovy and Rythm what to do?

coral tusk
#

:/

slender thistle
#

Make sure the bot can deafen itself with the DEAFEN_MEMBERS permission

opal plank
#

i think you'd need logic for that shiv

#

i dont see a handy operator for it

coral tusk
#

Luck

delicate lance
#

How to do that

opal plank
#
let:number = x
x - (x % y) / y
slender thistle
#

Oh disgrace JS

opal plank
#

so you get whole number

delicate lance
#

Should I on Adminstration for that

#

??

slender thistle
#

Time to use IPC with a Python script 😂

opal plank
#

ipc is fun to play with

#

thats what i use for communicating between the different bots

slender thistle
#

Hosting a local webserver that returns calculations lmao

opal plank
#

recommendation: set silent mode true

slender thistle
#

Heh

opal plank
#

otherwise it'll log every operation on ipc

slender thistle
#

If only I had an actual use case for it

opal plank
#

make a bot in 5 different langs and use ipc to interact with eachother

#

that sounds like fun

delicate lance
#

The problem in my bot is Not deafening itself and 🙄 Not staying in the vc after the song ends

#

Can anyone help me with the problem?

opal plank
#

this is growing out of proportion

#

had a spike of 200k registered users in that short span of time

#

postgres isnt keeping up with 5k calls per minute

slender thistle
#

Jesus

opal plank
#

i do wanna bring that number higher if possible to be able to hold that many calls

#

but it needs to scale accordingly

#

currently i hit a wall with 800k users active at once

eternal osprey
#

hey guys

opal plank
#

luckily enough IPC is keeping up

eternal osprey
#

i just did this and it works

opal plank
#

so not gonna have to change anything in that regard

eternal osprey
#

but non admins can still see the message

earnest phoenix
#

whats the best way to have server specific configs for custom prefix settings etc

eternal osprey
#

any way how to make sure they can't see the contents of this command

opal plank
#

you should use final permission @eternal osprey

#

though administrator should be fine in that case

#

though still good practice to account for channel overrides

#

@earnest phoenix likely store them in memory and in a database for long term

eternal osprey
#

I am not that known with the command final permission. I will look at the docs.

opal plank
#

map it with guildid and prefix

eternal osprey
#

but how do i make sure someone can't see the command

opal plank
#

lemm get you the guide for it

eternal osprey
#

without admin rides

earnest phoenix
#

@opal plank what db should i use for it?

opal plank
eternal osprey
#

lovely

opal plank
#

i use postgres, but thats because i have a huge amount of users, SQLlite or something smaller might be what you need

earnest phoenix
#

im gonna get that google cloud trial but gotta use another cc from my family since my own cc is already used lol

opal plank
#

it usually boils down to preference most times

eternal osprey
#

i still remember when i used json for database

#

oh god the fucking file was corrupted every minute

ivory ember
#

Oof

opal plank
#

Mongo /postgres / sql / sqlite, pick whichever tou like

eternal osprey
#

so i looked through the docs

#

{ VIEW_CHANNEL: false });

#

i guess i gotta use this

opal plank
timber plume
#

hey]

#

erwin

opal plank
#

this is the bit you wanna be looking for @eternal osprey

timber plume
#

is that website yours?

opal plank
#

wusup?

timber plume
#

or is the host

opal plank
#

the panel is mine, yes

timber plume
#

alright

#

of

#

sio

#

how do i open python

#

first time

#

i normal code in node.js

eternal osprey
#

i think you can better serach up a tutorial

timber plume
#

is there like a command

opal plank
#

im not sure how to compile py

honest perch
#

Technically its possible to store in json without corruption

eternal osprey
#

yeah but i sucked

#

like big time

opal plank
#

i need to port my whole twitch bot to ts too

timber plume
#

damn that sounds like nerd stuff

honest perch
opal plank
#

Porting Js code to Ts strict is the bane of my existance

timber plume
#

nerd

#

ha

#

jk

carmine summit
#

help

opal plank
timber plume
#

wut with

opal plank
#

the heck were u expecting?

carmine summit
#

i havent got the answer to my previous question

opal plank
#

repost it

#

i'll take a look

timber plume
#

server prefixs

#

prefixes*

opal plank
#

i did tell the answer for that

#

but that was another person

#

i think cw was stuck with his brown_mushroom something something

timber plume
#

is it

neat linden
#

'$getServerVar[prefix]help'

timber plume
#

message.guild.prefix = hehaha

opal plank
#

you need to attach it first

#

guild doesnt have prefix

slender thistle
#

Also... MENHERA-CHAN!!! THAT WAS MY PFP LIKE 2 YEARS AGO

opal plank
timber plume
#

or use thonny

opal plank
#

i think i tried py a long time ago

#

but i dont remember shit from it

slender thistle
#

Well, that's an interpreter :^)

opal plank
#

i dont even know if this was a dependency for something or if i compiled code

#

its likely a dependency

timber plume
#

how do i make python app go

#

node .

#

haha

#

i just typed go

opal plank
#

shiv might be able to tell you that

carmine summit
#

i want to read object.products.BROWN_MUSHROOM.quick_status.buyPrice
and i would like a loop to change the "BROWN_MUSHROOM" to 211 other objects. to get its value

slender thistle
#

Most apps used to require python2.7

opal plank
#

ive got no experience with py

timber plume
#

aight

slender thistle
#

python filename.py

opal plank
#

i think i remember what it was

slender thistle
#

Not sure what you mean exactly

opal plank
#

one sec

#

i think it was jekyll shiv

timber plume
#

Yas!

#

%run

slender thistle
#

Jekyll is Ruby, no?

opal plank
#

nah

#

actually

#

yeah

#

i meant nah as in 'was something else'

#

i dont recall what needed that

slender thistle
#

kek

carmine summit
#

i want to read object.products.N.quick_status.buyPrice and object.products.N.quick_status.sellPrice
and if (sellPrice > buyPrice) it will message.channel.send

slender thistle
#

I doubt it was something tbh. I'd expect Python2.7 at most but some applications do use Python 3.8

opal plank
#

@carmine summit i have absolutely no idea what you trying to do

carmine summit
#

see i have 212 objects

#

and i want to read 4 values

opal plank
#

okay...

carmine summit
#

each from this 212 objects

#

objects for example is N

opal plank
#

thats an array/object(probably object)

#

all those 212 is in an object or array?

carmine summit
#

wahts the diffrence?

opal plank
#

array you'd have to filter

#

object you can access directly

carmine summit
#

im not sure

opal plank
#

i am though

#

[array]

#

{object}

carmine summit
#

lemme see

#

what are you reffering to?

opal plank
#

whatever those 212 items are composed of

timber plume
#

how to define in python

carmine summit
#

object

slender thistle
#

Define what

opal plank
#

its an object then cw?

carmine summit
#

cw???????

timber plume
#

define discord

opal plank
#

cwickks

#

too big to type

slender thistle
#

import discord

carmine summit
#

what is cw?

slender thistle
opal plank
#

you

timber plume
#

ok

opal plank
#

you are cw, for the sake of me not having to type full name

timber plume
#

?

carmine summit
#

ah

#

aight

slender thistle
#

Tell me one thing

opal plank
#

its an object then

carmine summit
#

its an object then cw?
@opal plank yes

slender thistle
#

Are you experienced with Python, Magma?

timber plume
#

no

#

first time

opal plank
#

so how is that object formatted?

timber plume
#

i use node

#

just trying it out

slender thistle
#

Why are you trying to create a Discord bot as your first Python project?

carmine summit
#

so how is that object formatted?
@opal plank wdym

opal plank
#

obecj.Brown_mushroom ? or you need to filter properties insde?

timber plume
#

coz thats all i know how to make

carmine summit
#

object.products.BROWN_MUSHROOM.quick_status.buyPrice

#

i want to read the value of buyPrice

slender thistle
#

Please take a step back and get a hang of basic Python first

timber plume
#

aight

opal plank
#
{
 a : {b:1 , c:2},
 b : {b:2 , c:3},

}```
#

so products

slender thistle
#

check these out

timber plume
#

who here codes on node.js

opal plank
#

{
products: {items}
}

earnest phoenix
#

@carmine summit growtopia very nice game

opal plank
#

like this i assume?

pale vessel
#

jekyll? isn't that a static site generator that you can use on github

carmine summit
#

@carmine summit growtopia very nice game
@earnest phoenix dont mind it

opal plank
#

yes indeed flaz

carmine summit
#

yeah

#

yeah

#

correct

pale vessel
#

i used that once

#

with bootstrap 3 to make a blog

opal plank
#

okay, we getting somewhere

earnest phoenix
#

@carmine summit i play it

carmine summit
#

@carmine summit i play it
@earnest phoenix i quit it

opal plank
#

now what you want to do with BROWN_MUSHROOM ?

earnest phoenix
#

oof

carmine summit
#

read ...quick_status.buyPrice

opal plank
#

by doing that you already reading the value

#

object.products.BROWN_MUSHROOM.quick_status.buyPrice

carmine summit
#

i have 212 objects

opal plank
#

this will return buyPrice

carmine summit
#

i would like to create a loop

timber plume
#

what are some free hosts

opal plank
#

then for(let a in object.products) {//do stuff}

earnest phoenix
#

@timber plume dont use free hosts

timber plume
#

im broke rn

carmine summit
#

then for(let a in object.products) {//do stuff}
@opal plank can you explain

timber plume
#

i dont earn money

opal plank
#
let obj = {
a: 1,
b: 2,
}
let int = 0;
for(let something in obj) {
int + something
}
int (returns 3);
#

for() is a loop

#

you are looping each property inside the object

#

so its adding int(0) + 1(a) in the first loop, then int(1) + 2(b) in the second, return 3

#

needless to say you can do whatever you want inside, not only additions

#

but if you want a loop for works just fine

#

though there are better methods depending on what you're doing

carmine summit
#

im still confused

opal plank
#

about what?

carmine summit
#

all

opal plank
#

wdym all?

carmine summit
#

all

opal plank
#

i just introduced you to a for loop

#

and gave you an example

carmine summit
#

for (var j = 0; j <= 1000; j++) {

#

i have this code

opal plank
#

i assume you would know the rest by now, its basic syntax

carmine summit
#

but it only works if its an array

opal plank
#

but you aint using arrays dude

carmine summit
#

yeah

#

i aint using arrays

opal plank
#

you said yourself, its an object

carmine summit
#

thats the problem

#

i aint using arrays

opal plank
#

and this is an object

#

for iterates thru something that is iterable

carmine summit
#

what is a: ?

opal plank
#

a is something i declared

#

just a dummy variable

#

like foo or bar

slender thistle
#
let myvariable = 1;
let myarray = [1, 2, 3];
for (number in myarray) 
{
    // this loop body is executed on each iteration (an iteration is a run through the loop body ONCE)
    myvariable += number;
    // what happens is that JS loops through this loop body THREE times because length of `myarray` is 3
    // and on each ITERATION, `number` changes from 1 to 2 and 3, and added to `myvariable`
}
console.log(myvariable); // Will return 7, because 1 + 1 + 2 + 3 = 7
opal plank
#

^^ thats for arrays

#

my example is for objects

carmine summit
#

i need object

slender thistle
#

I did use for of though

pale vessel
#

for in

opal plank
#

js uses others

#

for in/of

slender thistle
#

what's the fucking difference between them, bismillah

opal plank
slender thistle
#

🤔 huh

#

That's... what the hell

carmine summit
#

wdym by (number in myarray)

opal plank
#

this explains a bit more thoughrouly

slender thistle
#

Imagine you going through a box of coins

#

there's 3 coins: 1, 2, 3 dollar coins

#

If you go from the left (start of the array), you get one coin. That coin happens to be 1 dollar. You do something with it, and then get to the next coin (2 dollars), do something with that coin, and move to the third one

opal plank
#

@carmine summit ^^

carmine summit
#

i think im catching it

opal plank
#

foor just loops the entries

carmine summit
#

alright i be coding and i be chat if i need help

opal plank
#

aight

slender thistle
#

Using type annotations is fucking painful

opal plank
#

Imagine using typescript

carmine summit
#

fking badge

opal plank
slender thistle
#

Python KEKW

opal plank
#

interfaces are a pain

#

ik, im using ts, i feel your pain

#

at least we can do :any if we really feeling like it

slender thistle
#

A friend of mine had to use one and I had to Google the answer for him

#

because he was literally clueless about it

opal plank
#

took me a couple hours to figure out types in ts too, ngl

slender thistle
#

kek

opal plank
#

strict mode is a bitch

earnest phoenix
#

And as in looping through arrays or objects, doing for (let variable of(or "in" for objects) array) { is better than for (variable of( or "in" for objects) array) { but as both works, i have no idea behind why is the first recommended

carmine summit
#

how can i make a loop that runs every 3 seconds?

earnest phoenix
#

Set an interval

opal plank
#

let just declares it in the scope

#

var would be good if you wanna keep the value in that case

earnest phoenix
#
setInterval(() => {
// Function or whatever you do
}, 3000);```
slender thistle
#

Do you mean a loop with an interval between each iteration with 3 seconds?
Or a snippet of code that runs every 3 seconds?

carmine summit
#

tysm

opal plank
#

im not saying you shouldnt

#

but usually, you shouldnt

#

idk what you trying to do but remember doing that with discord api(which i likely think you'll be doing) is bad

carmine summit
#

a snippet that runs every 2 seconds

opal plank
#

does it use the discord api?

carmine summit
#

yeah D:

opal plank
#

do you send messages or something /

#

then dont

carmine summit
#

why

earnest phoenix
#

API abuse

opal plank
#

^^

earnest phoenix
#

API abuse is not tolerated resulting in ratelimits

opal plank
#

as a dev you have responsibilities too

carmine summit
#

its ok as long as i dont reqquest 120 requests a minute

opal plank
#

bad idea dud

carmine summit
#

uh

#

k?

slender thistle
#

Just because X doesn't hit the ratelimits doesn't mean it's automatically good

earnest phoenix
#

No, making more than 25 requests per minute without user input is API abuse

opal plank
#

that'll likely trigger internal spam flags

delicate shore
#

Wow

carmine summit
#

maybe 10 seconds will be nice??????

opal plank
#

how about if its not user input, 5 minutes?

earnest phoenix
#

Even 1 minute is not good

carmine summit
#

uhhhhhhhhhh

opal plank
#

the only rare instances ive seen shit require lower than that and went by without too much issue is pokecord, which needed to ask for special permission for rate limits

earnest phoenix
#

5 minutes if no user input, it's ok, if there's user input, 10 seconds is fine

carmine summit
#

uhhhhhhhhhhhhhhh

#

ok

opal plank
#

if you're doing something for your server only, i dare say even 2 mniutes is fine

earnest phoenix
#

For example, a user input is when a user uses a command to trigger the bot, but if there's no user input and the bot does something automatically, that means "no user input"

opal plank
#

in a channel or two max

#

but going for a bot that can be added anywhere with that kind of automation is definetly asking for trouble

acoustic bridge
#
if voice and voice.is_connected():
        await voice.disconnect()

I want to make an automatic leave function for my music bot whenever the music/queue ends, the bot should leave. How would i change the if state to make it disconnect. I'm using ffmpeg and ytdl for the music commands by the way

slender thistle
#

... probably use a custom event?

earnest phoenix
#

<Wait python has ytdl too>

slender thistle
#

What does your code look like rn?

acoustic bridge
#

mine?

slender thistle
#

yes

carmine summit
#

whats the recommended interval if no user input and requires using API?

earnest phoenix
#

5 minutes

carmine summit
#

ok then

opal plank
#

there isnt a set value, but 5 mins should be fine

earnest phoenix
#

5 minutes or maybe 4 minutes should be fine but anyways

#

5 minutes best for now

carmine summit
#

but for testing can i do 5seconds?

earnest phoenix
#

Even for Testing, it's a bad thing

opal plank
#

just remember that none of us are discord devs/employees, we can only tell you good practices but its not up to us to judge

carmine summit
#

it shouldnt last long

slender thistle
#

ehh testing is a bit of an exception

acoustic bridge
#
if voice and voice.is_connected():
        await voice.move_to(channel)

    else:
        voice = await channel.connect()


    song_there = os.path.isfile("song.mp3")
    try:
        if song_there:
            os.remove("song.mp3")
            queues.clear()
    except PermissionError:
        await ctx.send("Music playing.")
        return

    ydl_opts = {
        'format': 'bestaudio/best',
        'quiet': True,
        'postprocessors': [{
            'key': 'FFmpegExtractAudio',
            'preferredcodec': 'mp3',
            'preferredquality': '192',
        }],
    }

    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
        ydl.download(['https://www.youtube.com/watch?v=9mEyJCXv9B8'])

    for file in os.listdir("./"):
        if file.endswith(".mp3"):
            name = file
            os.rename(file, "song.mp3")

    voice.play(discord.FFmpegPCMAudio("song.mp3"), after=lambda e: print(f'{name} has finished playing.'))
    voice.source = discord.PCMVolumeTransformer(voice.source)
    voice.source.volume = 0.10
#

Oh

carmine summit
#

waw

acoustic bridge
#

my bad,

slender thistle
#

which event/command is that

acoustic bridge
#

command for a specific yt link

#

it should be played upon using it and then the bot should leave when it finished playing

carmine summit
opal plank
#

why you array?

earnest phoenix
#

Send the content of the file in a hastebin

#

<You know nobody gonna download that file>

opal plank
#

you also are not doing anything with that for loop

#

(for something in something) you arent doing anything here

carmine summit
#

oke wait

opal plank
#

also number isnt defined

earnest phoenix
#

@opal plank Did you download the file and view it?

opal plank
#

and would catch a bad error if you js is in strict mode

#

im pretty sure number is a blacklisted word

carmine summit
opal plank
#

@earnest phoenix i did

earnest phoenix
#

Madlad

opal plank
#

NOW he added stuff

#

his txt file had this

#

didnt even put the whole thing

carmine summit
#

my head hurts

#

i placed the entire thing

opal plank
#

y'd you copy shiv's snippet?

carmine summit
#

i just copied whats is necessary

opal plank
#

how about NOT copying

earnest phoenix
#

The thing you did could work but it would log NaN into console

opal plank
#

cuz both me and shiv were explaining you how it works

slender thistle
#

I only gave you an example and tried to explain how a for in loop generally works

opal plank
#

its an example dude

carmine summit
#

CHILL

opal plank
#

we are chill

earnest phoenix
#

@carmine summit What are you exactly Trying to do in this case

opal plank
#

first that wont work cuz you doing numbers + strings

#

2 different types

carmine summit
#

i would like a variable that changes everytime a loop completes

opal plank
#

inside loop? var. outside? let

earnest phoenix
#

Variable changes to?

carmine summit
#

i have so much to learn

#

to the next item

opal plank
#

indeed, you need the basics before doing a bot

earnest phoenix
#

Next item?

#

<I'm literally confused>

opal plank
#

luckily got me into a good mood today

#

usually i'd just foward them to learn js w3schools

carmine summit
#

next item

opal plank
#

what is that suppose to be?

carmine summit
#

next item

opal plank
#

its not even an array

carmine summit
#

he said

earnest phoenix
#

I mean

opal plank
earnest phoenix
#

What will be the next item?

carmine summit
#

im stooped right?

#

the next in the line

opal plank
#

can be fixed by learning js

earnest phoenix
#

A variable gonna be the next item?

opal plank
#

shiv already told you

earnest phoenix
#

An array's element gonna be the next item?

earnest phoenix
#

Wot

opal plank
#

both me and him explained how it iterates thru the array/object

#

its ordered

earnest phoenix
#

@carmine summit So which and what's the purpose of your code

#

Can you show an example of what you're trying to do

carmine summit
#

im trying to get a value from 212 objects

earnest phoenix
#

Objects?

carmine summit
#

yah aka items

#

i was saying

earnest phoenix
#

Those are elements

carmine summit
#

whats the iffeerence?

earnest phoenix
#

Object and elements are different things

tight plinth
#

what is an element for you

opal plank
#

@tight plinth you're an element

earnest phoenix
#

An object is {} and an element is [ "bruh" ] (the thing in the array "bruh")

tight plinth
#

I'm talking seriously

carmine summit
#

object

#

they are supposed to be seprated

#

so yeah

tight plinth
#

object : {h: "j" }
property : h
value: "j"

array : ["hi"]
element 0: "hi"

earnest phoenix
#

Yes elements as you see is different

tight plinth
#

so that's their name

#

I see

carmine summit
#

its object in the API

#

i just copied the names and seperate it with commas

tight plinth
#

objects properties can contain anything from objects to arrays, numbers, strings, maps...

carmine summit
#

yeah

#

it contains another object

#

then number

#

which im trying to get

earnest phoenix
#

So if you're trying to get the next item of the array and log it to console or whatever, here's an example

let counter = 0;
let myArray = [1, 2, 3];

setInterval(() => {
console.log(myArray[counter]);
counter++;
}, 300000);
// Logs 1 after 5 minutes
// Logs 2 after 10 minutes
// Logs 3 after 15 minutes``` but i still don't know what else you're trying to do
carmine summit
#

its an object not an array

#

array is ez

tight plinth
#

objects are ez to do

carmine summit
#

object is confusing

tight plinth
#

like

earnest phoenix
#

Bruh an object can turned into an array and done the same

carmine summit
#

Bruh an object can turned into an array and done the same
@earnest phoenix how

earnest phoenix
#
Object.entries(<object>);```
tight plinth
#

let obj = {h: "hi" , g: {k: "hello"}}
obj.h returns "hi"
obj.g.k returns "hello"

carmine summit
#
Object.entries(<object>);```

@earnest phoenix i cant have 200 lines of this in my code

#

as i was trying to say

#

its 212 objects

tight plinth
#

you gotta go through all of them

carmine summit
#

o k ?

earnest phoenix
#

=>

Object.entries({
Bruh: "Nani",
Huh: "Wot",
Hmm: "Damn"
});```
<=
```js
[ ["Bruh", "Nani"], ["Huh", "Wot"], ["Hmm", "Damn"] ]```
tight plinth
#

you can do forEach with arrays

earnest phoenix
#

So you can work with this array as my example showed

#

you can do forEach with arrays
@tight plinth He logs an item every 5 minutes with an interval

carmine summit
#

i cannot convert the object into an array since its an API

earnest phoenix
#

No

#

Api returns a promise

#

If you resolve it, it turns into an object

#

And then you can turn that into an array

carmine summit
#

And then you can turn that into an array
@earnest phoenix how

restive furnace
#

its basics on js && communicating with APIs btw

tight plinth
#

^

#

you gotta learn nodejs

carmine summit
#

uh

#

i know how to read api

earnest phoenix
#

For example, this is our base url, let's assume this is an api and returns an object as a response

https://api.example.com```
We make a request to get the object
```js
require("node-fetch")("https://api.example.com").then(res => res.json());```
This return
```js
{
Hey: "This is a test",
Hi: "Hmm",
Oof: "No"
}```
And now we want to resolve the promise to use this freely
```js
let getObject = await require("node-fetch")("https://api.example.com").then(res => res.json());

let turnObjectIntoArray = Object.entries(getObject);

turnObjectIntoArray; // [ ["Hey", "This is a test"], ["Hi", "Hmm"], ["Oof", "No"] ]```
#

@carmine summit ↑

#

Breh pointing at my message

carmine summit
#

I know how to read APIs

dusty tulip
#

Ops sorry

#

My friend try to activate his bot, but it always say error

#

Ok

carmine summit
#

the problem is i got to read 212 different objects

#

and its gonna take a load of space

#

and i need to simplify it

#

or create a loop

earnest phoenix
#
[
// 212 objects
]```?
#

Is it inside an array or object

#

That 212 objects

carmine summit
#

object

#

no arrays

earnest phoenix
#
let myObjects = <Your object here>;
for (let object in myObjects) {
// Do something with this specific object, for example access it's property and change it
object.value = 3;
}```
carmine summit
#

so i have to copy paste that 212 times?

earnest phoenix
#

Bruh

restive furnace
#

no

#

its loop

earnest phoenix
#

That iterates through all of your 212 objects

carmine summit
#

explain more

earnest phoenix
#

Explain more of which part

carmine summit
#

let myObjects = <Your object here>;

restive furnace
#

its ur object

cinder patio
#

Voltrex, in the loop you gave object will be every key, not every value

dusty tulip
#

When my friends want to initiating cmd, it keep saying reference error at token

earnest phoenix
#
let myObjects = <the objects you received from the api>;```
Example: (I'm not showcasing an object from an api but still the same with an object received from the api)
```js
let myObjects = {
{
Something: "Bruh",
No: "Yes",
Yes: "No"
},
{
Huh: "test",
Some: "hmm",
Wtf: "Hold up"
}
}``` @carmine summit
#

@cinder patio What?

restive furnace
#

he ment that GoogleFeud

cinder patio
#

object will be the key in every entry, not the value

earnest phoenix
#

No it's the entire object

cinder patio
#
const obj = {a: {}, b: {}}
for (let object in obj) {
   console.log(object); // a, then b
}
#

no

restive furnace
#

yes he does want that i assume

carmine summit
#

i am trying to read products.BROWN_MUSHROOM.quick_status.buyPrice
and BROWN_MUSHROOM is the object i want to change for every loop

earnest phoenix
#

Example:

let someObjects = { { hmm: "test" }, { huh: "another test" } };
for (let object in someObjects) {
console.log(object);
// First time it logs { hmm: "test" }
// Second time it logs { huh: "another test" }
}``` @cinder patio
cinder patio
#

I think you are confusing objects with arrays here...

earnest phoenix
#

Wot

cinder patio
#

{ { hmm: "test" }, { huh: "another test" } }; That's not valid syntax

pale vessel
#

[{}]

cinder patio
#

Aside from that, a for...in loop iterates through the keys in an iterable

carmine summit
#
const obj = {a: {}, b: {}}
for (let object in obj) {
   console.log(object); // a, then b
}

@cinder patio This got my problem solved

#

thank you

earnest phoenix
#

Oh wait, this guy said his 212 objects were inside an object

#

That's what confused me

pale vessel
#

i mean if they meant array, array is still an object

#

but still

earnest phoenix
#

I said if his 212 objects were inside an object or array and he said object

#

So i was confused

pale vessel
#

bruh

carmine summit
#

but when i run the code, terminal bursted... but i want it to run every 3 seconds

#

how do i use timeout?

cinder patio
#

You'd want to use setInterval:

setInterval(functionThatYouWantToRunEvery3Seconds, 3000);
earnest phoenix
#

He's already using that

carmine summit
#

how can i exceed "z"?

restive furnace
#

{ { hmm: "test" }, { huh: "another test" } }; That's not valid syntax
it is if he ment object

carmine summit
#

it is if he ment object
@restive furnace i got that working

cinder patio
#

It's still not valid syntax

#

The keys are missing

restive furnace
#

how?

#

hmm

#

yes that

earnest phoenix
#

Yea i did not notice

carmine summit
#
const obj = {a: 'muhahaha', b: 'lol'}
for (let object in obj) {
   console.log(object); // a, then b
}
}, 3000);```
earnest phoenix
#

As he said object it got me confused

carmine summit
#

try to run this

vivid wadi
carmine summit
#

ignore the fact that i defined a and b

earnest phoenix
#

@vivid wadi You can't test your bot until it's approved

vivid wadi
#

ohhhhh

#

rip

earnest phoenix
#

Gotta wait 4+ weeks

vivid wadi
#

on my alt i had a bot

#

and i waited like some months

#

and it got declined

#

with no dm

dire flower
#

Hello

vivid wadi
#

hi waveDoggo

cinder patio
#

Cwickks, That should output

a
b

Every 3 seconds

dire flower
#

hello i want to add my bot to your site

carmine summit
#

yeah

slender thistle
#

-faq 1 @dire flower

gilded plankBOT
#

@dire flower

Frequently Asked Questions 📜
restive furnace
#

Cwickks, That should output

a
b

Every 3 seconds
dont confusw him more, he wants it act like that

timid terrace
#

Sa

slender thistle
dire flower
#

As

#

@timid terrace

timid terrace
#

Naber

slender thistle
#

-notr @timid terrace @dire flower

gilded plankBOT
#

@timid terrace @dire flower

İngilizceden başka dillerde sohbet etmek için #memes-and-media kanalını, top.gg hakkında (Türkçe olarak da) destek almak için #support kanalını kullanın.
Bu kanalda Türkçe konuşmayın.

dire flower
#

Ok @slender thistle

restive furnace
#

lol link

#

stop spamming links ok

timid terrace
#

O ne doctor

dusty tulip
#

When my friends want to initiating cmd, it keep saying reference error at token
Someone can help?

earnest phoenix
#

"refrence error at token" token not defined or invalid?

carmine summit
#

how do i define const obj ?

pale vessel
#

by doing const obj

earnest phoenix
#

How do i do bot count in serverinfo?

sinful belfry
#

you can iterate through all the guild members, and add one to a counter if they are a bot

vivid wadi
#

if so can somebody give me an invite

slender thistle
vivid wadi
#

ty

acoustic bridge
#

https://mystb.in/FashionGatewayStress.python
I'm looking for a random music command which will also queue up a random link upon using it once more.
However I'm not sure how to pick a random link and if it queue's up correctly

#

the code's in the link

earnest phoenix
#

if i have the server counter in the status on my bot do i need to do something to make it update automatically or does it do it already?

zenith terrace
#

It auto updates

earnest phoenix
#

okay cool

#

It doesn't auto update unless you restart the bot

carmine summit
#
const obj = {a:"", b:""}
for (let object in obj) {
   console.log(object); // a, then b
}

@cinder patio this code is good, but one of my object is called "logs:2" which messes with the syntax of how you define obj

earnest phoenix
#

okay now im suspicious i have 2 answers

#

If you want it to auto update without restarting the bot you can set an interval

cinder patio
#

Put it in like this {"logs:2": "some value..."}

earnest phoenix
#

aight thats something i'll do when i go home

#

set interval for it

#

K cool

zenith terrace
#

Close enough to being auto updating

#

I just never mentioned set interval mmLul

earnest phoenix
#

i have 2 bots stable version for it and the dev build aka the one i use for testing before pushing it to the real bot

#

Kinda pog

#

so i can set up hosting on google cloud

nova jay
slender thistle
#

I wouldn't worry too much about the styling of your privacy policy ngl

#

just make it easily enough to be read

#

why align text by center though

#

you could probably align it to the left

nova jay
#

it's because my whole website is aligned like that it would feel weird for me to change one page to look different

slender thistle
#

oh wait nvm I'm blind KEKW

nova jay
#

lol

slender thistle
#

You might want to add some kind of border-bottom for sections titles

#

because I can't differ them from the text itself

nova jay
slender thistle
#

might want to add a colored line above the text and below the section titles

#

but yeah that's more or less bearable

acoustic bridge
#

x = list of url's to pick from

select = random.choice(x)
        
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download([url])

How to make it pick one of the random url (what should be written there instead of the ([url]))

sudden geyser
#

just pass select?

#

random.choice returns a random element from an iterable based on a seed

#

and does ydl.download() require you pass a list, or just a string/some value

faint prism
#

x = list of url's to pick from

select = random.choice(x)
        
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download([url])

How to make it pick one of the random url (what should be written there instead of the ([url]))
@acoustic bridge What Lite said. Your variable select IS the random url. So use that in ydl.download(select)

acoustic bridge
#

i fixed it when i realized i had (url: str) as a parameter next to (ctx) - my bad

#
async def playlist(ctx, url:str):
green bison
#

can any one help me with this?
const bot = new Discord.SendEmbed()
^

TypeError: Discord.SendEmbed is not a constructor

faint prism
#

Take off the .SendEmbed()

#

Then on a different line do bot.SendEmbed()

green bison
#

ty

faint prism
#

but

pale vessel
#

SendEmbed? that's not a valid constructor

#

you mean MessageEmbed?

#

or RichEmbed in v11 but that's wack

faint prism
#

You probably want to keep bot functions somewhere away from when you first initialize the bot object

green bison
#

do i type it like this?
client.on("message", message => {
if (message.content === "-bot") {
bot.SendEmbed()

faint prism
#

lgtm

#

Just make sure you close the } }

green bison
#

ok

pale vessel
#

} });

#

what's SendEmbed()?

green bison
#

the bot didn't start

faint prism
#

Was there an error?

green bison
#

no nothing came out

#

nvm

#

it was loading

#

it says
bot.SendEmbed()
^

ReferenceError: bot is not defined

faint prism
#

Didn't you define it previously with const bot = new Discord ?

#

Make sure that's the right way to do that

green bison
#

oh i forgot

faint prism
#

||idk discord.js tbh||

glacial hazel
#

i need yt api

green bison
#

it says
const bot = new Discord
^

TypeError: Discord is not a constructor

pale vessel
#

you mean MessageEmbed()?

#

that are you trying to make?

#

an embed?

green bison
#

yes

pale vessel
#

please read docs

green bison
#

what about this?
const bot = new Discord
^

TypeError: Discord is not a constructor

pale vessel
#

why only Discord

#

if you want the embed constructor, it's Discord.MessageEmbed(), assuming you're on v12

faint prism
#

it's new Discord.Client()

pale vessel
#

that's the client

#

Discord is the module

#

MessageEmbed is a class

green bison
#

is the code .SendEmbed or .MessageEmbed becuase is says
bot.SendEmbed()
^

TypeError: bot.SendEmbed is not a function

faint prism
#

You're getting to the part where you have to read the docs

#

Your bot object will have multiple properties and functions

#

The docs will tell you what they are and what it can do

pale vessel
#

here's an examplejs const Discord = require("discord.js"); const embed = new Discord.MessageEmbed().setTitle("Title"); // read the rest in docs message.channel.send(embed);

faint prism
#

Like send a message

faint prism
#

Plz don't copy and paste that example lol

green bison
#

ok

pale vessel
#

technically it would work Discord is already defined

#

he defined message as message

faint prism
#

can you require something twice in js?

pale vessel
#

but he shouldn't define Discord as it's already been defined

#

you can, yes

nova latch
#

aq!help

slender thistle
vivid wadi
#

ii have a question

pale vessel
#

what is it

delicate shore
golden condor
#

Install make

#

apt-get install make or npm i -g make not sure which

vivid wadi
#

i saw something saying about octobor and verified bot dev badge and im wondering after octobor ends will verified bot dev badge be gone

pale vessel
#

they won't be giving the badges anymore

vivid wadi
#

oh

faint prism
#

good riddance I say

slender thistle
#

they will, apparently just not the early dev one

fluid basin
#

oh?

pale vessel
#

there's both early verified dev and verified dev?

delicate shore
#

Shiv are. u sure?

pale vessel
#

nani

lyric mountain
#

nice, now I want both

delicate shore
#

Yes

#

i also want both

fluid basin
#

I think they're going to increase the requirements if there is going to be a new badge

slender thistle
#

Since I'm not sure, I'll blame Discord for their poor phrasing

green bison
#

it still not working this is the code
const bot = new Discord.MessageEmbed()

client.on("message", message => {
if (message.content === "-bot") {
bot.SendEmbed()
.setAuthor(client.user.username, client.user.avatarURL)
.setColor("#00000")
.addField(
"✽ Bot Ping : ",
» ${Date.now() - client.createdTimestamp} + " ms",
true
)
.addField("Servers : ", » ${client.guilds.size}, true)
.addField("Channels : ", » ${client.channels.size} , true)
.addField("Users : ", » ${client.users.size} , true)
.addField("Bot Name : ", » ${client.user.tag} , true)
.addField("Bot Owner : ", » <@686573386289119232 , @742791852327174145 >, true)
.setImage("")
.setFooter(message.author.username, message.client.avatarURL);
message.channel.send(bot);
}
});

lyric mountain
#

oh my

#

codeblock plz

pale vessel
#

as far as i know, they won't be giving the badge to new verified devs and it'll be renamed to early verified bot developer

fringe axle
#
run(message, client, args) {

      let argsC = message.content.split(" ").slice(1);
      if (!argsC[0]) {
        return message.channel.send("Please mention someone");
        }

  const search = argsC.slice(0)[0];

    let {
      member
    } = message;
    if (message.mentions.members.size > 0) {
      member = message.mentions.members.first();
    } else if (search) {
      member = client.findersUtil.findMember(message.guild, search);
    if (member.size === 0) {
      return message.channel.send(`❌ No members found \`${search}\`!`);
    } else if (member.size === 1) {
      member = member.first();
    } else {
      return message.channel.send(client.findersUtil.formatMembers(client, member));
    }
};

if (!
  message.member.hasPermission('BAN_MEMBERS')) return message.channel.send("You dont have the permissions! You are missing the ``BAN_MEMBERS`` permissions");

  if (member.hasPermission("MANAGE_GUILD")) return message.channel.send("Failed to ban the user! (Higher permissions)");

  let reason = argsC.slice(1).join(' ');
  if (!reason) reason = 'No reason';

  member.ban({ reason: `${reason}` })
    .then(message.channel.send(`**${member.user.username}** has been banned from ${message.guild.name}`))

    const banEmbed = new MessageEmbed()
    .setAuthor(`Member banned | Issuer: <${message.author.id}>`, message.author.avatarURL())
    .setDescription(`User: ${message.mentions.members.first()}\nReason: ${reason}`)
    .setFooter(`Contact a staff member if you thing it was a mistake`)

    client.channels.cache.get("744906283756290048").send(banEmbed);
  }
}

I have this code and if I set message in run after client the permissions won't work. But if I do message first then client is undefined...

green bison
#

client.on("message", message => { if (message.content === "-bot") { bot.SendEmbed() .setAuthor(client.user.username, client.user.avatarURL) .setColor("#00000") .addField( "✽ **Bot Ping** : ", » ${Date.now() - client.createdTimestamp}+ " ms", true ) .addField("**Servers** : ",» ${client.guilds.size}, true) .addField("**Channels** : ", » ${client.channels.size} , true) .addField("**Users** : ", » ${client.users.size} , true) .addField("**Bot Name** : ", » ${client.user.tag} , true) .addField("**Bot Owner** : ", » <@686573386289119232 , @742791852327174145 >, true) .setImage("") .setFooter(message.author.username, message.client.avatarURL); message.channel.send(bot); } });

pale vessel
#

where did you execute the function?

fringe axle
#

Me?

pale vessel
#

yes

fringe axle
#

IN run

#

run(message, client, args)

golden condor
#

message.channel.send(bot). Are you okay?

fringe axle
pale vessel
#

@fringe axle yes but where? in the message event?

sharp thicket
#

Wait is send.Embed possible ???

pale vessel
#

no

golden condor
#

no

sharp thicket
#

@green bison thats ur problem..

#

You did send.Embed

fringe axle
#

@fringe axle yes but where? in the message event?
@pale vessel In permissions

pale vessel
#

no, you have to execute the function but where?

fringe axle
#
if (!
  message.member.hasPermission('BAN_MEMBERS')) return message.channel.send("You dont have the permissions! You are missing the ``BAN_MEMBERS`` permissions");
pale vessel
#

show the code where you run that function

#

not that

sharp thicket
#

Const embed = new discord.MessageEmbed

pale vessel
#

brain

knotty steeple
#

const bot = new Discord.MessageEmbed() why

sharp thicket
#

Oop

fringe axle
faint prism
#

``` interesting use of whitespace lol
lyric mountain
#

const bot = new Discord.MessageEmbed() why
@knotty steeple lul that's like doing const tomato = new Lettuce()

fringe axle
pale vessel
#

oh god commando

#

i'm out, never used commando before

knotty steeple
#

i have my own command framework

pale vessel
#

good to know

fringe axle
#

i'm out, never used commando before
@pale vessel ;_;

knotty steeple
#

ye

green bison
#

You did send.Embed
@sharp thicket
do i type bot.Send(Embed) ?

knotty steeple
#

no

delicate shore
#

it gives this error

#

earlier it was working fine

#

but when i shifted to gala....

#

it gives this

sharp thicket
#

No lol

#

Make a variable called embed

knotty steeple
#

bot.SendEmbed() wtf is this

pale vessel
#

mmLol code

fringe axle
#

New function.

sage orbit
#

what language

pale vessel
#

english

sharp thicket
#

Then at the end say message.channel.send(VariableName)

lyric mountain
#

you are missing this module

delicate shore
#

i did npm i over 1k times

knotty steeple
#

install ur modules

delicate shore
#

i did npm i

#

many times

fringe axle
#

i did npm i over 1k times
@delicate shore try npm i --save please

sharp thicket
#

Uh

golden condor
#

excuse me what

knotty steeple
#

seems like u didn't

sharp thicket
#

Npm i module —save

golden condor
#

How the fuck would that change anything

lyric mountain
#

or just use yarn smh

pale vessel
#

also, read errors, don't just spam npm i lmao

earnest phoenix
#

its not —

fringe axle
#

It's iOS

sharp thicket
#

It is lol

fringe axle
#

That makes that weird -

sharp thicket
#

—save

#

Im on mobile

green bison
#

var bot = new Discord.MessageEmbed()
like this?

pale vessel
#

yes