#development

1 messages Ā· Page 1995 of 1

spark flint
#

the

#

fuck

oak cliff
#

Please keep chats appropriate and on topic

#

@sly sierra you specifically I'm not warning again.

#

This is your last one

sly sierra
#

stare5 your father left you

split hazel
#

brooo that is hella sussy

#

im not into that kind of stuff tho

#

i only like clean balls

oak cliff
#

Keep the channel on topic.

azure lark
#

how do i console log the profile info from this

#
var bodyParser     = require("body-parser");
var cookieParser   = require("cookie-parser");
var cookieSession  = require("cookie-session");
var passport       = require("passport");
var twitchStrategy = require("passport-twitch-new").Strategy;
 
var app = express();
 
app.set("views", __dirname + "/views");
app.set("view engine", "ejs");
 
// Middlewares
app.use(bodyParser.urlencoded({ extended: true }));
app.use(cookieParser());
app.use(cookieSession({secret:""}));
app.use(passport.initialize());
app.use(express.static(__dirname + "/public"));
 
passport.use(new twitchStrategy({
    clientID: process.env.TWITCH_CLIENT_ID,
    clientSecret: process.env.TWITCH_CLIENT.ID,
    callbackURL: "https://meloidum.c-h-a-r.repl.co/auth/twitch/callback",
    scope: "user_read"
  },
  function(accessToken, refreshToken, profile, done) {
   
  }
));
 
  passport.serializeUser((user, done) => done(null, user));
  passport.deserializeUser((obj, done) => done(null, obj));

 
app.get("/", function (req, res) {
    res.render("index");
});


  app.get("/user", function (req, res) {
   
    res.redirect("/")
});
  
 
app.get("/auth/twitch", passport.authenticate("twitch"));
app.get("/auth/twitch/callback", passport.authenticate("twitch", { failureRedirect: "/" }), function(req, res) {
    // Successful authentication, redirect home.
    res.redirect("/user");
});
 
app.listen(3000);
 
sick agate
#

@azure lark you shared secret

azure lark
#

o

#

thanks

sick agate
#

console.log(profile) in function(accessToken, refreshToken, profile, done) {

} perhaps?

azure lark
#

yeah that works but do you know how i could display that info in a json format on /users page?

sick agate
#

????

azure lark
#

?

sick agate
#

no idea

feral aspen
#

Any faster way to do this?

#

I want to use a script tag instead of continuously repeating the <li> tag.

lament rock
#

Make an array of languages and then add html to the body and construct the string together with what is repetitive and fill inbetween value(s)

feral aspen
#

I did the first step but got lost with the second.

#

Couldn't find a documentation, too.

lament rock
#

[...languages].map(i => <li class="...">${i}</li>);

feral aspen
#

Like this, overall?

<script>
    ['HTML', 'CSS'].map(i => <li class="skills__list-item btn btn--plain">${i}</li>)
</script>
#

Well, that didn't work.

sudden geyser
#

I think this is pure HTML and not some React JSX stuff

#

You could manipulate the dom

feral aspen
#

Pardon?

cinder patio
#

You have to use the document API

#

document.body.children.append

hushed patrol
sudden geyser
#

and doesn't give you brain damage

hushed patrol
#

yes

feral aspen
earnest phoenix
feral aspen
#

None, I use pure CSS.

earnest phoenix
#

then you should have to repeat the li stuff or try using dom apis

feral aspen
#

Oh, I don't mind.

earnest phoenix
#

also the li isn't even inside a ul

feral aspen
#

What?

#

Oh, I didn't send the full code, my bad.

earnest phoenix
#

please don't tell me your script is INSIDE the ul

feral aspen
earnest phoenix
#

it is šŸ¤¦ā€ā™‚ļø

#

put it outside the ul

feral aspen
#
<script>
    <ul class="promises__list">
        ["hi"].map(i => <li class="skills__list-item btn btn--plain">${i}</li>)
    </ul>
</script>
#

Like this?

earnest phoenix
#

NO

feral aspen
#

GOODNESS.

#

I'm back to HTML, holy.

#

šŸ˜‚

boreal iron
#

Assign an ID to your ul and append your li elements to the ul

earnest phoenix
#

<script stuff />
<ul>
<li></li>
</ul>

#

it ain't a good idea to insert the elements using js because it wouldn't render for environments that have js disabled
such as search engine crawlers

feral aspen
#

Yeah, fair enough, I suppose.

earnest phoenix
#

anyways here's how to insert the elements using js:

cinder patio
#
["a", "b"].forEach(el => {
  const element = document.createElement("p");
  element.innerText = el;
  document.body.appendChild(element);
});
cinder patio
#

it was just an example

#

it's the exactly same method with li

spark flint
#

what would be the best way to extract top200 songs from spotify

#
split hazel
spark flint
split hazel
#

lol just dont use a library

#
  "headers": {
    "accept": "application/json, text/plain, */*",
    "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "cross-site",
    "sec-gpc": "1"
  },
  "referrer": "https://spotifycharts.com/",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": null,
  "method": "GET",
  "mode": "cors",
  "credentials": "omit"
});```
#

you're welcome?

spark flint
#

epic ty

split hazel
#

you can also rewrite it for python if you want

spark flint
#

i cba KEKW

split hazel
#

tho you dont need most of the things there

#

i just copied it from the browser

spark flint
#

ah alr

#

i'm trying to write in js anyways

#

defffo not making a scraper and downloader sus

split hazel
#

yeah this is all you need

await fetch("https://charts-spotify-com-service.spotify.com/public/v0/charts", {
  "headers": {
    "accept": "application/json"
  },
  "method": "GET"
}).then(d => d.json());```
spark flint
#

alr ty

#

also smh imagine hosting

split hazel
#

yeah i do host a lot of bots and websites

#

problem?

spark flint
#

fuck i can't spell

#

hoisting*

boreal iron
#

british

spark flint
#

i managed to get it to log song names dance

split hazel
#

nice

raw nest
#

In React I have a functional component and a compontent in it. I got a state that only affects the component but if I change the state it rerenders the whole functional component. How can I change that?

lament rock
#

by not using react

#

react re renders stuff A LOT

raw nest
#

that doesn't help... I don't rebuild a whole application just because it rerenders a single thing wrong.

sudden geyser
#

What do you mean by

functional component and a compontent

Do you mean by a regular function and then a class for components

raw nest
lament rock
#

I rewrite entire applications because I don't like their memory usage

raw nest
#

I made a quick example about it. It should only rerender what's inside ExampleComponent and not f.e. the paragraph. (In this example on click)

