#development

1 messages ยท Page 2080 of 1

boreal iron
#

Quiet white name

sharp geyser
#

Okay, but you make bots on discord

#

how lame

boreal iron
#

lmao

pine nova
#

kekw

boreal iron
#

Misty being mad not belonging to this privileged group

sharp geyser
#

privileged?

#

didn't you guys get that taken away recently

#

Presence Intent, Members Intent, Message Content Intent

#

very privileged indeed

boreal iron
sick agate
lyric mountain
#

of course that wont backfire

sudden geyser
#

I don't see why the badge exists, given 99% of bots will be forced to adopt app commands anyway.

quartz kindle
#

the actual exe or just the installer?

sharp geyser
quartz kindle
#

lel

#

dumb av

sharp geyser
#

says Webtorrent is scareware

#

so not harmless just an annoyance

#

that is how it is classified as anyway

sharp geyser
#

Actually ima setup a vm

#

just in case

quartz kindle
#

that same thing was detected in utorrent as well according to google

#

so it might be something with torrenting software in general

sharp geyser
#

maybe

#

but just in case

#

unless you wanna test it out for me tim ;)

quartz kindle
#

i already use it

sharp geyser
#

ic

quartz kindle
#

i mean, i use a streaming app that is built with webtorrent

sharp geyser
#

oh?

#

what streaming app

quartz kindle
#

stremio

#

its basically what popcorntime was but better

sharp geyser
#

ic

rocky dagger
#

do you need the EmbedBuilder when making an embed?

quartz kindle
#

you dont "need" it

rocky dagger
#

how can i do it without?

#

im already using json format

quartz kindle
#

yes thats how

#

using a raw json object

rocky dagger
#

i cant find out how to remove the builder, with the buttons and select menus i found out that i had to provide a integer type outside the json but i cant find anything about it for embeds

quartz kindle
#

you use a raw object

#
.send({ embeds: [{
  title: "abc",
  description: "xyz"
}] })
sharp geyser
#

Webtorrent Desktop looks ass

#

just to let you know tim

#

the UI is horrible

quartz kindle
#

lmao

rocky dagger
#

thanks

chilly nest
#

my bot's pfp isnt loading on top.gg

#

how do i fix that?

earnest phoenix
#

does sb know how I can make a ternary operator condition for methods like .sendMessage and .editMessage while using the same embed settings

#

I dont want to do do condition ? .editReply ( embed settings ) : .sendMessage ( embed settings ) because I would unnecessarily use the embed settings twice

quartz kindle
earnest phoenix
#

oo

chilly nest
#

anyone know how to update the pfp of a bot on top.gg?

earnest phoenix
quartz kindle
#

its just a ternary with object keys

rocky dagger
#

so i got an embed and when i log it i get this as expected but in the message the timestamp isnt included

earnest phoenix
#

can u show the message

plain talon
#

i think you just pu tUTC

#

put UTC

rocky dagger
lyric mountain
#

why tf discord sends the color as a string?

#

oh wait, that's what u send

earnest phoenix
lyric mountain
#

no, I mean, sending as a number is valid too

earnest phoenix
#

oh

#

didntt know dat

rocky dagger
#

decimal value

lyric mountain
#
0x FF FF FF FF
   A  R  G  B
pine nova
#

decimal color codes

lyric mountain
#

but it makes little sense to send it as a string instead of a number

#

since it'll need to be converted on the other side

rocky dagger
#

i got it stored as a string

earnest phoenix
rocky dagger
#

thats what im doing

lyric mountain
#

doesn't discord use unix seconds?

earnest phoenix
#

you use v13?

rocky dagger
earnest phoenix
#

oh

lyric mountain
#

are u sure that field is supposed to be an ISO date instead of unix epoch?

plain talon
#

it is meant to be unix i believe

rocky dagger
#

when i do Date.now()

plain talon
#

oh

lyric mountain
#

iso then

#

weird

earnest phoenix
#

my bot was made 7 days ago and has 400,000 members.. is 4v dedicated cpu, 2.7ghz good enough for this?

#

8gb ram, too

lyric mountain
#

member count is irrelevant

earnest phoenix
#

oh?

lyric mountain
#

how many servers?

earnest phoenix
#

9

lyric mountain
#

9 servers?

earnest phoenix
#

yea

#

2 large servers invited it

lyric mountain
#

you're far from having to worry abt server specs

digital swan
#

yeah u can run 9 servers on anything

earnest phoenix
#

excellent ๐Ÿ™‚

plain talon
#

more members = more events = more power

lyric mountain
#

