#stocknames

1 messages · Page 1 of 1 (latest)

tacit shuttle
#

Uuuuuuuh

#

I'm not sure I'm following you there :v

visual python
#

thats actually better

tacit shuttle
#

(yay threads are noice)

visual python
#

indeed

#

well, you said

#
for(idk)
idk
stuff
}```
#

I understand that it creates a variable called stock for each stockname

tacit shuttle
#

Yes

visual python
#

but why is there a for in the for loop

tacit shuttle
#

Oh that

visual python
#

how should I use it correctly?

tacit shuttle
#

It's the for (let i = 1; i < 6; i++) { for loop that you wrote

visual python
#

so I should add that there?

#

yea, makes sense

#

since I have a substock for my stock

#

ah, the forloop just replaces forEach?

#

so I can just put the whole code into there?

tacit shuttle
#

Oh btw, pasting the code instead of screening it makes it easier :p ||I say as I literally came here with a screenshot of my code for my problem||

visual python
#

since the forEach requires an async inside...?

#

xD

tacit shuttle
visual python
#

I see, thats very good to know

tacit shuttle
#

aight, time to abuse nitro

const path = require("path")
const fs = require("fs");
const Discord = require('discord.js');
const StockBlog = require("../../schemas/StockSchema");
module.exports = {
    name: "stocklist",
    category: "stocks",
    permissions: [],
    devOnly: false,
    description: "Shows all Stocks or one specific in a list",
    usage: "stocklist [stock]",
    run: async ({bot, message, args}) => {
      let { client } = bot;
        
        const embed = new Discord.MessageEmbed()

        const dir = path.join(__dirname, "../../Stockimages")
        let fullstocknames = fs.readdirSync(dir)
        let stocknames = fullstocknames.map(d => d.slice(0, -4))

        embed.setTitle(`Stock List`)
        //.setImage(message.guild.iconURL())
        /*fullstocknames.forEach((stock) => {
            const attachment = new Discord.MessageAttachment(`Stockimages/${stock}`, stock)
            embed.setTitle('test')
            .setImage(`attachment://${stock}`)
            message.channel.send({ embeds: [embed], files: [attachment] })
        })*/

        if(args[0] === undefined) {

            for(let stock of stocknames) {
                for()
            }

                /*stocknames.forEach((stock) => {

                    const stockasync = async() => {
    
                        for(let i = 1;i < 6;i++) {
                            let stocknumberfetch = await StockBlog.findOne({StockName: stock, StockNumber: i}, "StockName Owner StockValue StockNumber").exec()

                            console.log(stocknumberfetch)
    
                            //embed.addField({ name: `***${stocknumberfetch.StockName}*** ${stocknumberfetch.StockNumber}`, value: `${stocknumberfetch.Owner}: ***$${stocknumberfetch.StockValue}***` })
                        }
                    }
                    stockasync()
                })

                message.channel.send({ embeds: [embed] })*/

        } else if (stocknames.includes(args[0])) {

        } else throw "?Not a valid Stockname"
    }
}
visual python
#

lmfao

#

actually

tacit shuttle
#

Ok back to square 1

says that my MessageEmbed is an empty String, even tho it clearly isnt

visual python
#

indeed

tacit shuttle
visual python
#

uh

tacit shuttle
#

Because in the last version, this is the prototype of addField

visual python
#

16.14

tacit shuttle
#

... Did you spit out your node.js version? xD

visual python
#

meaning?

#

ah

tacit shuttle
#

discord.js's last version is 13.7

visual python
#

yea

#

lmfao

#

wait, where do I look

tacit shuttle
#

In your package.json file

visual python
#

13.6

#

k, updated to 13.7

tacit shuttle
visual python
#

indeed

tacit shuttle
visual python
#

modals?

#

well, if it doesnt break my code, I am fine with it

#

as long as it runs its fine xD

#

a problem with the Field

#

ig

tacit shuttle
visual python
#

lmfaooo

#

nice

tacit shuttle
#

It takes 2 parameters, not an object

visual python
#

wait what

#

so I cannot just say

#

name and value?

#

obviously not

tacit shuttle
#

You haven't made your way through JS syntax yet have you x')

visual python
#

cause it needs to be done...?

tacit shuttle
#

No it doesn't

visual python
#

xD

tacit shuttle
visual python
#

lemme see

#

nice, doesnt work

#

lmfao

tacit shuttle
#

What does it say?

visual python
#

nothing

#

thats the funny thing

tacit shuttle
#

And what did you write

visual python
tacit shuttle
#

Seems to me like the field is being added to the embed

visual python
#

seems like its being an ass B_DogeKek

tacit shuttle
#

What's not working exactly?

visual python
#

wait

#

HEX, SEND IT

#

bruh, I didnt send it

tacit shuttle
visual python
#

ahhhhhhhh

#

thanks

#

needa go eat

#

cya later

tacit shuttle
#

nice betterdiscord theme

#

See ya, have a nice meal xd

visual python
tacit shuttle
#

The background? Because Betterdiscord technically breaks Discord's TOS (even though in my experience they don't care about it)

visual python
#

yea, background is fine, the plugins are against TOS

#

and the new discord TOS changed and now they dont care about it

muted sierra
#

yo so in v13, I extended the Message/Interaction prototype to get custom methods

#

Now in v14 it doesn't let me