function Example() {
  const [state, setState] = useState(false)

  return (
    <div>
       <p onClick={() => setState(!state)} onLoad={() => console.log("Rendered")} >
         This text shouldn't get rerendered!
       </p>
       <ExampleComponent update={state} />
    </div>
  )
}
split hazel
#

pretty sure there are some things you can do to stop react from rerendering stuff

sudden geyser
lament rock
#

Yeah. I wouldn't recommend doing what I do

#

leave that to me

split hazel
cinder patio
raw nest
cinder patio
#

() => useState()

raw nest
cinder patio
#

The same goes for the console.log

raw nest
#

:)
still that's not the solution to the problem

cinder patio
#

React.useMemo maybe?

raw nest
raw nest
cinder patio
#

That's exactly ur problem

#

code inside {} gets executed immediately

#

by wrapping it in a function you are passing a function which gets called every time the element is loaded

#

Also I don't think onLoad works in react anyways

raw nest
cinder patio
#

nvm it does

#

but still

raw nest
cinder patio
#

that's ur issue

#

yes

raw nest
#

the thing is

#

I have a map function that renders data dynamically and my Child component (ExampleComponent) is in such one

cinder patio
#

maybe give a better example or better yet the actual code

sudden geyser
#

Isn't the rerending expected

raw nest
sudden geyser
#

Given your useState is bound to where you created it.

raw nest
#

that's the actual code (or a part of it) It's wrapped in some divs but that doesn't matter

cinder patio
#

And which component always gets re-rendered?

raw nest
#

well wait

#

actually the whole thing gets rerendered and I only want ItemButton to rerender xD said it wrong

cinder patio
#

when does the whole thing get rerendered?

raw nest
#

when the state updateItem gets changed (false/true)

#

it's never used anywhere else except in the Component (<ItemButton key={item.item_id} update={updateItem} handleCartAdd={handleCartAdd} handleStorage={handleStorage} item={item} wait={wait} />)

cinder patio
#

What's the meaning of that value? How does ItemButton use it

raw nest
#

The component get's rerendered. (It get's switched twice like true -> false -> true and so it rerenders once)

earnest phoenix
#

I have schema in my code
I have a document in my mongodb
I updated schema in my code
How to update document in mongodb with saving datas

cinder patio
sudden geyser
#

But if your old schema is in production, I'd suggest you leave it as-is and build on top of it.

raw nest
earnest phoenix
#

What you mean as production

sudden geyser
#

As in it's deployed. Your end users have interacted with it.

#

e.g. creating a user with a name

earnest phoenix
#

{"_id":{"$oid":"621a663e49c76713034034ad"},"id":"924474401704001546","language":"en","plugins":{"visible":true},"__v":{"$numberInt":"0"}}

#

I want to add it a new element when getting it

cinder patio
raw nest
cinder patio
#

nono I mean the component which uses them

raw nest
#

that's the return I can't send everything it's like 800 lines

cinder patio
#

And the modal?

raw nest
#

Alot of design things... šŸ˜…

cinder patio
#

jesus, have you thought of creating smaller components for this? Also parsing cartContent a few times can't be good

raw nest
#

But look I try to explain it here:
Items | Modal

If you change a value from an item, let's say you delete it from the cart it changes the items possible "orderable" storage.
And with this it should rerender Items. So it displays the current storage. But it rerenders almost the whole component so the Modal gets closed and you would have to open it everytime to make a single change

raw nest
boreal iron
#

I wanna say ads on topgg are actually working fine, even if the site has quite a few issues

ancient nova
#

does anyone know how to change the terminal icon using nodejs?

royal herald
#

how do i fix this

austere surge
#

yes

spark flint
#

message.guild.roles.cache.get('931167957713817631').members.map(m => m.user.id)

how can i make it not use cache

austere surge
#

fetch

spark flint
#

ah

#

TypeError: Cannot read properties of undefined (reading 'map')

royal herald
spark flint
#

i got it working now

#

used existing code, just fetched all users instead

#

so all were in cache

lament rock
split hazel
#

@civic scroll bro pls

#

or anyone

#

so i have a flexbox container right

#
.rate-target-container {
    display: flex;
    justify-content: center;
}
#

but for some reason after adding a flex-direction: column; to make elements flow down it invalidates the justify content center

#

making it not center anymore

earnest phoenix
#

Mmm css issues gotta love em

split hazel
#

i hate css so much

sudden geyser
#

we all do

split hazel
#

not only because its difficult but because i am terrible at designing things and making them look good

earnest phoenix
#

same here

woeful pike
#

justify-content works in the direction of the container

#

if you flip the direction you have to flip justify-content with align-items

split hazel
#

bro you are beautiful thank you

woeful pike
#

justify-content doesn't mean "center horizontally" it means center along the direction of the flexbox container

earnest phoenix
#

the more you know

#

I learned something from that as well

proven lantern
#

i just updated discord.js-light to version 4.6.0 from 3.5.11 and now im getting this error. path should always be there

spark flint
#

whats the best way to determine when someone revisits a tab so i can refresh page data?

#

as in clicks to visit another tab and clicks back sort of thing

proven lantern
#

swr

spark flint
#

ah

#

i don't use react

#

plain html and js dance

proven lantern
#

i think there is a focus event that you can listen to

spark flint
#
document.addEventListener("visibilitychange", function() {
  if (document.visibilityState === 'visible') {
    backgroundMusic.play();
  } else {
    backgroundMusic.pause();
  }
});``` just found this
#

might try adjusting that

proven lantern
#
window.onfocus = function() {
  console.log('Got focus');
}```
civic scroll
#

use addEventListener instead

proven lantern
#

yeah

#

just copied that. but using window should let you know when they alt + tab to a different applications and then back to the browser

split hazel
#

step 1

#

say brazil is good

#

step 2

#

@quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle @quartz kindle

proven lantern
#

does discord.js require above version 14 for nodejs ?

split hazel
#

@woeful pike do you happen to know a good way of using twitter emojis in your webpage instead of default os ones

#

i found a library but that only gives you a svg

ancient nova
split hazel
#

yeah

wheat mesa
split hazel
#

thanks for the link

proven lantern
#

oof

split hazel
#

appreciate it

craggy pine
#

Would it be safe to set ā€œrestTimeOffsetā€ to 200 for the main purpose of reacting faster to a msg lol

spark flint
#

odd question but uh

what is the best way to download a spotify song with nodejs

quartz kindle
#

you might need to manually delay reactions if you use a too low offset

#

djs's ratelimit handler sucks for reactions tho

craggy pine
#

Hmm

#

Good to know ty

quartz kindle
#

i use offset 0

