#development

1 messages · Page 1169 of 1

zenith knoll
#

filtered.username?

faint prism
#

What do you guys think about me being a bot hoster? Where I'd put a bot in it's own lightweight VM and have every connection for that VM go through tor.

cinder patio
#

no, member.user.username, in the example I have above

#

filtered is a map

zenith knoll
#

oHH

solemn latch
#

ive never seen a bot hoster be not sketchy af @faint prism

#

youd have to find out how to not be sketch

faint prism
#

Yeah, it would be super sketchy

#

VERY sketchy

#

If fact, I shouldn't do it. That's how sketchy it would be. Thank you for talking me out of it lol

zenith knoll
#

man

solemn latch
#

i only said a few words 😄

zenith knoll
#

i know what went wrong oin my OG code

solemn latch
#

yw

zenith knoll
#

my og code wouldve worked

#

if i did

cinder patio
#

Only in rare cases

zenith knoll
#

filtered.get(ids[i]).user.username instead of filtered.get(ids[i]).username

cinder patio
#

The issues are still there

zenith knoll
#

if i did

cinder patio
#

The issues are still there

zenith knoll
#

I CRASHED

#

my discord crashed 4 times today alr

#

hi?

#

crashed again

#

ok well it would work if i did filtered.get(ids[i]).user.username not filtered.get(ids[i]).username

cinder patio
#

Still has the potential to error

zenith knoll
#

ok

solemn latch
#

im not sure if this was a command or something, but your also fetching every member of the guild every time this is run.

#

which will result in a major increase in ram usage

faint prism
#

i only said a few words 😄
@solemn latch I mean. Only new bot devs, who don't know what their doing, would go for a random server host like that.
It makes me think of how many bad actors there are who are doing just that angeryBOYE

zenith knoll
#

i use a host i am affiliated with

#

idk if i get the credit for using my own code

#

lmao

thick gull
#

how would I push data to an array in a mongoDB?

                            findGuild.update({ $push: { ignoredChannels: args[1] } })
                            await findGuild.save().catch(e => console.log(e))

the findguild is just the guild, if i log it it returns the proper ID

guild is just

{
ignoredChannels: [],
guildID: 'id',
}
#

i've looked online

#

it's not working for me

solemn latch
#

such a common question weirdly

thick gull
#

yea

#

i changed it a couple of times too

solemn latch
#

db.student.update( { "subjects" : "gkn" },{ $push: { "achieve": 95 } });

#

like that?

thick gull
#

yep

#

thats the exact example i looked at first

solemn latch
#

not sure, ive had this question a few times and i just gave thost two links

#

always worked out 🤷‍♂️

snow urchin
solemn latch
#

this being client correct?

snow urchin
#

ya

solemn latch
#

i dont know then

#

@sinful belfry

#

idk why i always chose you

sinful belfry
#

@earnest phoenix read the rules

#

no self promotion here ty

snow urchin
#

O

sinful belfry
#

next time will result in a ban

snow urchin
#

someone clearly dont care

sinful belfry
#

rip them

#

i think it is around 1 per second (or 5 every 5 seconds)? not entirely sure though

#

just make sure it is a reasonable cooldown

#

you need a cooldown between adding roles

#

make sure it is reasonable

#

so give it a couple seconds between each time you add a role

faint prism
#

@thick gull I know you should be able to push an array of objects to a mongodb document

#

Idk the command, but ik it's possible

thick gull
#

yeah

#

i figured it out now

#

probably not the best method

#

but my code isn't optimized whatsoever

earnest phoenix
#

anyone do discord.py and wanna work on a bot with me and my mates as a project

#

we are all pretty decent not pro pro

#

dm me

#

this ain't the place to ask for devs to join your project

sinful belfry
#

^

#

-needdev

gilded plankBOT
#

DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.

ionic dawn
#

Welcome to InfoJobs

opal plank
#

ngl saying stuff like that makes it sound like you want someone to do 99% of the work for you

faint prism
#

^

opal plank
#

Rip badge for those who wanted it

#

not getting it anymore

honest perch
#

Rip badge for those who wanted it
@opal plank what did discord do

thick gull
#

they seperated it

#

if you verifiedd before today

#

you get 'early' verified bot dev

#

like early nitro supporter

honest perch
#

Oh lmao

thick gull
#

which im not sure was a good idea cause there's already a ton of accounts being sold, it'll like 4x that market

slender wagon
#

If u applied before today*

honest perch
#

XD

thick gull
#

and there will be WAY TOO many badges on some people's profile

late basalt
#

Does anyone know how to make a discord command that tells how old someones discord account is with JavaScript?

ebon kelp
pale vessel
#

that's the client

late basalt
#

?

pale vessel
#

well, still applies for users

late basalt
#

Does anyone know how to make a discord command that tells how old someones discord account is with JavaScript?

sinful belfry
#

what lib

#

discord.js v12?

late basalt
#

Yes it's discord.js

sinful belfry
#

this just returns the timestamp their account was created

#

then you can do whatever you want with that, such as getting the precise time their account was created

late basalt
#

Thx

ionic dawn
#

I have a question

#

is screen the best way to let the bot running?

digital ibex
#

wut

honest perch
#

What

ionic dawn
#

Im using "screen" command to let the bot running

#

like screen node bla bla

#

nvm I have an error at my code

digital ibex
#

im not sure why you’d wanna use it, seems unnecessary in this case

#

ok

ionic dawn
#

I leave my bot running for like a week, and after an update it crashes like... 24h after being online

honest perch
#

Use pm2

ionic dawn
#

any command is throwing an error and Im not handling it correctly

#

Use pm2
@honest perch Yeah just saw it right know

#

pm2 leave logs right?

honest perch
#

Yeah

#

Pm2 logs

#

Or pm2 logs appname

ionic dawn
#

just watching the console, someone just typed 3 commands at the same time with the argument: SPAM

#

someone is getting blacklisted CBuwu

stark abyss
#

Can someone help me get to that file in fonts from register?

#

Uhh

honest perch
#

../../fonts/comicsans

acoustic bridge
#
@client.command(aliases=["die"],pass_context=True)
async def leave(ctx):
    guild = ctx.message.guild.voice_client
    voice_client = guild.voice_client()
    await voice_client.disconnect()

Having issues with a leave Voice channel command.
Error: 'VoiceClient' object has no attribute 'voice_client'

stark abyss
#

../../fonts/comicsans
@honest perch thsi DIDNT work

