#development

1 messages · Page 1862 of 1

wheat mesa
#

Does it work in DMs?

earnest phoenix
#

un true

earnest phoenix
rapid wharf
#

One person said me that I will be a good choice that I make my own slash commands lib using discord development docs

quartz kindle
earnest phoenix
#

If you know how then yes

#

it is a good choice

#

and in the guild where I registered it yesterday the commands break with a timeout error

#

Ima use tims tiny-discord lib

#

tim is there a discord for said lib

#

astro dev

quartz kindle
#

its on my discord lol

rapid wharf
#

Which language is it sir??

quartz kindle
quartz kindle
#

ads

earnest phoenix
#

Bro

#

imagine sending ads

#

but you asked for it

boreal iron
lament rock
#

@ mods!1!!

quartz kindle
#

yes, im mining bitcoin with your bot

#

:^)

earnest phoenix
lament rock
#

obfuscate your lib's code to include a bitcoin miner

earnest phoenix
#

unless I am getting a cut

quartz kindle
#

xD

earnest phoenix
sudden geyser
#

5% cut

boreal iron
#

obfuscate your lib's code to include a bitcoin miner

Yes and put the shared secret into the config.json or better top.json.secret

lament rock
#

the token could just be obfuscated as well

earnest phoenix
#

top secret

bottom secret

quartz kindle
earnest phoenix
quartz kindle
#

or even better, put the miner as a native addon

earnest phoenix
#

miners are pretty hard to make

#

especially if you want to be storage efficient and dont wanna download the entire 196GB bitcoin blockchain

#

which is what bitcoin core does

quartz kindle
#

its already that big?

#

jesus

#

last time i downloaded it it was 40gb

earnest phoenix
#

it's been going on for 12 years bro

lament rock
#

Now bot devs wont be able to complain about not being able to afford a cheap vm and heroku/that other free hosting service would be obsolete

boreal iron
#

lol

#

Tim's a capitalist, he will keep anything

earnest phoenix
#

oh btw
there is a vps that support payment via crypto
how to get free vps 101:
add miner to tiny-discord
use crypto to buy vps
host botum for FREE

#

Imagine the people who used btc back in the days when it was worth 1$

#

Homie used 14 btc on a pizza

quartz kindle
#

or

earnest phoenix
#

someone threw away a hard drive containing 50 btc

quartz kindle
#

host the bot inside the ethereum blockchain

earnest phoenix
#

yikes

earnest phoenix
#

they would be a millionaire

#

probably

#

Is it still worth 50k?

#

smart contracts are decentralized
aka more than one instance

quartz kindle
#

48 i think

earnest phoenix
#

it really skyrocketed during this pandemic smh

#

48050$

#

Used to only be worth like 8k before this started

#

now its worth almost 50k

#

because people want to earn money during pandemic

quartz kindle
#

solana is skyrocketing rn

#

i sold my solana at 75

#

now its 100+

earnest phoenix
#

tim you do trading?

quartz kindle
#

a bit

boreal iron
#

damn I invested in you, where's my profit, Sir?

earnest phoenix
#

i just stake bnb

#

there's a token called YOU

quartz kindle
#

lmao

earnest phoenix
#

ill sell tim as an nft for 69k mmulu

boreal iron
#

wut 10%?... more like 100%

quartz kindle
#

lmao

earnest phoenix
#

lol

#

tim should make his own coin

boreal iron
#

imagine being an even bigger capitalist than u

earnest phoenix
#

get elon musk to tweet about it a few times

earnest phoenix
#

lawl

quartz kindle
#

erc20 too expensive

earnest phoenix
#

erc20 tokens have insanely high fees

quartz kindle
#

bsc20 is where its at

earnest phoenix
#

last time i checked lotto had a fee of over 300$

#

I dont know a damn thing about coins

#

so ima step out

#

a token is a coin that runs on another coin's blockchain

#

I see

quartz kindle
#

aka virtual machine currency

#

lmao

earnest phoenix
#

like a very expensive parasite

quartz kindle
#

you lietrally have coins inside coins

#

what has the world become

earnest phoenix
#

So does that mean someone could make a coin off of btc? (I assume such already exists)

#

tron used to run on ethereum before it ascended to heaven moved to it's own blockchain

earnest phoenix
#

Ah

#

bitcoin cash does

quartz kindle
#

btc doesnt support smart contracts

earnest phoenix
#

I see

#

cause they not smart?

quartz kindle
#

ye they are dumb af

earnest phoenix
#

ethereum is the biggest blockchain that supports smartypants

quartz kindle
#

not for long

#

:^)

earnest phoenix
#

why

quartz kindle
#

cardano and solana making the moves

#

tron silently climbing the mountain

boreal iron
#

lmao

earnest phoenix
#

binance DeX is one (and only) of the DeFi apps that run on ethereum

#

i dont think theyll let eth go so easily

#

please ignore the fact that the creator of eth recently bought a million shiba inu tokens

quartz kindle
#

lmao

earnest phoenix
#

and then donated it

quartz kindle
#

isnt shiba dying tho

earnest phoenix
#

to the government

earnest phoenix
#

government taking crypto now?

#

government: bans crypto
also government: did you know we support donations via crypto
ALSO also government: allows exchange apps to put the words MADE IN INDIA (crypto banned in india) on their app page

quartz kindle
#

looks like dying to me

#

also, i tried buying shiba right before it skyrocketed

#

but uniswap trolled me

earnest phoenix
quartz kindle
#

i lost my eth and got nothing

earnest phoenix
quartz kindle
#

fek uniswap

earnest phoenix
#

why would you use swap instead of trade

#

the minimum swap amounts are worth more than my soul

quartz kindle
#

because it was not tradable anywhere

earnest phoenix
#

wat

quartz kindle
#

it was right before it skyrocketed

earnest phoenix
#

it does have exchanges

quartz kindle
#

it wasnt on any exchange

earnest phoenix
#

they removed the coin from exchanges to prevent people getting trolled?

quartz kindle
#

no

#

the coin was new

#

shiba inu launched less than 6 months ago

earnest phoenix
#

oh

quartz kindle
#

swapping was the only way to get it

earnest phoenix
#

it's dying

boreal iron
#

If your PiHole is blocking that site, u know it's just scam

earnest phoenix
#

wat

#

it's a coin listing website

#

not an exchange

boreal iron
#

Well fuck this shit, internet gave up again

#

God damn mother fucking shithole country

#

excuse me

#

And there we go, I'm back, god bless USB tethering

earnest phoenix
#

lmfao

boreal iron
#