#

and manually control my rate limits

craggy pine
# quartz kindle i use offset 0

Console logging the event i see an object. Timeout, limit, ect. This is spat out from reacting. Can you explain what ā€œtimeoutā€ and ā€œlimitā€ specifically means in terms of the ratelimit?

quartz kindle
#

limit = how many per X you can do

#

timeout = within how much X time you can do that many

#

reactions should be 1 per 250ms

#

messages 5 per 5s

craggy pine
#

Ok so having my offset 85 i have
Timeout: 335
Limit: 1

quartz kindle
#

yes

#

250 + 85

craggy pine
#

Ahhhh thats where 250 plays in i did math and got that

#

Tyty

quartz kindle
#

reactions are weird because everything else is X per N, for example 5 messages per 5 seconds

#

reactions instead are always per 1

#

instead of 4 reactions per second, for some reason they do 1 reaction per 0.25 seconds

craggy pine
#

šŸ‘

quartz kindle
#

which screws up a lot of rate limit handlers

sudden geyser
#

so you just need to scale it down

quartz kindle
#

djs's ratelimit handler emits a ratelimit event everytime you go beyond the limit

#

for example if you send 6 messages in under 5 seconds, it will send the warning on thr 6th message

earnest phoenix
#

poor tim

#

šŸ˜”

quartz kindle
#

but since the limit for reactions is 1

#

if you send 2 reactions to a message, it will trigger the warning

#

almost every time

#

lol

split hazel
#

nice

boreal iron
#

imagine using reactions

prime mist
#

Checking my client rate limiting implementation to see if I need to fix stuff

frozen tundra
#

uh i am trying to use a embed for my description but its not showing in preview

prime mist
prime mist
fiery stream
#

Hi peeps

sudden geyser
#

why hello there

oak cliff
#

general kenobi

bright hornet
#

is there a way to use role id instead of pinging it? for ex: ?role-add <role id> <member id>

sudden geyser
#

Yeah

#

Depends on your library though.

lament rock
lyric mountain
#

Just split by space and grab first index

sudden geyser
#

yeah I was going to say that

#

but you bare the cost of 400 bad requests

lyric mountain
#

I outsmarted your outsmarting

sudden geyser
#

which counts towards your global limit

#

which hurts you

#

therefore you haven't outsmarted me

#

I'm still superior SenjoSmart

lyric mountain
#

oh my goood

lament rock
#

Caching the roles could work

earnest phoenix
#

I outsmarted both of u here is the solution: stop coding kthxbai

lament rock
#

based

sudden geyser
#

and that's why you major in business instead of cs

woeful pike
#

would prefer a business major over cs probably tbh

wheat mesa
#

I need to think of a c++ project to try out

#

I never know how to dive more into depth in a language

#

anyone have any ideas

lament rock
#

Definitely not audio processing

earnest phoenix
#

sounds like u need smth like that Ophidian :^)

boreal iron
sudden geyser
earnest phoenix
prime mist
#

I hear Rust is the new hotness.

sudden geyser
#

Oh yes it is šŸ¦€ šŸ¦€

quartz kindle
#

rust is rusty

fiery stream
#

Ping

boreal iron
#

Dong

sudden geyser
#

No, you say "pong".

fiery stream
#

Yeahh you say pong then then reply with the ms

boreal iron
lament rock
proven lantern
#

how do i listen to the message event with the new discordjs lib?
client.on('message') doesn't seem to work. The only thing i am going to do is tell them to use slash commands if they do a !help command

earnest phoenix
#

messageCreate

boreal iron
#

lol Ben

rocky hearth
#

Error: HTTP Exception: 400 (You can only bulk delete messages that are under 14 days old.)
Any other way around for this?

wheat mesa
#

Check the timestamp and compare with current date or just catch the error and handle it

#

But if you’re asking how to bulkDelete messages older than 14 days, you can’t. It’s an API limitation set by discord

rocky hearth
#

Was that limitation always there?

wheat mesa
#

Yes

rocky hearth
#

and it will fail, if atleast one message is older than 14 days.
Discord wont try to delete some messages, right?

wheat mesa
#

I don’t know how djs handles it internally

hybrid cargo
wheat mesa
#

Sounds like an API abuse issue at that point though

#

There’s a reason there’s a limit

#

Deleting one or two messages? Fine, delete a ton individually? Not a good idea

rocky hearth
#

can I fetch last 14 days old messages ?

hybrid cargo
bright hornet
#

How can I disable the sending embed if the bot doesn't have the permission?

lament rock
#

Wait for the successful mute and then send the embed

#

No, you can't reliably guess if it'll succeed or not, because a request can fail for reasons out of your control

bright hornet
warped turtle
bright hornet
#

ah wrong code line

hybrid cargo
#

Just check if the client has kickMembers permission in the guild. If it does kick and then send embed. If it doesnt then send missing permission error.

The catch() block can give any type of error and not just missing permissions. maybe the user had a higher role heirarchy wtc

bright hornet
# warped turtle I recommended to do kick first
targetMember.roles.add(role).catch(() => {
    message.reply("Missing Permission")
  })

message.channel.send({embeds: [muteEmbed]});``` this is the format im using, but still sending the embed
warped turtle
#

I don't know what's that do

bright hornet
bright hornet
#

wrong des lmao

hybrid cargo
bright hornet
#

and yes adding the Mute Role

earnest phoenix
#

Honestly why check permissions at all just check if the user has a higher role then them

#

:p

bright hornet
#

the prob is when the bot doesn't hve the perms it still sending the embed

earnest phoenix
#

Ah

warped turtle
#

Dang

hybrid cargo
earnest phoenix
#

I don't think there should even be a need for a try/catch here tho

hybrid cargo
#

well yeah, checks can be added to prevent all errors before trying to add the role

bright hornet
#

didn't work

earnest phoenix
#

Are you sure the bot doesn't have the permission?

earnest phoenix
#

Does your bot have administrator?

bright hornet
earnest phoenix
#

Mmm

#

It seems like the if statement is running through cause it evaluates as true

earnest phoenix
#

iirc they don't recommend using strings anymore as it can cause some issues (unless I heard wrong)

hybrid cargo
earnest phoenix
#

Well yes it still supports it

bright hornet
#

ohh

earnest phoenix
#

but it is highly discouraged to use it

#

I would think there is a performance or technical reason to it (one I dont know)

hybrid cargo
#

Yep it supports strings

earnest phoenix
#

Well yes it does support strings but they discourage from using them

#

either way it is a good idea to swap to using flags anyway if the devs don recommend strings

#

Even if it doesn't fix the issue

wheat mesa
#

Please šŸ‘ don’t šŸ‘ use šŸ‘ the šŸ‘ strings šŸ‘

lament rock
raw nest
prime mist
#

Just using flags / bigints without the extra conversion is much more straightforward.

bright hornet
#
const seconds = Math.round(process.uptime());
    const days = seconds >= 86400 ? Math.floor(seconds / 86400) : 0;
    const hours =
      seconds >= 3600 ? Math.floor((seconds - days * 86400) / 3600) : 0;
    const minutes =
      seconds >= 60
        ? Math.floor((seconds - days * 86400 - hours * 3600) / 60)
        : 0;
    const secondsRemain = seconds - days * 86400 - hours * 3600 - minutes * 60;``` if i put this on mongodb, how can i make it updated every seconds?
