#development

1 messages · Page 1693 of 1

earnest phoenix
#

and run it

#

same error

#

and run it

#

ok

waxen bough
#

the last thing to do ispkill the process but i won't recommend that

earnest phoenix
#

well nvm install script also uses curl

waxen bough
#

might break something

earnest phoenix
#

yeah

#

just saw it in the code

#

cargo install deno

#

if you already have rust installed

#

okie

#

WHY DO ALL INSTALL SCRIPTS USE CURL

waxen bough
#

install scripts need internet to download things and install them.

earnest phoenix
charred pumice
#

Why is repl.it saying that staying_alive is undefined?

from threading import Thread

app = Flask('')

@app.route('/')
def home():
  return "Webserver OK, Discord Bot OK"

  def run():
    app.run(host="0.0.0.0",port=8080)

    def staying_alive():
      t = Thread(target=run)
      t.start()```
waxen bough
#

unless the script have its own install data(probably folder) to get contents from.

earnest phoenix
#

in my case is in the samefile as my bot

charred pumice
#

So yes me too

earnest phoenix
#

🤦

#

i tried to install curl from ubuntu software store

charred pumice
earnest phoenix
#

app=Flask("")

@app.route("/")
def index():
return "<h1>Bot is running</h1>"
Thread(target=app.run,args=("0.0.0.0",8080)).start()

#

in my case i use like this

charred pumice
#

What file is that in?

earnest phoenix
#

main

charred pumice
#

Im confused what would I do?

earnest phoenix
#

why the fuck wont it work

charred pumice
#

I haven’t coded in long time

earnest phoenix
#

replace it

#

what process is using the shit

#

¯_(ツ)_/¯

#

restart

#

or install from source

#

cargo install deno

charred pumice
#

Can you show me bigger example or something

earnest phoenix
#

not really

#

its the piece of code i use in my bot

earnest phoenix
#

except i dont know how to do that

#

¯_(ツ)_/¯

charred pumice
#

What do you put at the end of your code?

earnest phoenix
#

thing that i just send

charred pumice
#

Is that’s all you put in your entire bot for it?

earnest phoenix
#

for keeping it alive yes

placid meadow
#

what is flask?

#

sort of lite webserver?

earnest phoenix
#

it worked

#

oh cool

#

but i have to type the path to deno everytime i need to use it

#

lol

#

add to bashrc

earnest phoenix
placid meadow
#

i got a nice lil gimmick for bashrc @earnest phoenix

earnest phoenix
#

ok

placid meadow
# earnest phoenix ok
function extract {
 if [ -z "$1" ]; then
    # display usage if no parameters given
    echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
    echo "       extract <path/file_name_1.ext> [path/file_name_2.ext] [path/file_name_3.ext]"
    return 1
 else
    for n in $@
    do
      if [ -f "$n" ] ; then
          case "${n%,}" in
            *.tar.bz2|*.tar.gz|*.tar.xz|*.tbz2|*.tgz|*.txz|*.tar)
                         tar xvf "$n"       ;;
            *.lzma)      unlzma ./"$n"      ;;
            *.bz2)       bunzip2 ./"$n"     ;;
            *.rar)       unrar x -ad ./"$n" ;;
            *.gz)        gunzip ./"$n"      ;;
            *.zip)       unzip ./"$n"       ;;
            *.z)         uncompress ./"$n"  ;;
            *.7z|*.arj|*.cab|*.chm|*.deb|*.dmg|*.iso|*.lzh|*.msi|*.rpm|*.udf|*.wim|*.xar)
                         7z x ./"$n"        ;;
            *.xz)        unxz ./"$n"        ;;
            *.exe)       cabextract ./"$n"  ;;
            *)
                         echo "extract: '$n' - unknown archive method"
                         return 1
                         ;;
          esac
      else
          echo "'$n' - file does not exist"
          return 1
      fi
    done
fi
}
#

multi unzipper

earnest phoenix
#

ok

placid meadow
#

i love it 😛 saves some time

placid meadow
latent heron
#

what the absolute fuck is this

#

if [ -z "$1" ]; then

#

this is the most black magic shit i've ever seen being done in Lua before

placid meadow
#

thats not lua

#

bash

latent heron
#

oh

placid meadow
#

😉

charred pumice
#

I haven’t coded in like a year and now I’m confused with some basic importing shit

#

Wtf

#

Not actually a year but damn

placid meadow
#

goes quick 😛

waxen bough
#

oh i want to bring up my problem with using bash scripts in my node project

#

i also want it to work on windows

earnest phoenix
placid meadow
#

bash can run in windows, ported

earnest phoenix
placid meadow
#

but ur better off with powershell i rekon

waxen bough
#
#!/usr/bin/env node

require("../build/run");
waxen bough
earnest phoenix
placid meadow
#

ok how so

latent heron
placid meadow
#

i know u have ported shells from linux to windows (forgot the name of it)

#

but why ?

#

the package is called cygwin

#

looked it up

lament rock
#

A singular cluster worker shouldn't consist of too many shards where it would get to that point. Processing incoming socket messages doesn't take that much processing power. The master thread wouldn't even be doing anything else computationally expensive if a thread pool is used to delegate command processing which could consist of 2D canvas rendering which is a good example of potentially heavy processing. Another would be audio encode/decode.

If a thread isn't being utilized, then that's wasted resources.

placid meadow
#

good point

#

but i like my approach 😉

#

and i do have drawing routines in there

lament rock
earnest phoenix
#

YES

#

I GOT DENO TO WORK FINALLY

#

ty @earnest phoenix

placid meadow
#
[Processor][4/7/2021 9:59:51 AM] -> Task Command from 'Barret'
[Command][4/7/2021 9:59:51 AM] Running '!top10'
[Command][4/7/2021 9:59:52 AM] <- Task Command finished in 963ms
lament rock
#

Is that actually time spent from processing or from network I/O as well

placid meadow
#

i might need to reduce the image size

#

thats time spend on executing a command (that contains 4 charts and linq query's)

#

thats the result of that command

lament rock
#

ah. Lovely

waxen bough
#

demn you talk about advanced stuff

lament rock
#

My highest res image is 800x500, but I'd say this still looks pretty clean

placid meadow
#

it does look nice indeed

waxen bough
#

how do you guys make threads talk to each other? do you guys use worker_threads?

placid meadow
#

talk to each other?

lament rock
#

node js does make use of worker_threads

#

well, users do

tepid agate
#

Why This Is Invalid?

cinder patio
#

You haven't saved your file

lament rock
#

in worker_threads, there is a parent port and the parent port can post messages to workers and workers can send stuff back to the parent. The workers extend EventEmitters, so communication between 2 threads feels native

#

You should read the node.js docs on worker threads though

cinder patio
#

IPC

lament rock
#

very helpful

placid meadow
#

or callback's

charred pumice
#

keep_alive.py:```from flask import Flask
from threading import Thread