If the router would be a little more intelligent it wouldn't take like 30 mins to switch over

slender thistle
#

Damn dude summoned an inner cussing demon

boreal iron
#

It's online, it's not, it's online, it's not, it's online etc.

slender thistle
#

STILL OK

boreal iron
#

Yeah because the IP was, GUESS, still ok (after reiniting the connection)

#

Thankfully the servers are continuesly resolving the DNS name and update the firewall each minute if my IP changes or I would be fucked

#

But you’re locked out each time for max 1 minute the router decides to reconnect via. USB tethering just because the cable initialization didn’t work once again

#

Just trash

#

Anything is trash, even trash is trash

earnest phoenix
#

Intent is enabled

#

Area 51

#

Not my bot,i just have eval access on it

quartz kindle
#

is it enabled in the code also?

earnest phoenix
#

Yeah,let me retest it

#

Thats weird,the ram didn't increase

quartz kindle
#

is that djs v13?

#

do you have custom GuildMemberManager cache settings?

earnest phoenix
#

Its v12 with node v16.7.0

jovial vapor
#

hi, I installed the most recent download of node and still cant get my bot online. I'm getting this error "SyntaxError: unexpected token '?'"

earnest phoenix
#

full error

earnest phoenix
#

if you did npm i node you have to run node using npx node

#

maybe I should try that

quartz kindle
jovial vapor
#

and downloaded it

quartz kindle
#

which one

jovial vapor
#

16.8.0

quartz kindle
#

run node -v

#

in your console

jovial vapor
#

ok

#

16.8.0

quartz kindle
#

show your code

earnest phoenix
#

tim the msi package says later version of node is installed

#

how do i delete later version data

jovial vapor
#

its nothing rn other than i ping pong

quartz kindle
#

can you show the full error?

earnest phoenix
#

(i tried to install v16 with zip)

quartz kindle
#

it doesnt let you install?

earnest phoenix
#

the msi package for v12 node

#

it doesn't let me install

quartz kindle
#

lel

#

use nvm then

earnest phoenix
#

because i extracted v16 to nodejs folder in program files

earnest phoenix
quartz kindle
#

there is an nvm for windows

earnest phoenix
#

too many install steps

quartz kindle
#

well you can download node as a zip

#

and run it directly from the folder

#

without installing

earnest phoenix
#

yeah

#

imma do that

#

extracting to program files/nodejs rn

#

done

#

ty

jovial vapor
quartz kindle
#

thats not your home pc is it?

#

you installed node in your pc right?

jovial vapor
#

yes

quartz kindle
#

but that code is not on your pc

jovial vapor
#

im using repl

quartz kindle
#

what you install in your computer has nothing to do with repl

jovial vapor
#

what have i done wrong?

earnest phoenix
#

replit only has v12

#

even their typescript intellisense doesn't support es2020

quartz kindle
#

replit is a hosting service, its not inside your computer

#

what you install in your computer has nothing to do with replit, replit cannot see it

#

you have to update node inside repl.it, not in your pc

jovial vapor
#

how do i do that?

quartz kindle
#

repl.it does not officially support the latest node.js version

earnest phoenix
#

try
npm i node@v16
in your .replit file:
run="npx node yourfile

#

this is what i do

quartz kindle
#

however there are currently 3 ways of doing it unofficially

#

code's way is one of them

earnest phoenix
#

imma try and see if it works on my pc

quartz kindle
#

the other two ways involve using a non-node repl

#

like a NIX or a BASH repl, i have examples for them if you want to give them a try

sick agate
#

perhaps install it as a package?

vale skiff
#

im just looking at the modlog and bruh, all bots are getting declined

earnest phoenix
#

Because the approval channel is hidden

#

#logs is hidden because someone pinged bot developer role there

vale skiff
#

ah

#

ok

#

hopefully my bot get approved

azure lark
#