woeful pike
#

you definitely don't want to do this

bright hornet
#

wait why

woeful pike
#

save a date to the database and derive the remaining time by comparing that time with the current time instead of updating a database every second

bright hornet
#

with country on it

woeful pike
#

you can fix formatting, this isn't the correct approach for it though

#

date-fns lets you format dates the way you need

bright hornet
#

package?

woeful pike
marble juniper
#

wtf

#

did they change logo or something

woeful pike
#

yeah the site is completely redesigned

#

looks really good

bright hornet
#

ah thanks for recommendations

woeful pike
#

my only issue is the scrollbar behaves really weirdly for some reason

#

but that could be a browser problem

marble juniper
#

Finally

#

d a r k t h e m e

#

it should be illegal for a site not to have a dark theme

#

smj

split hazel
#

now that i think about it

#

d.js should just use core.js

#

it will make it backwards compatible with older node versions and keep their "fucking annoying and cringe desire to use the latest sharp edge syntax" on every update

cinder patio
#

or just use typescript or babel which allow u to use the latest features

#

and transpile the code to es5

marble juniper
#

yes

split hazel
#

that too

cinder patio
#

no need to bundle polyfills which only increase size

split hazel
#

but unfortunately the djs team has a stick up their asses

#

so we'll never see those

marble juniper
#

adding more shit to the pile wont hurt

cinder patio
#

I think the next big version is rewritten in typescript?

split hazel
#

i'll probably end up maintaining a custom version of d.js which is transpiled to an older node or uses core

cinder patio
#

or did they scrap that

split hazel
#

if they dont use ts or something like that

#

it isnt too much work to maintain

#

just merge every once a while

foggy ermine
#

hey guys

#

where do you usually host your bots?

#

on a cloud service or you buy a server box?

marble juniper
#

vps

foggy ermine
#

vps?

marble juniper
#

virtual private server

#

aka cloud server

foggy ermine
#

o

#

how do you become a translator?

atomic kindle
#

by translating

dry imp
foggy ermine
#

btw

#

nice kronii pfp

dry imp
#

thx weeb

light flint
#

Anyone help me

earnest phoenix
light flint
earnest phoenix
#

You can write here

light flint
earnest phoenix
light flint
#

I also read it but can't understand

earnest phoenix
#

Read it again if you want us to give you a code block we can't do that

boreal iron
#

Did you already try the code example, adding your webhook token to it etc.?

light flint
#

But no success

#

Pls help me

boreal iron
#

Well then, show your code - without your webhook token

boreal iron
#

or not

feral aspen
#

i need help

feral aspen
earnest phoenix
#

I want some opinions on this rpg bot im making. I am trying to make it as fun as possible so I wanna add some competitiveness to it. My thought process was to try and model it similar to how those mobile games are like Rise of Kingdoms or Raid Shadow Legends, where a person has "power" essentially how strong they are. The goal is to become the most powerful. I am wondering if I should continue down that train of thought of trying to model it after those mobile games or come up with a different approach to a competitive model.

lament rock
#

can't exactly take it in the same direction as mobile games because of graphical limitations

earnest phoenix
#

stop using glitch for discord bots man

boreal iron
#

Just log your "intermediate value" and you will see it's not what it's supposed to be

earnest phoenix
#

arent you pinging your glitch project to "host" your bot

#

so its against the tos and you can get terminated for that

#

lmao

#

exactly

#

Glitch isnt a hosting

#

yes

#

get a vps if you have money

#

and learn basic js then discord.js

earnest phoenix
earnest phoenix
spark flint
#

Lol

simple stump
#

How do you make HTTP requests to a GraphQL API? It seems to be different from making regular HTTP requests. Where normally I can specify the path like this:

function someFunction() {
    console.log("Doing the thing");
    axios.post("https://some_website.com", {
        id: 15125
    }).then((res) => {
        console.log(res);
    }).catch((err) => {
        console.error(err);
    })
}

GraphQL seems to do this differently. Don't question the website, but I'm trying to use this:
https://anilist.gitbook.io/anilist-apiv2-docs/overview/graphql/getting-started
Example query request section.

lyric mountain
#

it's very confusing tbh

#

even worse for who's managing the api

cinder patio
#

you have to use a client which makes the request for u

#

like apollo-client

simple stump
#

Ah I see. Yeah GraphQL is weird. First time using it šŸ™

sudden geyser
simple stump
#

I’ll look into Apollo-client. I’m currently using axios so ĀÆ_(惄)_/ĀÆ

simple stump
sudden geyser
#

You don't need Apollo for this. I'd argue it'll make the process much more complex

#

You give it a json string

simple stump
#

Ah I see.

sudden geyser
#

With query and variables

simple stump
#

Set the query and variables as JSON variables and pass it as a parameter?

#

Yeah that worked. Thanks!

split hazel
#

graphql is so overengineered

earnest phoenix
#

y'all remember this

sudden geyser
#

I'd prefer GraphQL over what we currently have with REST APIs any day of the week

split hazel
#

graphql is basically rest with extra steps and some sugar on top

#

way too much sugar

sudden geyser
#

It's nothing like REST at all

#

A single endpoint where querying and mutating is separate

#

Where joining different resources is simple

#

Where the single structure of operation(options): resource is standardized and all clients feel the same

#

Where there is an actual standard to APIs as opposed to some generic convention (REST) that's often not followed or built on top of other standards (e.g. swagger)

#

Trying to dumb GraphQL down to "just being over engineered" is disingenuous imo

#

Many REST APIs replicate what GraphQL has already done and provide less—select fields, joining resources, query language, etc.

split hazel
#

pov you think graphql is the future

sudden geyser
#

I think it's ideas are

#

I've applied them to a REST API I'm building and it's been so much better than what most REST APIs give us

#

Just like how React was revolutionary and people move to Svelte but carry on the paradigm and ideas it showed them