#

No such file or directory /home/fonts

placid iron
#

Add a dot for every level up

stark abyss
#

?

placid iron
#

..../fonts maybe or just .../fonts

earnest phoenix
#

هلا

#

السلام عليكم ورحمه الله وبركاته

stark abyss
#

I don’t know about that lol

#

What is error: could not parse file

earnest phoenix
#

Pleas Help Me For Bot

glossy elk
#

whats a good db thats not mongodb

ionic dawn
#

So if you give my bot an ascii symbol(UNESCAPED_CHARACTER) it will go down cuz i didnt put an error handler there

worthy glacier
#

how do i make a command that pulls a random image from a google search

earnest phoenix
#

hey help me pls

worthy glacier
#

like !image cat

earnest phoenix
#

font not loading

ionic dawn
#

theres a cat api

sudden geyser
#

how do i make a command that pulls a random image from a google search
@worthy glacier you sure you need a google search, or should you be looking for a cat api

worthy glacier
#

google search

#

i want any keyword

#

i tried using the duckduckgo api

#

but it kept failing

faint prism
#

font not loading
@earnest phoenix code?

thick gull
#

there's one on youtube I saw a while back using cheerio

silk hare
#

How long does it normally takes to approve a bot?

faint prism
#

@silk hare #support also +4 weeks rn I think

indigo folio
#

@faint prism what happened to your bot

#

didn't you have one

ionic dawn
#

Yap, +4 weeks

faint prism
#

Yeah

#

It's doing fine

#

Still in queue @indigo folio

indigo folio
#

oh ok

zealous vortex
#

Hi

#

Happy programing !

earnest phoenix
#

Hello i have one question

User#flags
Returning bitfield: 256 what does that mean?
I want to check badges of an user but idk how

zealous vortex
#

@lavish saddle

faint prism
#

uh

frigid rivet
ebon kelp
#

A bot cannot self deaf someone, this only possible on client side

earnest phoenix
#

client.users.cache.get('556269605598003220').flags

UserFlags { bitfield: 256 }
ebon kelp
#

A number indecates if they're partner/employee/systm etc

earnest phoenix
#

Yeah but

#

UserFlags returning 256

#

That's not in the list

#

new Discord.UserFlags(bits) what is that

#

Hm i think i understand

#

Maybe flags.toArray()

#

Ah yeah it was toArray() nvm

worthy glacier
#

cheerio didnt work for me it kept getting flagged as a ingenuine search

#

and i didnt get it to successfully scrape from duckduckgo either

#

How do i have a always running check. Like if a user reaches a certain amount of currency the bot sends a message?

halcyon ember
#

why is my mysql broken

#

my query is SELECT * FROM ads ORDER BY ads..bid DESC LIMIT 1

sudden geyser
#

What is ads..bid

#

And what part specifically is broken

earnest phoenix
#

how do i prevent images from overlapping on canvas?

earnest phoenix
#

how can i get the guild's id in an on_user_update event? (in discord.py)

stark abyss
#

Error: Error: EACCES: permission denied, open './../../coins.json'

#

how to give permission

delicate shore
#

../../../?

#

Fuck thank god I have already submitted

thick gull
#

The dev server is a shit show rn

topaz fjord
#

so basically you just get a different badge

#

how "fun"

thick gull
#

you don't get a badge at all @topaz fjord

#

Unless you already verified you can't get one now

#

Verified dev is changing because too many people made shit rushed bots for it

topaz fjord
#

good

#

the badge would have no meaning if everyone got it

thick gull
#

yeah

#

but now nobody gets it

#

they ruined it for everyone

#

but discord has valid reasons

topaz fjord
#

¯\_(ツ)_/¯

thick gull
#

I 100% agree with the reasoning

faint prism
#

Good thing I don't notice badges 95% of the time

thick gull
#

I only began to notice them because of everyone going ogmgogkgomg bot

earnest phoenix
#

Can you send me a link to the dev server? @thick gull

thick gull
#

@earnest phoenix I can't find an invite

earnest phoenix
#

@earnest phoenix to discord developers?

#

Si senor

#

Wot

thick gull
#

The official one

#

by discord

earnest phoenix
thick gull
#

yeah

#

I tried developer and developers but those aren't related

faint prism
#

That's the official one

zenith knoll
#

When i give someone coins, i store it in a json file, but if they have 100, and i give like 90, they now have 10090 instead of 190. heres the code

thick gull
#

json database go brrr

#

wouldn't you just get the value do data+90?

#

not 100% sure what your doing

zenith knoll
#

Im doing

thick gull
#

might be my migraine brain

zenith knoll
#

ping me answers pls

faint prism
#

Don't use json as a db

earnest phoenix
#

You're adding a number to an string

faint prism
#

It will inevitably mess up and corrupt the entire thing

earnest phoenix
#

Which doesn't actually add up

zenith knoll
#

You're adding a number to an string
@earnest phoenix the value it a int

#

no ""