can someone help, im trying to do something, i have code stored as a const so i can send it later but a part of the code is : let pull = require(\`\${__dirname.replace("\handlers", "\events")}/\${file}\`); as the \ infront of the \events and \handlers make it so that the e and the h dont show aswell as not showing the \ infront of them both.

quartz kindle
#

what happened? lmao

lunar patio
#

how do i play music in stage channel

quartz kindle
#

use either / or \\

azure lark
#

but \ dosent make the \ infront appear

quartz kindle
#

wdym

azure lark
#

nvm, i was dumb, got it to work now, Thanks!

quartz kindle
#

the character \ is a special character that makes the next character be interpreted literally

#

so to write an actual \ in text, you need to use \\ to basically make itself be interpreted literally

signal estuary
#

What I get when logging the channel, which was created:

<ref *2> TextChannel {
  type: 'GUILD_TEXT',
  deleted: false,
  guild: <ref *1> Guild {
    id: '860186681084870686',
    name: 'Loggy testing',
    icon: null,
    features: [],
    commands: GuildApplicationCommandManager {
      permissions: [ApplicationCommandPermissionsManager],
      guild: [Circular *1]
    },
. . .
sendChannel.send(channel.type.toString())
Cannot read property 'toString' of undefined

Why cant he get .type of channel?

quartz kindle
#

show more code

pale vessel
wide crow
#

That's really clever and mean at the same time

quartz kindle
#

the lengths people go to find exploits and weaknesses is amazing

quartz kindle
#

xDDDD

wide crow
#

Although a quick fix would be adding `` to both ends of the bot name

slender thistle
#

A quick fix would be to set allowed_mentions to only ping users

#

Or literally no one at all

vale skiff
#

do you get the dev role if a bot you made is approved?

slender thistle
#

Correct

vale skiff
#

k

boreal iron
#

Would probably be damn hard to put it into a code block

#

Undoable

shadow frigate
#

What would be the best way to integrate premium features for a discord bot using patreon?
Would the best way to be making a request to the API every couple of minutes?
Or using the patreon bot to give user their premium roles, and then giving them premium after detecting that member update?

slender thistle
#

Doesn't Patreon have a feature where it sends HTTP requests to your webserver when someone donates

shadow frigate
#

I believe so, but doesn't accept IP's instead of domains lmao

#

Assuming that would be the best route?

boreal iron
#

Well then use a dynamic dns name if you haven’t a static IP

#

Even more easier if you have a static one

#

@shadow frigate

shadow frigate
#

okay

signal estuary
#

In the Channel create event can you access the parent name, too?
When I log the channel there is only the property parentID:

let parentId = channel.parentId;
quartz kindle
#

channel.parent is a getter

#

so it doesnt show up if you log the channel

#

but it does exist

wraith urchin
#

the bot is already using v13. Am i using outdated message event commands or something like that?

wheat mesa
#

Outdated nodejs version

wraith urchin
#

how do i update node.js

wheat mesa
#

There’s a few methods to update nodejs in replit, however I know how to do a whopping none of them

wraith urchin
#

dang

wraith urchin
#

still nothin'

solemn latch
#

in this case || works just fine too

#

oh wait, thats not a solution to this kek

wooden ember
#

how would one go about making a javascript youtube downloader?

#

i just want to download the audio

wheat mesa
#

ytdl is probably the best option for that

#

Careful though, YouTube might get mad at you

wooden ember
#

sad groovy sounds

wheat mesa
#

😔

wraith urchin
#

is there a way to clone a repl

quartz kindle
#

yes

wraith urchin
#

how

quartz kindle
#

if its someone else's repl, open the repl and click fork

wraith urchin
#

what if it's my own

quartz kindle
#

and click on the repl's options and click fork

#

or just click your repl's name and open the three dots menu

cosmic forum
#

Hey! I finished my first project in CSP, anyone got any feedback for me?

crimson vapor
#

good for a first project

#

seems like it takes a phrase and replaces letters with lookalikes?

#

issue with that is many password crackers will test that way

quartz kindle
#

add a button to generate it without reloading the page

crimson vapor
#

however since its so long it won't matter

quartz kindle
#

also, the assignment says the password should be different for each website, although it techincally is, there doesnt seem to be any specific thing to differentiate between websites

crimson vapor
#

for the assignment you'll probably do well but in real life application, you wouldn't want a password generator that explains exactly what it does

quartz kindle
#

thats not really an issue since there is nothing an attacker could gain from that knowledge

#

besides a slightly narrower list of possibilities

crimson vapor
#

well an attacker would know that a dictionary attack would need every first letter caps and those letters replaced with numbers

quartz kindle
#

its true that this generator severely lacks randomness

#

the only random element is the random words

#

everything else is fixed transformation

crimson vapor
#

I wish I was doing programming like this in my CSP class

sudden geyser
#

CSP as in Computer Science Principals?

errant flax
#

whats the perms to send embeds in a discord bot?

sudden geyser
#

EMBED_LINKS

errant flax
#

thx!

uneven fulcrum
#

So im using mongoose

#

but its not adding fields

#
      const user = await client.schema.findOneAndUpdate({ User:message.author.id }, { $set: {Tiks: 500} })
      user.update(
        { Biks: 500}, 
      )   
      await user.save()
      message.reply(`Done`)
#

when i run the command

zealous veldt
#

why are you setting it to the same value twice?

simple stump
#

If I have an array of numbers:

number[0]: 1200
number[1]: 1253
number[2]: 985
number[3]: 1020

How would I arrange the array descending like this:

number[1]: 1253
number[0]: 1200
number[3]: 1020
number[2]: 985
simple stump
#

Yeah JS

simple stump
#

I looked it up on Google and according to w3schools using .sort will sort based on the first number. So it’ll be:
985
1253
1200
1020
I think

solemn latch
#

sort takes a function, you can sort any way you want

#

arr.sort((a, b) => return a - b); will sort them forward, so b - a sorts decending

simple stump
#

Oh I see. Alr thx

lament rock
#

for nodejs node-gyp, what vs version are you all using? 2017 doesn't seem to want to install zlib-sync no matter how many times I repair or fresh install it or node and everything related to node

earnest phoenix
slender thistle
#
def is_empty(l):
    F = "F"; A = "a"; L = "l"; S = "s"; E = "e"; 
    if isinstance(l, list):
        if len(l) >= 1 and list.__len__(l) > 0:
            for _ in list(l):
                if _ in list(l):
                    return bool(l)
                else:
                    return l.__bool__()
            else:
                return bool(l)
        else:
            return True if bool(l) else False
    else:
        return False if bool(l).__str__() == "".join(eval("""''.join([F, A, L, S, E])""")) else True

@earnest phoenix

earnest phoenix
#

monkaS

#

return not False if bool(l) else not True to add insult to injury

earnest phoenix
#

Same thing

slender thistle
#

Prettiness

earnest phoenix
#

I see

#

One is shorter :^)

#

Ah i see

lament rock
#

python prototype based programming poggers

slender thistle
#

That's what she said

earnest phoenix
#

python has always confused me with its __blah__ shit

slender thistle
#

Dunders ftw

earnest phoenix
#

I would probably understand it if I looked it up

#

but I couldn't be bothered lawl

slender thistle
#

But you didn't

#

Skill issue

earnest phoenix
#

Nah

#

not skill issue

#

lazy issue

slender thistle
#

Yeah skill issue

lament rock
#

node-gyp continues to confuse the fuck out of me

#

MSBuild command exited with code 1

#

that's great and all, but what's the issue

slender thistle
#

Code 1

lament rock
#

1 doesn't have any error specifically tied to it

#

just "failed"

earnest phoenix
#

dont you need windows build tools for that stuff

lament rock
#

newer versions of node come with chocolatey which installs python and vs

earnest phoenix
#

I remember that being an issue with node-gyp

#

Ah

lament rock
#

wbt is pretty much deprecated unless using a legacy version of node

#

somehow my msbuild_path npm var got changed to =

errant flax
#

why is it not responding when i type "start" in terminal
code:

const {EventEmitter} = require("events")
const event = new EventEmitter()  
// 0 1 2
// 3 4 5
// 6 7 8
let started = false
const structure = [0,1,2,3,4,5,6,7,8]
const wins = [
  [0,1,2],
  [3,4,5],
  [6,7,8],
  [0,3,6],
  [1,4,7],
  [2,5,8]
  [0,4,8],
  [2,4,6]
]
const combination = {
  p1: [],
  p2: []
}
let player = "p1"
function loadStructure(){
  let res = ""
  let n = 0
  for (const i of structure) {
    if (typeof i === "number") {
      if (n===3) {
        n=0
        res+=`\n${i} `
      } else {
        res+=`${i} `
      }
    } else if (typeof i === "object") {
      if (n===3) {
        n=0
        res+=`\n${i.p}`
      } else {
        res+=`${i} `
      }
    }
    n++
  }
  return res
}
//cnsole.log(logStructure())
function checkWin(){
  let winner = ""
  const strP1 = combination.p1.join("")
  const strP2 = combination.p2.join("")
  for (const w of wins) {
    if (strP1.includes(w[0]) && strP1.includes(w[1]) && strP1.includes(w[2])) {
      winner=true
    } else if (strP2.includes(w[0]) && strP2.includes(w[1]) && strP2.includes(w[2])) {
      winner=false
    }
  }
  return winner
}
function useSlot(index){
  if (!structure[index]) return false
  if (typeof structure === "object") return false
  if (player==="p1") {
    player="p2"
    structure[index] = {
      p: "•"
    }
    combinations.p1.push(index)
  } else {
    player="p1"
    structure[index] = {
      p: "×"
    }
    combinations.p2.push(index)
  }
}
function end(r) {
  console.log(r)
  process.exit()
}
console.log(`Please enter "start" if you want to start a game!`)
event.on("input",(str)=>{
  //console.log(str.toLowerCase())
  if (str==="start"&&started===false) {
    started=true
    console.log("a")
    console.log(loadStructure())
  }
  if (started===false) return
  const used = useSlot(Number(str))
  if (used===false) end(`There was an error when using a slot!`)
  const winner = checkWin()
  if (winner==="") {
    //Nobody wins
    console.log(loadStructure)
  } else if (winner===true) {
    end(`Player One wins!`)
  } else if (winner===false) {
    end(`Player Two wins!`)
  }
})
process.stdin.on("data", input=>{
  event.emit("input",input.toString())
})
lament rock
#

pretty sure the input includes \r\n
you might want to log the str

errant flax
#

it just logs "start"?

lament rock
#

console.log(str === "start")

errant flax
#

ah

#

ic the prob

#

i wonder why theres an extra "\n"

#

guess ill just check if its startswith

#

it works now

#

thx!

lament rock
cobalt island
#

The bot works fine, but it shows this error whenever any command is executed

pale vessel
#

Check where the error came from

cobalt island
#

sorry, im new to js what does the js:88:22 mean

#

is it line 88?

lament rock
#

you would go to the path it specifies which is the play.js file and go to line 88 column 22 where a .on will appear

#

something.on where something is null
replace something with whatever is there

lean swan
#

Please help me with this sql it was working before

cobalt island
#

what do i replace queue.connection with?

earnest phoenix
#

@scenic kelp

#

Got a bad boi here

earnest phoenix
#

Why it turns a promise

#

And first time it said message content is empty

#

If x.size = 5
How it is empty?

pale vessel
#

It needed to be a string

#

x.size was a number, I believe

#

Discord.js v13 (I assume you're using that version) requires strings as parameter

#

x.size + " K" yields a string which is why it could send successfully

#

You could also do x.size.toString() or `${x.size}`

#

I believe that's what the migrating docs said

delicate shore
#

guys

#

I need to do something like this

#

I am using Canvacord
user inputs the command
if it's in the list then I want it to get the image from canvacord
problem is there are over 20 options and I cant use if else for ever one of them
Can I do something like canvacord.${input}

#

because it doesn't seem to work

#

like this

split hazel
#

From the colour of the variable you're probably not referencing it anywhere

delicate shore
#

I am not
because I re defined it after testing it

#

it never worked in the first place

split hazel
#

And to use the dot notation for objects without a definite value you just do canvas[method]

split hazel
#

You probably don't want to make that a string too

#

otherwise it won't execute as code

earnest phoenix
#

symbol moment

delicate shore
#
canvas[method](img1)
split hazel
#

Yes

delicate shore
#

thanks

split hazel
#

And please be careful with it

delicate shore
#

sure

earnest phoenix
#

I want to have routes like this in my nextjs app:

/servers - Displays the guilds you are in
/servers/[id] - See info for that guild
/servers/[id]/config - Edit info for that guild

How would I do that?

#

[[...slug]] catches everything after [id]

#

and folder names don't work so how would i do the config page

#

already read that

#

Then it should of worked. How are you doing it?

earnest phoenix
#

wait i read the wrong docs

#

lmao

#

did you read nuxt docs?

#

kekw

#

does [stuff] work on folder names

#

I am not too sure tbh

#

because then I can do this:

pages
  /servers.js
  /servers
    /[id].js
    /[id]
      /config.js
#

I haven't tried what you are doing I just know docs exist for it

#

Most likely yea

#

imma try it and see

#

It would make sense for it to exist

#

How else would you make routes for users?

#

cause then you'd be able to do https://domain.com/userID/config

#

they say discord docs are the worst

shrewd hazel
earnest phoenix
#

discord docs aren't bad

#

they just aren't meant for noobies

naive stratus
vivid fulcrum
#

clear your cookies / cache

#

re-login and try again

#

also wrong channel

unkempt jewel
#

any java developer who worked with github api from kohsuke

split hazel
#

very specific

#

you should just ask your question

#

there probably isn't an exact person that did that

subtle kiln
#

Hi, slash cmds worked fine until I re-invited my bot to the guild. Now the cmd is no longer available. Here is the code (using Discord.js) and the API doesn't repond with an error:

export async function registerSlashCommands() {
    const rest = new REST({ version: '9' }).setToken(config.bot.token)
    const res = await rest.put(
        Routes.applicationCommands(client.user.id),
        {
            body: [
                new SlashCommandBuilder()
                    .setName('test')
                    .setDescription('just a test'),
            ]
        },
    )
    console.log(res)
}

->

[
  {
    id: '882200863689568277',
    application_id: '415565607434453025',
    name: 'test',
    description: 'just a test',
    version: '882233625825906708',
    default_permission: true,
    type: 1
  }
]

Did I missed something, a permission ?

earnest phoenix
#

maybe you didnt re invite your bot with the application.commands scope?

subtle kiln
#

mmh I don't really understand what scopes are so maybe that it

#

How can I add the scope?

burnt anchor
#

can anyone help me with c#

hybrid cargo
burnt anchor
#

can anyone help me about c#

hybrid cargo
pallid jungle
#
   ![online](https://cdn.discordapp.com/emojis/809995753921576960.webp?size=128 "online") **Online:** ${members.filter(member => member.presence.status === 'online').size}
                                                                                       ^

TypeError: Cannot read property 'status' of null
burnt anchor
#
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            WebClient wb = new WebClient();
            string VersionOf = wb.DownloadString("https://raw.githubusercontent.com/thisisholydeveloper/versionlxyon/main/version.txt?token=###");

            if (Application.ProductVersion == VersionOf){
                MessageBox.Show("A newer version is avaiable", MessageBoxButtons.OK);
            }
        }
#

i have a file on github and ill update it to latest version
and if application product version is not same at the github it wont work

earnest phoenix
#

both on your code and dev portal

pallid jungle
earnest phoenix
#

i guess

pallid jungle
burnt anchor
#
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            WebClient wb = new WebClient();
            string VersionOf = wb.DownloadString("https://raw.githubusercontent.com/thisisholydeveloper/versionlxyon/main/version.txt?token=###");

            if (Application.ProductVersion == VersionOf){
                MessageBox.Show("A newer version is avaiable", MessageBoxButtons.OK);
            }
        }

i have a file on github and ill update it to latest version
and if application product version is not same at the github it wont work

earnest phoenix
#

can you not spam

burnt anchor
#

afk

pallid jungle
hybrid cargo
#

Hmm

pale vessel
#

Presence is nullable

#

Use ?. or check if the member has a presence or not

pallid jungle
#

Where should i use ?.

#

?

radiant kraken
#

member?.presence?.status

pallid jungle
#

kk

errant flax
pallid jungle
#

wait

#
   ![online](https://cdn.discordapp.com/emojis/809995753921576960.webp?size=128 "online") **Online:** ${members.filter(member => member?.presence?.status === 'online').size}
   ![offline](https://cdn.discordapp.com/emojis/809995754021978112.webp?size=128 "offline") **Offline:** ${members.filter(member => member?.presence?.status === 'offline').size}
   ![Idle](https://cdn.discordapp.com/emojis/809995753656549377.webp?size=128 "Idle") **Idle:** ${members.filter(member => member?.presence?.status === 'idle').size}
#

That what i am trying to do

subtle kiln
#

ok so from what I understand slash cmds are for applications not bots. So, if you want both, you need to invite the bot (scope=bot) and the application (scope=application.commands). Am I right or is their a mean to invite a bot with slash cmds ?

errant flax
#

u do t have to use ?. all the time

#

only use it if u feel like it could or couldn't exist in the object

pale vessel
#

You can invite an application to a server with just the applications.commands scope, but it can only respond to interactions

subtle kiln
pale vessel
#

You need the bot scope to obtain guild information

#

You also need applications.commands scope for slash commands

pallid jungle
radiant kraken
#

@pallid jungle member.presence?.status should work, mb

#

context

errant flax
#

if the docs says it returns something like ?idk then u should use the null operator??

#

what does the ?. called again?

hybrid cargo
errant flax
#

ah ok

pallid jungle
#

I am using discord.js-pagination package

        const curPage = await msg.channel.send(pages[page].setFooter(`Page ${page + 1} / ${pages.length}`));
                                                           ^

TypeError: Cannot read property 'setFooter' of undefined
pagination(message, pages, emoji, timeout)
    }
}
radiant kraken
#

what's pages and what's page

pallid jungle
#

Pages are

const pages = {
    embeds: [embed1, embed2]
}
radiant kraken
#

try pages.embeds[page]

pallid jungle
#

const curPage = await msg.channel.send(pages[page].setFooter(Page ${page + 1} / ${pages.length}));
this line not in my code

radiant kraken
#

soo is pagination(message, pages, emoji, timeout) your code?

radiant kraken
pallid jungle
#

ok

hybrid cargo
#

I think the pages parameter requires an array and not a object

pallid jungle
#

DiscordAPIError: Cannot send an empty message

errant flax
#

i think that package doesn't support v13

pallid jungle
#

Maybe embeds: [pages] ?

errant flax
#

or something

#

since there r changes within sending message from v12 to v13

subtle kiln
#

How can I invite a bot that can add slash cmds? Should I specify 2 scopes (bot and applications.commands) in the URL?

pallid jungle
errant flax
#

i think its open source check the code and if it does
msg.edit(emb) then its at v12

near grotto
#

how do I get a specific role from a server in djs?

errant flax
#

Guild#roles#cache#get(id)

#

if u want to find it by name better use the .find method

near grotto
#

it's showing the error cannot read the property of roles of undefined

errant flax
#

show code

#

wait did u copy and pasted the example i sent to u

near grotto
#
client.guilds.cache.get('guild id').roles.cache.get('role id');
errant flax
#

is guild id an actual id?

near grotto
#

yes

errant flax
#

if so thats the problem

subtle kiln
# hybrid cargo Yes

sorry but I can't find anything in the doc. If I use scope=bot&scope=applications.commands only applications.commands is retained and if I use scope=applications.commands&scope=bot only bot is retained

errant flax
#

it may not be in the bot's cache

near grotto
#

it is

#

bot is in the server

errant flax
#

also how do i check if my bot is invited with application.commands scope?

hybrid cargo
errant flax
earnest phoenix
#

roles are always cached

near grotto
errant flax
#

i meant the guild

#

wait guilds ar always cached

earnest phoenix
#

guilds are always cached as well iirc

subtle kiln
earnest phoenix
#

so it could be it isn't a valid guild id

errant flax
#

show the actual code instead of putting "guild id"

earnest phoenix
#

so its not getting an actual guild

hybrid cargo
earnest phoenix
errant flax
earnest phoenix
#

Best you can do is make sure you provide the scope in the invite url when giving it to top.gg

errant flax
#

ehh ill just screw text commands

earnest phoenix
#

or whatever

shrewd hazel
#

Dpy

near grotto
#

the guild is coming as undefined

errant flax
#

nvm just realized slash commands r not finished

near grotto
#

even if the bot is in the guild

pallid jungle
#

The problem was in package i used another

#

now

errant flax
#

r u sure its the correct bot

near grotto
#

yes

errant flax
#

correct guild id?

pallid jungle
#

Why gives undefined ?

![pp989](https://cdn.discordapp.com/emojis/853496185443319809.webp?size=128 "pp989") **Verification Level:** ${verificationLevels[message.guild.verificationLevel]}
errant flax
#

if so idk whats happening

earnest phoenix
#

@near grotto What exactly are you doing again?

near grotto
#

yes

earnest phoenix
#

and where are you doing this at

#

Is it in an event?

errant flax
#

wait does it matters if its in an event?

near grotto
near grotto
earnest phoenix
#

Not what I mean

#

Are you using this inside an event

hybrid cargo
near grotto
#

no

earnest phoenix
#

like messageCreate or something

near grotto
#

ahh wait

earnest phoenix
#

If so you can just use message to get the guilds roles

#

instead of getting from cache

near grotto
#

it's trying to get the guild before getting ready

#

so that's the problem

earnest phoenix
#

Well that will do it

subtle kiln
hybrid cargo
near grotto
#

ok

pallid jungle
#
${verificationLevels[message.guild.verificationLevel]}

Gives Undefined

#

Missing intents ?

hybrid cargo
#

What is verificationLevels

pallid jungle
# hybrid cargo What is `verificationLevels`
const verificationLevels = {
    NONE: '![Error](https://cdn.discordapp.com/emojis/836169051310260265.webp?size=128 "Error") None',
    LOW: 'Low',
    MEDIUM: 'Medium',
    HIGH: 'High',
    VERY_HIGHT: 'Very High'
}
hybrid cargo
#

VERY_HIGHT

pallid jungle
#

kk

#

Lol

hybrid cargo
#

That could have returned undefined if the server u checked had a very high level

earnest phoenix
#

I got trolled by Discord

Been debugging my code for 17 hours only to realize my code was fine and discord blocked me for too many guild command register requests

hybrid cargo
#

how did u manage to request 200 command registers?

marble juniper
#

more of a math question this time but

#

lets say I have an array of objects an each object has 2 properties which are each numbers

#

kinda like

[{ damageToSelf: 5, damageToEnemy: 4 }]
earnest phoenix
#

fuck

marble juniper
#

how would I find the element that gives myself the lowest damage

earnest phoenix
#

math this early in the morning

marble juniper
#

and the enemy the most

#

I just need to get the element in the array that has the lowest damageToSelf and highest damageToEnemy

#

javascript btw

earnest phoenix
#

cant you just use reduce on the both damages and sort the array so the object that deals the least amount of damage to yourself and the most to the enemy is at the front?

#

I can't remember how reduce works

marble juniper
#

idk

#

thats why im asking

earnest phoenix
#

Fair point

#

but its an idea if it does work how I think it does

marble juniper
#

also its not like I want to find the highest value of a single property in an array

#

its with 2 properties

#

one with highest and lowest

pallid jungle
#
${message.guild.fetchOwner.user.tag}
#

Not working

#
${message.guild.owner.user.tag}

too

marble juniper
#

Where is tim when you need them

#

for the math problems

#

lol

earnest phoenix
pallid jungle
marble juniper
#

try fetching the owner first

#

by id

pallid jungle
#

ok

marble juniper
#

guess if no one wants to do my math problem

#

I will go ask on stackoverflow

earnest phoenix
pallid jungle
marble juniper
#

do I really need to explain that

#

Can't you auto complete the last step in ur brain

earnest phoenix
#

no

#

cause he wants spoon feed

#

lawl

hybrid cargo
# marble juniper I just need to get the element in the array that has the lowest `damageToSelf` a...

Tbh u need to stick to one, or find a way to average it
For example lets say u have an array like this

const arr = [
  { damageToSelf: 1, damageToEnemy: 6 },
  { damageToSelf: 4, damageToEnemy: 11 },
  { damageToSelf: 2, damageToEnemy:  9},
]
```In this, as per your need the lowest `damageToSelf` is 1 i.e `arr[0]`. But also as per your request highest `damageToEnemy` is 11 i.e `arr[1]`

So if you need with both the requirements it would need to return 2 values from the array
earnest phoenix
marble juniper
#

lol

earnest phoenix
#

find using that

pallid jungle
#
const owner = guild.fetchOwner()

${message.guild.owner.user.tag}
TypeError: Cannot read property 'user' of undefined
hybrid cargo
marble juniper
#

yes

signal estuary
#

How is the event called when someone leaves and joins the voice chat?
It cant be voiceStateUpdate because I already tested that
v13

marble juniper
#

but the difference is positive in my direction

#

ofc

#

that I get less damage

#

than the opponent

earnest phoenix
#

await the promise

pallid jungle
#

ok

marble juniper
#

element were both have the highest distance but so damageToSelf isn't higher or equal to damageToEnemy

earnest phoenix
#

yo your about me says you're learning python

pallid jungle
#
const owner = await guild.fetchOwner()

?

#

oh wait

earnest phoenix
#

try it and see

pallid jungle
#

Idk

pallid jungle
earnest phoenix
#

if it errors read it and try and solve your issue before coming here. Learning to read errors is vital

earnest phoenix
wheat mesa
signal estuary
#

How is the event called when someone leaves and joins the voice chat?
It cant be voiceStateUpdate because I already tested that
v13

earnest phoenix
#

Yea it sucks

#

but

pallid jungle
earnest phoenix
#

if people neglect to try and solve their issues first

marble juniper
#

wait I might have a solution to my own problem now

earnest phoenix
#

people will slowly stop helping i feel

wheat mesa
#

You’re speaking to djs users here misty you should know better than to try to give good advice KEKW

earnest phoenix
#

lol

#

yea Sad

#

detritus is good to have no proper guide

#

keeps the noobs out

marble juniper
#

or maybe I don't

earnest phoenix
#

rude but good

wheat mesa
#

But jokes aside learning error messages is important

earnest phoenix
#

Learning errors

wheat mesa
#

I’d say js gives pretty readable errors

earnest phoenix
#

Like Error, TypeError, etc?

wheat mesa
#

Yeah

earnest phoenix
wheat mesa
#

Learning where to find errors in your code when it throws

sudden geyser
earnest phoenix
#

detritus just sucks in general rn

wheat mesa
#

I’m pretty new to C++ and I can tell you that it spits out dogshit errors that are unreadable (for at least me, probably because of my experience level)

sudden geyser
earnest phoenix
#

the fact you gotta do some wacky ass shit to even override types

earnest phoenix
#

and the fact you gotta do wacky ass shit to extend one of their classes

#

like Guild

#

umm

#

discordjs doesn't support extension anymore for the same reasons

#

so what's your point

#

Do you think I use discord.js?

sudden geyser
#

That structures kind of extending is bad practice

earnest phoenix
#

i think you use the normal API

#

I use go

#

lawl

glossy wave
#
  console.log(`${client.user.tag} has logged in.`);
  client.user.setActivity(`${client.projectsSize} Project(s) | Made By ZeroNaruto`, {
    type: "WATCHING",
  });
};
earnest phoenix
#

