#development

1 messages · Page 1702 of 1

opal plank
#

its basically a map

violet haven
#

i don't understand the ref thing

opal plank
#

probably got a reference

violet haven
#

how do i access?

opal plank
#

do <Collection>.get('🟢')

#

or

#

if thats ur first

#

<Collection>.first()

#

i think d.js implements first()

lament rock
#

It does

opal plank
#

then perfect

violet haven
#

first? the first part of the map?

opal plank
#

not part of Map

#

but part of Collection

violet haven
#

it's like the first react?

lament rock
#

Collection<K, V>.first(): V

opal plank
#

should, yes

lament rock
#

gets the first entry in the Collection

#

in this case 🟢

violet haven
#

@opal plank @lament rock thx it works well

empty pond
#

How to do that if someone votes my bot i would get a message in a channel

opal plank
empty pond
#

what is package for that

#

means what to write npm i ?

lament rock
#

If you present a toast for someone to vote for your bot, you would have to store a user ID and a message ID and a channel ID in memory or in a database which can be accessed at a later time and get the channel by ID and get the message by ID

feral aspen
#

Hi.

#

In the value argument, can I make a loop inside it? 👀

lament rock
#

loop to do what

feral aspen
#

Loop through an object.

crimson vapor
#

hi @opal plank

lament rock
#

depends what you want to do with the Object. You can use methods on ArrayLike which return an acceptable value for MessageEmbed.addField value like Array.map or Array.reduce which iterate over the Array and return a value

#

Object.values(obj).map

feral aspen
#

Oh, forgot about that!

#

Thanks.

drifting wedge
#

how do i import a file from a folder above?

#
add.py
-> calculator.py```
#

and i want to import function from add.py

slender thistle
pale vessel
#

shouldn't it be a package?

slender thistle
#

Package as in?

#

Don't see how that applies here

pale vessel
#

hmm ok

opal plank
lament rock
#

btw @opal plank, can you link me detritus gh? Need to rewrite a bot

#

Heap too chomk

onyx hare
#

im testing this cooldown, i have this it kinda works for one person just doesn't trigger like it should after the message is sent the first time that sends with it then ill try n figure out how to convert it to be a guild cooldown

    if (message !== null && timeout - (Date.now() - message) > 0) {
        let time = ms(timeout - (Date.now() - message));
         message.channel.send(":x: There Already Was An Explosion. " + `Try Again In**${time.minutes} Minutes**`);  
    }
#

my english broke in that sentence

lament rock
#

PogYou. Gracias

opal plank
#

No problemo manito

steep drum
lament rock
#

I know instanceof Message can be coerced to a string which can be coerced to a number, but I don't think JS takes that route ever unless explicitly written.

#

Not the answer tho xd

drifting wedge
#

attempted relative import beyond top-level package

#

@slender thistle

zenith terrace
#

Erwin probably has all the detritus links open on chrome or something waiting for someone to ask about it

steep drum
#

I thought Erwin was a bot made in detritus?

pale vessel
#

selfbot?

lament rock
#

Possibly. Natural language isn't impossible

steep drum
#

It's a vicious cycle

slender thistle
#

Interesting

drifting wedge
#

from ....client.userprofile import createUser

#

more exact but same idea

pale vessel
#

does it have an init file

drifting wedge
#

no but its not a package?

slender thistle
#

It doesn't need to be, technically

#

sec

drifting wedge
#

its just a file with a single function?

pale vessel
#

really?

#

i read that it needed to be a package

onyx hare
pale vessel
#

hence why i asked

drifting wedge
#

yeah but its a file

#

not a package

#

so thats my issue

#

i alwats struggle with importing functions

#

from other files

slender thistle
#

Sec

fervent goblet
#

How do i get the permissions set for a specific role in a channel? discord.js

fervent goblet
#

i have only found the final permissions but i need to get the permissions for only that role

#

even if its unset

steep drum
slender thistle
#

or well

steep drum
#

You shouldn't subtract 2 different types of objects just because

lament rock
#

GuildChannel.permissionOverrides: Collection<string, PermissionOverwrites>

you can get the PermissionOverwrites by ID since it's keyed by either member IDs or Role IDs

earnest phoenix
#

How to make a dj only Command

lament rock
#

check if a member has a role

unreal estuary
#

has anyone used discordphp here

slender thistle
#

@drifting wedge

# cogs/fun.py
from bot import TestCog

print(TestCog)
# main.py
class TestCog:
    pass
#

Works

#

Don't ask me how or why, but it does

drifting wedge
#

wait wtf

#

i treat class as a func/

#

???

#

i need params...

slender thistle
#

wdym class as a func

drifting wedge
#

idk

slender thistle
#

that's just my example

drifting wedge
#

so the class

#

testcog.functiom()?

slender thistle
#

seems so

drifting wedge
#

ty

slender thistle
#
# cogs/fun.py
from bot import test

test()
#
# main.py
def test():
    print("w")
#

so yeah

#

you get the gist

unreal estuary
#

has anyone used discord php

drifting wedge
#

wait wot

#

dont u need the class?

pale vessel
slender thistle
#

Which class?

#

I'm rather curious what you're trying to do

unreal estuary
#

how do i send a message im gonna cry

#

with discord php

drifting wedge
#

lemme explain exactly

#

so basically

#

i have a user profile data structure

#

for user data

pale vessel
#

if you only need to send a message, why not use curl?

drifting wedge
#

but if i edit it, i dont want to edit it in all the cogs

unreal estuary
drifting wedge
#

so i have the cogs import this one function that has the user profile]

#

so o i only edit it there

unreal estuary
#

i sound rlly dumb

slender thistle
#

Sounds interesting. Does the function cache anything, or like... how does it work?

#

And, also, does it work?

#

That question bothers me more than anything rn since my head hurts

drifting wedge
#

it does

#

but i need to import it in the cogs

#
async def createUser(id):
    user_info = {
        "_id": id,

        "account_info": {
            "premium": False,
            "bought": None,
            "ends": None,
        },

        "quests": {
            "level":0,
            "xp":0,
            "active_quest_ids":None,
            "quest_timer":None
        },

        "currency": 
            {
                "on_message_multiplier": 1,
                "bank_limit": 2500,
                "bank": 0,
                "type" : "multiplayer",
                "coins" : 0,
                "tokens" : 0,
                "tickets": 0,
                "pets": None
            },
        "lootboxes": None,
        "levels": {
            "level":None,
            "xp":None,
        },

        "pet": {
            "alive": True,
            "name": None,
            "training": {
                "level":None,
                "xp":None
            },
            "age":None,
            "id":None
        },
        
        "profile": {
            "bio":"No Bio Set",
            "title":None,
            "badges_active":None,
            "badges_owned":None,
        },

        "guilds": {
            "in_guild":None,
            "guildname":None,
        },

        "daily_rewards": {
            "day":1,
            "date":None,
        },

        "daily_quests": {
            "level": None,
            "xp": None,
            "current_quests": {
                "today_quests": None,
                "today_quests_complete": None,
            }
        },

        }

    collection.insert_one(user_info)```
