#development

1 messages · Page 66 of 1

lyric mountain
#

You probably mean per-click ads

lament rock
#

a paid user is worth so much more than an ad supported user

lyric mountain
#

There are also the trackers, that yt sells to partners for profile building

lament rock
#

On the scale yt is on, that isn't feasible for maintaining themselves

hidden gorge
#

why wont you work!

lyric mountain
#

Well, then tell me why yt allows upload with no clear max limit

#

If it was hurting their pockets they wouldn't allow it

fervent moss
lament rock
lament rock
hidden gorge
lament rock
#

packet sniff loading up Discord on your device

lyric mountain
#

Which returns to my original point

lament rock
#

thats what theyre doing with 4k video

lyric mountain
#

Never said anything abt 4k

lament rock
#

im just saying

lyric mountain
#

Yes, but that's an edge case

lament rock
#

not really

#

4k is a major resource sink

hidden gorge
lyric mountain
#

I was talking about hosting videos on youtube

#

4k are edge cases, they aren't nowhere near the majority of all videos

lament rock
hidden gorge
lament rock
#

then theres your answer

hidden gorge
lyric mountain
#

Don't u use code highlighting?

#

Cuz syntax errors show be dead obvious

hidden gorge
#

i do

#

but it shows none

lyric mountain
#

Show the error u got

hidden gorge
#

but im using

const client = new Discord.Client({ intents: 131071 })
lyric mountain
#

Don't djs have enums for intents?

#

Where did u get that number?

hidden gorge
#

my friend

lament rock
#

Discord.Intents.resolve

hidden gorge
#

i mainly use 32767

hidden gorge
lament rock
hidden gorge
#

im sorry i have never used Discord.Intents.resolve

lament rock
#

Have you never used the require("discord.js").Intents class

hidden gorge
#

huh

lament rock
#

???!

hidden gorge
#

im confused

lyric mountain
#

Ok so, intents aren't a number

solemn latch
lyric mountain
#

They're actually a bitfield value

hidden gorge
lyric mountain
#

So, if u convert that number to binary, you'll get something akin to an array, but as a number

#

Each bit represents an intent

#

Ur number is probably outside their range

hidden gorge
#

will

const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] })```
work?
#

ok it did but i got a bitfielf

lyric mountain
#

Don't ask if something will work

hidden gorge
#

field

neon leaf
#

try this

const client = new Client({ intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.GuildVoiceStates
] }); client.login(config.client.token)```
neon leaf
#

whats the error

hidden gorge
#

missing intents

solemn latch
#

What djs versuon?

neon leaf
#

enable the intents on discord dev panel

hidden gorge
#

14.6

hidden gorge
neon leaf
#

show screenshot of the error

hidden gorge
lyric mountain
#

Did u save the file?

hidden gorge
hidden gorge
neon leaf
#

seems you havent removed old code somewhere

#

because it works for me on 14.6

#

and make sure you are using the correct token

hidden gorge
#
{
    "token": "token here"
}```
#

thats my config.json

neon leaf
#

your code says config.client.token, aka

{
  "client": {
    "token": "xyz"
  }
}```
hidden gorge
#

i removed my token

neon leaf
boreal iron
#

GatewayIntentBits.Guilds etc. doesn’t exist

neon leaf
#

it does

#

else my code wouldnt work when it does

#

its also in the official docs

boreal iron
#

No

neon leaf
boreal iron
#

Either import GatewayIntentFlags or select the right properties

#

GatewayIntentBits.Flags.Guilds

#

For example

neon leaf
#

look at the screenshot

boreal iron
#

or GatewayIntentFlags.Guilds

#

well... looks like the static GatewayIntentFlags has been removed again, lol

#

guess I need to update my version then

neon leaf
#

It has been deprecated in v13

boreal iron
#

nope

#

the constant exists in v14

#

watch previous versions of v14

#

and got removed and renamed again

#

has been the same constant like permission flags https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/util/PermissionsBitField.js#L19

#

but not for the gatewayintentflags anymore

#

I love the non-existing consistency of djs

#

there u go

undone magnet
#

@pliant gorge

lyric mountain
boreal iron
#

yeah for real

boreal iron
lament rock
#

new tc39 proposal for type annotations that are ignored by the runtime

lyric mountain
#

"Hey, I already saw that one"

"What do you mean? It's brand new!"

quartz kindle
#
  • apple
lyric mountain
#

steve jobs would be so pissed if he saw apple today

solemn latch
#

I would think so

neon leaf
#

Does anyone know if I can make a github action run when my package.json updates to a new version?

lyric mountain
sharp geyser
boreal iron
#

true

digital swan
boreal iron
# hidden gorge 14.6

can't see any wrong, may remove the djs package completelly and reinstall the latest one#

humble tree
#

any change to see the position of the own bot in the verification queue?

boreal iron
#

never

#

the details of the queue aren't public

#

for whatever reason

humble tree
#

Ok guess have to wait okeh

boreal iron
#

1-2 weeks iirc

neon leaf
#

I am actually going insane, I transferred my api from pterodactyl to raw docker and it got 8x slower, what. both are docker but raw docker is slower, the only difference id know is that I assigned the raw container an internal ip. does anyone know how to fix this?

solemn latch
#

Slower, like processing time, or ping?

neon leaf
#

I dont know, webrequests are 8x slower

solemn latch
#

Diffrent hardware? Diffrent location?

neon leaf
#

it just went from 100ms waiting time to 800ms, this is what I used to create my internal network that nginx reverse proxies:
docker network create Internal --driver=bridge --gateway=172.22.0.1 --subnet=172.22.0.0/16 --label=Internal

#

ok, confirmed its not the database ping, even for an html file it took 1.2sec

surreal sage
#

Ight so you know an object e.g { "a": 1, "b": 2 }
And you could do let { a } = object to get specific values
Would it be possible to do let {...} = object?

#

identifier expected hmm

surreal sage
neon leaf
#

why not just do

...```
surreal sage
#

I want to get a variable for all keys in an object

#
const {...} = {"a":1,"b":2} //Incorrect syntax but so you might understand what I want

a //1
b //2
quartz kindle
#

not possible, you need to know the keys

surreal sage
#

damn, thanks tho.

quartz kindle
#

the only way to create dynamic variables is using eval

#

which is not a good idea

neon leaf
#

speaking from experience lol

wheat mesa
#

just use eval in production so your users can get exactly what they want

#

;^)

quartz kindle
surreal sage
#

yeah I want to have auto-fill (the functionality that shows all variables & functions etc)

quartz kindle
#

in your code editor?

surreal sage
#

yeah

#

Forgot what it was called

quartz kindle
#

you can do that with either typescript or jsdoc

#

its called intellisense

surreal sage
#

built in feature of vsc

quartz kindle
#

vsc has a built in interpreter, but you still have to put it in your code so vsc can find it and display it

#

some things it can automatically assume

#

others you need to help it

eternal osprey
#

hey guys i have a question

#
Length operator+ (const Length& a, const Length& b)
{// Precondition:
    assert (0 <= a.minutes && 0 <= a.seconds && a.seconds < 60 && 0 <= b.minutes && 0 <= b.seconds && b.seconds < 60) ;
/*  Postcondition:
    Result is the sum of a and b.
*/
    // implement this function
    int total_seconds = a.seconds + b.seconds;
    int total_minutes = a.minutes + b.minutes;
    while(total_seconds % 60 == 0){
total_seconds = total_seconds - 60;
total_minutes++;
    }
    Length sum = {total_seconds, total_minutes};
    return sum;
}
```How would i ever call this function?
#