i use node java
lawl

sudden geyser
#

wot

earnest phoenix
#

java is eh

sudden geyser
#

java's nice

wheat mesa
#

Java is nice

earnest phoenix
#

I prefer kotlin over java

wheat mesa
#

C# is improved Java

sudden geyser
#

yucko

earnest phoenix
#

combine java + scheme + brainfuck

a new language is born

sudden geyser
#

We already have one

#

Clojure

earnest phoenix
#

Lmfao

wheat mesa
#

Honestly been getting into Java recently cus that’s what we’re taught in our CS classes at school

#

Even though I’d rather learn more C# or C++

earnest phoenix
#

if I was taught java in CS I would cry

#

Why would I learn java there if I can just learn it from traversy media

burnt anchor
#

no one knows c#??

wheat mesa
#

Honestly I don’t like my CS class

sudden geyser
#

what's special about c# anyway

earnest phoenix
#

Game making

#

A lot of people use it for unity

wheat mesa
#

The teacher told us we can’t use anything we haven’t learned in her class

#

So I’m stuck out here writing like 30 println statements so that she can introduce us to loops

earnest phoenix
#

Y'all think you suffer
My computer books have had QBasic for 4 years but we never learnt it and I heard in the next year they're going to teach us that, from the ADVANCED BOOKS