#

sorry for spam

slender thistle
#

That's the function that you want to import?

drifting wedge
#

yes

modest maple
#

why...

slender thistle
#

camel case in Python reeee

modest maple
#

why is that async

#

and why is that hardcoded

#

and why is that even in a function scope

drifting wedge
#

because its in a discord bot

#

and i dont want to make it wait

#

?

modest maple
#

and that changes what exacly?

#

thats not how async works

pale vessel
modest maple
#

just because it's a coroutine function doesnt mean it wont block

slender thistle
#

It doesn't magically become asynchronous anyways so the async is redundant

modest maple
#

it just means if it wants to yield to a future it can

#

hence why time.sleep in a coroutine still blocks mmLol

drifting wedge
#

it gets called in another async func

slender thistle
#

That doesn't matter really

drifting wedge
#

:p

slender thistle
#

It's still just redundant mmLol

drifting wedge
#

alr

#

but when how do i make it not blocking?

#

or would it already not be>

slender thistle
#

The execution time with pymongo isn't noticeable so I wouldn't worry about that

drifting wedge
#

ehh i mean i want to make it as fast as possible

earnest phoenix
#

It's always a good idea to switch to async driver in this case nonetheless

#

Making something async doesn't necessarily mean making it faster

drifting wedge
#

so i was right>

#

see im a good programmer man

#

oh 😦

slender thistle
#

Motor is deprecated, isn't it?

earnest phoenix
#

I'm not saying that, your async def is superfluous no matter what

modest maple
earnest phoenix
#

No clue, haven't used mongo actually

slender thistle
#

Haven't seen it updated a few months ago when I looked at it

#

Oh, 4 days ago last commit

modest maple
#

doesnt look deprecated to me

#

they deprecated py 2

#

if thats what you mean

slender thistle
#

Yeah I'm not sure what the fuck made me think it's deprecated

drifting wedge
#

pymongo works fine?

slender thistle
#

Could probably go with Motor

#

since that seems to be async

drifting wedge
#

ill make a note of it

#

not intrested in switching now though

crimson vapor
drifting wedge
#

wait maybe...

#

what do i need for it?

slender thistle
#

a?

drifting wedge
#

wait so shiv, what do i need to do for the importing of the function again?

slender thistle
#

Is it a method or a file-level function?

drifting wedge
#

uhhh....

#

its a function

#

😆

slender thistle
#

Then yeah, from cog import createUser I guess

drifting wedge
#

yeah thw issue is the relative import beyond top-level package

#

@slender thistle

#

attempted relative import beyond top-level package

#

sorry for the ping lmfao

#

and thanks for the help huggies

slender thistle
#

import cog; cog.createUser

drifting wedge
#

oh ok

#

and i want to make it a class?

slender thistle
#

wdym a class

drifting wedge
#

in the function file

#

because its not an actual cog

#

its jsut a file

slender thistle
#

Can you show what the file looks like?

drifting wedge
#

fullhttps://paste.pythondiscord.com/jovexiyoje.py

#

full file ^

slender thistle
#

Why is it in a class? k3llyhmm

#

You could just have it as a function in a file

drifting wedge
#

YOU TOLD ME TO

slender thistle
#

errr

drifting wedge
#

ok removed class

#

rest it good?

#

?

slender thistle
#

Ya no need for the class

#

Try it mmLol

drifting wedge
#

well i cant lmfao

#

im on mac cuz travelling

#

and it cant run discord bots lol

#

so im just winging it all lmfao

slender thistle
#

Oh dear

#

repl time mmLol

drifting wedge
#

lol

#

might vps it

#

but idk

#

ill be travelling for lie 4 months lmfao

#

when i get back

slender thistle
#

wew

drifting wedge
#

oh dear lol

#

bugfixing time

slender thistle
#

I mean, it should be good

drifting wedge
#

me telling my team we need to rewrite some stuff

current code: if 'false' == funtoggled:

slender thistle
#

lmfao

fervent goblet
#

how do i check if a bitfield contains SEND_MESSAGES ?

slender thistle
#

The bit is 0x800

earnest phoenix
drifting wedge
#

@slender thistle i know im hella annoying but last one: attempted relative import beyond top-level package

#

from ...userprofile import createUser