I mean, it doesn't even have a fucking name to call??

wheat mesa
#

It’s an operator

#

It gets called when the operator is used on that class

#

Look up “c++ operator overloading”

#

It’ll have a million resources that explain it better than I can lol

eternal osprey
#

owhhh operator overloading right? So if i use a + b it will automatically perform this function?

#

where a and b are Length variables?

wheat mesa
#

Yes

eternal osprey
#

How would i log the new values tho?

#

nvm i am stupide

#

Like in the above code ```c++
Length p1 = {1,2};
Length p2 = {5,6};

cout <<  p1 + p2; ;  ```How would this not work if i want to see the output of sum that i am returning?
wheat mesa
#

Because Length probably doesn’t have an ostream& operator<<

surreal sage
#
async function getBrowser() {
    return new Promise(async (resolve, reject) => {
        if (!session.browser) {
            try {
                const browser = await puppeteer.launch({
                    ...puppeteerOptions,
                });

                resolve(browser);
                session.browser = browser;
            } catch (err) {
                reject(err);
            }
        } else {
            resolve(session.browser);
        }
    });
}```
This lovely code, just keep it here

Another piece of code making use of the code above
```js
    return new Promise(async (resolve, reject) => {
        const browser = await getBrowser();
    });```
#

I don't see where I made await having no effect

lyric mountain
#

well, await doesn't make much sense inside a promise

surreal sage
#

I'm guessing I can remove ... from ...puppeteerOptions too

lyric mountain
#

use then instead

surreal sage
#

Yeah so that aint showin up

#

a

#

(above async function getBrowser())

#

I think that'd be better

#

oh wow what a surprise

#

How could I have it detect it as browserClass?

lyric mountain
#

No, I mean, not like that

#

resolve the promise with puppeteer launch

#

then await it

surreal sage
#

ah

#

I want to keep that session.browser possibly

lyric mountain
#
async function getBrowser() {
    return session.browser = await new Promise(async (resolve, reject) => {
        if (!session.browser) {
            try {
                resolve(puppeteer.launch({
                    ...puppeteerOptions,
                }));
            } catch (err) {
                reject(err);
            }
        } else {
            resolve(session.browser);
        }
    });
}
#

or just

surreal sage
#

Welcome to the world to coding ig

lyric mountain
#

that way u dont need to use then

surreal sage
#

gon type it out for the "hand feels"

#

great start

#
/**
 * Launch a puppeteer window with settings from config.json
 * Returns the browser and sets session.browser to it
 * @returns {Promise} Browser (Vanilla)
 */
async function getBrowser() {
    return (session.browser = await new Promise(async (resolve, reject) => {
        if (!session.browser) {
            try {
                resolve(
                    puppeteer.launch({
                        ...puppeteerOptions,
                    })
                );
            } catch (err) {
                reject(err);
            }
        } else {
            resolve(session.browser);
        }
    }));
}```
quartz kindle
#

thats still redundant

#

a function that returns a promise does not need to be async, nor do you need to await the promise

#
function getBrowser() {
  return new Promise(...)
}
#

if puppeteer.launch returns a promise, you dont need to create a promise either

surreal sage
#
/**
 * Launch a puppeteer window with settings from config.json
 * Returns the browser and sets session.browser to it
 * @returns {browserClass} Browser (Vanilla)
 */
function getBrowser() {
    return (session.browser = new Promise(async (resolve, reject) => {
        if (session.browser) return resolve(session.browser);

        resolve(
            puppeteer.launch({
                ...puppeteerOptions,
            })
        );
    }));
}```
quartz kindle
#
function getBrowser() {
    if(session.browser) {
        return Promise.resolve(session.browser);
    }
    return puppeteer.launch(puppeteerOptions).then(result => session.browser = result);
}
surreal sage
#
    return new Promise(async (resolve, reject) => {
        const browser = await getBrowser();
    });```
quartz kindle
#

no need for the promise there either

#

just return getBrowser()