app = Flask('')

@app.route('/')
def home():
return "Webserver OK, Discord Bot OK"

def run():
app.run(host="0.0.0.0",port=8080)

def keep_alive():
  t = Thread(target=run)
  t.start()```
  File "main.py", line 3388, in <module>
    keep_alive.keep_alive()
AttributeError: module 'keep_alive' has no attribute 'keep_alive'``` somebody plz
woeful pike
placid meadow
#

is the def run one time listener or a loop deal ?

#

i rekon one time listener

waxen bough
waxen bough
lament rock
#

Pretty sure you can listen to individual workers and provide callbacks for each message receive

woeful pike
#

you can't process 2 things at the same time so there is no race condition when receiving messages

placid meadow
#

parallel threading 😉

#

it cant be faster, can do more work

lament rock
#

even if you can't do what I mentioned (unlikely), then you can make a system where threads identify themselves

waxen bough
#

i meant if the same worker thread sent 2 messages to main thread at the same time.

charred pumice
#

Can somebody plz help me xd

placid meadow
#

like torrent clients do

woeful pike
#

wha

placid meadow
#

chunk as in, partial piece of work, over several threads

earnest phoenix
charred pumice
#

wym

#

I’m not?

lament rock
#

If you're talking about trying to resolve a Promise to somewhere else other than the direct callback, you'd have to set up an outgoing Map with keys the threads would bounce back and forth to identify what it's linked to and relate that key with a Promise's resolve function.

placid meadow
#

woot... my bot just exceeded the 300 users mark

woeful pike
#

I mean you can receive messages in multiple threads simultaneously but not on one. I've never had to use threads in node tho so they're not even a particularly useful concept unless you're dealing with cpu intensive work

charred pumice
placid meadow
lament rock
#

main => create task with resolve => store in Map. key 123 (example) => send key 123 and task to worker => worker does task => worker sends back 123 and result of work => main thread can get the key and resolve the Promise

charred pumice
#

Cause I’m watching video and it does the exact same thing

woeful pike
#

if you're doing something that requires threading I'd argue you're using the wrong language

cinder patio
#

You just have to fix the identation

placid meadow
#

in dotnet u can just use the Task.Factory features

#

time capped or whatever u need

charred pumice
#

Whose talking to who I’m confused

#

xD

lament rock
#

Games make use of threads. Languages games use bad

placid meadow
#

my bot has between 5 and 10 threads, more then half is from the discord Library,

woeful pike
#

I meant in javascript obviously

placid meadow
lament rock
#

Ah. Alright. I mean, the alternative is making separate processes which is more of a chore to setup ipc than it is to just have a parent port visible to worker threads. I've definitely come into issues with audio encode when applying ffmpeg filters since exec sucks.

woeful pike
#

look into fluent-ffmpeg idktbhprollyanod

lament rock
#

amandathink will check out

placid meadow
#

i wish u could make high prio threads 😛

lament rock
#

isn't that up for user task delegation though

placid meadow
#

dunnow, dotnet has the 'background' flag on them

earnest phoenix
lament rock
#

Can't you select which threads get used in a pool?

#

Actually, it wouldn't really make sense to include a high priority task in a pool

placid meadow
#

for audio/stream it would be nice

#

those are delay sensitive

charred pumice
#

Bro I’m following video perfectly and it gives this error

#

Wtf

placid meadow
#

user error

#

😛

charred pumice
#

?

placid meadow
#

was a joke

charred pumice
#

I made keep_alive.py

#

I imported it

#

I ran keep_alive.keep_alive()

#

And it say that keep_alive has no attribute called keep_alive

#

Wyf

runic sun
#

Guys, who can help me to make bot with Leveling, Music, YT and Twitch announcements, level rewards and website for it please dm me i am new in this and I really need help

placid meadow
#

i have a leveling formula

#

but other then that

next crow
#

#

Im Turkish

earnest phoenix
#

ok

runic sun
runic sun
placid meadow
runic sun
#

What does VB mean?

ancient vault
#

Hi

runic sun
#

Hi

ancient vault
placid meadow
#

ehh ..

runic sun
#

No

ancient vault
#

I forgot what it means lmao

runic sun
#

Lol

cinder patio
#

Visual Basic

waxen bough
#

visual basic... iguessss?

ancient vault
#

Yeah I think so

cinder patio
#

"think so"

#

that's what it is

ancient vault
placid meadow
#

well i dont think the logarithm level code wont do any good 😛

ancient vault
runic sun
#

Ok

placid meadow
#

found it on the unity forum for mmo's

#

lol

#

works well

runic sun
placid meadow
#

this is a source yes

#

u can extract the formula and use it else where

#

in another language

runic sun
#

Can I check my level by !rank with it?

placid meadow
#

well you need a way to add experience (a number) that comes from some mechanic

#

in my case, i have a chat stats bot that multiplies 0.5 * TotalWords

runic sun
#

How do I add xp?

placid meadow
#

you have a user class, for instance with 3 fields. Experience, Level and Required

#

the experience is where you add the input points , then computeRequired(current) calculates the required experience to level up

#

if that condition is met, you can level up

runic sun
#

And where do I place it?

placid meadow
#
        Public Shared Sub LevelUp(p As Profile)
            If (p.Level < Constants.LevelMax) Then
                p.Exp = 0
                p.Level += 1
                p.Required = Words.Calculate(p.Level)
            End If
        End Sub