earnest phoenix
#
parseInt(userinfo[message.author.id].coins) += parseInt(coins);```
zenith knoll
#

omfg so smart so smart

thick gull
#

how did you do the xp

#

if yoh

#

nevermind

knotty steeple
#

Don't use json as a db
It will inevitably mess up and corrupt the entire thing

zenith knoll
#

Uh

#

only if u cant use it corrctly

#

its what my dad says

thick gull
#

JSON isn't a read write file

zenith knoll
#

he works for google so i assume hes right

#

fs lets u read and write

knotty steeple
#

lol no

thick gull
#

yeah but that doesn't mean your supposed to

knotty steeple
#

if u need a 1 file db use sqlite

thick gull
#

node lets you crash the process

#

doesn't mean it should be reliably used

zenith knoll
#

whats a good db?

earnest phoenix
#

Mongodb

zenith knoll
#

i hear abt mongo and mongoose and mysql

#

sqlite for JS requires python

#

lmao

earnest phoenix
#

Wot

thick gull
#

Mongo is easy to learn once you get the hang of it

earnest phoenix
#

Haha JSON database go BRRRRRRRRRRRRR

thick gull
#

it took me a while to figure out prefix but now that I have its easy

knotty steeple
#

sqlite for JS requires python
@zenith knoll no?

zenith knoll
#

yes

#

i install it

#

but

#

it says

thick gull
#

You need python to use quickdb iirc

knotty steeple
#

u only need build tools to compile

zenith knoll
#

Could not find 'python'

earnest phoenix
zenith knoll
#

Okay

#

so mongo or mongoose?

knotty steeple
#

quickdb is fucking sqlite

thick gull
#

same thing

#

mongoose is for mongo

#

yes exactly

zenith knoll
#

k

#

wait

#

so what to use as db

thick gull
#

Unless mongos the name of something other than what I'm thinking about

#

MongoDB

earnest phoenix
#

mongodb and mongoose overwrite to the same driver, they both just have different functions and methods

thick gull
#

use mongoose to connect

#

oh

#

They're two different things (?)

zenith knoll
#

lemme test my bot

earnest phoenix
#

Yes

zenith knoll
thick gull
#

oh

knotty steeple
#

better-sqlite3 is a native c++ package that needs node-gyp and build tools to compile

#

node-gyp requires python

zenith terrace
#

I have tried several times to try to even connect to mongo and I fail at it 😫

thick gull
#

mongoose.on(urlwhatever

#

or something

earnest phoenix
#

Provide the correct the username, password and database name then @zenith terrace

thick gull
#

Idk i wrote it while sleep deprived

earnest phoenix
#

Clusters have them

knotty steeple
#

get precompiled build

zenith terrace
#

Provide the correct the username, password and database name then @zenith terrace
@earnest phoenix I know that part but I just stupid at everything else

earnest phoenix
#

Lol

#

How do I make a bot this is confusing.

zenith terrace
#

read docs

earnest phoenix
#

Lmfao

sick cloud
delicate shore
#

My bot restarts everytime weather command is run

earnest phoenix
#

Tf

#

My bot restarts everytime weather command is run
@delicate shore glitch runs it again right

#

Your bot crashes and glitch restarts it after five minutes

delicate shore
#

no

#

my bot is 24*7 online

#

because i have glitch premium

zenith terrace
#

when vps is cheaper than glitch

delicate shore
#

but i cancelled it

#

i bought galaxy gate

topaz fjord
#

seems like a code issue

#

highly unlikely it's the vps causing the problem

delicate shore
#

oh

thick gull
sick cloud
#

cool

delicate shore
#

can one invent his own

#

language

#

for discord

sick cloud
#

wdym language

thick gull
#

yeah

#

he means library

delicate shore
#

i mean liv

thick gull
#

probably

delicate shore
#

lib

sick cloud
#

of course

#

but there's little reason to

delicate shore
#

no

thick gull
#

but I want a role in this server

delicate shore
#

ok

thick gull
sick cloud
#

you don't get a role in the server for making a discord library

delicate shore
#

I wanna join discord but i am only 15

sick cloud
#

?

thick gull
#

if I can't have verified bot dev badge I'll do it for library

delicate shore
#

you don't get a role in the server for making a discord library
@sick cloud ik

thick gull
#

there's library dev role

#

I think

sick cloud
#

that's for dbl api libs

delicate shore
#

no

sick cloud
#

already made for most major languages

#

ie shiv has it for the py version i believe

thick gull
#

o h

#

well I'll do it for discord.bat can't stop me

delicate shore
#

shivaco has no role

thick gull
sick cloud
#

nice

#

i'm making a db that uses json so i'm very intelligent mmLol

thick gull
#

why

sick cloud
#

because of boredom

#

it's not a simple one, sort of complex

short lantern
#

Guys

#

How do i use

sick cloud
#

its the one i sent the hastebin of b4

short lantern
#

Server stats

sick cloud
#

@short lantern wrong server

thick gull
#

wrongserver™️

short lantern
#

Oh

#

Mb

sick cloud
#

go to its bot page and click join support server

delicate shore
#

Boomer™️

sick cloud
#

nice

delicate shore
thick gull
#

there's alot of libs like that

delicate shore
#

they have no docs tho

thick gull
#

I don't think many are good

#

But they exist

delicate shore
#

oo

thick gull
#

you can use the readme

#

it explains basic shit

sick cloud
#

i made one

#

never completed though and unsure of if it works

#

but you could look at it if you want

thick gull
#

I want to make a full game on my bot

sick cloud
thick gull
#

Still thinking of a decent idea

#

maybe a fishing game..? That's done to death though I think

sick cloud
#

^

thick gull
#

I'm not going for a simple three command game

#

I mean like the whole bot

delicate shore
#

what is lua

thick gull
#

so I'm brainstorming a hecc alot

#

lua is a language

#

it was my third language but its the oldest one I know how to use still, well not LUA but roblox lua

sick cloud
#

disappointing

thick gull
#

there's alot of things I would want to do

#

I want to make a social media for somereason but it won't go anywhere obviously mmulu

sick cloud
#

my js db is half done and i haven't done docs yet so that's a nice oof

thick gull
#

Can you get info on a user without any mutual servers

sick cloud
#

via the api yes

#

/users/:id with Authorization: Bot {bot token}

#

iirc

thick gull
#

man

#

I'm 3 iq and don't know how to form a link with that

sick cloud
#

dumb question time but how can i filter using a sort of object
like filter this

[
  { id: 1, name: 'bob' },
  { id: 2, name: 'bob' },
  { id: 3, name: 'fred' }
]

using this
{ name: bob }
to get this

[
  { id: 1, name: 'bob' },
  { id: 2, name: 'bob' }
]
#

not a func but an array of values that all must === true to filter correctly

earnest phoenix
#

???

#

@sick cloud wtf are you saying

thick gull
#

find all ids with name bob

earnest phoenix
#

loop

sick cloud
#

not helpful

earnest phoenix
#

make a for loop

thick gull
#

not a good idea with large files

sick cloud
#

because i want it to be dynamic

earnest phoenix
#

to check

#

And then splice or add elements to the array

#

Donr

sick cloud
#

so i can do a filter ie. { name: 'some username', type: 'user', age: 4 } etc

thick gull
#

but aren't loops

earnest phoenix
#
  • Types it out *
thick gull
#

not good

sick cloud
#

loops are synchronous

thick gull
#

in long files

sick cloud
#

mongodb has this kind of filter

#

just wanna replicate it

thick gull
#

Idk man im kind of -3 iq

earnest phoenix
#

How can i filter user with a certain type of badges ?

i have try with
client.users.cache.map(u => u.flags)

But it's returning

[
UserFlags { bitfield: 0 },
UserFlags { bitfield: 256 },
UserFlags { bitfield: 0 },
UserFlags { bitfield: 65536 },
undefined,
undefined,
undefined,
UserFlags { bitfield: 128 },
UserFlags { bitfield: 64 },
... 41628 more items
]```
pale vessel
#