lament rock
#

@quartz kindle looks like that beamcoder doesn't support piping streams for filters. I have to stick with command line ffmpeg

quartz kindle
#

their filterer doesnt work?

craggy pine
#

Kind of an odd situation im in and idk if anyone would have any knowledge on what is happening.

I was creating music functions using the library ā€œDistubeā€ and kinda got myself ratelimited. Oh well. So i put my bot on my linux machine (same wifi but using a ipv6 tunnel) and for the most part, itll join, queue the song, immediately leave, and thats it. I can queue specific songs no issue but most fail. After thinking it was a distube related issue I figured out that when I disabled my ipv6 it works 100% no issue. I wonder why that could be. Distube uses ffmpeg, ytd-lp and other related things. Any ideas?

marble juniper
#

Absolutely no idea

wheat mesa
#

ytdl can only download a video at the speed youtube allows, which is just enough to buffer the video

#

could be something related to that

#

ipv6 isn't supported by everything quite yet

craggy pine
#

Well strangely enough, using my friends server setup identically as mine in terms of ipv6 tunnel and packages, it works flawlessly for him on ipv6 tunnel.

#

While mine i must disable my tunnel for it to work

split hazel
#

ipv6 is so messy

#

its supposed to be our future replacement and lifeline for ipv4 running out of ips

tranquil nymph
#

it already is, there are no other options

split hazel
#

yet not that many services support it let alone broadband providers

tranquil nymph
#

to be fair, ipv4 isnt close to running out yet

#

so it makes sense that support is bare

split hazel
#

yeah but not too far either

tranquil nymph
#

that's true, and I expect more and more services will start to use it

drowsy flume
#

anyone know HTML here KEKW

tranquil nymph
#

probably the most

split hazel
#

if we didnt reuse ipv4 ips we'd already be at that stage šŸ’€

tranquil nymph
#

oh yea and double too

lyric mountain
#

I mean, there's a chance y2k38 will come before ipv4 overflow

drowsy flume
#
<body>
<img src="https://imgur.com/gallery/drjvJbY" alt="image">
<h1 class="test">IdleMiner Bot</h1>
</body>```
do you know why the image isnt showing, just showing the alt text
#

do imgur links not work

drowsy flume
#

oh

lyric mountain
#

that's imgur url, not the image's

#

the correct url will always be prefixed by i. and have the extension at the end

split hazel
#

i also dont get how html lets you get away with not closing some tags

#

quite inconsistent

tranquil nymph
lyric mountain
#

there'll always be some who leave it for later tho

lyric mountain
#

sometimes even big enterprises

lyric mountain
drowsy flume
#

oh ty that worked šŸ˜„

boreal iron
tranquil nymph
#

try xml troll

boreal iron
#

His entire code block isn't valid HTML anyways, doesn't contain html tags nor the doctype

tranquil nymph
#

although the usecases arent the same so the issue doesnt really apply, it is a worlds' difference. Just tag something with the closing character immediately if it only is one element

boreal iron
#

But modern browsers are capable of handling this

tranquil nymph
sudden geyser
#

I'd like the closing character to just not exist for elements without children, where we'll be left with this:

<br>

A small change. :)

earnest phoenix
#

breh
discord rlly know what they doing with cloudflare

#

they banned my application after 1.5 year of development-_-
constatly runnin on the uptimerobots cloud

sudden geyser
#

Yeah repl.it isn't optimal for hosting bots.

earnest phoenix
sudden geyser
#

Uptimerobot I assume is just pinging your host.

#

But you have the code hosted on repl.it

#

Else where do you have it hosted

modest maple
#

tou can tell by that ss

#

and also, 1.5 years of development and you're still using replt it? Interesting way of doing things

earnest phoenix
modest maple
#

thats not how that works

earnest phoenix
modest maple
sudden geyser
#

It doesn't matter what services you munge together in your bot's process. You're still using repl.it, which is the problem.

spark flint
#

Replit is the host

sudden geyser
#

Heroku?

spark flint
#

Uptime just pings to keep it alive

#

Or get a cheap vps

modest maple
#

consider spenting like $4 a month for a vps

earnest phoenix
modest maple
#

although it'll be shit for AI

spark flint
#

Get a £2 even

modest maple
#

but it'll still be better than Repl

earnest phoenix
#

just bunch of if statement

tranquil nymph
#

just host on oracles free cloud servers

earnest phoenix
#

just tryna brague by AI

modest maple
#

yikes

sudden geyser
#

oracle
ima have to stop you right there

tranquil nymph
#

works fine

#

lots of things to hate on but at least they provide their services for free with a pretty neat environment/specs

sudden geyser
#

If you want free hosting just search for them (e.g. Heroku). Just know what you're getting yourself into.

earnest phoenix
sudden geyser
#

Like a 2009 macbook?

earnest phoenix
#

like 2004 Windows XP

sudden geyser
#

maybe

earnest phoenix
#

on my grandad's place.

tranquil nymph
#

if it can run modern websockets from common language sdk's

earnest phoenix
#

but, I don't get it, why have I got banned from discord?

sudden geyser
modest maple
spark flint
#

You’re not banned

tranquil nymph
#

make a ticket to t&s to figure that out

spark flint
#

It’s just ratelimited

modest maple
#

so someone else on your IP got fucked

spark flint
modest maple
#

which intern fucked you

tranquil nymph
#

I have no idea what the error is

spark flint
#

It’s not banned, just ip limited for like 60 mins

earnest phoenix
sudden geyser
tranquil nymph
spark flint
#

Yeah

tranquil nymph
#

lmao

earnest phoenix
#

guess I'll leave that project dyin on my local pc.

tranquil nymph
#

literally wait a day and you'll be fine

earnest phoenix
sudden geyser
#

They won't

#

Since this error will keep occurring in the future

earnest phoenix
#

to get enough moni for the vps

tranquil nymph
#

contabo is jokingly cheap, you can pay it from a 13 year olds' pocket cash

#

and its really high quality for the price

sudden geyser
#

Try asking your parent/guardian

earnest phoenix
#

rip

sudden geyser
#

better investment

#

asterisk

tranquil nymph
#

I don't think I mentioned you had either, it was in manner of speaking

cinder patio
#

Host your bot on heruko until it grows enough for you to care to host is on an actual VPS

earnest phoenix
#

let's wait till the bot grows

tranquil nymph
#

doesnt heruko use the same ip across multiple envs

#

that wont work out well if a tcpclient is ran on just one

earnest phoenix
#

till then

tranquil nymph
#

have fun attempting that lol

earnest phoenix
#

bet

tranquil nymph
#

what language are you writing it in anyway

earnest phoenix
tranquil nymph
#

lovely, have fun porting

split tendon
#

does anyone got unverifed bot for no clear reason without notice about that?

sudden geyser
#

Please clarify.

split tendon
#

bot just got unverifed

solemn latch
#

probably best to make a support ticket to discord

quasi breach
#

Bot was verified, but before 30 min, bot just got unverified again for no clear reason, and without any notification.

#

This not make any sense

sudden geyser
#

Contact Discord.

#

And pray you don't end up waiting 3 months.

tranquil nymph
#

good chance its a caching issue, but you can make a ticket either way if not

simple stump
#

I have a function that returns an embed:

function returnEmbed() {
  const embed = ...;
  return embed;
}

And a function that adds the embed to an array and sends it:

let embeds = [];
function doSomething() {
  for (let i = 0; i < someNum; i++) {
    embeds.push(returnEmbed());
  }
  message.channel.send({ embeds: embeds });
}

However, I get the error embeds[0].description is a required a field. How would I fix this?

tranquil nymph
#

if you dont have any values set inside the embed before sending it, it will throw an error because its empty, makes perfect sense to me

#

populate either a field, or the description, or the title of an embed for it to be created successfully

wheat mesa
#

you definitely don't if you're getting that error :p

simple stump
#
        const embed = new Discord.MessageEmbed()
            .setTitle(info.title.romaji)
            .setDescription("Info on " + info.title.romaji + ".")
            .addField('Format', "`" + info.format + "`", true)
            .addField('Titles', "English:\n`" + info.title.english + "`\nNative:\n`" + info.title.native + "`", true)
            .addField('Status', `\`${info.status}\``, true)
            .addField('Episodes', `\`${info.episodes}\``, true)
            .addField('Average Duration', `\`${info.duration}\` minutes`, true)
            .addField('Average Score', "`" + info.averageScore + "/100`", true)
            .addField('Popularity', "`" + info.popularity + "`", true)
            .addField('Source Material', "`" + info.source + "`", true)
            .addField('Adult', "`" + info.isAdult + "`", true)
            .setFooter("Requested by " + message.author.tag)
            .setTimestamp()
            .setColor(message.member.displayHexColor);