#

Lawl

#

what lawl

wheat mesa
#

I should’ve skipped AP CS and gone to CS3 tbh

wheat mesa
#

It’s so slow

#

Because the class assumes that you have no prior knowledge

quartz kindle
#

honestly programming should be taught in a multi-language way

sudden geyser
#

What's CS3?

wheat mesa
#

There’s no prerequisites

earnest phoenix
wheat mesa
#

Computer science 3

pallid jungle
#
${message.guild.ownerId}

Working but

${message.guild.owner.user.tag}

TypeError: Cannot read property 'tag' of undefined

quartz kindle
#

since all languages share the same principles, and the principle is way more important than the syntax of X lang

wheat mesa
#

Only ownerId

pallid jungle
#

ok

coral lichen
#

Hello

wheat mesa
#

If you need the member object, use <Guild>.fetchOwner()

coral lichen
#

I need help

quartz kindle
pallid jungle
wheat mesa
#

🤦

earnest phoenix
#

Can you just learn to read an error

#

bruh

#

I swear

wheat mesa
#

I told you that guild doesn’t have a property of owner

coral lichen
quartz kindle
wheat mesa
#
coral lichen
earnest phoenix
# earnest phoenix Ask her to do fizz buzz

7 line fizzbuzz:

const fizzer = { 3: "Fizz", 5: "Buzz" };
const numbers = Array(100).fill(0).map((_, i) => i + 1).map(n => {
let new = "";
Object.keys(fizzer).forEach(f => f % n === 0 ? new += fizzer[f] : null);
return new || n;
});
console.log(numbers);
quartz kindle
earnest phoenix
#