fervent goblet
#

I am trying to specifically check if the @ everyone role is allowed to send messages or is neutral

#

in a channel

slender thistle
#

import userprofile

fervent goblet
#

discord.js

drifting wedge
#

no worky

#

package not found

#

its not a package imdumb

earnest phoenix
fervent goblet
#

permissionsFor adds all the overwrites

#

i need it before

earnest phoenix
#

wut

fervent goblet
#

so permissionsFor accounts for every other overwrite

#

like other roles

earnest phoenix
#

<GuildChannel>.permissionsFor() gets the overwrite for that specific user or role and checks if it has those permissions

#

Not every other overwrite

inland lake
#

how can I check when my bot is going to be looked at?

quartz kindle
#

you cant

slender thistle
earnest phoenix
#

Shivaco i don't about shards and what is sharding.Can you explain me?

drifting wedge
#

well its fine ig

#

because i can just set it up for vps

#

but like i would like to make it relative

#

but if its for absolute then i got it

#

but i really dont want to

winged linden
drifting wedge
#

ooooh shiv i have an idea

#

rememebrt that api i (you) made?

#

with aiohtt?

#

i can do it via there

slender thistle
#

As in?

drifting wedge
#

make a route for it that makes the user profie

slender thistle
#

ehhh

earnest phoenix
drifting wedge
#

no fucking with functions / path required

#

but it would be like 5-10 requests / sec

#

so idk if itll survive

#

i could do it in my flask server then?

#

its supposed to be beffier

#

beefier

slender thistle
#

Absolute imports are reasonable here imo

drifting wedge
#

maybe

#

but it would be for vps only

#

because i dont even know how to fucking open my files on mac

slender thistle
#
import sys, os

sys.path.insert(0, os.path.dirname(".."))

import main

print(main.mystr)
#

This is so dumb

#

yet it works

earnest phoenix
#

@earnest phoenix
Sharding is a method to split portions of bots into separate processes. This is an enforced strategy by Discord once a bot reaches a certain number of guilds (2500). Once this number is reached, a bot must be sharded in a way that only 2500 guilds maximum may be allocated per shard.

slender thistle
#

You could go with websockets for this if you were to have a local API doing it for you

drifting wedge
#

alr ty shiv

slender thistle
#

But yeah

#

Python imports are fun

earnest phoenix
slender thistle
#

Then you can't log into the bot account

earnest phoenix
#

Oj

#

Oh*

earnest phoenix
#

Oh

#

So you would receive an error from discord's gateway

#

Can i shard now? Actually it's in 74 guilds as of now

slender thistle
#

You always can

earnest phoenix
#

Oh

#

Ok

#

You can shard whenever you want

slender thistle
#

It's just pointless until a certain point

earnest phoenix
#

Oh

#

Thanks to both of you shivaco and voltrex for the info ❤️

#

But it is recommended to shard after 2.5k guilds, since the bot has to handle more than a single process, and also your bot is already sharded by default mmLol

drifting wedge
#

how do i import it?

#

thats the issue

earnest phoenix
#

Every bot runs on at least one shard called shard 0

slender thistle
#

Well...

earnest phoenix
#

Oh

slender thistle
#

What's your file structure?

drifting wedge
#

oh its a mess

slender thistle
#

... so long as it's readable

drifting wedge
#

it is i just dont know how ur thingy works

pallid garden
#

How i make a bot in tt gg website

slender thistle
#

It adds the level above the file to sys.path and then imports the file

#

hence the ..

pallid garden
#

?

drifting wedge
#

WAT MY BRAIN IS MELTING

slender thistle
pallid garden
#

Oh i using android

#

Dont have pc

drifting wedge
#

wtf is going on

#

MY BRAIINNN

slender thistle
pallid garden
#

Its free make one?

slender thistle
#

After all that is done, only then should you submit it on top.gg

#

It's free to make one unless you somehow end up using services that force you to pay for it

pallid garden
#

Hate paying lol

slender thistle
pallid garden
#

I like make bot free

slender thistle
#
    @commands.command()
    async def say(self, ctx, *, msg):
        """Make the bot say something."""
        await ctx.send(
            msg.replace("@everyone", "@\u200beveryone").replace("@here", "@\u200bhere"))  # NO @EVERYONE PINGS FOR YA.

I struggle to see my own code from 2019

pallid garden
#

👀

pallid garden
#

?

slender thistle
#

I highly doubt Poketwo is written in Python

pallid garden
#

Poketwo have lots views

#

Also copyright

#

Not from nintendo though

drifting wedge
pallid garden
#

Because nintendo hate Copyright fan

slender thistle
#
** member is sent when the command is invoked in a guild, and user is sent when invoked in a DM

... This is fun

drifting wedge
#

shiv the absolute approach wont work

pallid garden
drifting wedge
#

not for me on mac

#

:p

slender thistle
#

...?????

drifting wedge
#

so either: webserver or try to import it

#

im not good with mac, its too weird

pallid garden
slender thistle
#

Can you print what os.path.dirname("..") returns?

drifting wedge
#

i cant deal with figuring this out rn baby_sad

#

my brain is melting

slender thistle
#

Take a break, yeah

pallid garden
#

Gotta be carefull random people make illegal bot.

slender thistle
pallid garden
#

Yeah tsk tsk

#

People do make legal bot as long is legal

cosmic forum
#

Anyone know how I can connect via ssh on Visual Studio Code using an ssh key file? (ssh_key.key)

pallid garden
#

Question what prefix means

drifting wedge
#

immma take a break because im fucking dying rn

#

but the sys thing wont work

#

but ill try something else

#

bye

#

i will sleep

#

and not melt my brain