``` this would be the level up code
#

in my code that is

runic sun
#

Cool

placid meadow
#

ehm if u dont know what to do with it ...

#

i think you need to do some more tutorials 😛

runic sun
#

Maybe u can just tell me where to place it?

placid meadow
#

dude...rly ?

#

i just did

runic sun
#

Oh

#

I just don’t rly und am noob

placid meadow
#

i gave you my codes, u cant just expect me to do all of it?

runic sun
#

Ok

#

I didn’t

cinder patio
#

You don't just place it somewhere and expect it to work

runic sun
cinder patio
#

I doubt you're coding in VB

#

you rewrite to your language

runic sun
#

I never did coding-

cinder patio
#

then you should learn it before jumping into creating a bot

#

at least the basics

runic sun
#

Oh ok

waxen bough
#

dem i got [debug] 429 hit on routeon my bot i didn't even spam messages.

#

my bot*

earnest phoenix
#

How do you make typescript ignore imports that contain .ts at the end? VSC is yelling at me for putting .ts at the end and Deno is yelling at me for NOT putting .ts at the end

earnest phoenix
#

and also i already have deno extension installed but it doesnt work

#

sigh is it time to do @obtuse osprey-ignore on all my files

earnest phoenix
green kestrel
cinder patio
#

looks good

green kestrel
#

thanks, did I miss any important question?

cinder patio
#

I don't think so

sudden geyser
#

Everything is fine except for some grammar mistakes

green kestrel
#

please let me know them and I'll fix 👍

opal plank
#

np

crimson vapor
#

hi weeb

opal plank
crimson vapor
#

im in class

opal plank
waxen bough
#

does sqlite support aarch64

lyric mountain
#

sqlite is a self-contained database

#

if your system support files then i guess it does support sqlite

crimson vapor
opal plank
#

just say you're also learning in a culture exchange program

#

cuz you plan to travel abroad in the future

#

exemplary student, working 2x as hard as the rest

umbral zealot
opal plank
#

yeah

#

in all honesty i was about to ask if there was a simplier way to do a sql call with multiple lines

#

as in, multiple inserts

#

usual format is usually (query, [])

umbral zealot
#

there usually is, with transactions

opal plank
#

not that, you can append multiple values in the same query

#

example

umbral zealot
#

depends on your sql language actually.

#

and module/client

opal plank
#
INSERT INTO table (id, timestamp, foo, bar) VALUES ($1, $2, $3, $4), ($5, $6, $7), ($8, $9, $10)

for example

umbral zealot
#

ok yes but are you using mysql2 or pgsql or better-sqlite3 or ... what

opal plank
#
pg.query(`INSERT INTO table (id, timestamp, foo, bar) VALUES ($1, $2, $3, $4), ($5, $6, $7), ($8, $9, $10)`, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
umbral zealot
#

Ah, pg. ok .

opal plank
#

lets see

#

pg

#

thats the module

lyric mountain
#

btw

#

that won't work

opal plank
#

usually that querry is fine

#

it does

lyric mountain
#

you pass 4 field but 3 args

umbral zealot
lyric mountain
opal plank
#

timestamp is auto inserted

lyric mountain
#

ah ok

opal plank
#

3 passed values

umbral zealot
#

Thing is it's going to be multiple queries

lyric mountain
#

actually

#

can't u just remove timestamp field then?

opal plank
#

it doesnt need multiple queries

umbral zealot
#

but those queries are going to be run within one batch

opal plank
#

what i did works but its not good

umbral zealot
#

oh wait, "append multiple values" I thought you meant write multiple rows. aight nevermind

opal plank
#

the proper way would be to repeat() on the string and do [...array]

#

to destructure the array into the correct chunks

#

so [[1,2,3], [1,2,3], [2,3,4]] => [1,2,3], [1,2,3], [2,3,4]
and the query uses VALUES ($1), ($2), ($3)

#

adding only the ($NumberOfShards)

ember goblet
#

why white

opal plank
#

yall know a way to do something like that?

lyric mountain
#

what's that?

ember goblet
#

white

lyric mountain
#

be more specific

umbral zealot
#

well clearly you made it white with html and css?

lyric mountain
ember goblet
#

should look red normally

leaden iron
#

send ur code here

ember goblet
#

oh

opal plank
ember goblet
#

1 minute

frigid dagger
#

@leaden iron bro when u got badge

umbral zealot
#

Over 6 months ago

#

The badge is no longer being given

leaden iron
#

cuz I have a bot

frigid dagger
#

@umbral zealot hmm i want

leaden iron
#

u can't

umbral zealot
#

WEll you can't get it.

ember goblet
#

body

#

css

frigid dagger
#

@umbral zealot whyy

umbral zealot
frigid dagger
lyric mountain
#

is that inside your longdesc?

lyric mountain
#

discord made it legacy

ember goblet
#

yes

lyric mountain
#

so it's 101% impossible to get it

ember goblet
#

@lyric mountain

leaden iron
#

comedy

ember goblet
#

why white

frigid dagger
#

@leaden iron which is your bot?

leaden iron
#

emojicord

#

but offline

frigid dagger
#

@leaden iron why

umbral zealot
#

remove the whole <doctype> and html and all that jazz. Keep only the <style> tag and its contents, along with your html. You should not be putting the entire html in here, as you're writing code that's already on a page

frigid dagger
#

I have made

#

Bot music one

#

It is online

#

24/7

#

But How To Make it Go In Vc 24/7

opal plank
#

well, rip optimizing that sql call then

old cliff
#

is there a way to do Object.assign() but only merge properties present in the Source?

dusky mason
#

when running lavalink, it says the port is already in use and just closes

cinder patio
#

The fix for the error is in the error message

umbral zealot
#

I'm guessing that's because the port's already in use? 😛

tacit sequoia
#

Try another port

cinder remnant
#

Am new

#

Can someone show me love

cinder patio
#

no

umbral zealot
#

unless you want programmed love

#

const love = input || 0;

sudden geyser
#

Defaults to 0

winged linden
#

Oof

cinder remnant
#

Development and developers should show me some love

cinder patio
#

for what

#

what'd you do

waxen bough
#

let give em chance to change

sudden geyser
#

Emotions are wack

umbral zealot
#

You don't get free love. Do you have a programming-related question?

cinder remnant
#

Am a programmer for United States

waxen bough
opal plank
cinder remnant
dusky mason
cinder remnant
#

I have been a ghost staff for over 5 years together with USA support

umbral zealot
dusky mason
#

well none worked

#

same error on the ports

umbral zealot
#

yeah no I'm saying you're configuring the port once and using it twice

dusky mason
#

oh oh i see

umbral zealot
#

it's starting twice is my theory

dusky mason
#

i mean i ran killall lavalink

#

unless

#

oh wait

#

no

#

i ran that

#

no processes

opal plank
#

it might be other processes using that port

#

do a netscan

umbral zealot
#

It's gotta be that, there is literally no other reason for all the ports to do the same thing. Something's starting it twice.

cinder patio
opal plank
#

@dusky mason run netstat in your terminal

#

should work on linux and windows afaik

#

either cmd/shell or linux prompt

dusky mason
#

what are you interested in the output?

#

pretty long

#

output

opal plank
#

thats not for ME to check, its for YOU to look

#

those are all your open ports

dusky mason
#

ohh

#

alr

opal plank
#

check if it has the one you looking for

#

the same u trying to open with lavalink

#

that'll tell you the app using it

cinder remnant
dusky mason
#

the ports i was using is not on the netscan list

umbral zealot
#

Start it, and when it gives you that error, run netscan again

opal plank
#

then you should be able to run it on that port

#

ssh tunneling can mess with ports fyi

#

cuz it redirects port traffics

#

keep that in mind

dusky mason
#

yeah port 8080 still in use

opal plank
#

i usually use that for my debuggers so i can run it locally

#

i

#

will

#

absolutely

#

fucking

#

slap you

#

isnt 8080 reserved?

umbral zealot
#

no?

#

lol

opal plank
#

8080 is the normal 80 port isnt it

umbral zealot
#

they were using 2333 before, not sure why 8080 now

dusky mason
#

i mean

waxen bough
#

i use 8080 port too

dusky mason
#

you asked for

waxen bough
#

because it's easy to type

dusky mason
#

me to try other ports

umbral zealot
#

no port 8080 is often used internally for webservers in development

#

it's not a reserved port in any way

dusky mason
#

oh i was just on stack and saw other people use 8080 for lavalink

opal plank
#

nvm me then

#

i would still not recommend using it

#

its too much used

#

8080 is for proxy iirc

dusky mason
#

yeah ill change back to 2333

#

since it's default for

#

lavalink

opal plank
#

its too much unecessary traffic passing through them

dusky mason
#

2333 in use

opal plank
#

how are you opening it?

#

it sounds like you're trying to run 2 instances at once

umbral zealot
#

yeah I've said that earlier.

#

clearly that's the issue

opal plank
#

it should be really simple tho

umbral zealot
#

I don't see any other way

opal plank
#

java -jar lavalink.jar

#

thats all

#

of course, make sure ur in the same dir

#

or point it to an absolute path

lyric mountain
#
fuser -n tcp -k 2333
java -jar lavalink.jar

KEKW

dusky mason
#

yeah thats what im using

opal plank
#

why not use the default yml file with it?

dusky mason
#

yml?

opal plank
#

yes

dusky mason
#

i use it

opal plank
#

it cna pickup the yml file for options

#

then why u running fuser?

lyric mountain
#

actually

opal plank
#

just run what i sent

lyric mountain
#

he didn't refer to my msg

dusky mason
#

yeah i didn't

#

lol

#

i was refering to erwins

opal plank
#

oh

still flower
#

With my API and webhook for votes as you know it returns the api, but when I use other parts of my api for example user/:userID sometimes it give me the GuildMember object and let me@use their username and others it won’t, is there anyway to fix this or actually make it more consistent

dusky mason
#

(i should've used reply)

lyric mountain
opal plank
#

so you just running it with java - jar lavalink?

dusky mason
#

yeah

lyric mountain
#

messy context

dusky mason
#

well with &

#

since i need it

#

in the background

#

wait

#

isn't that

#

the problem

opal plank
dusky mason
#

what if there it's just running in the background

#

can't be because i used killall

lyric mountain
#

fuser it

#

to shutdown any leftover lavalink process

dusky mason
#

just got this

lyric mountain
#

there was indeed something in port 2333

#

not anymore tho

dusky mason
#

alr lemme try again

#

no big error

lyric mountain
#

honestly, as long as you use an uncommon port, you could just create a bash file with those two commands

#

that way you ensure the port is open

dusky mason
#

yeah

#

alr thanks tho

cosmic forum
#

Hello, I am making a login/signup system, and I'm currently using cookies to store their username for usage around the site. Is there a better way of knowing who is signed in, and not need them to keep logging in for every new page the visit/leave? (nodejs)

earnest phoenix
#
<html>
<head>
    <title>blynox</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <h1>Blynox</h1>
    <p><h4>The new google</h4></p>
    <button id="btn1">Like</button>
    <script src="code.js"></script>
    <p id="text">Click the button</p>
    <script src="code.js"></script>
    <button id="btn2">Color</button>
    
</body>
</html>```
my code
```js
document.getElementById("btn2").onclick = function() {
    document.getElementById("text").style.color = "blue";
    }```