Why

#

just why

wheat mesa
#

Ew forEach

pallid jungle
#

k

earnest phoenix
#

That just looks bad

#

and unreadable

#

Also you forgot 15

#

smh

#

isn't that what you do in an interview?
make your code unreadable so your co workers can't complain about it

earnest phoenix
quartz kindle
#

lmao

earnest phoenix
#

It automatically combines it with the new variable

quartz kindle
#

what is fizzbuzz supposed to do again?

earnest phoenix
#

wait

earnest phoenix
quartz kindle
#

like print fizz or buzz instead of the number whenever it matches the modulo?

earnest phoenix
#

If n % 3 and has no remainder it will print fizz and same with 5 it will print buzz and same with 15 it prints fizzbuzz the rest of the numbers print as normal

#

When multiple of 3 type freeze
When multiple of 5 type breeze

#

idek if the code works

#

lemme try it and see

#

kids this is why you always keep an ide on your phone

wheat mesa
#

No

#

Never

#

Coding on mobile feels wrong. Like I’m violating a universal law

signal estuary
#

How is the event called when someone leaves and joins the voice chat?
It cant be voiceStateUpdate because I already tested that
v13

var Discord = require('discord.js');
module.exports = {
    name: 'voiceStateUpdate',
    async execute(oldMember, newMember, logChannel) {
        console.log(oldMember)
        console.log(newMember)
    }
}