slender thistle
#

Have a good nap

drifting wedge
#

ah fuck im still in school

#

AHHHH

#

typo

#

ok bye

slender thistle
#

Oof

pallid garden
#

School you should do school work not on discord tsk tsk children these days.

drifting wedge
#

go learn how to code or whatever

pallid garden
#

?

#

@slender thistle what his problem?

slender thistle
#

Give him a break, he's tired

pallid garden
#

Probably he grumpty yeah.

drifting wedge
#

yeah sorry if i was rude

#

cya

pallid garden
#

@slender thistle should i make random ID?

slender thistle
#

ID?

pallid garden
#

Yeah in add new bot

slender thistle
#

Well, yeah, you do need a bot account

pallid garden
#

I make randomly?

slender thistle
#

IDs are generated randomly by Discord

pallid garden
#

Oh

#

Gonna make a legal.bot no illegal bot lol

#

Do i have a github?

cinder patio
#

you should be able to answer that question

pallid garden
#

@cinder patio remember that show cockaroach say good good

drifting wedge
#

@pallid garden what language do you want to make it in?

pallid garden
#

What???

steep drum
#

you're not ready to make a bot, learn a programming language first

drifting wedge
#

eh

#

i learnt how to make a bot before learning a lang lol

#

prob why im not such a good programmer lmfao

lyric mountain
#

it's like cooking for the first time without watching videos

#

some people can make a nice steak on the first try

steep drum
#

wait, how did you program a bot before learning a programming language?

lyric mountain
#

but some people will set the kitchen on fire

boreal iron
lyric mountain
solemn latch
pallid garden
#

@solemn latch i wanna make a bot for pokemon

solemn latch
#

its generally much much faster to start by learning first. but some people decide to go the long route because it seems faster.

#

pokemons a fun one

pallid garden
#

Yes

#

Only legal bot not illegal

solemn latch
#

luckily a lot of the datasets you need are readily available through various wiki's

lyric mountain
#

you need to learn how to handle APIs and databases

pallid garden
#

I saw one in website for pokemon shield and sword genned hex code

#

Tsk tsk

#

In top gg

lyric mountain
#

what?

pallid garden
#

Yeah

#

I stay away from it

lyric mountain
#

no, like, what did you say?

pallid garden
#

Its a copyright

lyric mountain
#

don't think anyone will bother to sue a minor discord bot

#

not even pokecord got sued

pallid garden
#

So the bot will dm you link trade in pokemon shield and sword game

#

I try it once i kick bot out

#

I did release it in the wild

solemn latch
#

sounds interesting.

pallid garden
#

Yeah that illegal to make

#

Funny how bot trade you a pokemon in shield and sword game

lyric mountain
#

not sure what you're talking about but I'd say it's not illegal at all unless it was some kind of hack or something

pallid garden
#

Yeah hack

#

They use a code make discord bot from it

#

Its call miku bot

#

I saw one

#

I recommend stay way from it

lyric mountain
#

no don't think it's illegal

#

since there are official sites mentioning such codes

#

guess you're confusing stuff but whatever

solemn latch
#

I actually wonder how DMCA works with API's like that.
If I use an API, which doesn't have the license to use images, and I use that API, can I realistically be dmca'ed since I don't have any of the photos myself.

steep drum
#

fan sites use those assets though? i think it straddles the line on fair use

lyric mountain
#

yeah, unless you're selling the photos it's ok

steep drum
#

as long as you're not trying to make money off it?

lyric mountain
#

pokemon wouldn't be as big as it is without fan stuff

solemn latch
#

I didnt think fair use accounted for if your making money.

#

licenses can, but i dont think thats fair use is it?

lyric mountain
#

you're not selling the photos, you're making money out of ads or stuff like that

#

so your income from the images is 0

opal plank
#

im fairly certain the definition of "fair use" is that you somehow have to modify the contents of the overall piece, as in, the asset you are taking is only being used to supplement your theory/content, not be the main focus of it

#