surreal sage
#
    return new Promise(async (resolve, reject) => {
        const browser = getBrowser();
        const page = await browser.newPage()
        page.goto("google.com")
    });```
quartz kindle
#
return getBrowser().then(browser => browser.newpage()).then(page => page.goto("google.com"))
#

or make the containing function async

surreal sage
#

The function where this promise is in is planned to resolve on completion*

quartz kindle
#

that does resolve on completion

#

show how you want to use this function

surreal sage
#

well I can't since I'm getting different errors now 😃

quartz kindle
surreal sage
#

The function is supposed to be a task, it'd repeat itself continuously but only 1 task at a time

#

See it as a for loop with just 1 line of code in it

lyric mountain
#

Shouldn't u use interval then?

surreal sage
lyric mountain
#

Well, yes but u can just start the interval where you'd first call that function

quartz kindle
#

you want it to be infinite?

#

or to be interruptible?

#

you can use an async while

lyric mountain
#

Ayo tf

quartz kindle
#

or a recursive function

#

or an async infinite for

surreal sage
quartz kindle
#

fun fact, some people prefer an infinite for over an infinite while because its shorter to write

#

while(true) vs for(;;)

surreal sage
#

for (;;) errored last time I tried to but now it doesn't shrug

quartz kindle
#

exdee

lyric mountain
#

I just use forever { ... }

surreal sage
#

didn't know Blankcould be a parameter LUL

quartz kindle
#

what lang is that

lyric mountain
#

Groovy ofc

surreal sage
#

😒

quartz kindle
#

lel

#

still longer to write

lyric mountain
#

Same length

#

for(;;)
forever

surreal sage
#

f it, moving the code to check for the browser inside the functions where it would getBrowser()

quartz kindle
#

lel

boreal iron
surreal sage
#

🖕 you dirty 1996 or whatever javascript devs

sudden geyser
#

Anyone who writes for(;;) should be barred from programming

surreal sage
#

1995 fuck

#

almost shrug

quartz kindle
#
async function startLoop() {
  while(true) {
    const browser = await getBrowser();
    const page = await browser.newPage();
    await page.goto("google.com");
    // optionally await some timeout to add a delay before the next loop
  }
}
eternal osprey
#
ostream& operator<< (ostream& out, Length& length)
{// Precondition:
    
/*  Postcondition:
    the value of length has been read from in: first minutes, then ':', then seconds
*/
out << length.minutes << ':' << length.seconds;
    // implement this function
    return out;
}
Length operator+ (const Length& a, const Length& b)
{// Precondition:
   
    int total_seconds = a.seconds + b.seconds;
    int total_minutes = a.minutes + b.minutes;
    while(total_seconds % 60 == 0){
total_seconds = total_seconds - 60;
total_minutes++;
    }
    Length sum = {total_seconds, total_minutes};
    return sum;
}

int main()
{
   Length p1 = {44,55};
   Length p2 = {4,1};
   cout << p1 + p1;
  

    return 0;
}
```I honestly have no idea why it is not outputting this shit?
surreal sage
#
        let browser = new browserClass();
        if (!session.browserCreated)
            (browser = await puppeteer.launch({ ...puppeteerOptions })),
                (session.browserCreated = true),
                (session.browser = browser);```
shorten this 😉
#

(new browserClass() just so I can read off docs)

quartz kindle
#

why do you do { ...puppeteerOptions } tho

surreal sage
#

I like ... shrug

quartz kindle
#

i mean, sure, if you like duplicating the object every time

surreal sage
quartz kindle
#

dafuq is that cursed if

surreal sage
#

> me trying to shorten it

lyric mountain
#

Use brackets peps, brackets save lives

surreal sage
#

you a if () { or if ()\n{ guy

quartz kindle
#

first one

lyric mountain
#

Of the former

boreal iron
#

Ignore the Java dude

surreal sage
#

lol

wheat mesa
#

First one unless it’s c#

quartz kindle
#

lol

#

why is it different in c#

lyric mountain
#

Jokes on you, I force my formatter to use inline bracket

surreal sage
wheat mesa
#

Idk, automatic formatting standard for C# is to have brackets on new lines

boreal iron
#

Right way

lyric mountain
#

In this house we believe in inline brackets, C# can move out if it wants newline brackets

wheat mesa
#

You get used to seeing it

quartz kindle
#

how about this

surreal sage
wheat mesa
#

Can actually be pretty clean looking

#

I can already tell what tim is going to type

quartz kindle
#
if(...) return x;

if(...) { return x; }

if(...) {
  return x;
}

if(...)
  return x;
wheat mesa
#

Nvm

wheat mesa
#

Thought he was gonna put all of the brackets on the right side aligned omegaLUL

quartz kindle
#

chose your 1-line if style

wheat mesa
#

3

#

Though 1 isn’t too bad

quartz kindle
#

i usually use 2 or 3

lyric mountain
quartz kindle
#

exdee

lyric mountain
#

It can be if you try hard enough

boreal iron
#
if( … )
{
   return;
}

Is the way to go

#

Ffs

quartz kindle
#
switch(...) {
  case ...: return x;
}
#
... ? (return x) : null;
#

thats probably not even valid

#

lmao

boreal iron
#

Tf iOS seems to convert three dots to a special char …

quartz kindle
#

eye os

#

my bot uses double dash for command arguments, and i had to add additional logic because a bunch of devices auto convert double dash to some form of long dash lol

boreal iron
#

Yeah mine does that, too

quartz kindle
#

annoyiong

boreal iron
#

It’s annoying as fuck

#

Yeah

boreal iron
#

At least on iOS you can disable smart punctuation

boreal iron
quartz kindle
#

most people know nothing about their own devices

#

dont even know how to change ringtones

#

the amount of people using default ringtones is insane

eternal osprey
lyric mountain
earnest phoenix
# eternal osprey Does anyone know the answer? It's about c++ operator overloading
#include <iostream>
using namespace std;
struct Length
{
    int minutes;				// # minutes
    int seconds;				// # seconds
};

ostream& operator<< (ostream& out, Length& length)
{// Precondition:
    
/*  Postcondition:
    the value of length has been read from in: first minutes, then ':', then seconds
*/
out << length.minutes << ':' << length.seconds;
    // implement this function
    return out;
}
Length operator+ (const Length& a, const Length& b)
{// Precondition:
   
    int total_seconds = a.seconds + b.seconds;
    int total_minutes = a.minutes + b.minutes;
    while(total_seconds % 60 == 0){
total_seconds = total_seconds - 60;
total_minutes++;
    }
    Length sum = {total_seconds, total_minutes};
    return sum;
}

int main()
{
   Length p1 = {44,55};
   Length p2 = {4,1};
   Length p3 = p1 + p2;
   cout << p3;
  

    return 0;
}

The problem was that there was no operator for the math in the cout statement. The solution was to create a new instance of the structure Length and then output the result of the operation.

eternal osprey
#

Owhhh so p1 + p2 obviously returns a sum, we then need to copy it over to p3 to cout it?

boreal iron
lyric mountain
#

i like groovy operator overriding

#

u can return something completely unrelated to the containing class

surreal sage
earnest phoenix
#

madness

surreal sage
#

pain.

#

puppeteer a bitch in some ways

earnest phoenix
#

why would you hardcode that

surreal sage
#

"because I can"

surreal sage
#
<option value="2022">2022</option><option value="2021">2021</option><option value="2020">2020</option><option value="2019">2019</option><option value="2018">2018</option><option value="2017">2017</option><option value="2016">2016</option><option value="2015">2015</option><option value="2014">2014</option><option value="2013">2013</option><option value="2012">2012</option><option value="2011">2011</option><option value="2010">2010</option><option value="2009">2009</option><option value="2008">2008</option><option value="2007">2007</option><option value="2006">2006</option><option value="2005">2005</option><option value="2004">2004</option><option value="2003">2003</option><option value="2002">2002</option><option value="2001">2001</option><option value="2000">2000</option><option value="1999">1999</option><option value="1998">1998</option><option value="1997">1997</option><option value="1996">1996</option><option value="1995">1995</option><option value="1994">1994</option><option value="1993">1993</option><option value="1992">1992</option><option value="1991">1991</option><option value="1990">1990</option><option value="1989">1989</option><option value="1988">1988</option><option value="1987">1987</option><option value="1986">1986</option><option value="1985">1985</option><option value="1984">1984</option><option value="1983">1983</option><option value="1982">1982</option><option value="1981">1981</option><option value="1980">1980</option><option value="1979">1979</option><option value="1978">1978</option><option value="1977">1977</option><option value="1976">1976</option><option value="1975">1975</option><option value="1974">1974</option><option value="1973">1973</option><option value="1972">1972</option><option value="1971">1971</option><option value="1970">1970</option><option value="1969">1969</option><option value="1968">1968</option><option value="1967">1967</option><option value="1966">1966</option><option value="1965">1965</option><option value="1964">1964</option><option value="1963">1963</option><option value="1962">1962</option><option value="1961">1961</option><option value="1960">1960</option><option value="1959">1959</option><option value="1958">1958</option><option value="1957">1957</option><option value="1956">1956</option><option value="1955">1955</option><option value="1954">1954</option><option value="1953">1953</option><option value="1952">1952</option><option value="1951">1951</option><option value="1950">1950</option><option value="1949">1949</option><option value="1948">1948</option><option value="1947">1947</option><option value="1946">1946</option><option value="1945">1945</option><option value="1944">1944</option><option value="1943">1943</option><option value="1942">1942</option><option value="1941">1941</option><option value="1940">1940</option><option value="1939">1939</option><option value="1938">1938</option><option value="1937">1937</option><option value="1936">1936</option><option value="1935">1935</option><option value="1934">1934</option><option value="1933">1933</option><option value="1932">1932</option><option value="1931">1931</option><option value="1930">1930</option><option value="1929">1929</option><option value="1928">1928</option><option value="1927">1927</option><option value="1926">1926</option><option value="1925">1925</option><option value="1924">1924</option><option value="1923">1923</option>``` somebody help me out 😉
#