tranquil nymph
#

took the words right out of my mouth

simple stump
#

I logged all the data and none of it is null

wheat mesa
#

can you show your actual function code

simple stump
#

What's strange is that I can send the embed individually

#

But I can't send it all at once via an array.

frigid robin
#

When my bot should reply to a message but has no "send_messages" permissions in the channel, it ignores it because I always check whether

message.channel.permissions_for(message.guild.me).send_messages

.However, I see errors in my logs where it doesn't ignore it and tries to reply. Error is 403 Forbidden (error code: 50013): Missing Permissions.
How is that possible? I could not reproduce locally

quartz kindle
#

the function is returning undefined

spark flint
quartz kindle
#

why do they publish dev versions to npm @_@

quartz kindle
frigid robin
#

I'll have to add to my logs to know, thanks :]

boreal iron
#

If you send embeds for example then also check if you have the permission to send them

frigid robin
#

yeah looks like it could be a link sometimes. but i don't really wanna check whether I'm gonna reply with a link OR file OR whatever..
maybe i should just ask for admin perms for my bot? do most ppl do that?

boreal iron
#

lol

#

Why don’t you know which content you’re sending?

#

You should better require message send, embeds, message links permissions then

#

Instead of administrator perms

frigid robin
#

the bot learns what to answer, it's user dependent and it may change from time to time

frigid robin
boreal iron
#

Errr no the event is always the same

#

You gotta check the permissions for your bot when the event is triggered if it hasn’t enough permissions then return the event

#

Like you did here

split hazel
boreal iron
#

But if you also send embeds, links etc. expand this permission check

#

And check if your bot has the permissions to send embeds and links or don’t reply

boreal iron
#

Copyright strike 1 for you Sir

earnest phoenix
spark flint
earnest phoenix
spark flint
#

MessageEmbed has now been renamed to Embed.

#

oh no

earnest phoenix
#

lmao

spark flint
#

client.rest.on instead of client.on
plump_panic

boreal iron
#

@quartz kindle @split hazel
The leak also includes the algorithms for all of Samsung's biometric login features, bootloader source code from all recent devices, confidential source code from partner Qualcomm, source code from Samsung's activation servers, and full source code for Samsung account authorization and authentication, including APIs and services. In the medium and long term, this information should certainly provide an attack surface for Galaxy devices.

split hazel
#

link?

#

i would love to see the bootloader leak

#

to see how they generate their bootloader lock codes

#

im assuming samsung also locks them

boreal iron
#

Dunno need to so some onion searches

#

Just shared it (once again)

boreal iron
#

If that’s a real source I gotta laugh my ass off

spark flint
boreal iron
#

Seems to be as devastating as checkm8 for iOS

sudden geyser
#

checkm8 wasn't a source code leak though

split hazel
#

giv source plz tank yu

boreal iron
#

The results can be devastating

sudden geyser
#

was it really devastating

#

all I remember it for was jailbreaking

tawny lava
#

this is WAY more devastating than checkm8

boreal iron
#

Indeed

#

End users can be fucked here remotely

#

Not so for checkm8

tawny lava
#

mhm

#

potentially

quartz kindle
#

gg chinese galaxy clones incoming

boreal iron
#

But still you will have more access you should have which will result in scammers fucking off more people

#

I mean I would never put anything important on a jailbroken iOS device, too

split hazel
#

ayo whos breaking out of jail

spark flint
#

lizard

marble juniper
#

lol

#

should I be concerned now as a samsung user

boreal iron
marble juniper
#

Surely samsung is gonna do a security patch of some sorts.... right?

boreal iron
marble juniper
#

tf

sudden geyser
#

yeah just tell them to give you more than 2 years of software updates

tawny lava
#

jailbreakers be like: why yes I do want to run closed source literal exploit code on my device

sudden geyser
#

well before there were good reasons to jailbreak

#

today for the average person not so much

boreal iron
#

In the past yeah, not anymore

#

I agree

tawny lava
#

it's way more of a pain now cuz if you restart it goes away

quartz kindle
tawny lava
#

and you have to resign the app that re-enables it every 7 days if u don't have a dev account

quartz kindle
#

i dont see how attackers could push updates to it

boreal iron
#

But yeah doesn’t make much sense

#

As you don’t know how to contact them

quartz kindle
#

they could spoof and intercept samsung servers with a mitm attack

sudden geyser
#

who restarts their phone

simple stump
quartz kindle
#