isn't that just literally filter()?

thick gull
#

.toArray()?

sick cloud
#

yeah but i want to do it without a function

earnest phoenix
#

.toArray is not a function

thick gull
#

oh

earnest phoenix
#
for (let info of userInfoArray) {
// insert code to check if it passes the filter

// on false
userInfoArray.splice(info);
}
thick gull
#

I saw someone saying something about it here eaflier

#

kek

pale vessel
#

arch, not all flags are cached, you have to fetch them using user#fetchFlags() if it's not cached

earnest phoenix
#

hope that's correct

pale vessel
#

probably won't work using map

earnest phoenix
#

gtg attend zoom class

pale vessel
#

you probably need a for loop for promises

sick cloud
#

prob

#

it's a function that returns a promise

#

so

pale vessel
#

welp back to manga

earnest phoenix
#
const users = message.member
const flags = await users.user.fetchFlags()
const userFlags = flags.toArray()

That's returning the user flags but idk how i can do that for every users

thick gull
#

just run it when a user talks or wdym

earnest phoenix
#

hm i really need all users

#

it's a function that returns a promise
@sick cloud try my loop

#

lemme explain it better

sick cloud
#

not really sure if that's what i'm looking for

pale vessel
#

something like js const array = []; for (const user of members.map(x => x.user)) array.push(user.flags ? user.flags : await user.fetchFlags());

sick cloud
#

i have the array of db items and then the object of values which much = true for them to be returned

#

so

pale vessel
#

@earnest phoenix

earnest phoenix
#

hm i'm trying

#
for (let info of userInfoArray; var filteredArray)
// loops on every element of the array
// and also creates a temporary array
{
// check if the info passes the filter
info (smth) 
// on true
filteredArray.push(info);
// on false
// do nothing
}
return filteredArray;
#

@sick cloud

#

filteredArray contains every element of userInfoArray that passed the filter

#

i haven't included the filter in my code above because 1. spoonfeeding and 2. idk what you want the filter to be

#

Cannot read property 'flags' of undefined hm weird

pale vessel
#

show code

earnest phoenix
#
 const members = client.users.cache
    const array = [];
    for (const user of members.map(x => x.user)) array.push(user.flags ? user.flags : await user.fetchFlags());
    console.log(array)

idk if it's good

pale vessel
#

users aren't member

sick cloud
#

lol i did it a totally different way thinking "would this work" and it did

pallid igloo
#

iirc, Mapped values aren't arrays

pale vessel
#

remove .map(x => x.user) and add .array() after users.cache

#

they are

sick cloud
#

👌

pale vessel
#

it's literally Array.prototype.map()

sick cloud
#

@earnest phoenix appreciated anyways, pointed me towards for which helped

pallid igloo
#

Mapped things are objects, You need to convert them into arrays.

pale vessel
#

arrays are objects thank you

sick cloud
#

^

pale vessel
#

use Array.isArray()

sick cloud
#

js is dumb

#

map returns an array

pale vessel
#

but Map() isn't array lul

earnest phoenix
#
 const members = client.users.cache.array()
    const array = [];
    for (const user of members) array.push(user.flags ? user.flags : await user.fetchFlags());
    console.log(array)

No error, but returning anything

thick gull
#

iscomputeron()

pallid igloo
#

but Map() isn't array lul
@pale vessel Yeah, I meant that one.

sick cloud
pale vessel
#

ya

pallid igloo
#

new Map()

sick cloud
#

that's a totally different thing

#

lmao

pale vessel
#

lmao

sick cloud
#

maps are key value data stores, .map on array is different

pallid igloo
pale vessel
#

what are you saying

#

what's your point

pallid igloo
#

nothing.

pale vessel
#

Map and arrays are objects

sick cloud
#

if i do delete object[key] will it delete that part of the object or the entire object

pale vessel
#

the key

#

and the value

#

part of the object i guess

sick cloud
#

like

const obj = { "a": "a", "b": "b" }
delete obj["a"]
// should be => { "b": "b" }
#

right

slender thistle
#

Mhm, should at least

fluid pivot
#

me and 2 other people are making a bot like dyno anyone know how to code websites?

pale vessel
#

yeah

sick cloud
#

ok cool cool

slender thistle
#

Didn't I answer that already

pale vessel
#

attention span of a goldfish

sick cloud
#

nice

#

i got offered $10 to replicate mee6 once 😎

#

dunno why

earnest phoenix
#

$10.. LUL

pallid igloo
#

Making a dashboard isn't trivial. It requires a whole lot of moving parts, including express, templates, oauth2, and having a website.
If that sort of thing is critical for you, check out https://github.com/AnIdiotsGuide/guidebot/tree/dashboard which is a complete working example of a discord.js dashboard integrated inside a bot. Note: It won't work on a sharded bot, but is a good stepping stone for smaller bots.

sick cloud
#

@earnest phoenix ikr

pallid igloo
#

@fluid pivot Read that.

#

did I kill the chat?

sick cloud
#

mayb

fluid pivot
#

ok thanks

pallid igloo
#

Can I sort of like push elements into a {} object?

#

bcs array.push exists

warm marsh
#

Not like that.

pallid igloo
#

so uhh, some sort of json.push?

sick cloud
#

in a way, i guess
you can do obj[key] = value

warm marsh
#

Push exists on arrays not objects.

slender thistle
#

You're creating a key, that's not really pushing

pallid igloo
#

in a way, i guess
you can do obj[key] = value
@sick cloud Uhh, What if I use strict?

sick cloud
#

yeah

#

because objs aren't arrays

#

¯_(ツ)_/¯

cinder patio
#

Well objects aren't indexed

#

Having a push function makes no sense

pallid igloo
#

oh right, I was just asking for an object equivalent for push

pale vessel
#

unless you meant an array of objects then you can just push an object normally

pallid igloo
#

like

object.somefunction("key", "value");
pale vessel
#

that's like the same as setting the key and value isn't it

pallid igloo
#

or does that not exist?

warm marsh
#

The obj[key] = value or using Object.defineProperty

pallid igloo
#

object.defineProperty, Mdn docs. Here I come.

pale vessel
#

but that syntax is identical to Map.set()

vast iron
#

anybody has a spare music bot i can modify ?

cinder patio
#