#

help guys

#

code.js:5 Uncaught TypeError: Cannot set property 'onclick' of null

umbral zealot
#

Wehre are you putting your code though

earnest phoenix
#

?

umbral zealot
#

if that's your entire html file where's the javascript

earnest phoenix
#

nop

umbral zealot
#

OH! wait it's the script tag, IS ee

earnest phoenix
#

...

#

ok...

umbral zealot
#

put it after defining the button

#

move the script tag one lower.

earnest phoenix
#

ok

umbral zealot
#

basically one of these is not like the other, and it's the one that fails 😛 ```html
<button id="btn1">Like</button>
<script src="code.js"></script>

<script src="code.js"></script>
<button id="btn2">Color</button>
cosmic forum
#

@earnest phoenix why have you called the same script twice?

earnest phoenix
#

thanks

#

it workd

umbral zealot
#

Good, though, you should absolutely delete the first one since you shouldn't run the same code twice 😛

earnest phoenix
#

kk

cosmic forum
#

@earnest phoenix also, it'd be a good idea to keep ur script tags after the body element.

earnest phoenix
#

i did

cosmic forum
#

Ok

earnest phoenix
#

pls how to randomize color here

lyric mountain
#

here you can't

earnest phoenix
#

in the code

#

@lyric mountain thats not funny

lyric mountain
#

what's funny?

#

it wasn't a joke