(also im here cuz the dorks are bullying me in #general )

solemn latch
#

yeah thats what i thought too erwin

opal plank
#

i dont think money/selling has anything to do with it, legally speaking

#

that would be part of licensing

solemn latch
#

what do you think of this erwin?

I actually wonder how DMCA works with API's like that.
If I use an API, which doesn't have the license to use images, and I use that API, can I realistically be dmca'ed since I don't have any of the photos myself.

opal plank
#

where you would pay someone to acquire rights to distribute it or use it as you wish

crimson vapor
#

what the fuck Erwin you left general for development

#

wow

opal plank
#

im not a lawyer, so i can only do speculation, not give legal advice, but based off what youtube does, the platform isnt responsible for the content users provide

#

assuming the content you have in the api is user-based

#

and you have a way to allow the owners of the copyright material to remove it

#

i think you can avoid legal issues to an extent

#

thats literally what youtube does

opal plank
#

that would hold true for imgur or any hosting service, for example

crimson vapor
#

man

lyric mountain
#

torrent sites be like

solemn latch
#

well, in this context we are talking about pokemon photo's being in an api, and a seperate dev using those images.
the api owners dont have legal right to those images, would the seperate dev be in any way responsible.

crimson vapor
#

we weren't bullying you

steep drum
#

this is just wikipedia so take it with a grain of salt

#

The first factor is "the purpose and character of the use, including whether such use is of a commercial nature or is for nonprofit educational purposes."

pallid garden
#

@solemn latch yeah i did contact email

opal plank
#

if you are the owner of that content, you can always request it to be taken down

lyric mountain
#

so like, the only one to blame is the service owner

opal plank
#

though like i said, it would go into fair-use grounds

solemn latch
pallid garden
#

Yep

opal plank
#

is what they do around the image?

#

or does the image supplement their content?

#

theres a lot of caveats for fair use

#

best to talk with a lawyer about it tbh

pallid garden
#

Usally nintendo hate fans copyrights

lyric mountain
#

they don't

pallid garden
#

Like pokecord and poketwo

#

They do lol

lyric mountain
#

pokecord/poketwo are free advertising for them

#

popular pokemon bots = more people interested in pokemon

opal plank
#

nintendo went as far as copyright claiming videos on youtube from people playing their games

pallid garden
#

Like in roblox nintendo banned pokemon in roblox games.

opal plank
#

nintendo is WELL known for going overboard on copyrighted content

solemn latch
#

I guess my question is less about fair use, and more about if there was copyright infringement and there's two parties(api owner, separate dev)
can both of them be realistically charged(wrong word for this, but im blanking) separately.

pallid garden
#

Like they did with pokemon bronze bricks game

#

They remove it

opal plank
lyric mountain
#

lol wtf are the CEOs thinking

solemn latch
#

they do a lot of silly things.

opal plank
#

Nintendo™️

solemn latch
#

have for years

pallid garden
#

Yeah

opal plank
#

im fairl certain what harry said is true

#

they did have a dispute with nitendo regarding a minecraft pokemon mod

pallid garden
#

Reason why nintendo dont like fans copyrights

#

Minecraft in nintendo switch

#

Its not kinda like copyright

pallid garden
#

Hmm

vivid fulcrum
#

literally every industry became like this

#

including the music industry too

opal plank
#

Nintendo Shuts Down Pokemon Minecraft Mod, Pixelmon!
🎬 SUBSCRIBE ► http://bit.ly/SubLog 🔔 AND CLICK THE BELL!

👾 MY NEW CHANNEL! ► http://bit.ly/itsdotZiP
▬▬▬▬▬▬▬▬▬▬▬▬▬
📰 Facebook ► http://facebook.com/Logdotzip
💬 Twitter ► http://twitter.com/Logdotzip
📸 Instagram ► http://instagram.com/Logdotzip
▬▬▬▬▬▬▬▬▬▬▬▬▬

There is some minecraft news for a...

▶ Play video
pallid garden
#

People they never learn tsk tsk

vivid fulcrum
#

greedy capitalists stripping away creative freedom just to ooze more money out of you

opal plank
#

nintendo goes literally overboard on anything they can claim

#

he said the word "nintendo" in his video, copyright em'

#

said "nintendo" in a discord server, get em'

pallid garden
#

Yeah copyright illegal

lyric mountain
#

you use the word "copyright" a lot don't u?

pallid garden
#

Sometime yeah remind people lol

#

But they don't care

lyric mountain
opal plank
lyric mountain
pallid garden
#

Only nintendo and pokemon own it

lyric mountain
#

only nintendo owns it

pallid garden
#

Yeah both

lyric mountain
#

no

#

pokemon is a copyrighted thing of nintendo

solemn latch
#

pokemon isnt a company afaik.

#

its like saying my shoe owns my shoe :p

pallid garden
#

lol

#

I email nintendo before emualtor and roms illegal

opal plank
#

isnt it something freak?

#

GameFreak or something

#

or is that the publisher?

pallid garden
#

They say yeah its illegal

lyric mountain
#

obv roms are illegal

opal plank
#

i always remember seeing that name in the old versions

pallid garden
#

Well nintendo say to me emulator illegal as well

lyric mountain
#

it is

pallid garden
#

Yep

opal plank
last tapir
#

welp

pallid garden
#

Some people say is not illegal lol

last tapir
#
let a = 8, b = 6;
// Only change code below this line
//6,8     6, 8
console.log(a, b)
[a, b] = [b, a];

console.log(a, b)
```**
Console:**
8 6
TypeError: Cannot set property '6' of undefined
opal plank
#

thats not how js works

last tapir
#

idk, i think that is how destructuring array works

pallid garden
#

I think coding hard for me their anyway with no coding?

opal plank
#

not even close

earnest phoenix
opal plank
#

destructuring arrays are [...]

pallid garden
#

?

lyric mountain
#

dbd is not an option

earnest phoenix
opal plank
#
let a = [1, 2, 3];
let b = [...a, 4];
console.log(b) // [1,2,3,4]
pallid garden
#

Yeah if people cant code they use different option

opal plank
#

thats destructuring arrays @last tapir

solemn latch
#

hiring a dev is a good option for people who cant code but need code.

lyric mountain
#

dbd is like this

earnest phoenix
lyric mountain
#

a box of cooked potato

#

and it's expensive af

crimson vapor
solemn latch
pallid garden
#

👀

lyric mountain
#

it's just. cooked. potatos

#

like

#

who can't cook potatos?

earnest phoenix
solemn latch
#

who cant change oil? 👀

#

still, nearly everyone gets their oil changed professionally

lyric mountain
pallid garden
#

lol gotta go talk you later.

#

Doing some house work.

opal plank
#

How to Chef

lyric mountain
#

how do you burn a cooked potato?

crimson vapor
#

its potatoes

#

just boil them

#

ezpz

opal plank
#

look, i know people who legit burn cup noodles

pallid garden
#

@opal plank youtube cooking video helps

opal plank
#

dont doubt poeople's ignorance

lyric mountain
#

lol wtf

crimson vapor
#

how

#

what the fuck

#

Erwin

#

you gotta get away from those people

#

might spread to you

lyric mountain
#

well, I mean, internet is full of those stuff

#

like that cow on top of a water tower

opal plank
#

cries is slow pc

lyric mountain
#

ah, yes, this one

opal plank
#

funfact

earnest phoenix
#

What are the max slash commands a bot can have?

opal plank
#

cows ACTUALLY cant walk downstairs

lyric mountain
#

and pigs can't look up in the sky

opal plank
#

and discord devs cant dev

cinder patio
#

I think

#

afaik

opal plank
#

thats rather small ngl

earnest phoenix
#

oh :C no custom slash commands

cinder patio
#

actually 100

opal plank
#

i might try slash commands

vivid fulcrum
#

slash commands are garbage

opal plank
cinder patio
#

100 global and then 100 per guild

opal plank
cinder patio
#

I think they can be useful for certain type of bots

lament rock
#

would be very situation

#

a lot of bots that do implement them that I've seen do so in such an unproductive manner

opal plank
#

if i were to do it, it'd probably be an extension of normal commands

#

so you could use both

cinder patio
#

that's kinda pointless tbh

opal plank
#

was about to say that tbh

steep drum
cinder patio
#

Slash commands are good for when you want to make it look like the bot is integrated with discord, there was a gif of a translation bot recently that used slash commands - definitely better than using regular commands

zinc marlin
#

How make splash commands 👀

opal plank
#

throw water at it

crimson vapor
#

yeah fl0w's bot

opal plank
#

splash commands

zinc marlin
#

🤡

#

😂

lyric mountain
#

is plash

crimson vapor
#

I kinda want to try slash commands but idk seems like there is no point

opal plank
lyric mountain
#

slash commands are superfluous

crimson vapor
#

would be nice if it was implemented well into libs

#

cough @slim heart cough

cinder patio
#

A big pro is being able to send client-only messages, so only the person can see the command can see em

lyric mountain
#

it'd be a great thing IF they added it together with the bot api

opal plank
#

the ONLY good thing i take from them is arguments, but in all honesty, theres not much there

lyric mountain
#

but now?

#

they're too late

slim heart
#

leave me be u stinky boitch

opal plank
#

since it explains visually what arguments are required

lyric mountain
#

yes, that

crimson vapor
#

lmao

cinder patio
#

yeah arguments are great too

opal plank
#

but i already have catches and error parsing in the bot normally

slim heart
#

if someone is gonna use slash commands with rose, their bot is gonna be big, so they should be making their own http thing instead of the gateway

opal plank
#

so, theres that too

crimson vapor
#

true

#

but that seems like justification of being lazy

#

imo

opal plank
#

i THINK i might be able to adapt detritus command handler with it

slim heart
#

thats exactly what it is

crimson vapor
#

imagine weather bot with fucking slash commands

#

that would be so cool

opal plank
#

so the same function from the handler can be executed for the interactions

#

let me ask cake rq

lament rock
#

argument type parsing and required/optional args are great

opal plank
#

there are a LOT of caveats though

#

but i think its possible to emit a payload containing all info that a normal payload would have

earnest phoenix
#

That's right, Pico from Newgrounds

near igloo
#

alright why this happens, but running this line of code:js Object.keys(require.cache).forEach(key => delete require.cache[key]) makes js message.author.send("test")return (node:12056) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Channelidk why

slim heart
#

@crimson vapor with cache optimization yt uses only 2.9GB B)

crimson vapor
#

pog

#

6gb before?

slim heart
#

4

crimson vapor
#

ah

#

so down a gb

#

pog

slim heart
#

2

#

well

#

yeah]

#

1.1

lament rock
# near igloo alright why this happens, but running this line of code:```js Object.keys(requir...

You're dropping EVERY required file from the cache which can cause data to be swept which can include data important to Discord.js

Do not drop everything in the require.cache. Only what you actually need to drop and re-require. You cannot reload Discord.js live since your client instance is still bound to a stale require of Discord.js and the data that reaches the root will not be swept

near igloo
earnest phoenix
#

is it possible to send a "ping" from html script tag to node js server to run a function?

#

question mark

lament rock
#

require.cache is keyed by absolute paths to files. You can drop that specifically and then re-require. If it has sub-module requires, you can also drop those since require.cache is an Object.<string, Module> and Module has a sub module property on it. I forget it's exact name. You'd basically recursively go through modules and their children and drop them then re-require the entry point

slim heart
#

@crimson vapor dont tell erwin but i just tested it and detritus has a 300MB overhead above rose with the same settings

crimson vapor
#

the way its built means that it has a higher overhead

#

also im like 60% sure with some cache disabled, commands don't work

slim heart
#

idk

lyric mountain
#

what do you mean by "ping"?

vivid fulcrum
#

it isn't anyway

slim heart
#

i had channels roles guilds on

vivid fulcrum
#

html is incapable of doing anything

lyric mountain
#

script tag

crimson vapor
#

ok

slim heart
#

and the same "cache control"

vivid fulcrum
#

oh

lyric mountain
#

so ig js

vivid fulcrum
#

im blind

crimson vapor
#

I forget which ones didn't work for me when I was doing basic testing

earnest phoenix
#

idk

#

a scipt tag with an click event

#

that can activate a function

#

from node.js

steep drum
#

use ajax

earnest phoenix
#

is it possible

#

?

lament rock
#

you can also abuse img tags to force a GET

lyric mountain
#

you can use fetch to call some serverside endpoint

#

there are a myriad of options actually

vocal trellis
#

If i restart my bot and a user react nothing happends. If the user types something in a channel and tries it then again it works
Do you know how to fix this?
i already use partials

lyric mountain
#

depends on how dirty you're willing to get

vocal trellis
#

ow lol

#

sorry

lyric mountain
#

like, you want reaction events to work?

vocal trellis
#

yes

lyric mountain
#

show current code

vocal trellis
#

if i restart my bot and a user reacts my bots embed it doesnt work and if the user types a message and then reacts the event works

lyric mountain
#

show current code

vocal trellis
opal plank
#

wew

#

how many calls you doing PER command?

vocal trellis
#

calls?

#

what do you mean with calls

opal plank
#

i see 6 calls PER command

#

either db calls

#

or fetch calls

vivid fulcrum
#

are you sure those are db calls

#

they just seem like unnecessary awaiters on a getter

crimson vapor
#

what lib is that?

opal plank
vivid fulcrum
opal plank
#

it looks like mongodb

#

or some other document based db

crimson vapor
#

nah thats not mongodb

#

well I doubt it is

earnest phoenix
#

I see both MongoDB and enmap based calls

slim umbra
#

looks a little like typeorm

opal plank
#

updateOne() is definitively mongo

slim umbra
#

but na

opal plank
#

thats what gave it away for me

crimson vapor
opal plank
#

mongoose uses that no?

slim umbra
#

wtf is that editor

crimson vapor
#

it does

#

thats vsc

slim umbra
#

or font*

earnest phoenix
#

Putting await keyword before every type of operation moment

crimson vapor
#

its just low quality ss

slim umbra
#

get eslint @ whoever wrote that

#

or grow eyes

crimson vapor
#

nah

#

standardjs

opal plank
#

heres another good part

#

you can have reactionAdd on channelDM's

#

which wont have guild with it

lament rock
#

get accessors can return a Promise btw

slim umbra
#

just a wasted api call

crimson vapor
slim umbra
#

no use

opal plank
#

not only that

#

those are all executed on any reaction it seems

slim umbra
#

yeah

lyric mountain
opal plank
#

@vocal trellis well, we already gave you plenty of feedback it seems, i'd recommend checking what we all said

crimson vapor
#

bro your internet ok?

earnest phoenix
crimson vapor
#

mine was decent

opal plank
crimson vapor
#

get better internet brazilians

#

smh

earnest phoenix
#

Code Minecraft edition

slim umbra
#

ngl replaceall was like the only good thing added to node 15

earnest phoenix
#

I see no point in String.prototype.replaceAll(), since you can use regex in String.prototype.replace() with the global flag

opal plank
#

i mean, it looks fine to me

#

you sure its not your internet?

lyric mountain
#

yes

crimson vapor
sudden geyser
#

It looks correct

opal plank
#

i actually use replace() instead of replaceAll() cuz literally every fucking instance i've tried using it on, hasnt worked

vivid fulcrum
lyric mountain
#

because you used this

slim umbra
#

r u sure u werent using it wrong

opal plank
lyric mountain
#

also, barely anyone can type that word without some specialized keyboard

earnest phoenix
#

The only good thing added in Node.js v15 was private properties and methods in classes

opal plank
#

conditional chaining

vocal trellis
#

wow

opal plank
#

thats best feature node added

#

ever

#

period

vocal trellis
#

big hate on my code 😂

opal plank
#

no discussion

vocal trellis
#

first of all

earnest phoenix
#

TC39 lazy decisions moment

vocal trellis
#

i use mongodb

vivid fulcrum
#

uncatched promises crashing the process

opal plank
#

CALLED IT

#

WHO SAID IT WASNT?

#

@crimson vapor @slim umbra git rekt

#

both of ya

earnest phoenix
opal plank
#

ik

#

but best feature

vivid fulcrum
#

node 14 <= literally says that uncatched promises will result in a process termination in the future

earnest phoenix
#

yes

vivid fulcrum
#

✨ the future is now ✨

opal plank
#

best node 15 feature is crashing on any unhandler rejection

#

cant wait to see how many devs will quit after that

#

discord.js updates to node 15 on v13, we gonna have a 50% increase in people here

#

MY BOT DIED, WHY

earnest phoenix
#

Node.js v15 be like, lets change warn to throw on every exception

#

But it is nice

vivid fulcrum
#

it's a good change

opal plank
#

indeed

vocal trellis
#

but guys

opal plank
#

well

vocal trellis
#

i didnt got an answer

opal plank
#

yes and no

regal saddle
#

well

vivid fulcrum
#

makes incompetent devs less incompetent

vocal trellis
#

on my probleù

opal plank
#

they'll do this

vocal trellis
#

what is with that

opal plank
#

well, but i guess thats technically handling exceptions

vivid fulcrum
#

your entire snippet you posted is a dumpster fire

opal plank
#

^^

vocal trellis
#

Okay

#

Challenge for you @vivid fulcrum

#

Rewrite it

vivid fulcrum
#

pay me

vocal trellis
#

Lmao you are the one having problems with the code

opal plank
#

most of us here would, but we arent allowed to spoonfed

vivid fulcrum
#

??

vocal trellis
#

Rewrite my snippet

vivid fulcrum
#

i could not care less about your code lol gtfo

vocal trellis
#

lol

opal plank
#

almost everything you wrote there we have it here

lyric mountain
# opal plank MY BOT DIED, WHY

"What? why can't I have 498017247 syntax and logical errors in my code and don't have it running normally?"
----- any lazy JS bot dev ever

vivid fulcrum
#

i just commented that it's garbage

#

you clearly don't know what you're doing

vocal trellis
#

okay rewrite the snippet

vivid fulcrum
#

and your question is an xyproblem

vocal trellis
#

good

vivid fulcrum
#

pay me

vocal trellis
#

and maybe ill pay you

vivid fulcrum
#

maybe is not good enough

vocal trellis
#

okay

#

then not

vivid fulcrum
#

stonks

earnest phoenix
#

Development channel moment?

opal plank
#

always

#

well, either way @vocal trellis , we arent just calling your code shit, we are calling your code shit and explaining why thats the case. As harsh as it is, its constructive criticism

lyric mountain
#

yes but I don't have enough mana to cast "clairvoyance"

#

so I can't know the question

opal plank
#

imagine not owning a crystal ball

#

everyone knows you can use clairvoyance for free with it

#

with no mana cost

#

noob

lyric mountain
#

mine broke yesterday damn

opal plank
#

oh i se

lyric mountain
#

rolled 1 on dexterity check

opal plank
#

i know a mage in the favelas of rio that would get you one for a nice price

vivid fulcrum
#

i sold mine to health workers in order to help fight covid :(

earnest phoenix
#

anyone here use the discord.js-collector library?

#

Oh god, not another bloated npm package

vivid fulcrum
#

why is there a library for everything in node

opal plank
#

cuz js devs

vivid fulcrum
#

can't you people just do something yourselves for once

opal plank
#

^^^^^^^^^^^^

earnest phoenix
#

it makes life easier

lyric mountain
#

that's why maven requires a shitton of steps to publish packages to central

crimson vapor
#

honestly most people just don't have the experience and understanding to do it themselvers

opal plank
#

thats why i recommend people typescript, the majority of ts users have at least 3 functioning braincells since you need to write a lot of stuff yourself, specially interfaces and types

earnest phoenix
#

It has 750 weekly downloads

opal plank
earnest phoenix
#

Makes life harder doesn't it

earnest phoenix
opal plank
crimson vapor
#

I got bullied for using any

lyric mountain
#

the issue is that JS is too compliant

crimson vapor
#

it was sad

earnest phoenix
#

Because it is always maintained by hundreds of people

lyric mountain
#

it accepts anything

earnest phoenix
#

The package you said isn't

opal plank
crimson vapor
#

well yeah, it was you

craggy pine
opal plank
#

you welcome

lyric mountain
#

so people don't Smart Think™️ when doing js

past dove
#

Is there any way to join a server whis is using my bot ?

vivid fulcrum
#

no

crimson vapor
#

nope

lyric mountain
earnest phoenix
#

It's a pretty popular package

#

ToS inb4

lament rock
#

Do people even think when doing JS

opal plank
#

"popular package"

#

you wanna see popular stuff?

#

fine

crimson vapor
#

800 a week is not popular

opal plank
#

let me give you a piece of mind my dude

crimson vapor
#

at all

vivid fulcrum
earnest phoenix
#

For that

#

for an "extension" to discord.js

vivid fulcrum
#

it's a bloated package

#

djs already has a collector built in

earnest phoenix
#

ok

vocal trellis
opal plank
vocal trellis
#

i get better every day

crimson vapor
#

no

vocal trellis
#

and learn more every day

opal plank
crimson vapor
#

not this Erwin

#

can we not

earnest phoenix
#

The package could be deprecated at any moment, if stuff changes and and the package doesn't get updated

#

What do you do

#

I update it myself

#

or rewrite the entire code for my bot

vivid fulcrum
#

the fact that actual huge libraries have stupid packages like is-undefined and is-thirtheen as their deps like what??

earnest phoenix
#

ok

lament rock
#

I want to know what "popular" packages unironically depend on meme packages like that

earnest phoenix
#

If you know how to update it then why not write one yourself instead of using an npm package that implements it?

lament rock
#

proprietary software is poggers

opal plank
# vocal trellis and learn more every day

we pointed out WHY its bad idea to do what you're doing, not blindly calling out "HuH DUH shIT cODE GiT BEttER", if theres anything specific from what we said that you dont understand WHY its not good, please ask

vocal trellis
lyric mountain
#

can't live without it

#

who knows when it's thirteen

opal plank
#

you can get memberCount with the guild payload

#

though thats not always accurate

earnest phoenix
#

npm registry is filled with shit ton of bloated npm packages

vocal trellis
opal plank
#

since it updates every couple hours iirc

earnest phoenix
#

tbh the only reason I thought to use it was because I thought it could could see the reactions made after bot downtime

opal plank
#

correct

lament rock
#

only GUILD_CREATE returns member_count

opal plank
#

<guild>.memberCount

quartz kindle
#

what if someone makes npm2

opal plank
#

i second that

vocal trellis
#

i mean like total

opal plank
#

yes

#

member COUNT

lament rock
#

Tim. Make npm2

earnest phoenix
vocal trellis
#

would this work

opal plank
#

total amount

vocal trellis
quartz kindle
#

memberCunt

vocal trellis
#

would this work without

earnest phoenix
#

ok

vocal trellis
#

intents

opal plank
#

that would work

#

dont need intents

vocal trellis
#

okay ❤️ thanks

crimson vapor
#

yea but it would be a bit off

opal plank
#

memberCount comes with it

crimson vapor
#

the overlap of members in servers

lament rock
#

You need the GUILDS intent of course

crimson vapor
#

shh

earnest phoenix
#

Wait, doesn't <Guild>.memberCount not update without the guild members intents?

opal plank
#

no

lament rock
#

You might be thinking of invite.approximate_member_count, Erwin

opal plank
#

i think you only receieve it once

#

when you connect via gateway

#

you get guilds objects

vivid fulcrum
#

approximate_member_count is rest only

opal plank
#

after that you would get them only with payloads that include guild

vivid fulcrum
#

member_count or memberCount in djs is gw only

opal plank
#

guild_create/guild_delete, etc

#

back of my head i dont remember other events that emit a guild object

lament rock
#

Guild.member_count is always accurate since events are replayed to the client if it has GUILD_MEMBER intents

opal plank
#

unavailable too

earnest phoenix
#

Yep as I said