Well, there is a Map class that stores key-value pairs just like an object

pallid igloo
#

anybody has a spare music bot i can modify ?
@vast iron We aren't sharing source code.

sick cloud
#

maps are just fancy objects change my mind

warm marsh
#

It takes object, key, value, and options.

vast iron
#

oki

pallid igloo
#

maps are just fancy objects change my mind
how?

cinder patio
#

That's true

#

Arrays are also fancy objects

warm marsh
#

He's not wrong.

sick cloud
#

because map.set(key, val) is mostly the same as obj[key] = value

#

lol

warm marsh
#

They're*

sick cloud
#

just fancy

cinder patio
#

But they are optimized differently

pallid igloo
#

Arrays are also fancy objects
@cinder patio Not really. Arrays are a whole other book.

sick cloud
#

of course they are

#

but in practice they're similar

#

everything has its own use

cinder patio
#

Yeah

pallid igloo
#

client.user.setPresence : You sure I have a use?

cinder patio
#

Nah, arrays are objects where the key is an integer

pallid igloo
#

mhm.

#

but they can be useful for taking out random properties from an object.

#

Like an 8ball command or something.

cinder patio
#

Yes. Every data structure has it's use

sick cloud
#

^

pallid igloo
#

Why the F do people need 'use strict'? I know what it is, But it isn't helpful.

sick cloud
#

nice thing about arrays and objects is that they're mostly (though diff names over langs) a uniform data struct on languages

pallid igloo
#

Functions are the one things which have different names EVERYWHERE.

#

In js they are called methods

sick cloud
#

yeah

#

function

warm marsh
#

No.

sick cloud
#

👏

slender thistle
#

Methods are functions attached to objects, are they not?

warm marsh
#

Yes.

sick cloud
#

i hate people that call the constructor of a class a "function"

#

cough quick.db cough

pallid igloo
#

xD

#

iamma go to shitpost, I found some great memes.

earnest phoenix
#

how do you guys host your bot

#
const members = client.users.cache.array()
const array = [];
for (const user of members) array.push(user.flags ? user.flags : await user.fetchFlags());
console.log(array)

No error, but returning anything

Did someone know why?

errant perch
#

how do i set bots status to streaming? discord.js v12.3.1

earnest phoenix
#

client.user.setActivity('with my bot friends!', { url: 'https://twitch.tv/your/stream/here', type: 'STREAMING' });

errant perch
#

thanks

cinder patio
#

Are you sure the code is even executing?

earnest phoenix
#

?

cinder patio
#

If nothing gets logged, then the code probably doesn't run in the first place

sick cloud
#

dumb question but are for loops able to be awaited or something

pale vessel
#

yeah

sick cloud
#

just a simple await or what

pale vessel
#

yeah

sick cloud
#

trying to do an edit function but it's resolving true before it even finishes

pale vessel
#

i'd use a for loop for that

cinder patio
#

for loops are synchronous, the code after them will always execute after the loop is finished

sick cloud
#

for loops

#

i am

#

and ok good

earnest phoenix
#

i dont understand

#

too much information for my brain

delicate shore
#

Ok nice

opal plank
#

should prob learn a programming language then Arch

#

¯_(ツ)_/¯

delicate shore
#
weather.find({ search: args.join(" "), degreeType: "C" }, function(
      error,
      result
    ) {
      if (error) return msg.channel.send(error);
      if (!args[1]) return msg.channel.send("Please specify a location");

      if (result === undefined || result.length === 0)
        return msg.channel.send("**Invalid** location");

      let current = result[0].current;
      let location = result[0].location;

      const weatherinfo = new Discord.MessageEmbed()
        .setDescription(`**${current.skytext}**`)
        .setAuthor(`Weather forecast for ${current.observationpoint}`)
        .setThumbnail(current.imageUrl)
        .setColor(0x111111)
        .addField("Timezone", `UTC${location.timezone}`, true)
        .addField("Degree Type", "Celsius", true)
        .addField("Temperature", `${current.temperature}°`, true)
        .addField("Wind", current.winddisplay, true)
        .addField("Feels like", `${current.feelslike}°`, true)
        .addField("Humidity", `${current.humidity}%`, true);

      msg.channel.send(weatherinfo);
    });```
#

my bot restarts whenever this command is run

opal plank
#

no errors?

#

wrap that onto a try block and see the output @delicate shore

delicate shore
#

no errors?
@opal plank yeh

#

ok

#

lemme see

opal plank
#

needless to say, make sure you putting a catch block capturing any errors

sick cloud
#

my entire json db is 300 lines including it all nice

earnest phoenix
#

should prob learn a programming language then Arch
@opal plank it's not easy to do what i want to do

opal plank
#

how come?

delicate shore
#

needless to say, make sure you putting a catch block capturing any errors
@opal plank should i log err only?

opal plank
#

yeah

delicate shore
#

ok

#

no err

#

Not Erwin, No error

opal plank
#

still restarts?

delicate shore
#

no

#

it is not restarting now

opal plank
delicate shore
#

🧠

opal plank
#

maybe the lib?

delicate shore
#

maybe

opal plank
#

its not usually very good to just ignore this

#

prob good idea to debug it

delicate shore
#

ok

#

idk how to debug ;-;

opal plank
#

use step debugging withtou the try catch

#

use vsc step debugger

delicate shore
#

cries in glitch

opal plank
#

shouldnt be using glitch in the first place

delicate shore
#

glitch also has a debugger option

#

shouldnt be using glitch in the first place
@opal plank i purchased galaxy gate and today i am shifting to it

opal plank
#

i wouldnt know, as glitch AINT A BOT HOSTING PLAT

delicate shore
#

So, as of today--August 19, 2020--we are changing the “Verified Bot Developer” profile badge to the “Early Verified Developer” badge, and will not be granting it to anyone who submits for approval after today. If you have already submitted your application, you will still receive the badge.

analog rampart
opal plank
#

no more badges

delicate shore
#

@opal plank but i applied on 14 july

#

so i will get it

thick gull
#

I can care less about the badge

opal plank
#

fancy pants then

thick gull
#

now I feel less pressure

delicate shore
#

Only if my bot gets approved 🤞

thick gull
#

cause little kids filling the queue which drowns my bot out

#

less pressure without it

delicate shore
#

;-;

opal plank
#

had to delete over 20 guilds with less than 5 members in it

delicate shore
#

why

opal plank
#

cuz they were inactive dead servers

delicate shore
#

ok

opal plank
#

either test servers or something else

delicate shore
#

my bot is in 5 test servers

#

but i don't think it matters

#

out of 614

#

614-5 = 609

#

609

earnest phoenix
#

@earnest phoenix appreciated anyways, pointed me towards for which helped
@sick cloud welcome 🥰

#

I have the badge

#

Will it be changed?

#

Wait so ill keep this badge forever and it cant be gotten anymore?

pale vessel
#

yes

earnest phoenix
#

Pog

pale vessel
#

indeed

pearl jasper
golden condor
#

h

delicate shore
#

h

unreal bluff
#

Yo, Having some issues with discord embeds on messages. Generating a image to be shown. Works fine when attaching to a message without an embed.

var attachment = await new MessageAttachment(image, "whatever.PNG");

What should I do to get an embed image to work with this? or image even!~

glass steeple
#
            await message.add_reaction("✅")```