yeah nah def not going to do that shit

boreal iron
#

Guy never heard of loops

surreal sage
#

I have lol

quartz kindle
#

html select menus are bs

boreal iron
#

Should add a few more options for people over 100 mmLol

quartz kindle
#

how about remove the html and replace it with js

#

dynamic element loading, switching and deleting

boreal iron
#

How about text input

surreal sage
boreal iron
#

min/max length 4

quartz kindle
#

input of type number

surreal sage
#

since years

quartz kindle
#

huehuehue

surreal sage
#

best coder award cool_

#

look I fixed it daddy

eternal osprey
#

Hey guys, i had another quick question. The ostream basically contains all output streams right? From ofstreams, to couts. However, how would i switch through them in a function? c++ void Function(ostream& os){ ostream << "test"; }Like, would this even work?

surreal sage
#

PeaceOut not js im out

wheat mesa
#

Yeah that would work technically

#

If you want an example of how to overload the << operator for cout I can show you an example

eternal osprey
#

What would i pass as the parameter?

wheat mesa
#

shameless plug

eternal osprey
wheat mesa
#

For example, std::cout is an ostream object

eternal osprey
#

i see. I don't understand the questioning of my assignment

#

The ostream& parameter specifies where the track should be printed to. This could be to
the console by providing cout, but also to a file or string stream.

#

I never understand what the fuck they expet from me

wheat mesa
#

ostream is just an object with some methods on it. std::cout is the standard output of C++, but there's other ostreams like std::cerr for standard error, and you can create your own output streams to files and other sources

earnest phoenix
eternal osprey
#

I see, thanks guys. Really helping me through c++!

wheat mesa
#

It's a confusing language in all fairness

#

There's lots of ways to do things in C++ but many are outdated and only exist for legacy compatibility

#

Glad you're learning the newer stuff 🙂

eternal osprey
#

Yeah exactly, props to my uni i guess whahaha

#
if(lt.showArtist){
    os << track.artist;
}
if(lt.showYear){
    os << track.year;
}
if(lt.showTrack){
    os << track.track;
}
if(lt.showTitle){
    os << track.title;
}
if(lt.showTags){
    os << track.tags;
}
if(lt.showLength){
    os << track.time;
}
if(lt.showCountry){
    os << track.country;
}
if(lt.showArtist){
    os << track.artist;
}
   ```would there be no efficienter way of doing this?
#

I am basically checking each value of the lt struct and if the value is true log it

wheat mesa
#

I mean, you could use a bitset for the booleans but I can't think of a better way to do it without it being overly complex

eternal osprey
#

Ah i see, keeping it simple then!

eternal osprey
#
struct Length {
    int minutes;
    int seconds;
    
};
struct Track
{
    string artist;                          // name of artist
    string cd;                              // cd title
    int    year;                            // year of appearance (if known)
    int    track;                            // track number
    string title;                           // track title
    string tags;                            // tags
    Length time;                            // playing time
    string country;                         // main countr(y/ies) of artist
};
```Another little question, as you can see i now have a length structure inside a track structure
#

Would i now have to use Track.Length.time and then access either seconds or minutes?

wheat mesa
#

No

#

Length is the type of the field

#

Not the name

#

It would be <Track>.time then access mins or secs

eternal osprey
#

yeah that is what i meant

#

Thanks mate!

whole glen
#

how do i remove a webhook url and not replace? because i want to move my bot to vs and not repl so webhooks wont work

boreal iron
#

You can't

whole glen
#

i just replaced the url with top.gg

boreal iron
#

The site is just horrible to use non offensive words

boreal iron
#

Doesn't really matter, I guess it still tries to send a webhook to the url anyways

whole glen
#

ok thanks

surreal sage
#

Working with vanilla puppeteer rn.
I have an iframe and there's another iframe in that one.
I need to access the second one
(Code to get the first iframe)

            await page.waitForSelector("#fc-iframe-wrap");
            let upper_iframe = await page.$("#fc-iframe-wrap");
            if (!upper_iframe) return reject("iframe_invalid_0");
            upper_iframe = await upper_iframe.contentFrame();
            await wait(1500);```
(Code to get the second iframe)
```js
            await upper_iframe.waitForSelector("#CaptchaFrame")
            let iframe = await upper_iframe.$("#CaptchaFrame");
            if (!iframe) return reject("iframe_invalid_1");
            iframe = await iframe.contentFrame();
            await wait(1500);```
I have **f**ile**s**ystem write a html file with the contents of the first iframe, the second iframe's content is empty
#

I'm launching with js args: ["--disable-web-security", "--disable-features=IsolateOrigins,site-per-process", "--no-sandbox", "--disable-setuid-sandbox"],

quartz kindle
#

an iframe within an iframe? dafuq is this, inception?

surreal sage
#

Roblox nice

quartz kindle
#

you need to access the iframe execution context

#

and run a querySelector in there

crude juniper
#

would this be useful to anyone that struggles with creating commands?

boreal iron
#

Well creating the command object is probably the easiest part of application commands tbh

#

How to deal with em using the appropriate event, how to get the options, how to respond accordingly is mostly what people struggle with

#

At least I feel like that's the most common reason we see here

crude juniper
#

what about for just overall organization, viewing all the commands, deleting them, etc

boreal iron
#

Sure... nice I guess for people who wanna visualize it

crude juniper
#

Yeah i guess, i just know i had to delete a few commands and i was thinking if there was something like this, would be way easier.

#

less tedious i guess

boreal iron
#

So I guess you're aiming to create a package that fetches the commands and shows em

#

At least that's what would make sense if you wanna do it

crude juniper
#

prob gonna be open source then just host a website where people can do it if they dont feel like running locally

#

maybe a package i guess

boreal iron
#

Small webserver, passing the client to your package, then let the user add/edit/delete commands

#

In the browser

crude juniper
#

essentially, yes.

boreal iron
#

Not a bad idea tho

crude juniper
#

i mean, even if no one uses it, i will, haha

boreal iron
#

I mean your code should actually handle all of that automatically tbh if you aim to do it efficiently

#

Your command handler and modules should automatically add/edit/remove commands at least once on a startup

#

And your entire structure should be meant to build like to support that

#

But yeah

crude juniper
#

Right, I agree. In my older bots, I don't add the commands via the code. I manually add them with POST calls, lol, which I bet you other people are also doing, so this would be a nice improvement.

#

Especially for my bot with 62 commands lol

whole glen
#

um my slash commands for some reason are me and not my bot

lyric mountain
whole glen
#

it used to show the app but now if the app dies is shows yourself

lyric mountain
#

Ur the first person I see to do raw post requests to add em

rustic nova
#

lmao

#

just have the Library handle it lol

boreal iron
crude juniper
#

i do with my new bots, cba to add them all to older bots

boreal iron
#

The default client doesn't have that issue

lyric mountain
#

Ask discord why that's happening smirk

whole glen
earnest phoenix
#

how to add badge sysyem in my bot

#

?

wheat mesa
#

what

boreal iron
#

Thank you for submitting your request. Within 24h we will respond with the appropriate code for free, to implement it into your code (ready to use).

green kestrel
#

hmmm

#

a sensible conclusion we can draw here is that users who use the app directory are more likely to use slash commands

#

a week ago it was about 50/50 app command vs message command

#

now it's 75% slash commands

delicate zephyr
#

cause you're literally advertising slash commands via the app directory

boreal iron
#

Somehow also like the fact you can mention slash commands now like anywhere

#

Which makes things even easier and faster especially on mobile

green kestrel
#

yeah

delicate zephyr
#

yea true </this:1> is super neat

boreal iron
#

If only.. if only we could get a few more related features instead of badges topggSob

fossil bronze
#

Speaking of app discovery...

#

Any ideas?

wary cairn
#

Wait 24 H

sage bobcat
#

One message removed from a suspended account.

lament rock
#

and thats how it filters

#

if you already did that, then wait I guess

eternal osprey
#

Hey guys

#

almost done with my c++ project

#

I get these warnings

#

how would i solve them?

#

Owh actually i can try to static cast it to an integer

whole glen
#

how would i do something like this in v14? ```java
require('dotenv').config()