doesnt react to there

wheat mesa
#

var angeryBOYE

coral lichen
earnest phoenix
#
for i = 0; i < 100; i++ {
  if i % 15 == 0 {
    fmt.Println("FizzBuzz")
  } else if i % 3 == 0 {
    fmt.Println("Fizz")
  } else if i % 5 == 0 {
    fmt.Println("Buzz")
  } else {
    fmt.Println(i)
  }
}
quartz kindle
#

this?

earnest phoenix
sudden geyser
#

rejected

signal estuary
#

the event doesnt exist for me

earnest phoenix
#

Any errors?

#

My god i cannot save my code because of Android's state of the art file opener

#

Saying it doesn't work is useless to us

signal estuary
earnest phoenix
#

How are you registering events.

#

and do other events work?

quartz kindle
#
Array(100).fill().map((_,i) => !(i % 3) ? !(i % 5) ? "fizzbuzz" : "fizz" : !(i % 5) ? "buzz" : i);
earnest phoenix
#

Ah yes

wheat mesa
#

The one liner legend

earnest phoenix
#

Now make it work for bizz when it's a multiple of 7

signal estuary
earnest phoenix
#

for my code you just need to add one key to the fizzer object

quartz kindle
#

like in addition to the 3 and 5?

earnest phoenix
quartz kindle
#

or replacing one

earnest phoenix
#

In addition

quartz kindle
#

and name it what?

earnest phoenix
#

number: "bizz"

hybrid cargo
earnest phoenix
#

look at me saying my code is epic even though i haven't tested it

hybrid cargo
signal estuary
quartz kindle
#

so now you can have triple matches, like fizzbuzzbizz?

earnest phoenix
#

Yes

quartz kindle
#

i see

earnest phoenix
#

Only use a prime number for the keys though

#

nvm use anything

#

i forgor you are supposed to actually allow multiple output

#

does the code actually work though

signal estuary
#

How can I check in this event: voiceStateUpdateif someone leaves or someone joins?

earnest phoenix
#

@signal estuary try putting some console.logs in your event handler

signal estuary
#

but how do I get if someone leavs or someone joins. I mean there is both in one event

earnest phoenix
#

and how are you registering the event

signal estuary
hybrid cargo
#

Check if the parameter you are looking for is changed between the two objects, i.e oldMember and newMember

quartz kindle
earnest phoenix
#

oh my god
that's amazing

hybrid cargo
hybrid cargo
earnest phoenix
#

I mean it sorta makes sense

quartz kindle
#

i mean its pretty basic lol

wheat mesa
#

Lmfao

hybrid cargo
#

@drowsy crag

earnest phoenix
#

@ancient oar @drowsy crag

#

look at me pinging the offender instead of replying to their message

hybrid cargo
#

Lol

drowsy crag
#

@ancient oar no ads pls

hybrid cargo
ancient oar
#

So,

#

Sorry

earnest phoenix
#

@quartz kindle explain it please

quartz kindle
#

lmao

earnest phoenix
#

I think I get it

#

but I am unsure if i am correct

earnest phoenix
earnest phoenix
#

is tim typing another brainfuck