i've defined to give reactions till the role.members is 20, but it's exceeding and giving upto 23
slender thistle
#

Are you sure len(Role3.members) is actually over 20?

unreal bluff
#

await only pauses for a return on the function/value you're setting @glass steeple
example. you should use return; to just get out the process or another method.

#
if (len(set(message.mentions))>= 4 && len(Role3.members) < 20) return;
#

I am not 100% sure if you want to halt them after on that if but just looked like you wanted to.

slender thistle
#

????

unreal bluff
#

oh he wasn't on javascript probably nevermind.

slender thistle
#

But how does add_reaction look anywhere close to a return

unreal bluff
#

and is php and other languages for if statements.

#

Did javascript ever pickup those words?

#

he said ~i've defined to give reactions till the role.members is 20, but it's exceeding and giving upto 23~

glass steeple
#

@slender thistle yes I've checked

#

it goes upto 23

unreal bluff
#

I was assuming he wanted that if statement to stop after but i didn't edit anything. Valid point. Shouldn't have added any cents to it.

glass steeple
#

it's py

#

What i am doing is , on every reaction I've set to give role

#

so, it should stop as soon as there are 20 members in that role

#

but it's exceeding that

#

and giving 23 roles

unreal blaze
#

Discord Bot Developer badge no longer granted?

#

I heared something like that

slender thistle
#

#news

small zenith
#

how can i fetch server details with its invite link? D.js v12

clever vector
#

Can i add custom emoji to footer?

golden condor
#

Yes....

earnest phoenix
#

@small zenith what do you mean

vale garden
#

hi

#

i have no js problem

#

but i have a problem in java

#

lol

earnest phoenix
#

Wdym

#

LOl

vale garden
#

i have an assignment to give today

#

plz help me

#

lol

#

plz

earnest phoenix
#

Shiw logs

#

Show ogs

#

Show logs

vale garden
#
import java.util.Scanner;

public class Pro
{
    public static void main ()
    {
     Scanner sc = new Scanner(System.in);
     String name, address;
     char type;
     int amount,d;
     System.out.println("Enter your name.");
     name = sc.next();
     System.out.println("Enter your address.");
     address = sc.next();
     System.out.println("Enter the type of your purchase.");
     type = sc.next().charAt(0);
     System.out.println("Enter the amount for which you purchased the product.");
     amount = sc.nextInt();
     switch(type)
     {
         case 'L': d = (amount <= 25000) ? 0/100 : (amount > 25000 && amount <= 57000) ? 5/100 : (amount > 57000 && amount <= 100000) ? 75/1000 : (amount > 100000) ? 10/100 : 43243;
         break;
         case 'D': d = (amount <= 25000) ? 5/100 : (amount > 25000 && amount <= 57000) ? 75/1000 : (amount > 57000 && amount <= 100000) ? 10/100 : (amount > 100000) ? 15/100 : 43243;
         break;
         default: System.out.println("You have entered an invalid purchase type!");                      
        }
        int total = (amount) - (amount * d);
     System.out.println("Name: " + name + "/nTotal Price: " + total);

}
}
#

just see this

earnest phoenix
#

Logs not code

#

I siad lohs

#

Logd

vale garden
#

it says d isnt initialized

earnest phoenix
#

Logs

#

Ir is probably

#

Cuz d dont have any value

#

Thats why

vale garden
#

but

#

no the value is given from the ternary operator