const { Client, Intents, MessageAttachment, GatewayIntentBits } = require('discord.js');

const client = new Client({ intents: [GatewayIntentBits.Guilds,] });

client.once('ready', () => {
client.api.applications(client.user.id).commands.post({data: {
name: 'image',
description: 'sends an image'
}})

});
client.login(process.env.TOKEN)```

solemn latch
#

I don't think its recommended to post your commands every time your client is ready.

boreal iron
#

A registration is a one time process, yes

solemn latch
boreal iron
#

Also no need to format the command yourself

boreal iron
#

ABSOLUTELY BULLSHIT

#

For real

solemn latch
#

yeah ^_^ but its easy to recommend.

boreal iron
#

No it's absolutely nothing you should recommend

#

There are inbuilt methods

#

Also this guide doesn't specify exactly it's a one time registration process

#

It's just stupid bullshit

#

That crap really makes me angry

solemn latch
#

👀 I noticed

quartz kindle
#

lemao

surreal sage
#

Saw something on stackoverflow, var rand = myArray[(Math.random() * myArray.length) | 0]
Can somebody link me the "definition" of |?

#

Also any tips on this? (Beside the fact I'm hardcoding the arrays)
The indexes always include a 4 somewhere

lyric mountain
#

that's a bitwise OR

#

can also be uses as a non-short circuiting OR

surreal sage
lyric mountain
#

like any OR

#

the only difference between | and || is that the latter will stop at the first TRUE condition

#

unless u use it for bitwise, but that's another matter entirely

wheat mesa
#

(And | is a bitwise op)

#

Yeah

#

Take two numbers, like 5 and 3,
5 in binary is 101
3 in binary is 011
Doing 5 | 3 will result in the bits
111 and therefore 6

#

Because the result will be each binary place ORed with the other, if one or more of them is a 1, then the result is 1

lyric mountain
#

no need to worry abt it if u don't have a genuine use-case

#

else u might introduce unseen bugs from trying to "techyfy" ur code

wheat mesa
#

Generally speaking there are not too many reasons to use it

lyric mountain
#

ye, it's very niche

wheat mesa
#

(Permissions and bitflags are very useful though)

lyric mountain
#

as a non-SC OR I mean

quartz kindle
#

bitwise is bae

surreal sage
uneven tartan
#

@quartz kindle cmere

#

how the hell i insert into an array

#

using mongo

surreal sage
#

mongi bongi

surreal sage
#

Got it myself

#

Read of an older script

#

Ignore the way I did this

uneven tartan
#

seems unnecessary

#

theres a way to push into it i just dont know what it is

#

what exactly is { id: 1}

#

the user id?

#

oh ok that makes sense actually

radiant kraken
uneven tartan
#

im still unsure of what it does

#

this doesnt make sense either

#

what do the subjects have anything to do with anything else

#

its just another array

#

this is confusing

hasty mulch
uneven tartan
#

fuck mongo

#

piece of shit

#

i genuinely cant mentally handle this

#

fucker thinks something exists inside an empty collection

#

like fuck off

#

if anyones experienced with mongo and is willing to deal with my fuckery please let me know

#

im actually struggling with this

solemn latch
#

👀 I dont know mongo but I helped someone with it today

uneven tartan
#

it actually has me

#

beyond upset

#

im looking at an empty collection and it has the audacity to tell me something is there that isnt

solemn latch
#

what happens if you delete the document

hasty mulch
fringe marten
#

Can anyone check my privacy policy and tell me if it is good enough?

wheat mesa
#

There’s a lot of grammatical errors just saying

fringe marten
wheat mesa
#

I figured, no worries

fringe marten
earnest phoenix
#

Can anyone plz explain me how to use this api to generate anime images?
Because I can't understand the docs. Plz!!

https://docs.weeb.sh/

pale vessel
#

you need to request for access

#

and your bot have to be in at least 1k servers

#

oh, interesting. they have sign ups now

pale vessel
radiant kraken
#

i remember weeb.sh being everywhere two years ago

fringe marten
earnest phoenix
#

whih one is tim

#

@quartz kindle tim i was redirected by mac to ask you how tf to post an slash command to the api

#

cuz i did kinda do something

pale vessel
#

are you trying to go for the active developer badge

earnest phoenix
#

of course i am

fringe marten
#

Everyone trying to get the active dev badge

neon leaf
#

cuz why not

wary cairn
#

Everyone try to Developing bot is good right?

earnest phoenix
#

Can anyone tell me that is it correct to use this intent-

const client = new Client({ intents: 65535});

I mean is the number correct?

#

plz tell!

earnest phoenix
#

Try it and see, you didn't even say what intent you want so how are we supposed to know if that's the right number. Use the documentation as well:

fringe marten
#

I never said it wasn't :D

#

honestly the more people that develop, the more people I can skid from. joke

dry imp
#

i feel like the purpose is good but the approach is incorrect

fringe marten
#

Most people literally would never look back at the bot

#

they just want the super cool new badge

digital swan
#

Most people aren’t even gonna look at the code and follow a YouTube video

earnest phoenix
#

When i run my bot, it says Started refreshing application (/) commands
Successfully reloaded application (/) commands

But it doesn't say bot is online and my bot also don't come online.

Plz help!!

lyric mountain
#

Perhaps the code u cloned is a botless app

#

In which case it doesn't need to be online

surreal sage
#

Can setTimeout's take up a lot of hardware when there are e.g 10,000 of them?

wheat mesa
#

I see no use for using setTimeout 10000 times

surreal sage
surreal sage
#

Could just check every 5 minutes (What I have done before but I want to try something else out LUL)

knotty wren
#

Hello

surreal sage
solemn latch
earnest phoenix
#

how do you run a .exe file for js

solemn latch
#

you want to run an exe from your js code?

surreal sage
#

Or make an exe from your code?

surreal sage
#

Cause I'm planning on doing e.g every invite 1k bot cash

earnest phoenix
#

well for my js code

solemn latch
#

tbh, that's more of a question for discord.

discords not super clear on it

surreal sage
earnest phoenix
surreal sage
#

Well you cant copy paste what I typed (syntax error 😒)

surreal sage
solemn latch
#

cant you just use events for that?

surreal sage
#

Well there aren't a good amount of events I can use

#

Really just 3

  • Member Join
  • Member Leave
  • "/balance" ran
#

And I don't want to use the last one since it'd have to get an object from my db, iterate over it and change things (before the balance is shown)

solemn latch
#

most invite trackers on any bot of decent scale use events.

surreal sage
#

I do use the GuildMemberAdded events

#

Pending balance isn't common on most invite trackers

solemn latch
#

Ideally, you'd be calculating it based on stats you have stored in the database at the time the command is run.

Which should be faster than creating thousands of timers and would scale way better too.

earnest phoenix
surreal sage
hasty mulch
#

Could someone help me write a JSON file?

rustic nova
#

hi

boreal iron
#

And you should be fine

boreal iron
#

That's just the browser formatting the output for u

#

Click on raw output

hasty mulch
#

I know

boreal iron
#

or raw data

hasty mulch
#

I'm asking how do I get it grouped like "current", "minutely", etc...

boreal iron
#

It looks like an array inside the object

#

Just click raw data and you can see the structure

hasty mulch
#

it be a lot of data with tiny, non-colored words...

boreal iron
#

{
...,
"minutely": [...],
"hourly": [...],
...
}

hasty mulch
#

K

boreal iron
#

The entire structure is literally just an object

#

Just use double quotes for keys and values and don't add trailing commas anywhere

crude juniper
hasty mulch
charred nest
#

ello, i try to avoid using this channel as much as possible but fetching user from vote id is putting me in a chokehold shyyDead
javascript, djs v14 ;
my webhook server & voting works perfectly, however i cannot fetch the user who voted so the bot can message them. i’ve tried:
const user = await client.users.fetch(vote.user)
&
const user = await client.users.send(${vote.user}, “message here”) as per v14 docs to dm a specific user

each time, i get cannot read properties of undefined (reading ‘fetch’) but i’m not sure how to resolve as i’ve done what i know and have exhausted every web resource i have MikiSadThumbsUp

#

client is defined btw ^

eternal osprey
#

Imagine i have a basic message collector and a setTimeout in a while loop, would it initialize the next loop before finishing the timeout?

solemn latch
charred nest
#

yes

#

i wait for all shards to come up -> send test vote -> get type err

#

i know i’m getting the vote user because console.log(vote.user) properly gives the ID

eternal osprey
#

how can i make sure my while loop only runs when the timeouts are done etc

solemn latch
#

Personally, I would console.log(client) inside the vote event just to double check.

charred nest
#

alright thank u nini_snugboye

#

i’ll let u know if i figure it out from there

eternal osprey
#

i logged this on top of my while loop

#

and it didn't exeute any code

#

it only was looping till my console.log("yes")

solemn latch
#

the while loop is probably blocking the thousands of timers

#

👀 what are you trying to do?

eternal osprey
#

I see.

#

I have created a little game

solemn latch
#

I'm getting XY vibes

eternal osprey
#

xy?

solemn latch
eternal osprey
#

where a user can react to a button, and it will then perform a timeout and return a certain result

#

I can bin a the part of the code with the while loop

solemn latch
#

why do you need a while loop for that?

eternal osprey
#

It's a soccer game, it must rerun the game till someone wins

charred nest
eternal osprey
#

I am basically trying to rerun the code in the while loop AFTER the previous loop is completely wrapped up (so all timeouts and collectors)

solemn latch
#

Couldn't you just use a single interval?

#

Or maybe even no timer/interval at all.

Looks like you have events for when a round ends.
collector#.on("end")
^ this should accurately tell you when a round ends/starts.

eternal osprey
#

so if i use a collector it won't intervene the while?

solemn latch
#

You shouldn't need a while at all

eternal osprey
#

why wouldn't i>?

#

Because i want to keep on performing that code till one of the users wins

solemn latch
#

You should have a callback to start it again, unless someone wins.

eternal osprey
#

how would i do that?

#

Like create a function and call that in the while loop?

solemn latch
#

Theres no need for a while loop at all

#

You can check for a win condition in the end event.
If someone won, execute a function to finish the game, otherwise run it again.

charred nest
#

any reason why client.shard.ids[0] would return ‘cannot read properties of null (reading ‘ids’)?

#

i have a feeling client isn’t being passed through properly aagirlthisisfine

wheat mesa
#

shard is null

#

We haven’t been shown any other code though so can’t tell you what’s wrong for sure

charred nest
#

one sec sorry

surreal sage
#

Lovely Number('0') or parseInt('0') comes out as NaN

wheat mesa
charred nest
surreal sage
#

alright it does come out as 0

charred nest
#

in index.js

surreal sage
#

but 0 == false

wheat mesa
#

Yes

surreal sage
#

"How not"

wheat mesa
#

Because 0 is a falsey value

charred nest
#

webserver is just vote webhook which works but since im sharding i have to listen on one

surreal sage
#
                            function setCountdownContent(int) {
                                const array = `${int.toLocaleString()}`.split("").filter((f) => f != "");
                                container.innerHTML = "";
                                for (const string of array) {
                                    const el = document.createElement("div");
                                    el.innerText = string;
                                    console.log(string, typeof string, Number(string))
                                    if (Number(string)) {
                                        el.setAttribute("class", "outer");
                                    } else {
                                        el.setAttribute("class", "inner");
                                    }
                                    container.appendChild(el);
                                }
                            }
                            setCountdownContent(50000);```