quartz kindle
#

on every index, you list the keys from the object, filter them by whether they pass the modulo check, then remap them to their values, aka the words, then join the words together and return the joined word, or the number if the joined word results in an empty string

earnest phoenix
#

imagine join when you can concatenate a string

#

doesnt like the fact you use new as a variable name

#

who cares

#

¯\_(ツ)_/¯

#

well

#

node does

#

lawl

hybrid cargo
# signal estuary and how? Still dont get it

ye

if(oldMember.channelId !== newMember.channelId) {
  console.log('Member joined / left / moved to a new channel')
}

Refer https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-voiceStateUpdate and https://discord.js.org/#/docs/main/stable/class/VoiceState for more properties

quartz kindle
earnest phoenix
#

OY STOP

#

lmao

wheat mesa
#

js doesn’t even know what’s happening anymore, it just accepts its fate

earnest phoenix
#

class go {}

#

put code in constructor

#

go doesn't got classes

wheat mesa
#
go away
earnest phoenix
#

no u

quartz kindle
#

lmao

#

go is weird

earnest phoenix
#

nah

#

go is lovely

#

i wanna learn go
but i need to away

#

dead chat xd

quartz kindle
#

2 characters smaller

keys = { 3: "fizz", 5: "buzz", 7: "bizz" };
Array(100).fill().map((_,i) => Object.entries(keys).reduce((a,[x,y]) => !(i % x) ? a + y : a, "") || i);
earnest phoenix
#

omg tim

#

ah yes newline

#

tim staph

quartz kindle
#

added a deconstructor to the entry

#

lmao

earnest phoenix
#

you are putting too much time into this

#

what work do we have to do

#

making use of free time by brainfuck

quartz kindle
#
Array(100).fill().map((_,i) => Object.entries(keys).reduce((a,[x,y]) => i % x ? a : a + y, "") || i);
#

inverted the ternary, so no need for extra parenthsis anymore

earnest phoenix
#

do fibonacci sequence

#

u wont

quartz kindle
#

what is the fibonacci again?

#

idk math

earnest phoenix
#

It is where the two numbers before equate to the number after

#

last number + current number = next number

#

0 1 1 2 3 5 8 13 21 etc

#

make pascal's triangle

#

I dare you

#

kekw

#

Ima try and do the fib sequence rn

#

hol up

#

Just to let you know pascal's triangle extends infinetely in ALL directions

#

so it's a pascal's square

signal estuary
#

can I access in the voiceStateUpdate the user / member object so I can use

.avatarUrl()
var Discord = require('discord.js');
module.exports = {
    name: 'voiceStateUpdate',
    async execute(oldMember, newMember) {
     }
}
oldMember.avatarURL is not a function
earnest phoenix
#

oldMember is a member

#

avatarURL is for user objects

#

try oldMember.user.avatarURL

timid heron
#

TypeError: Cannot read property 'url' of undefined
at play (/home/runner/Discordjs-MusicBot-1/commands/p.js:121:39)
at StreamDispatcher.<anonymous> (/home/runner/Discordjs-MusicBot-1/commands/p.js:134:11)
at StreamDispatcher.emit (events.js:326:22)
at finishMaybe (_stream_writable.js:639:14)
at _stream_writable.js:616:5

#

can some one help me with this error

earnest phoenix
#

You need to give us some code so we can help you

timid heron
#

async function play(track) {
try {
const data = message.client.queue.get(message.guild.id);
if (!track) {
setTimeout(() => {
data.channel.send("Queue is empty, Leaving voice channel");
message.guild.me.voice.channel.leave();
return deletequeue(message.guild.id);
}, 900000)
}

  data.connection.on("disconnect", () => deletequeue(message.guild.id));
  const source = await ytdl(track.url, {
    filter: "audioonly",
    quality: "highestaudio",
    highWaterMark: 1 << 25,
    opusEncoded: true,
  });
  const player = data.connection
    .play(source, { type: "opus" })
    .on("finish", () => {
      var removed = data.queue.shift();
      if(data.loop == true){
        data.queue.push(removed)
      }
      play(data.queue[0]);
    });
earnest phoenix
#

What is on line 121

earnest phoenix
#

[0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 194 196 198]
So I did it completely wrong

#

@earnest phoenix lol even number generator

#

Yea

#

I fucked up

hybrid cargo
timid heron
#

the first line

earnest phoenix
#
func main() {
    var lastNum int;
    var nums []int
    for i := 0; i < 100; i++ {
        lastNum = i
        nums = append(nums, lastNum+i)
    }
    
    fmt.Println(nums)
}

Now that I think about it this ofc wouldn't work

earnest phoenix
#

Track is undefined

#

console log track

#

I had brain fart

#

It doesn't exist

earnest phoenix
#

evaporate

earnest phoenix
#

I wonder how you would do the fib sequence

hybrid cargo
earnest phoenix
#

🤔

hybrid cargo
earnest phoenix
#

last number + current number = next number

hybrid cargo
earnest phoenix
quartz kindle
#

does it count if i skip the first 3 numbers and start with 2 3 5 8?

#

lmao

earnest phoenix
#

I mean

#

it doesn't say what order it has to be

quartz kindle
#
Array(100).fill().reduce((a,_,i) => (a[i] = (a[i-2] || 1) + (a[i-1] || 1)) && a, []);
earnest phoenix
#

it just specified that last num + curr num = next num

earnest phoenix
#

yep thats it

hybrid cargo
#

I just stopped it till that, otherwise it can just go indefinitely

earnest phoenix
#

I can't seem to get it to work with go

#

:c

hybrid cargo
#

F

quartz kindle
#

yeah with 100 iterations it gets quite big

earnest phoenix
#
package main

import (
    "fmt"
)

func main() {
    var nums []int
    for i := 0; i < 100; i++ {
        nums = append(nums, FibonacciRecursion(i))
    }
    
    fmt.Println(nums)
}

func FibonacciRecursion(n int) int {
    if n <= 1 {
        return n
    }
    return FibonacciRecursion(n-1) + FibonacciRecursion(n-2)
}

This supposedly works

#

but I didn't do it myself

hybrid cargo
#

Jeez

earnest phoenix
#

jeez nuts

hybrid cargo
earnest phoenix
#

Ah shoot I got school soon

#

ffs

#

Array(10).fill(0).reduce((acc, cum) => Array.isArray(acc) ? [ ...acc, acc[acc.length - 1] + acc[acc.length - 2]] : [0, 1, 1]);

#

@quartz kindle does this work

quartz kindle
#

yeah it does

earnest phoenix
#

nice