earnest phoenix
#
document.getElementById("btn2").onclick = function() {
    document.getElementById("text").style.color = "blue"
}```
lyric mountain
#

you asked how to randomize color "here", aka top.gg discord server

earnest phoenix
#

i wanna say that how to randomize the color in the code

#

instead of blue

lyric mountain
#

in that code, just use RGB format instead of names

earnest phoenix
#

?

lyric mountain
#

#RRGGBB

earnest phoenix
#

will it works

umbral zealot
#

try it and see

earnest phoenix
#

to randomize the colors

#

of the changing text

lyric mountain
#

it'll only change color on button click tho

earnest phoenix
#

pk

#

kk

lyric mountain
#

btw, #RRGGBB is not a valid hex

earnest phoenix
#

ok

lyric mountain
#

just in case

#

idk if it'd work, but if you're able to use CSS colors there you could try rgb(R,G,B)

#

it'd be easier than using hex

earnest phoenix
#

kk

vivid fulcrum
#

they're setting the css color style

#

so they're able to use any of hex, rgb, rgba

lyric mountain
#
`rgb(${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)})`

basically

pale vessel
#

bruh just use hex

#

Math.random() * 0xffffff

earnest phoenix
#

nvm

#

ill try both

lyric mountain
#

oh, forgot about the byte way

earnest phoenix
#

ok

#

@pale vessel i did but it still same color

pale vessel
#

show your code

earnest phoenix
#
document.getElementById("btn2").onclick = function() {
    document.getElementById("text").style.color = Math.random() * 0xffffff
}
pale vessel
#

make it a string

vivid fulcrum
#

and floor it

earnest phoenix
#

huh

vivid fulcrum
#

also

#

dont you have to remove one byte

earnest phoenix
#

?

earnest phoenix
pale vessel
#

floor it and turn it into a string

#

oh and prepend a #

earnest phoenix
#

ok

pale vessel
#

make sure to use the correct radix

old cliff
#

is there a way to do Object.assign() but only merge properties present in the Source?
like I have objects a and b

let a = {_1: 1, _2:2, _8: "three" };
let b = {_1:0, _2: 0, _3:0, _4: 0};

I want the result to be -

{_1: 1, _2: 2, _3: 0, _4:0}
waxen bough
old cliff
#

I want it to retain the values of target i.e. a

pale vessel
old cliff
lyric mountain
#

yes

pale vessel
#

wait

#

i'm stupid af

#

editing that

old cliff
lyric mountain
#

but since you want to ignore B data if it exists in A, there's no reason not to use Object.assign()

old cliff
#

not extra keys in a

pale vessel
#

there

old cliff
#

ok let me check flaz

robust moth
pale vessel
#

👍 thanks

old cliff
waxen bough
#

I just upgraded npm to latest version and now im getting this error

pale vessel
#

try again

#

i got that error and retrying worked

waxen bough
#

except i retried several times

#

even clear npm cache

median moss
void glade
#

mmh yes jython

old cliff
median moss
#

does anyone knows how to make a new server log? Like, when the bot joins or quit a server, he sends a message with info and etc about it.
And also a command with server list

(Js)

earnest phoenix
waxen bough
pale vessel
old cliff
#

ok.... I'll figure it out myself

modest maple
earnest phoenix
#

ive been coding for four hours today

#

should i take a break

lyric mountain
#

let intersection = arrA.filter(x => arrB.includes(x));

#

just found this on medium

#

would be shorter than that loop

modest maple
#

why dont you just use a set

waxen bough
#

@earnest phoenix

modest maple
#

or does JS not have that

lyric mountain
#

nvm

earnest phoenix
#

angry noises

median moss
wary oak
#

Anyone who can help me with my python problem?
I have created an .env file to store tokens and keys. I use the following code to call the token:

client.run(os.getenv("TOKEN"))

But I keep getting the error

AttributeError: 'NoneType' object has no attribute 'strip'

Anyone familiar with this?

pale vessel
earnest phoenix
#

ig it's time to add the websocket shit to my lib and then i could publish v0.1.0

waxen bough
wary oak
earnest phoenix
#

see your vps' methods for reading .env

median moss
#

@waxen bough and how can I make the bot sending it to a specific chat?

waxen bough
lyric mountain
#

that's why I said "nvm"

waxen bough
earnest phoenix
#

im going to read discord docs for websocket gateway

wary oak
earnest phoenix
#

bye

#

pls dont ping meh

#

im tired

earnest phoenix
old cliff
pale vessel
#

oof an extra module just for that?

earnest phoenix
#

@robust moth guys i think its a scam

pale vessel
#

lodash is useful though

old cliff
#

can you tell some more uses?

cinder patio
#

You can do it with a recursive function

median moss
#

@waxen bough

client.on("guildMemberAdd", () => {
  var content = `New server: ${guild.name}, ${guild.id}, with ${guild.members.cache.size} members.`;
  var channel = client.guilds.cache
    .get("774041271655333928") // Id do Servidor
    .channels.cache.get("821474350619688970"); //Id do canal onde a mensagem será enviada
  channel.send(content);
  console.log("New server");
})```
cinder patio
# old cliff I can probable use lodash merge for that
// obj1 is your target
// obj2 is your source
function merge(obj1, obj2) {
   for (const key in obj1) {
      if (typeof obj2[key] === "object") obj1[key] = merge(obj1[key], obj2[key]);
      else if (key in obj2) obj1[key] = obj2[key] 
}
   return obj1;
}
cinder patio
#

You will have to do a little more checking to ensure that the property is really an object and not an array or something else

old cliff
#

yeah

#

thats what I wanted exactly

#

ty

waxen bough
median moss
#

a new server log on my server

#

so I know the servers my bot joins

#

.-.

#

well, I invited him to a server to test it but he didn't send the log

#

F

waxen bough
waxen bough
#

and also the member agument is not passed

waxen bough
median moss
#

I don't want user

#

I want server

#

.-.

waxen bough
#

okay hold on

median moss
median moss
waxen bough
#
client.on("guildMemberAdd",(member)=>{
    const channel = client.guilds.cache.get("774041271655333928")
    ?.channels.cache.get("821474350619688970");
    if (member.user.id!==client.user?.id) return;
    
    channel.send(`New server: ${member.guild.name}, ${member.guild.id}, with ${member.guild.members.cache.size} members.`);
    console.log("new server");
});
median moss
#

ok

#

thx

#

wht there are those ? @waxen bough

opal plank
#

you check for cache

#

but not for channel

#