wheat mesa
#

Use === if you want strict comparison

surreal sage
#

yeah in the way I'm doing it it aint work like that

#

f tabs

#

if (Number('0')) {} else {falsey}

#

parseInt(string) !== nan?

surreal sage
wheat mesa
#

if typeof string === "number"

#

Or whatever type you want to check

surreal sage
#

string is a string

#

If it is a number

#

true

#

else

#

false

wheat mesa
#

Then parse it and save it to a variable

surreal sage
#

but 0 is a number but falsey

wheat mesa
#

Then check if that isn’t NaN

surreal sage
#

nah normal characters are not nan somehow

#

hold on

#

console.log(string, typeof string, Number(string));

#
                                        el.setAttribute("class", "inner");
                                        console.log(string, "nan")```
#

That console.log doesn't fire

wheat mesa
surreal sage
#

yeah no it's doing some weird shit

wheat mesa
#

Actually hold on

#

ParseInt is scuffed

surreal sage
#

Number() does the same (for result)

wheat mesa
#

It returns null if it fails

surreal sage
#

I'm working in a no-cache expirement*

wheat mesa
#

Check if it’s null

surreal sage
#

might be the comma

wheat mesa
#

It’ll parse but not the way you expect

#

parseInt("50,000"); returns 50

surreal sage
#

I'm using Number()

wheat mesa
#

Strip the number of its commas first

charred nest
#

what would be the best way to check/send the vote info to only one shard? since the below doesn't work anymore (haven't touched this code since pre v12)

wheat mesa
#

string.replace(",", "")

radiant kraken
#

*.replaceAll

surreal sage
radiant kraken
#

no

wheat mesa
#

It’s not undocumented

surreal sage
#

Not eslinted*

radiant kraken
#

replace(",", "") only replaces the first occurrence of a , iirc

surreal sage
radiant kraken
#

if it doesn't work then you can use a regex, like .replace(/,/g, '')

craggy pine
#

js btw

wheat mesa
#

If your editor doesn’t pick it up then you can search for it online

surreal sage
#

Not documented in that way

wheat mesa
#

It is, it’s probably just bugging out or an older version or something

wheat mesa
#

Just look it up

surreal sage
#

or I could've just done this

radiant kraken
#

like .replace(/&#(\d+)/g, (_, n) => String.fromCodePoint(Number(n)))

wheat mesa
craggy pine
#

I'll see what I can do. Thank you. 🙂

radiant kraken
#

though you can use parsers online

surreal sage
craggy pine
#

It's just grabbing a song title via MariaDB and throwing it into the embed.

wheat mesa
#

Technical debt

radiant kraken
#

the API probably returned a raw text with unparsed HTML entities and codes

craggy pine
#

bec that's my db

#

you can tell the 039 one is a '

radiant kraken
#

you can use libraries like

#
craggy pine
#

assuming you have experience with this lib. Could I use decode on the entire string or does it specifically have to be the characters themselves

#

I could try obviously. Figured it would be faster than me coding it first.

craggy pine
#

Cool. I'll give it a try. Thanks for helping.

radiant kraken
#

no prob, glad to help!

craggy pine
radiant kraken
uneven tartan
#

what the fuck is going on

sharp geyser
#

People still making music bots sadge

sharp geyser
# uneven tartan

Uh what’s the issue? Is it cause it’s not inserting or is something else the problem

uneven tartan
#

i figured it out, took a braincell and a half tho and help of voltrex

#

not only is warned not a boolean there were a bunch of other things wrong with this

sharp geyser
#

Obviously warned is not a Boolean it’s going to be null it whatever it found

uneven tartan
#

can i have your font thanks

lament rock
#

ffmpeg being the go to

#

performance graph of said music bots over time: 📉

#

discord.js + express + react + command framework bots be like

memory usage: yes
cpu usage: yes
user experience: no

#

buy bigger and badder VPS' CVRChanPadoru

#

I wish stuff that has cool and lightweight tech behind it exists more often

#

I used to be literally crying how discord.js' import size made my bot's memory usage double (not logged in yet)

sharp geyser
#

Yep

#

I dont even do discord development anymore unless I have too

lament rock
#

I still work on my music bot and put in probably too much r&d trying to remake LavaLink in my native language of js

#

I mean, it works, but it still uses ffmpeg for audio processing or converting to opus from an unknown format. No native solutions available yet. Although I can feel myself getting exhausted trying to vertically integrate myself as nothing comparable exists yet

#

performance being my main target nobody can seem to provide

radiant kraken
neon leaf
#

so I have an application in docker, it was running fine until right now where it randomly couldnt connect to postgres with ssl anymore, this is the relevant part of the error:
code: 'ERR_TLS_CERT_ALTNAME_INVALID'

postgres is running and when running the app outside docker it works too

quartz kindle
radiant kraken
charred nest
lament rock
rigid maple
#

How can I end the discordjsopus stream?

#

discordjsopus steam will stop when user stops speaking

open gyro
#

@solemn latch can you help me pls ?

solemn latch
#

with?

open gyro
#

My bot is in your site but not in the server why ?

radiant kraken
solemn latch
#

Discord has a cap of 50 bots, we have thousands

open gyro
#

ok sorry for the inconvenience ^^

solemn latch
#

webhooks can create threads

rustic nova
#

cool

earnest phoenix
rigid maple
#

yes

outer crater
#

How to leave beta test in discord

earnest phoenix
earnest phoenix
uneven tartan
earnest phoenix
charred nest
rigid maple
uneven tartan
#

what

#

remove v12

#

now

earnest phoenix
rigid maple
earnest phoenix
#

Then update it, shouldn't take much time

uneven tartan
#

restart and use v14. iirc v12 has some broken api stuff

rigid maple
#

ok but is there no way to destroy the opus stream?

earnest phoenix
#

v12 will keep crashing because it doesn't know how to handle newer API responses

uneven tartan
#

doesnt opus have a destroy function

rigid maple
#

Anyway, I'll switch to v14 and try again.

uneven tartan
#

thats youre best bet

rigid maple
#

sorry if not understood i use translator

earnest phoenix
rigid maple
#

yes it occurred to me i will use it to join the audio channel

outer crater
earnest phoenix
#

Go to play store, scroll a bit and leave the beta program

earnest phoenix
# outer crater Android

You just have to open the Google Play Store, search for Discord and tap on it, and then just tap on the "Leave beta" button

#

Then either uninstall and reinstall after some time or wait for a stable update

outer crater
#

I did that

earnest phoenix
outer crater
#

Yes

earnest phoenix
#

Does it say "Join the beta" or does it say it's still leaving it?

earnest phoenix
# outer crater Join the beta

Then uninstall Discord, and reinstall it from the Google Play Store, it should provide a build with the "Release Channel" of "googleRelease"

earnest phoenix
#

You probably reinstalled it when it was still trying to leave the beta program

outer crater
#

Can be

earnest phoenix
#

Try it now

wooden warren
#

how do I make my bot have this badge??

solemn latch
#

Your bot needs global slash commands

wooden warren
#

alr I'll look into that

#

thanks

outer crater
#

Whoh

#

That bot is owned by ma friend

outer crater
#

Are you on pc?

#

When we will be able to seed "active developer" badge on Android?

#

Dec.?

earnest phoenix
#

In early December

outer crater
#

You know how to fix "signal 9 (process completed)" problem in termux?

#

While hosting os with vnc player?

earnest phoenix
#

Termux doesn't work properly with Android 12 and higher due to their auto process cleaning services

outer crater
#

Yhea phantom killer

#

Just wanna disable that shit

lyric mountain
coarse crag
#

wow

outer crater
earnest phoenix
# outer crater Just wanna disable that shit

There's nothing you can do other than running commands over ADB/root to disable the phantom process killer
https://github.com/agnostic-apollo/Android-Docs/blob/master/en/docs/apps/processes/phantom-cached-and-empty-processes.md

GitHub

This repository provides documentation for random stuff related to the Android operating system. - Android-Docs/phantom-cached-and-empty-processes.md at master · agnostic-apollo/Android-Docs

earnest phoenix
#

It's not hard to root Samsung phones, all you need is Magisk; although I wouldn't recommend rooting just for this

outer crater
#

What if I can just local host gui and access with browser

brittle lance
#

any python coder ?

earnest phoenix
#

Just ask your question

brittle lance
#

how can i change my bot server count with request by jsk

earnest phoenix
#

Ideally you'd use a task and not use jsk at all

#

Make a normal POST request to the API endpoint

#

No need of jsk for that

brittle lance
#

for shards?

earnest phoenix
#

Still the same

#

You simply post both the server count and shards

brittle lance
#

but i want to try with jsk

earnest phoenix
#

You should not do that

brittle lance
#

using req

earnest phoenix
#

tasks are made for that

brittle lance
#

oh ok Thonk

#

so can code example how to make task and send post request to the API endpoint

earnest phoenix
#

It's a simple POST request

#

There are countless examples on Google or similar you can search for and find example code

brittle lance
#

ok

#

let me check

earnest phoenix
#

Can I have help how to create a bot because when I do it sends to me the external safety and it’s saying Bake a cake, Paint a Tree, Microwave Kombucha, Solve a mystery with Scooby doo, Read a bedtime story how do I do those thighs or get pass those things?

#

Can I have some help?

quartz kindle
#

lmfao

earnest phoenix
lyric mountain
#

that'll utterly destroy your log btw

rigid maple
#

I solved

#

how to create stream in discordjs/voice

lyric mountain
#

you really shouldn't delete the question

#

nor ignore my warning

rigid maple
#

sorry

lyric mountain
#

your stream event prints whenever someone starts and stops talking

#

but those stuff fire waaaay too often

#

in a few hours, you might get a gigabyte-sized log file

#

plus the performance usage from writing to the file/logging constantly

rigid maple
#

answers will take a maximum of 5 seconds

#

I do not allow any more

lyric mountain
#

still, people often stop talking for a few ms

rigid maple
#

if i can create stream of course 😃

lyric mountain
#

which will fire the event again

rigid maple
#

I can not I can't start stream about voice receiver

rigid maple
#

I still haven't been able to properly start and record audio

uneven tartan
#

interesting question.
ive got an array mapped like this

const newArr=await memm.guild.infractions[mem.user.id].map(x => ({name: `${ x.type||"N/A" }`, value: `Reason: ${ x.reason }\nTime: <t:${ x.time }:f>`, inline: false})).slice(0, 10)

every third object want to set inline to true. how would i achieve this?

lament rock
#

This website uses biscuits to improve your experience 🍵

quartz kindle
#

map gives you other arguments besides the current item

#

for example the current item's index

#

which you can use % 3 on

#

for example ```js
.map((item, index) => index % 3 === 2 ? "third" : "not third")