it starts becoming a thing when u near like 5-10k servers or so

earnest phoenix
lyric mountain
#

members are almost never loaded at all times

earnest phoenix
lyric mountain
#

the cache keeps like a fraction of that

lyric mountain
#

the only real metric is server count, because more servers = way more events

earnest phoenix
#

that

quartz kindle
#

cpu matters for events per second, which usually increases with member count
ram matters for cache, which usually increases more with guilds than only members

earnest phoenix
#

thats for today

#

i know it looks fine but

#

its just came online officially

quartz kindle
#

also, if your bot is single threaded, the number of cpus wont matter

earnest phoenix
plain talon
#

spawn your commands on a new thread

#

ez

lyric mountain
#

with js it'll be a litte tricky

earnest phoenix
#

i use py

lyric mountain
#

with py too

quartz kindle
#

threading is usually acompanied with sharding, which is only relevant once you reach 1k+ guilds

earnest phoenix
#

ah

digital swan
#

is there anyway to force discord-hybrid-sharding to launch more than 1 cluster with very little servers?

earnest phoenix
#

interaction[sendCondition ? 'send' : 'editReply']({ .... blabla })

I get this error
interaction[(intermediate value)(intermediate value)(intermediate value)] is not a function

my goal was to do a condition to see if its true/false and then do interaction.one of the methods({})

sudden geyser
#

that's wack

#

you sure the error isn't coming from somewhere else?

earnest phoenix
#

no cuz

#

when I do interaction.send({ }) it works perfectly fine ( sendCondition is true in this case )

#

but when I add the ternary operator to that it throws that error instead

#

interaction is when true a channel to send the message to and when false a message to edit

pearl trail
#

(sendCondition ? interaction.send : interaction.editReply).bind(interaction)({..}) try that

earnest phoenix
#

property of bind is undefined

sudden geyser
#

Try logging interaction to see what you get

pearl trail
#

ah ic ic

#

its not send, instead it is reply

earnest phoenix
#

a textchannel

#

( to which I want to send a message to )

#

replacing send with reply causes the same error

pearl trail
#

is interaction a CommandInteraction or a Message

earnest phoenix
#