#
switch(type)
     {
         case 'L': d = (amount <= 25000) ? 0/100 : (amount > 25000 && amount <= 57000) ? 5/100 : (amount > 57000 && amount <= 100000) ? 75/1000 : (amount > 100000) ? 10/100 : 43243;
         break;
         case 'D': d = (amount <= 25000) ? 5/100 : (amount > 25000 && amount <= 57000) ? 75/1000 : (amount > 57000 && amount <= 100000) ? 10/100 : (amount > 100000) ? 15/100 : 43243;
         break;
         default: System.out.println("You have entered an invalid purchase type!");                      
        }```
#

helppppppp

earnest phoenix
#

Try to definr d as 0

vale garden
#

kk

#

bruhhhhhhhhh

#

didnt work

earnest phoenix
#

Logs

#

Plz

vale garden
#

still says: variable d might not have been initialized

earnest phoenix
#

Show log

#

Full log

vale garden
#

bruh im on bluej

#

how do i

#

lol

earnest phoenix
#

Wtf is bluej

#

I see why lmao

vale garden
#

why

green kestrel
#

So, ive heard that from yesterday night, discord are no longer giving out the bot developer badge to anyone that gets verified. those that have it will keep it (its going to be subtly renamed to Early Verified Developer) and verification will still exist, just no badge. Tbh, i think its a great idea because there were far too many people trying to game the system to get their bots to 75 servers just for a badge. What do you all think?

earnest phoenix
#

True

#

I am one of them but i also want 2 make a bot

thick gull
#

I think they shouldn't have started with the low requirements for the badhe

#

keep verification low

earnest phoenix
#

@vale garden tell me when you see it

thick gull
#

but badge high

#

like couple hundred servers at minimum for the bot

#

that way it's not people who made a bot and spammed servers

#

it'll take more effort for the spammer ywah

#

but it'll reduce the amount ofnpeople

stoic gate
#

Hey is there a way to react with custom emotes across shards? Currently my bot can only react with a custom emote that it has on that shard.

earnest phoenix
#

Yes..

stoic gate
#

How do you do it?

#

I'm having a lot of trouble

royal ore
#

help pls

#

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

honest perch
#

@rugged terrace depends what database youre using

royal ore
#

help me someone

thick gull
#

@royal ore you have multiple message listeners

#

read the error

rugged terrace
#

Hey guys what's the best nodejs database library for a bot with around 2k servers

honest perch
#

@rugged terrace depends what database youre using

royal ore
#

yes so what should i do?

thick gull
#

"11 message listeners"

#

combine them?

royal ore
#

how?

thick gull
#

did you separate them for each command or

rugged terrace
#

I'm rewriting the bot so I'm open to any options really for basic user points etc

royal ore
#

umm i didnt get u

honest perch
#

@rugged terrace it depends on preference then, sql, no sql

#

personally i use mongodb

rugged terrace
#

What's the key difference? I used enmap but I had data corruption issues

brave sapphire
#

does someone know how to create a server invite with a discord.js bot?

rugged terrace
#

Which is sqlite

honest perch
rugged terrace
#

Thanks I'll have a reas

#

Read

green kestrel
#

personally i'd look at mongo, redis, mysql and postgres.

honest perch
#

^

#

they are some of the most popular

green kestrel
#

mongo, redis and *sql do different things

royal ore
#

(node:12536) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
@royal ore help pls

restive furnace
#

redis is in memory-db, so its best at caching

green kestrel
#

when youre getting to 2000 servers, tbh i'd skip sqlite entirely. its locking scemantics dont scale well for stuff like that imho

rugged terrace
#

Yea I had data corruption issues with enmap with uses sqlite3

green kestrel
#

i think a lot pick sqlite because it has a really nice interface in node.js

rugged terrace
#

Yea I used enmap and it's dead easy

green kestrel
#

im used to old-school sql, issuing actual queries not representing queries as fluent objects

#

i think im a dying breed lol

honest perch
#

if youre going to use mongo i suggest mongoose for the lib as its also very easy, from what ive seen sql isnt too hard either

umbral pollen
#
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false
       
-----> Installing binaries
       engines.node (package.json):  12.x
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 12.x...
       Downloading and installing node 12.18.3...
       Using default npm version: 6.14.6
       
-----> Installing dependencies
       Installing node modules
       npm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
       npm ERR! 
       npm ERR! 
       npm ERR! Missing: discord-modmail@^0.0.1
       npm ERR! 
       
       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.72Ugs/_logs/2020-08-20T08_33_05_693Z-debug.log
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       If you're stuck, please submit a ticket so we can help:
       https://help.heroku.com/
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed```
rugged terrace
#

Aight thanks

umbral pollen
#

How to fix it

green kestrel
#

mongo and sql are for different problems

#

mongo is like... imagine you wanted to store a million identical objects, e.g. user records, or channel records... but you dont care too much about the relation between them, you use an object ("document") db like mongo

#

*sql is like, imagine you have tons of spreadsheet-like tables, and you want to run a query that automagically joins them together... then you use sql

rugged terrace
#

My bot @delicate pendant basically has to store two things, user info some strings and numbers alongside bets like this {"20190302": {"02828372":"PHX|20|200"}

green kestrel
#

from what i understand things like mongo dont really have a concept of foreign key relations between tables, you have to make that sort of thing yourself in your middleware

rugged terrace
#

Sorry what do you mean by relations?

green kestrel
#

for a small number of 'bets' mongo might suffice

#

so... in discord terms, a user is related to a membership, which is related to a guild

rugged terrace
#

Around 5k users actually are registered

green kestrel
#

and one or more channels is related to a guild

rugged terrace
#

Ah ok

#

Well I don't care about that really

#

It's all global not server specific

green kestrel
#

you might if you get bigger still

#

depends how quick mongo can search the list for a specifically keyed item (fast?)

opal plank
#

ive havent any problems with postgres thus far

#

that includes query times

earnest phoenix
#

@umbral pollen just install the npm

umbral pollen
#

which one ??

green kestrel
#

ive never used postgres, just been a mysql user out of popularity of the software

umbral pollen
#

and how ??

earnest phoenix
#

npm install discord-modmail

green kestrel
#

i assume mongo etc support clustering like sql servers do?

rugged terrace
#

Ok I'll look at testing, mongoose, postgres and a sql variant

green kestrel
#

(i know redis does)

thick gull
#

yeah

#

I think so

rugged terrace
#

And redis too

earnest phoenix
#

once you go postgres you never go back

opal plank
#

those were per minute iterations

green kestrel
#

imho redis is "mongo for smaller objects"

#

it can hold larger "documents" but isnt designed to

opal plank
#

i got to a point where i was getting speeds as fast as 570 db calls per mintue

rugged terrace
#

Yea I'm expecting up to 10k servers once the bot gets a lot bettee

opal plank
#

was holding just fine

rugged terrace
#

Maybe 5k

opal plank
#

800K active users was my rig's limit

#

though postgres itself was keeping up

green kestrel
#

hmm, i think i can tell you that figure, bearing in mind my db server has a lot running off it

rugged terrace
#

Anyways thanks for the help guys

wanton anvil
#

what is shards

green kestrel
#

Questions since startup: 7,660,978 Documentation
ø per hour: 164,638
ø per minute: 2,744
ø per second: 46

#

this db server hosts about 6 websites and two bots each with ~2000 servers

#

^^ from phpmyadmin

opal plank
#

i was stress testing the other day

#

800K users talking at the same time

earnest phoenix
#

yo\

opal plank
#

running 2 calls on every message

green kestrel
#

nice

earnest phoenix
#

how many guilds

opal plank
#

it managed to keep up to 810K

green kestrel
#

i do many sql queries on each message

opal plank
#

thats not discord

#

thats twitch

green kestrel
#

like tens

#

ah, twitch bots use irc dont they

high bough
#
Error: Failed to lookup view "/home/kayuimineko/Cecyl/dashboard/templates/index.ejs" in views directory "/home/kayuimineko/Cecyl/views"
    at Function.render (/home/kayuimineko/Cecyl/node_modules/express/lib/application.js:580:17)
    at ServerResponse.render (/home/kayuimineko/Cecyl/node_modules/express/lib/response.js:1012:7)
    at renderTemplate (/home/kayuimineko/Cecyl/views/dashboard/dashboard.js:85:9)
    at /home/kayuimineko/Cecyl/views/dashboard/dashboard.js:141:5
    at Layer.handle [as handle_request] (/home/kayuimineko/Cecyl/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/kayuimineko/Cecyl/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/kayuimineko/Cecyl/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/kayuimineko/Cecyl/node_modules/express/lib/router/layer.js:95:5)
    at /home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:335:12)
    at next (/home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:275:10)
    at urlencodedParser (/home/kayuimineko/Cecyl/node_modules/body-parser/lib/types/urlencoded.js:91:7)
    at Layer.handle [as handle_request] (/home/kayuimineko/Cecyl/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:317:13)
    at /home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/kayuimineko/Cecyl/node_modules/express/lib/router/index.js:335:12)