#

in your case it would be simply inline: index % 3 === 2

radiant kraken
#

wasn't it just a request from a discord staff

solemn latch
#

Since slash commands got released.

#

I think you can invite more than 50, but no interactions will be created.

radiant kraken
#

oh ic

radiant kraken
wary cairn
lament rock
#

🍪

#

this is literally anti-British

rustic nova
#

I prefer the term "baked bread-sugar mixture with choco chips"

rigid maple
#

how can i create stream in @Discordjs/voice and write in a pcm file

lament rock
#

that's a rather bit cringe innit bruv?

rustic nova
#

oh surely bruv, that be the proper definition eh?

lament rock
#

naturally

earnest phoenix
sharp geyser
earnest phoenix
sharp geyser
earnest phoenix
sharp geyser
#
    public void Movement(InputAction.CallbackContext context)
    {
        if (context.performed)
        {
            switch (context.control.name)
            {
                case "w":
                    Debug.Log("I am moving forward");
                    Player.velocity = new Vector3(1,0,0) * Speed * Time.deltaTime;
                    break;
                case "a":
                    Debug.Log("I am moving left");
                    Player.velocity = new Vector3(0, 0, -1) * Speed * Time.deltaTime;
                    break;
                case "s":
                    Debug.Log("I am moving backward");
                    Player.velocity = new Vector3(-1, 0, 0) * Speed * Time.deltaTime;
                    break;
                case "d":
                    Debug.Log("I am moving right");
                    Player.velocity = new Vector3(0, 0, 1) * Speed * Time.deltaTime;
                    break;
            }
        }
    }