<ref *2> TextChannel {

#

oh

#

yeah

#

not a message

pearl trail
#

hm, editReply is not a thing on textch

earnest phoenix
#

if sendCondition is false, interaction will be a message that I want to edit

pearl trail
#

so interaction is dynamic? it can be TextChannel or Message?

earnest phoenix
#

yes

#

I want to reuse the embed settings thats why I reuse the arrow function

pearl trail
#

prob this will work (interaction.edit ?? interaction.send).bind(interaction)({..})

#

if edit is undefined, which is textch, use send

earnest phoenix
#

<33 it works, arigato

#

I guess that's how I do it with dynamic arguments, learned smthing new then

pearl trail
#

glad i can help, no prob ^-^

quartz kindle
#

weird, the methods should not be losing their context just from that

ancient nova
earnest phoenix
#

apks are safe imo

#

its not like u gonna catch a virus and next day ur device wont work at all anymore

#

also depends where u got the apk from

ancient nova
earnest phoenix
#

no

ancient nova
#

I replaced mrs major on android in 1 day

quartz kindle
#

yeah, the worst an apk can do is show you ads when you open it, unless you explicitly give it permissions to do more

earnest phoenix
#

whats mrs major

ancient nova
#

also made 2 ransenwares

earnest phoenix
#

whats mrs major

#

and do u mean ransomware

ancient nova
quartz kindle
#

rasenganware

ancient nova
earnest phoenix
earnest phoenix
ancient nova
quartz kindle
#

exactly, the only way an app can do something is if you somehow give it system perms

earnest phoenix
#

u literally cant fuck up ur device in one day unless u grant it some system perms or root ur device ( which I honestly dont even know how to do and why would an apk require those in first place. an apk requires default settings or settings like reading ur contacts or images, from there u can just judge whether u want to install or not )

ancient nova
ancient nova
#

fucking up rooting process can perm brick ur device so that's 1 way

earnest phoenix
#

example

#

tell me how do u grant system perms

#

and fuck up ur device ( by that, I mean to be forced to set ur device back to default + u lucky if u can backup somehow ) just by installing an apk

quartz kindle
ancient nova
quartz kindle
#

regardless of how bad you fuck it up, you cannot rewrite the emergency mode area

ancient nova
ancient nova
#

Samsung s9

earnest phoenix
#

ok elaborate

quartz kindle
#

like no power at all?

earnest phoenix
#

u were not able to get into emergency mode or like

#

holding ur buttons long enough

ancient nova
#

it showed the samsung logo but then instantly tuned off again

earnest phoenix
#

where u can access stuff like setting ur phone back to default or requiring backup

earnest phoenix
earnest phoenix
#

ok what happened

ancient nova
#

it just didn't turn on

earnest phoenix
#

no

ancient nova
#

yes

earnest phoenix
#

they are forced to turn on

#

ur talking about ur phone which didnt boot up

ancient nova
#

power button + buttom volume button right?

earnest phoenix
#

e.g. u were bootlocked

earnest phoenix
ancient nova
#

ic, still it was pretty dead eitherway, the final 5 minutes it was on I couldn't open any app, install anything etc.

ancient nova
#

I would have to factory reset most likely

earnest phoenix
#

no

#

u wouldnt

#

were u able to access the settings?

ancient nova
#

yes but changing some of them crashed the settings app

earnest phoenix
#

changing what

#

wdym by some of them

ancient nova
#

I tried changing some of the settings related to the app I used for rooting but it crashed the settings app when i tried doing anything

#

package manager got fucked up too I couldn't install or uninstall anything

earnest phoenix
#

bro u can just go to the developer settings and then enable that usb device thingy and from there u can literally transfer all ur data onto ur pc

ancient nova
#

and when i tried rebooting it just wouldn't turn back on

quartz kindle
#

there are 3 ways to turn on an android phone
normal boot
recovery mode
download mode

download mode is the only one that cannot be tampered with

earnest phoenix
#

there is no way u were able to click the settings but not being able to toggle the usb thing

quartz kindle
#

this is recovery mode

quartz kindle
#

this is download mode

ancient nova
#

oh that

earnest phoenix
#

yeah that

ancient nova
#

didn't try download mode but it's usuless now either way since I bought a new phone

earnest phoenix
#

on huawei we have this

#

I was bootlocked because my storage was full

quartz kindle
#

download mode is like turning your phone into a usb device open for writing, you plug it into a pc and use a software to install a new image on it

ancient nova
earnest phoenix
#

huawei doesnt have :(

quartz kindle
#

it should have

ancient nova
earnest phoenix
#

and then wait until battery drained

#

then I was no longer bootlocked

quartz kindle
#

you can install anything with download mode, even something broken

ancient nova
#

that seems like a big issue wtf

earnest phoenix
#

I want to edit an ephemeral message because i need to await something, but each time i get "undefined", here is my code
using djs v13

 if (interaction.customId === "test") {
const msg = await interaction.reply({ embeds: [embed], ephemeral: true });
console.log(msg) // return undefined so i can't edit
}
quartz kindle
#

you cannot ever break download mode itself

ancient nova
earnest phoenix
quartz kindle
#

because download mode is a hardware thing

#

a specific combination of hardware buttons and turn on your usb hardware in that specific mode

earnest phoenix
#
if (interaction.customId === "test") {
interaction.reply({ embeds: [embed], ephemeral: true }).then(msg => console.log(msg));
}
quartz kindle
#

it doesnt return the reply by default

earnest phoenix
#

it work tysm

granite trout
#

Hey, will text commands stop working for all bots or just verified bots?

boreal iron
#

For any verified bot

#

Up to 75 (100) guilds unverified bots can still enable privileged intents - for testing purposes or private usage

granite trout
#

oh okay

bright hornet
#

Does anyone using asp.net?

#

Just wanted to ask something about wrapping on controller

earnest phoenix
#

Hey guys, I have a HTML/javascript related question.

#

Basically I use JSDOM and Axios to get some data from a website

#

but then I see this part

#

I know how to get html values but

#

I need this url in particular

#

I don't know how to reference javascript stuff inside HTML

#

here is my best (working) try;

const websiteData = await axios.get(getUrl)
const websiteDom = new JSDOM(websiteData.data);

const links = websiteDom.window.document.getElementsByTagName("a")
let urlList = [];
for (let i=0; i<links.length; i++) urlList.push(links[i].getAttribute("href"))

const imageUrl = urlList.find(url => url.includes('img3.gelbooru.com'))
console.log(imageUrl)
#

but I feel like this is unnecessary code and maybe can be reduced

wheat mesa
#

Why not just links.some(link => link.getAttribute('href').includes('url'))

#

Sorry I had to edit that message about 30 times because mobile moment and Iโ€™ve been rusting for too long tonight

eternal osprey
#
client.on('messageCreate', async message => {
console.log(message)
})```Hey guys why is this event not firing?
sharp geyser
#

When is it not firing?

#

In DMs or in Guilds

eternal osprey
#

well i am sending a message in a guild

#

it's just not doing anything

sharp geyser
#

Show me the intents you have enabled for ur bot

eternal osprey
#

i have enabled the message intent

sharp geyser
#

Not what I am asking

#

I want to see ur intents

#

In code*

eternal osprey
#
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });```Yeah this is the issue
sharp geyser
#

You'd need the GULDS intent yes

eternal osprey
#

Is there any place where all the intents are listed?

#

I can't seem to find them in the guide

sharp geyser
#

the docs

#
sharp geyser
#

I think a lot of people are voltrex

eternal osprey
#

Yeah

earnest phoenix
#

It's better to upgrade then

eternal osprey
#

Bro ffs is there a v14 already?

sharp geyser
#

A lot of people don't see it that way

#

yes

eternal osprey
#

I ain't going to switch

sharp geyser
#

it has been ou for a few days now

earnest phoenix
#

v14 was released 2-3 days ago

eternal osprey
#

Did they do a lot of changes?

sharp geyser
#

v14 is also a cist pool

sharp geyser
eternal osprey
#

Like the fucking humongous changes from v12-v13

eternal osprey
earnest phoenix
eternal osprey
#

they honestly need to chill their ass

sharp geyser
#

Voltrex serious question here

#

Should I handle caching in my lib?

earnest phoenix
#

There are way too many changes that pissed almost everyone off

eternal osprey
#

I think that i will stick with v13 man

earnest phoenix
eternal osprey
#

they are making everything so hard for no fucking reason

sharp geyser
#

I was thinking of letting the users handle the caching themselves

earnest phoenix
#

Well you shouldn't handle caching that much by default, and let the users configure the caching behavior

sharp geyser
#

Mmmm what would you say is an ideal result?

earnest phoenix
#

What do you mean by that?

eternal osprey
#
- new MessageEmbed().addField('Inline field title', 'Some value here', true);

+ new EmbedBuilder().addFields([
+  { name: 'one', value: 'one' },
+  { name: 'two', value: 'two' },
+]);```wait they really changed the way embeds should be formatted now?
earnest phoenix
#

Yes, they removed the addField() method

eternal osprey
#

waaaaht?

sharp geyser
#

Like what all should I do on my end

eternal osprey
#

is it safe to just continue with v13 as v14 seems like shit imo?

sharp geyser
#

at somme point you will have to swap to v13

#

the api endpoint v13 uses will someday be deprecated

earnest phoenix
#

Not really, although fixes will be backported from v14 to v13 for a while, support for it will soon be dropped and will probably break just like the previous versions did

sharp geyser
#

I also gotta think of a system design that will allow for caching to be implemented seamlessly. Before I had a lot of circular dependencies that were biting me in the ass

plain talon
#

999995519839502346 so close to 19 length id

eternal osprey
#

If your id number is lower it means your account is older right?

plain talon
#

yes

eternal osprey
#

345138133429649408

#

pogg

plain talon
#

this is how the id is generated

sharp geyser
#

957347862314905610 my account is sadly newer

#

my other accounts got deleted/banned

#

๐Ÿ˜”

eternal osprey
#

why so hard. I would throw an easy string generator in java and call it a go

plain talon
#

discord didnt make the snowflake system

sharp geyser
#

wasn't twitter the first to adopt it?

#

Yea

plain talon
#

yeah

sharp geyser
#

Snowflakes are easier

plain talon
#

same with the emoji in discord

#

also twitter

#

twitter make so much useful stuff outside of their site

sharp geyser
#

Snowflakes are guaranteed to be unique iirc

plain talon
#

like bootstrap css

#

ye cuz its based on the time

sharp geyser
#

yea

plain talon
#

which is always increasing

sharp geyser
#

bootstrap sucks

eternal osprey
#
    .addChoices({
                    name: 'Planetary Raid', 
                    value: 'raid'
                    
                }```how would i add multiple choices?
sharp geyser
#

array

#

.addChoices

eternal osprey
plain talon
#

[{name value},{name value}]

earnest phoenix
sharp geyser
#

๐Ÿ˜”

eternal osprey
plain talon
#

oh

sharp geyser
#

the docs say it takes in an array though

eternal osprey
#
    .addChoices(
                { name: 'Funny', value: 'gif_funny' },
                { name: 'Meme', value: 'gif_meme' },
                { name: 'Movie', value: 'gif_movie' },
            ));```this is their method
sharp geyser
#

What

#

why

plain talon
#

addChoices(...choices) maybe

sharp geyser
#

smh