possibly with dns poisoning as well

sudden geyser
#

we never restart our phones but we're reluctant to not restart our laptops

sudden geyser
#

this bad boy's been running for 25 days

#

no problem whatsoever

marble juniper
sudden geyser
#

that's probably killing your battery

marble juniper
#

how

boreal iron
sudden geyser
#

just going through the process alone

simple stump
#

If I have an array:

let genres = ["action", "adventure", "comedy", "drama", "fantasy", "horror", "music", "mystery", "psychological", "romance", "sci-fi", "slice of life", "sports", "supernatural", "thriller"];

How would I get the item most similar to a String?

marble juniper
#

bruh

sudden geyser
#

you'd probably want a frequency table thought you meant most frequent

quartz kindle
simple stump
quartz kindle
#

there are many libs on npm for it

split hazel
#

what i was gonna say <3

marble juniper
#
split hazel
#

levenshtein is the homie

boreal iron
marble juniper
boreal iron
#

Even more now

#

I mean you can attack each Galaxy in public networks now acting as man in the middle Samsung security server

#

Ffs

#

Driving around in your car fucking off Samsung users with a public WiFi hotspot

#

As most people don’t disable WiFi anyways

marble juniper
#

Just

#

don't auto connect to them

solemn latch
#

its crazy to me people leave autoconnect on

marble juniper
#

Also does this even do anything lol

marble juniper
split hazel
boreal iron
marble juniper
#

I got bluetooth enabled cuz of the corona warn app lol

solemn latch
#

my wifi turns off automatically if I'm not somewhere Ive logged into wifi before šŸ‘€

#

bluetooth is always on, but mostly because of my watch

marble juniper
#

My wifi turns on in places I use wifi frequently and turns off everywhere else

solemn latch
#

yeah

marble juniper
#

so basically everytime im at home

solemn latch
#

that setting

marble juniper
#

lol

solemn latch
#

it saves me so much battery life when on the road

quartz kindle
marble juniper
#

np

#

lol

quartz kindle
marble juniper
#

no idea what any of this means

#

but yes

quartz kindle
#

lmao

#

leftmost col = searched word

#

colored cols = closest result according to algorithm in the header

marble juniper
#

ok

split hazel
#

and the error is obviously how accurate it was

#

well how accurately it can display the result i think

boreal iron
quartz kindle
#

the red rows are the errors

sudden geyser
#

came to find the most similar string, walked out with a history lesson on string algorithms

quartz kindle
#

matches that the algo got wrong

marble juniper
#

lol

#

Idk if I need it anymore honestly

#

its pretty useless

#

I got another app with my covid-19 recovery certificate on it

#

So I don't need it at all lol

quartz kindle
marble juniper
#

but more accurate

#

lol

quartz kindle
#

fastest-levenshtein is about 4x faster than fast-dice-coefficient

marble juniper
#

if speed maters use levenshtein then idk

boreal iron
#

I feel like Tim is benchmarking the entire world

marble juniper
#

Yes

#

He is gonna run out of benches to mark

quartz kindle
#

im editing the fast-dice-coefficient benchmark to include fastest-levenshtein

#

lmao

#

the author posted this

#

but im running their exact same benchmark file

#

and i get completely different results

#

lmao

boreal iron
quartz kindle
#

provided their benchmark is 3 years old

#

and node.js made huge performance improvements since

boreal iron
#

Why are you spending time on that? Is your api already done and released?

quartz kindle
#

😩 😩 😩 😩 😩 😩

#

y u bully me

boreal iron
quartz kindle
#

am working on it tho

boreal iron
#

I sent you some moneys…
You’re mine now!!

quartz kindle
#

im kinda having to work simulatenously on my bot and api, since my bot depends on it

boreal iron
#

Are you even working on one of it atm?

quartz kindle
#

yesh

#

i made slash command autocomplete with the api source files, so i dont need to query the api for this

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

@sage bobcat

neat ingot
#

what is this french your doing?

quartz kindle
#

french?lmao

neat ingot
#

yisun, kesun, sundre?

quartz kindle
#

those are names of asteroids

neat ingot
#

ahhh neat šŸ˜„

quartz kindle
#

doing text search on 500k asteroids is expensive =X

neat ingot
#

searching for what kinda text?

quartz kindle
#

find asteroid by name

neat ingot
#

not viable to like, 'pre-parse' it and store the data in some name=> data object?

#

i mean, i guess your doing that if your using the data for slash commands šŸ˜„

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

yeah but you still need to loop over all names to find a match

neat ingot
#

yea, but only once, then you can object[name]

quartz kindle
#

once per search

#

im caching search results tho, so if someone searches for "abc", i'll cache that result for the next time "abc" is typed

neat ingot
#

yea, good time to spend some cache šŸ˜„

quartz kindle
#

im also using one of my libs for storing the data, so i get faster matching than arrays

neat ingot
#

I have a custom cache module I've privately maintained for like 5 years. šŸ˜›

#

oh, which lib?

quartz kindle
#

ftset

neat ingot
#

there is no github for this? i can only find npm package šŸ˜›

#

~ trying to plagarize your for loops here šŸ˜„

#

nvm i found it šŸ˜„

sage bobcat
#

One message removed from a suspended account.

neat ingot
#

wth is Symbol.iterator ?

quartz kindle
#

@sage bobcat

quartz kindle
#

for(const item of ftset)

neat ingot
#

ooohh interesting

stiff dust
#

hello

#

i have 3 role as He/Him She/Her They/Them

i want if someone get one of them remove the other two

#

what should i do for that ? (i dont want to write 3 if statement for each one)

#

djs

quartz kindle
#

by name or by id?

earnest phoenix
#

That is tthe goal of this project

#

take it to the farthest it can go

boreal iron
quartz kindle
#

this one is the biggest autocomplete one tho, the others are not even close

#

the autocomplete for database matches is like 40k, this one is a bit over 600k, split over 7 files for different categories

#

plus it needs to work like an array since the user can select multiple items from it

boreal iron
#

Ay ay sounds expensive

quartz kindle
#

yeah costs a few ms

#

still under 10ms tho

boreal iron
#

Well I mean in reference to my database it’s still not much but proves anyways an optimized database is one of the most important things

#

lmao another great news of today

#

Leading US internet providers incl. backbone are cutting of RU costumers

#

That means new IPv4 will be available soon KEKW

quartz kindle
#

lel rip

boreal iron
#

In reference to this RU is preparing to cut their internet off from the entire world

#

I laugh my ass off

quartz kindle
boreal iron
#

Well makes me smile as my index is round about 466GB iirc

quartz kindle
#