lel

#

const channel = undefined

#

undefined.send('New server...)

waxen bough
opal plank
median moss
opal plank
#

you also can directl get channels from client

#

instead of fetching guild

#

client.channels.cache.get()

pale vessel
# waxen bough ```javascript client.on("guildMemberAdd",(member)=>{ const channel = client....

your formatter be like```js
client . on ("guildMemberAdd", ( member ) => {
const channel = client . guilds . cache . get("774041271655333928")
?. channels . cache . get ("821474350619688970") ;
if ( member . user . id !== client . user ?. id ) return ;

channel . send ( `New server: ${ member . guild . name }, ${ member . guild . id }, with ${ member . guild . members . cache . size } members.` ) ;
console . log ("new server") ;

} ) ;```

opal plank
#

please stop

#

i feel oppressed

pale vessel
#

same

#

i feel the same

waxen bough
pale vessel
#

pog

median moss
#

should this work?

client.on("guildMemberAdd",(member)=>{
    const channel = client.guilds.cache.get("774041271655333928")
    client.channels.cache.get("821474350619688970");
    if (member.user.id!==client.user.id) return;
    
    channel.send(`New server: ${member.guild.name}, ${member.guild.id}, with ${member.guild.members.cache.size} members.`);
    console.log("new server");
});```
pale vessel
#

that was a little exaggerated though

waxen bough
#

i just installed eslinter

median moss
#

;-;

#

didn't work

waxen bough
#

you don't need guilds.cache.get actually i forgot about that

client.on("guildMemberAdd",(member)=>{
    const channel = client.channels.cache.get("821474350619688970");
    if (member.user.id!==client.user.id) return;
    
    channel.send(`New server: ${member.guild.name}, ${member.guild.id}, with ${member.guild.members.cache.size} members.`);
    console.log("new server");
});
#

oops

opal plank
#

i literally told you about that

opal plank
waxen bough
#

you don't need guilds.cache.get actually i forgot about that

client.on("guildMemberAdd",(member)=>{
    const channel = client.channels.cache.get("821474350619688970");
    if (member.user.id!==client.user.id) return;
    
    if (channel)channel.send(`New server: ${member.guild.name}, ${member.guild.id}, with ${member.guild.members.cache.size} members.`);
    console.log("new server");
});
opal plank
#

and once again

#

that snippet will fail

waxen bough
opal plank
#

ugh

#

fine

#

i'll do it myself

median moss
#

ok

waxen bough
opal plank
#
client.on("guildMemberAdd",(member)=>{
    const channel = client.guilds.cache.get("774041271655333928")
    if (member.user.id!==client.user.id) return;
    
//.get() can return undefined, check if there IS A CHANNEL before sending, otherwise undefined.send() is not a function;
    channel?.send(`New server: ${member.guild.name}, ${member.guild.id}, with ${member.guild.members.cache.size} members.`);
    console.log("new server");
});```
opal plank
#

also

#

guildMemberAdd isnt the event for new guilds

median moss
opal plank
#

guildMemberAdd is for new member joins

median moss
pale vessel
#

oh no! it's icrawl's birthday!

opal plank
#

guildCreate is the event for new guilds

median moss
opal plank
waxen bough
#

oh mann. i'm sorry this is my fault

median moss
#

np

#

@opal plank but then I have to change the code, don't I?

waxen bough
#
client.on("guildCreate",(guild)=>{
    const channel=client.guilds.cache.get("774041271655333928");
    if (member.user.id!==client.user.id) return;
    
    channel?.send(`New server: ${guild.name}, ${guild.id}, with ${guild.members.cache.size} members.`);
    console.log("new server");
});
median moss
#

ok

opal plank
#

and there you have it

#

well

#

kinda

#

here

median moss
# waxen bough ```javascript client.on("guildCreate",(guild)=>{ const channel=client.guilds...

ReferenceError: guild is not defined
at Client.<anonymous> (/home/runner/BulbaBot/index.js:83:43)
at Client.emit (events.js:314:20)
at Client.EventEmitter.emit (domain.js:483:12)
at GuildMemberRemoveAction.handle (/home/runner/BulbaBot/node_modules/discord.js/src/client/actions/GuildMemberRemove.js:22:51)
at Object.module.exports [as GUILD_MEMBER_REMOVE] (/home/runner/BulbaBot/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js:4:36)
at WebSocketManager.handlePacket (/home/runner/BulbaBot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/runner/BulbaBot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/runner/BulbaBot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/runner/BulbaBot/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (events.js:314:20)

opal plank
#
client.on("guildCreate",(guild)=>{
    const channel=client.guilds.cache.get("774041271655333928");
    if (member.user.id!==client.user.id) return;
    
    channel?.send(`New server: ${guild.name}, ${guild.id}, with ${guild.members.cache.size} members.`).catch(console.log);
    console.log("new server");
});```
or
```ts
client.on("guildCreate", async (guild)=>{
    const channel=client.guilds.cache.get("774041271655333928");
    if (member.user.id!==client.user.id) return;
    
   await channel?.send(`New server: ${guild.name}, ${guild.id}, with ${guild.members.cache.size} members.`).catch(console.log);
    console.log("new server");
});```
opal plank
#

read the word in between the 2 snippets

median moss
#

ok

#

lmao

#

and why it is channel?.send

opal plank
#

? is conditional chain

waxen bough
opal plank
#

its the same as if(channel) channel.send()

#

but its node 14+ iirc

median moss
#

this is giving error in my code

opal plank
#

but discord.js already changed their requirement for d.js to use node 14 or higher

opal plank
median moss
#

ok

opal plank
#

it says right there

#

node 14 or higher

waxen bough
opal plank
#

node 14, like i said

#

if you running d.js, you are on 14+

waxen bough
#

fuck messed up again

#
client.on("guildCreate", (guild)=>{
    const channel=client.channels.cache.get("774041271655333928");
    if (member.user.id!==client.user.id) return;
    
   channel?.send(`New server: ${guild.name}, ${guild.id}, with ${guild.members.cache.size} members.`).catch(console.log);
    console.log("new server");
});
#

i put client.guilds instead of client.channels

#

damn this is imbarrasing rn

median moss
waxen bough
opal plank
median moss
#

bruh

opal plank
#

@median moss open cmd and run node --version

median moss
#

then why I cant use it

waxen bough
#

what did it say

median moss
opal plank
#

just version

#

without the --

median moss
#

but when I open it it says Welcome to Node.js version 14.60

opal plank
#

my bad

#

node -v

median moss
#

v14.16.0

opal plank
#

then its supported

median moss
#

wtf

waxen bough
waxen bough
median moss
#

@opal plank my node.js command says v14.16.0, but on repl.it it says v12.16.1

median moss
waxen bough
median moss
#

oof

waxen bough
#

and you can't do anything afaik

opal plank
#

then dont use conditional chaining

#

if(channel) channel.send()

median moss
#

but is there any other way to do this?

crystal wigeon
#

anyone used double counter bot?

median moss
crystal wigeon
median moss
#

@opal plank (node:1557) UnhandledPromiseRejectionWarning: ReferenceError: member is not defined
(node:1557) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1557) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

waxen bough
#

i have never used it

waxen bough
median moss
#

ok

median moss
waxen bough
median moss
#

yes

waxen bough
#

but it's correct though

median moss
#

I tried adding to another server

#

but didn't work thought

waxen bough
#

the arguments are right

median moss
#
client.on("guildCreate", (guild)=>{
    const channel=client.channels.cache.get("774041271655333928");
    
   if(channel) channel.send()(`New server: ${guild.name}, ${guild.id}, with ${guild.members.cache.size} members.`).catch(console.log);
    console.log("New server");
});```
median moss
waxen bough
#

wait why is it send()(

median moss
#

oh

#

boy

#

lmaooo

waxen bough
#

did you add client.login() somewhere in your code?

median moss
#

@proven ice

#

oof

#

sorry

#

wrong ping

waxen bough
#

that's the problem

median moss
#

ok

#

where do I put it

waxen bough
#

i assume in the end of your code. client.login("your-secret-token"). You need to login with your bot's token

median moss
#

oooo

waxen bough
#

And also you didn't notice your bot was offline?

median moss
#

I have this

median moss
#

I thought you were talking about putting on this code we are trying to do

#

client.login(process.env.TOKEN);

waxen bough
median moss
#

I have him for like 5 months

#

lmao

waxen bough
median moss
onyx hare
#

what do i need to do so the "Test Message From test.txt" shows

const Discord = require("discord.js");
const test = require('../txt/test.txt');
exports.run = async (client, message, args, utils) => { 
  message.channel.send(`${message.author.username} Heres Test.txt ${test}`)
}

the txt

["Test Message From Test.txt"]
median moss
#
client.on("guildCreate", (guild)=>{
    const channel=client.channels.cache.get("774041271655333928");
    
   if(channel) channel.send(`New server: ${guild.name}, ${guild.id}, with ${guild.members.cache.size} members.`).catch(console.log);
    console.log("New server");
});```
waxen bough
#

if that was triggered then it should at least write "New server" in your log

waxen bough
median moss
#

oh

waxen bough
#

wait can you paste the channel ID again.

#

shit that's probably guild's id.

median moss
#

same ID

#

oh

#

no

#

actualy

#

it was guild id

waxen bough
#

hahaha

median moss
#

lmao

waxen bough
#

it should work now this time.

median moss
#

bruhhhh

#

no

#

wtf this stupid bot

#

😠

waxen bough
#

821474350619688970 this the id?

median moss
#

yes

#

this .catch(console.log); is for what?

cosmic forum
#

Anyone know how I can call a json value using a variable?

Like:

let name = "me";
console.log(json.name);
#

It doesn't work though.

crimson vapor
#

json[name]

cosmic forum
#

Ah ok

waxen bough
cosmic forum
#

thanks

median moss
#

holy shit

#

FINALLY

#

IT WORKED

waxen bough
#

ahaha just the id \

median moss
#

thanks <@&330168063729074177>

#

bruh

#

@waxen bough

#

why do I keep pinging wrong person

waxen bough
median moss
#

what is the key for removing bot

zinc marlin
#

Umm-

median moss
#

@waxen bough do u know the key for when the bot quits a server?

#

guildDelete?

crimson vapor
#

yes

median moss
past nova
#

so the website css is just loading half of the background

#

a month ago it loaded it entirely but seems like the site updated and now it just shows half of it

#

ive tried some stuff but got no idea what it is

#

anyona knows what could it be?

grizzled raven
#

are you sure if the background is actually the size of the full page

#

if not, then try enabling bg-repeat

#

background-repeat: repeat-y;

cosmic forum
#

Anyone know how I can push an array into a json file?

Here's what I have:

index.js:

const userdb = require("./userdb.json");

let email = req.body.email;
let username = req.body.username;
let password = req.body.password;

let userarray = {
  email: {
    u: username,
    p: password,
    v: 0
  }
};

await userdb.push(userarray);

await fs.writeFile("userdb.json", JSON.stringify(userdb), function(err) {
  if (err) throw err;
});

userdb.json:

{
  "email@gmail.com": {
    "u": "email",
    "p": "password",
    "v": 0
  }
}
past nova
#

its not but its supposed to be repeating

#

thats the thing

pale vessel
#

make it an array

#

and you don't need to use await

#

it's all sync

cosmic forum
#

ok

#

@pale vessel I changed it to this, but now it says Unexpected token o in JSON at position 1.

index.js:

const userdb = require("./userdb.json");

let email = req.body.email;
let username = req.body.username;
let password = req.body.password;

let userarray = {
  email: {
    u: username,
    p: password,
    v: 0
  }
};

JSON.parse(userdb).push(userarray);

fs.writeFile("userdb.json", JSON.stringify(userdb), function(err) {
  if (err) throw err;
});

userdb.json:

{
  "email@gmail.com": {
    "u": "email",
    "p": "password",
    "v": 0
  }
}
quaint basin
#

const discord = require("discord.js");

module.exports = {
name: "ban",
category: "moderation",
description: "Ban anyone with one shot whithout knowing anyone xD",
usage: "ban <@user> <reason>",
run: async (client, message, args) => {

if(!message.member.hasPermission("BAN_MEMBERS")) {
  return message.channel.send(`**${message.author.username}**, You do not have perms to ban someone`)
}

if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
  return message.channel.send(`**${message.author.username}**, I am do not have perms to ban someone`)
}

const target = message.mentions.members.first();

if(!target) {
  return message.channel.send(`**${message.author.username}**, Please mention the person who you want to ban.`)
}

if(target.id === message.author.id) {
  return message.channel.send(`**${message.author.username}**, You can not ban yourself!`)
}

if(!args[1]) {
return message.channel.send(**${message.author.username}**, Please Give Reason To ban Member)
}

let embed = new discord.MessageEmbed()
.setTitle("Action : Ban")
.setDescription(`Banned ${target} (${target.id})`)
.setColor("#ff2050")
.setThumbnail(target.avatarURL)
.setFooter(`Banned by ${message.author.tag}`);

message.channel.send(embed)
target.ban(args[1])

}
}

#

My bot can't ban members

cosmic forum
#

that command is to kick

#

not ban

cinder patio
cosmic forum
cinder patio
#

Instead of

{
  "email@gmail.com": {
    "u": "email",
    "p": "password",
    "v": 0
  }
}

do

[
{
    "u": "email",
    "p": "password",
    "v": 0
  }
]
quaint basin
cosmic forum
#

wait

#

but then how would we know what email has what password, username, and such

cinder patio
#

Array#find

cosmic forum
#

I'd like the end result to look something like this:

{
  "email@gmail.com": {
    "u": "username",
    "p": "password",
    "v": 0
  },
  "diffemail@gmail.com": {
    "u": "username",
    "p": "password",
    "v": 0
  }
}
cinder patio
#

If you want to stick to objects then just do dbObj[user.email] = user

cosmic forum
#

ah, but is it not possible to keep it as i did?

cinder patio
#

it is, if you want to stick to the format you sent, add objects like this: dbObj[user.email] = user

cosmic forum
#

ok

pale vessel
#

and undo what you did with JSON.parse()

#

just modify the object directly and save it

runic sun
#

Who’s tutorials of coding discord bot can you recommend?

#

People

proven ice
#

Lol

copper cradle
#

they get outdated pretty fast

runic sun
#

Tank

#

My bot will becom popular

quaint basin
#

iam using ban commands and san I get an error

pale vessel
#

did you provide reason as string

#

check your code and refer docs

earnest phoenix
#

Any advice here?

copper cradle
#

try to fix your way of asking things

earnest phoenix
#

Oh I appoligize

#

I'm new

#

Is there a diff channel or a template?

copper cradle
#

What am I supposed to say to somebody asking for advice without any context

earnest phoenix
#

I have this

cinder patio
#

It's message.channel

sterile lantern
#

repeatchannel is defined as message

earnest phoenix
#
@client.command()
async def buy(ctx,item,amount = 1):
  await open_account(ctx.author)

  res = await buy_this(ctx.author,item,amount)

  if not res[0]:
     if res[1]==1:
       await ctx.send("That object isn't there!")
       return
     if res[1]==2:
       await ctx.send(f"You don't have enough money in your wallet to buy that! {amount}")
       return
      
      
  await ctx.send(f"You just bought {amount} {item}")



async def buy_this(user,item_name,amount):
  item_name = item_name.lower()
  name_ = None
  for item in lvlshop:
    name = item["name"].lower()
    if name == item_name:
      name_ = name
      price = item["price"]
      break

  if name_ == None:
    return [False,1]

  cost = price*amount

  users = await get_economy_data()

  bal = await update_economy(user)

  if bal[0]<cost:
    return [False,2]


  try:
    index = 0
    t = None
    for thing in users[str(user.id)]["level"]:
      n = thing["item"]
      if n == item_name:
        old_amt = thing["amount"]
        new_amt = old_amt + amount
        users[str(user.id)]["level"][index]["amount"] = new_amt
        break
      index+=1  
    if t == None:
        obj = {"item":item_name , "amount" : amount}
        users[str(user.id)]["level"].append(obj)
    
  except:
    obj = {"item":item_name , "amount" : amount}
    users[str(user.id)]["level"] = [obj]

  with open("economy.json","w") as f:
    json.dump(users,f)

  await update_economy(user,cost*-1,"wallet")

  return[True,"Worked"] 

sterile lantern
#

yeah

cinder patio
#

not message.repeatchannel

earnest phoenix
#

Thee fields on the level card with 1 should not be there

cinder patio
#

You're deconstructing an object here

#

property names need to match

copper cradle
#

watcha tryna do my guy

#

just ask your question

#

share your problem with us

cinder patio
#

show your new code

earnest phoenix
#

I have %work gets money then you can %buy levels

#

They are displaying incorrectly

copper cradle
#

how should they display?

earnest phoenix
cinder patio
#

do you know how deconstructing an object works?

earnest phoenix
#

The 3 fields at the bottom are extra

#

I dont want them there

cinder patio
#

Then why are you attempting to use it?

earnest phoenix
#

I just want the top 2 to go up un number each level they buy

copper cradle
#

alr I get it

#

now

#

show where you make the embed

#

you're storing them somewhere, if you don't want the 3 bottom rows showing then remove them from wherever you're storing them

cinder patio
#

you don't have to deconstruct the message object in order to get the channel

copper cradle
#

brb

earnest phoenix
# copper cradle show where you make the embed
@client.command()
async def level(ctx):
  await open_account(ctx.author)
  user = ctx.author
  users = await get_economy_data()

  try:
    level = users[str(user.id)]["level"]
  except:
    level = []
  
  
  em = discord.Embed(title = f"{ctx.author.name}'s Level",color = discord.Color.blue())
  
  for item in level:
    name = item["item"]
    amount = item["amount"]

    em.add_field(name = name, value = amount)

  await ctx.send(embed = em)



cinder patio
#

message is your message object:

const myChannel = message.channel; // Same as above, without deconstructing, variable name can be whatever
copper cradle
earnest phoenix
#

No I dont

copper cradle
#

then don't store them

earnest phoenix
#

I cant figure out where that line is

#

I'm new to this

copper cradle
#

literally where you define level

#

get_economy_data

#

when you buy a new level

#

don't store the basic ones

earnest phoenix
#

Should I make a new json?

copper cradle
#

I'm not too sure what you're trying to do here

copper cradle
#

sorry if I'm not making too much sense

earnest phoenix
#

Its ok its me I think

copper cradle
#

I'm a school and can't quite think right

earnest phoenix
#

I'm dumb

#

So the issue is in my level command?

#

Users = get_economy_data?

copper cradle
#

whatever you do inside the get_economy function