Help?

green kestrel
#

just very butchered irc

opal plank
#

they do

#

yeah twitch's IRC is a bit wanky

#

youtube aint much better either when it comes to sending messages

green kestrel
#

one day i'll have a go at it, irc was my thing for a very long time

opal plank
#

its okay

distant goblet
#

.

opal plank
#

nothing good

#

but not to bad either

green kestrel
#

both my bots were originally irc bots 😄

opal plank
#

thus far what i got is kiwi, youtube, twitch and discord when it comes to irc

#

though

#

i dont think youtube is techncially considered irc

#

their stream bit is similar though

green kestrel
#

for youtube streamed chats?

high bough
#

I was trying out express to make a web dashboard and this error came up

opal plank
#

yeah

green kestrel
#

i havent even looked at how theirs works

opal plank
#

its a bit janky

#

there arent any libs so im having to do the work by myself

green kestrel
#

is it irc with a websocket protocol? like inspircd m_websocket?

opal plank
#

lemme grab the docs

#

it explains better than i do

#

my side is just auth and parse from there

green kestrel
#

hmm, its simple REST with OAUTH2

#

i dont see any irc there at least from the public api perspective

stoic gate
#

Does anyone happen to know how to react with custom emotes across shards?

opal plank
#

thats why i said, its not techncially irc

open acorn
#

guys

#

there is an new exploit on discord

green kestrel
#

oh noes

open acorn
#

do u know how it works

vale garden
#

@vale garden tell me when you see it
@earnest phoenix see what

opal plank
vale garden
#

aaaaaaaaaaaaa i need help

#

plz

#

help

#

e

#

me

opal plank
#

@open acorn report it there

#

actually

#

no

green kestrel
#

what new exploit is this @open acorn

opal plank
#

testers

vale garden
#
switch(type)
     {
         case 'L': int d = (amount <= 25000) ? 0 : (amount > 25000 && amount <= 57000) ? 5/100 : (amount > 57000 && amount <= 100000) ? 75/1000 : (amount > 100000) ? 10/100 : 43243;
         break;
         case 'D': int d = (amount <= 25000) ? 5/100 : (amount > 25000 && amount <= 57000) ? 75/1000 : (amount > 57000 && amount <= 100000) ? 10/100 : (amount > 100000) ? 15/100 : 43243;
         break;
         default: System.out.println("You have entered an invalid purchase type!");                      
        }
green kestrel
#

is it publically known?

open acorn
#

i think it works through embeds

#

nop

vale garden
#

i messed up something here

#

plz

#

help

#

me

green kestrel
#

then keep schtum and report it 🙂

open acorn
#

i dont know it

vale garden
#

the int d isnt getting initialized properly

#

jelp

#

helppp

#

plzlzlzl

opal plank
#

spamming wont get you anywhere mate

vale garden
#

then what will

#

lol

#

help

#

plz

green kestrel
#

what the actual..... start by taking out all those horrid ? : single line if's

earnest phoenix
#

@vale garden bro its literally easy, you just have to think logic

opal plank
#

yeah that chaning is horrid

green kestrel
#

trying to figure out order of exection for them when you chain them together like that is like drinking hydrochloric acid.

vale garden
#

dude plz just tell me

#

cuz

#

i dont have time

opal plank
#

chill bro

vale garden
#

i need to submit this in like 5 mins

#

lmao

#

its an assignment

#

plzz

green kestrel
#

submit it to where

open acorn
#

i think the exploit works with embeds, as the discord server loads links meta as an embed

green kestrel
#

we arent your homework helpers 😛

open acorn
#
#

there

vale garden
#

lmao

#

bruh

earnest phoenix
#

Whats that good for, you not gonna learn anything from me spoon feeding you @vale garden

opal plank
#

you need to decalre d beforehand

green kestrel
#

did your tutor give you that code? its awful tbh

#

im thinking awful on purpose.

opal plank
#

declare d without value before the switch

cinder patio
#

Isn't each case it's own scope? You initialize d only in the case scopes.

int d;

switch(...) {
... d = ...
}
earnest phoenix
opal plank
#

nope

#

cases dont have scopes

#

you need to add {} if you want to scope them

#

the switch is a scope though

earnest phoenix
green kestrel
#

hes scoped the whole switch {}

earnest phoenix
#

That wont matter

#

LMAO

opal plank
#

yeah, though the question was

Isn't each case it's own scope?

#

cases dont have scopes unless you specify

green kestrel
#

well, that is assuming this is typescript or js or something

opal plank
#

its js

green kestrel
#

its java, right?

opal plank
#

though i use typescript

earnest phoenix
#

@vale garden i will give you two solutions to this

vivid wadi
#

I need help

green kestrel
#

System.out.println?

opal plank
#

good question

solid gull
#

oh

opal plank
#

system.print is usable in js too i think

#

actually

#

no, my bad

vivid wadi
#

could i make a kick command for my discord bot on visual studio code?

opal plank
#

erm

#

actually

cinder patio
#

you can

vivid wadi
#

cuz i find no vids on youtube explaining that

opal plank
#

wot?

#

code is code

#

vsc is an editor

vivid wadi
#

oh

cinder patio
#

you will have to write it yourself then

earnest phoenix
#

LoL

vivid wadi
#

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOh

opal plank
small zenith
#

@earnest phoenix I want to get server id and name from its invite link ( dis cord.gg/XD )

earnest phoenix
#

stop spam

vivid wadi
#

i started yesterday so could some people give me an example

earnest phoenix
#

@vivid wadi u sure in yt has no tutorial for kick command ???

#
  1. null check it and do something if condition is true
  2. instead of initiating a int that is null by default, make it 0 by default
    @vale garden
vivid wadi
#

YES

opal plank
#

do you know Javscript or some other langauge?

earnest phoenix
#

^^^

small zenith
#

and im using discord.js v12

vivid wadi