xDD

boreal iron
#

I think I shared that a while ago

stiff dust
boreal iron
#

I was close

stiff dust
quartz kindle
# stiff dust guildMemberUpdate event

you want to add the role with code and remove the others with code? or you want to add the role with discord and detect and remove the others with code?

earnest phoenix
#

Still not sure what approach I wanna take with this rpg bot šŸ˜”

stiff dust
#

if someone get role 1

#

bot remove role 2 and 3

#

and also if get role 2 remove 1 and 3

#

and for 3 remove role 1 and 2

warped turtle
stiff dust
#

i can write it in a hard way

#

im looking for easier way

warped turtle
#

When member get a role in that list remove the other role that isn't the role that was added

#

I can't give you an example idk JavaScript

stiff dust
#

how to remove others except that one

craggy pine
#

Loop thru the roles the user has and if the role.name = the role they recieved ignore, the rest remove em

warped turtle
#

Good luck making your bot tho

quartz kindle
# stiff dust i want in guildMemberUpdate
const roles = [id1, id2, id3] // he/him, she/her, they/them
let added;
for(const role of roles) {
  if(!oldMember.roles.cache.has(role) && newMember.roles.cache.has(role)) {
    added = role;
    break;
  }
}
const other = roles.filter(x => x !== added);
for(const role of other) {
  if(newMember.roles.cache.has(role)) {
    await newMember.roles.remove(role);
  }
}
#

something like that

stiff dust
#

well it make sense

#

tnx alot

simple stump
#

If I have a function that takes time to return like this:

function myFunc() {
  let someValue = "yes";
  // HTTP requests to https://myapi.net
  axios.post("https://myapi.net", {
    id: 15125
  }).then((res) => {
    console.log("It worked!");
    // Return res.data.
    return res.data;
  }).catch((err) => {
    // Log the errors.
    console.error(err);
    return false;
  });
  return someValue;
}

The code works fine and, "It worked!" Is logged. However, the function always returns yes and never res.data. How do I make the function return res.data?

quartz kindle
#

by using promises and async/await

#

await axios.post

simple stump
#

Aight. tyy

quartz kindle
#

you can do this instead, looks nicer:

async function myFunc() {
  try {
    const res = await axios.post("https://myapi.net", { id: 15125 });
    return res.data
  } catch(e) {
    console.log(e);
    return false;
  }
}
#

or even this

function myFunc() {
  return axios.post("https://myapi.net", { id: 15125 }).then(res => res.data).catch(e => !!console.log(e));
}
simple stump
#

Would it be possible to edit a replied message? I can edit a sent message, but not a replied one.

sudden geyser
#

If you own it, yes.

#

Just get the replied message's ID and edit that.

simple stump
#

Ah I forgot that I needed to include fetchReply haha. Thanks!

boreal iron
#

Well yeah you should have been more specific then

#

That’s only required for replies on interactions

blissful coral
#

Hey guys

#

I don't know a easier way of doing this so its less code but

#

Anyone know a way where I could compress this down a few lines?

#

Basically I have an array of 3 elements and each element being another array with 3 numbers inside as a tictactoe board layout

#

When a player makes a move I am doing a check for which location it is (1-9) and then it correlates it to the correct board slot in the array form. Then it checks to make sure that if the board already has a X or O (1 or 2) in it then it doesn't replace it there

neat ingot
sudden geyser
#

Well, you have this.board[Math.floor(location / 3)][(location - 1) % 3]; to get the current position in the board.

simple stump
#

My bad for not specifying earlier. Unfortunately editing the reply doesn't work and I get the error, Unknown Message.

await interaction.reply({ embeds: [loadingEmbed], ephemeral: true, fetchReply: true }).then(async (msg) => {
  console.log(msg); // Logs correctly.
  functions.searchGenre(msg, genreName, 1); // msg.edit doesn't work
}).catch((err) => {
  console.error(err);
});
blissful coral
#

I have the winning lines part to do a final determination just like yours but its in a different part of the code

#

Thanks Klay for the info

stiff dust
boreal iron
simple stump
blissful coral
boreal iron
#

Or you wouldn’t be able to log it

simple stump
#

Oh oops. How would I get the correct object then?

boreal iron
#

It’s probably your function expecting your parameter msg to be something different

simple stump
#

yea im just trying to edit the message replied

boreal iron
#

Just try msg.edit(…) please to make sure Im not wrong

#

Instead of using your function

simple stump
boreal iron
#

Wut

simple stump
#
await interaction.reply({ embeds: [loadingEmbed], ephemeral: true, fetchReply: true }).then(async (msg) => {
  //console.log(msg);
  msg.edit("test");
}).catch((err) => {
  console.error(err);
});
#

Whoops that showed my name lol

boreal iron
#

Ehm test it please with a non-ephemeral

#

reply

simple stump
#

aight

sudden geyser
simple stump
#

mb i shouldve tried that first

blissful coral
#

So it'd be

sudden geyser
#

Will it be 0?

boreal iron
#

Hmm weird

sudden geyser
#

Given your code ranges from 1 to 9

boreal iron
#

So ephemeral messages can’t be edited?!

blissful coral
#

1 and 2 would return at 0 because its Math.floor()

#

So if I do - 1 it'll be -1

simple stump
sudden geyser
#

I think it works as intended.

boreal iron
# simple stump yea idk haha

Hmm I’m unable to search the docs atm, let’s see if @earnest phoenix replies. He usually knows that stuff

blissful coral
#

OH I see what you meant

#

I thought you mean doing Math.floor(location / 3) - 1

sudden geyser
#

Ah, yeah

#

Tried that first actually

blissful coral
#

Yeah that was why I said no lol sorry

#

Thanks for explanation

boreal iron
#

Np

#

My gosh edited a 2 chars message

#

_thanks auto correct _

lyric mountain
#

What does those $9 and $5 mean?

prime mist
#

So you can access the results as a variable.

lyric mountain
#

Chrome console has that?

#

I thought it was output-only

#

Good to know

bright hornet
spark flint
#

Error: Client network socket disconnected before secure TLS connection was established

Error: socket hang up

left verge
#

alguien que hable espaƱol??

quartz kindle
#

.catch(err => console.log(err)) or .catch(console.log)
not .catch(err => console.log), this doesnt log anything

bright hornet
sudden geyser
#

no

quartz kindle
bright hornet
#

šŸ˜•

bright hornet
quartz kindle
#

you will have the answer when you fix all your catches

bright hornet
#

ahk

earnest phoenix
#

how do I make my bot mention someone? (Like this: @earnest phoenix)

#

for example, user.id sends the user's ID