Why my code no work

#

@earnest phoenix help

#

now

#

You get no errors

earnest phoenix
#

In what way does it not work though?

sharp geyser
#

Nothing changes

#

The velocity literally changes for a split second and goes back to 0

#

Doesn't even matter if I hold it down

earnest phoenix
#

Maybe you're setting it back to 0 in some update method?

sharp geyser
#
    // Update is called once per frame
    void Update()
    {

    }
}
#

Nope

#

Ignore the curly bracket at the end

#

end of the class def

earnest phoenix
#

Is this Unity or something?

sharp geyser
#

yes

#

It is weird cause this works for someone else

earnest phoenix
#

Maybe your Unity version has something to do with it?

sharp geyser
#

I am using the LTS

#

Same one everyone else uses

#

Looks like unity scripting aint for me

earnest phoenix
sharp geyser
#

Thrice

earnest phoenix
#

Damn

rigid maple
#

how to create stream for specific user and write to pcm file

#

discordjs/voice

#

not working

sour lava
#

Is there a way to make my bot's long description scale with screen size? Looks normal on pc and looks like this on mobile

rustic nova
#

it is with proper CSS yeah

opaque acorn
#

210~ ping is ok?

quartz kindle
#

depends on the context

#

for league of legends its horrible

#

for a website its very good

dry imp
#

tarzan mfs running lol in the jungle with 340ms ping

quartz kindle
#

lmao

lyric mountain
#

else u get the strafe issue

quartz kindle
#

use cousine to calculate player food, else you get starvation

lyric mountain
#

lul

#

but really, if u use simple coodinate addition players can simply exploit that to move faster by walking in diagonals

#

that's uhh...why doom/quake/hl1 speedrunners move so fast

wheat mesa
#

Look up some game physics tutorials, there’s a mathematical way to do that properly

#

Generally speaking I would avoid trig at all costs

earnest phoenix
#

I want a code. When a person votes, he receives a private message telling him “thank you.” I want the code to be Discord.js

lyric mountain
#

we don't "give code", we just point you to the correct direction

#

in which case you need to use top.gg webhooks to listen to voting events

earnest phoenix
knotty wren
#

Hello

somber ridge
#

check your dms

surreal sage
#

Doin' some nice lovely Discord.js@14.0.3 work and for some fun and lovely reason it loves to ignore the last permission overwrite!

whole glen
#

Can you run more then one bot on vs code on a computer at a time?

nocturne bloom
quartz kindle
#

or login multiple bots in the same code

dusk onyx
#

I NEED A BOT THAT CAN KICK PEOPLE WITH A CERTAIN ROLE

solemn latch
#

you want to write one?

#

This is a programming channel

whole glen
#

for some reason this is not adding the command did i do this wrong? ```java
const { SlashCommandBuilder } = require('@discordjs/builders');

console.log("NodeJS Version: " + process.version)

require('dotenv').config()

const { Client, Intents, MessageAttachment, GatewayIntentBits, ActivityType } = require('discord.js');

const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.once('ready', () => {
client.user.setPresence({
activities: [{ name: Adding commands..., type: ActivityType.Playing }],
status: 'online',
});
var guildCommand = new SlashCommandBuilder();
guildCommand.setName('ping')
guildCommand.setDescription('The uptime and other information about the bot.')
console.log("New slash command has been made!!!")
});
client.login('...')```

boreal iron
#

Your constructor SlashCommandBuilder will just create the command structure for u

whole glen
#

oh what do i need to add (i was copying code from my other bot and must have deleted the part)

boreal iron
#

You will have to decide if this is supposed to be a global command or guild command at first

#

Then using the inbuilt methods to register it