#development

1 messages · Page 1543 of 1

earnest phoenix
#

lmao

#

So uh,

#

What do you guys recommend doing?

solemn latch
#

mongodb is pretty much just maps/collections.

#

if you understand or learn how to use maps, mongodb should be relativly straight forward.

earnest phoenix
#

MongoDB is pretty sold for a discord bot

#

Can you guys send the documents or the some tutorials or maybe help me!

#

?

solemn latch
earnest phoenix
#

Thanks

#

my top.gg account got hacked i think

#

wait

solemn latch
#

how do you mean?

earnest phoenix
#

never mind

#

What are clusters?

#

that was me

#

sorry

solemn latch
#

you dont need clustering until you have a ton of users

earnest phoenix
#

Ok, so how do I connect my bot with db?

#

I can screen share if you guys want

solemn latch
#

you are a djs user right?

earnest phoenix
#

From looking slightly at their code, yes

#

Mhm

#

What?...

#

@solemn latch should I screen share?

solemn latch
#

i dont see why you would need to.

#

you should take the time to read the docs, it can take some time.

earnest phoenix
#

Ima be totally honest the Docs are very confusing they really don’t explain me anything

solemn latch
#

how much of the docs did you read?

earnest phoenix
#

Just this, since this is the only one you sent

solemn latch
#

just the getting started page is about an hour long read.

earnest phoenix
#

How can I even code on mongoDB?

solemn latch
#

im in the middle of learning mongodb, started this week. after reading the getting stated page i had multiple questions i had to research.
its not something you just read one page and understand.

earnest phoenix
#

Did you even read the first paragraph of the website

solemn latch
#

^

#

you need to actually read it.

earnest phoenix
#

What about the code in the uh top?

#

🗿

solemn latch
#

as in the web shell thingy?

earnest phoenix
#

How can I delete a cluster?

solemn latch
#

you probably shouldnt be making clusters, you should focus on reading for now

#

the docs has a mongo shell built in, you can practice and learn with that

earnest phoenix
#

Yes, I did it by mistake now how do I delete them?

#

Literally started using the database
Creates clusters
How do i delete them?

#

I didn’t

#

I just came on the page and then it said that

#

So I thought it was something else

#

Now tell me

#

Lol

solemn latch
#

shoot dude i dont even know

#

ive never had to delete one

earnest phoenix
#

I'm pretty sure they have all documentation for everything about the database, such as simply deleting those

#

Lol..

silk acorn
earnest phoenix
#

Documentation is what you're looking for once again

#

🗿

hidden lynx
#

there is literally a delete button in the cloud version for clusters

#

there is literally a delete button in the cloud version for clusters

earnest phoenix
#

Found out...

#

No need to bully weirdsip

glossy spoke
#

guys

#

imagine a raider bot in top.gg and verified

hidden lynx
#

lol why did it send my message twice. sry bout that. I hate using discord on mobile

earnest phoenix
#

Why dosent it show connect application?

#

Oh mb figured out

solemn latch
#

iirc, the getting started guide goes over all that.

earnest phoenix
#

Hm, I guess I don’t want a data base since it’s almost impossible to use it on iOS

rustic nova
glossy spoke
#

it's an hipotetic case

#

i didn't saw any raider bot on top.gg or verified

lyric mountain
misty sigil
#

sorry bro i can't use sql im on windows

signal rover
#

Anyone who has in mind to start creating a new bot? I have several ideas that could be good. Focused on economy-rpg

lyric mountain
#

Wait, isn't iOS specifically iphone OS?

lyric mountain
signal rover
#

why?

lyric mountain
#

Bro tip: create a prototype, saying "i have an idea" is a bad omen

#

Without a working prototype (or even a concept) the project will either fail or noone will want to work with you on it

slender wagon
#

Otherwise just order it from someone

signal rover
#

I have no idea how to create bots, I only have some ideas, but not how to program them.

lyric mountain
#

World is full of ideas unfortunately

slender wagon
#

Not ez to put them to work

lyric mountain
#

Projects where one thinks and the other programs 90% of the times becomes a boss-employee relationship

#

And the pj dies within 1 or 2 months

#

Not to say you'd have about 20% share on the pj

slender wagon
#

Yeet

signal rover
#

Obviously I am not talking about being, ''the owner of anyone's life'', you are taking it out of context and exaggerating it. I'm simply looking for someone who will listen to my ideas, and if he is interested in carrying them out, doing it his way and I would be happy to help with the logic or mechanics of the game.

lyric mountain
#

If did mean "owner of life", it just becomes a unbearable relationship

#

Where one says what to do, and the other put it to work

#

You see, sometimes a simple idea is excruciatingly painful to program

signal rover
lyric mountain
#

It always start like this unfortunately

#

Unless both understand programming, it'll become a constant fight

dusky sundial
#

It's pretty funny to see how non-programmers look at projects. This one guy wanted to pay me $50 for a bot with 67 commands.

dusky sundial
#

That's $0.7/h if each command takes an hour to do. And that's being very generous

solemn latch
#

ive had commands that take over a week of research and dev time.

#

single commands

dusky sundial
#

^^

lyric mountain
#

A thing I always though was simple is AI in games

dusky sundial
#

He didn't even list the commands, just said "some moderation, some fun"

lyric mountain
#

That until I had to make one myself

slender wagon
#

I mean u should have a premade one

lyric mountain
#

Now I will never see bots in games the same way as before

solemn latch
#

if just doing a handful of mod commands, i could see $1-$3 per command.

slender wagon
#

U don't need hours to make one

lyric mountain
solemn latch
#

some commands are not things you just make

lyric mountain
#

Most of the time it's custom-made bots

dusky sundial
#

I always cringe when people say "can't you just make a program that does that?" for everything.

solemn latch
#

ai systems, complex multiplayer games

dusky sundial
#

One of my friends asked me if I could "hack V-bucks" for him in fortnite

slender wagon
#

I get that all the time

lyric mountain
#

I have a trading card game that I made for discord, a thing I'm currently trying to implement is "play vs bot"

#

Man

#

I've never seem a concept SO F HARD to understand as much as AI

slender wagon
#

Maths

mellow kelp
#

meth

dusky sundial
#

pukes

signal rover
slender wagon
#

Yeah we can't change that AI requires alot of Math knowledge

dusky sundial
#

When they say you need to be good at maths to be a programmer, AI is what they mean

earnest phoenix
#

or game deving

dusky sundial
#

Yea, or that

mellow kelp
#

At least we know for sure AI isn't gonna take over the world

lyric mountain
earnest phoenix
#

you're going to find yourself using trig a lot in game deving

dusky sundial
#

Unless you use something like game maker studio

lyric mountain
#

However, would you accept to be owner of 0% of the bot?

#

Because, yk, suggestions don't give ownership of even 1% of the project

slender wagon
#

If u are aiming for Machine Learning or AI you gonna need some good Math knowledge

lyric mountain
#

They are suggestions after all

slender wagon
#

Otherwise u just need logic

dusky sundial
#

Lol, imagine suggesting a feature and then claiming ownership of said feature when it is implemented

lyric mountain
#

My currently issue is knowing how the AI would know what cards to play

#

Or what cards are high priority

slender wagon
#

Doesn't that happen all the time

slender wagon
signal rover
mellow kelp
#

I want to implement some sort of AI for my undertale battle system

#

Hope it's not too hard

dusky sundial
#

AI is always hard sipinteresting

slender wagon
#

I think there are some packages that can help u but AI aint easy

mellow kelp
#

Crap KEKW

lyric mountain
#

AI stands for Always Impossible

mellow kelp
#

Accurate

slender wagon
#

U should know what u are doing and not only Stack Overflow

dusky sundial
#

There's a reason not everything has AI

mellow kelp
#

Makes sense

slender wagon
#

But yeah AI will become a big thing sooner or later

mellow kelp
#

User generated content slick

earnest phoenix
#

it already is a big thing

#

it's used a lot for protein folding

dusky sundial
#

Random number generator == AI Lmao

mellow kelp
lyric mountain
#

One day I'll implement PvE in my game and boy, imagine the pleasure when the time comes

#

The feeling when you finish a big hard project is unspeakable

dusky sundial
#

true, throwback to developing minecraft server plugins for a pixelmon server

#

colorful_sparks The feeling of compiling it and sending it over discord to the owner colorful_sparks

#

And then they come back and say "hey can you make it work like this instead?" and that feature requires you to rewrite the entire thing because they didn't say they wanted it like that from the beggining

lyric mountain
dusky sundial
#

I mean yeah, why request a feature in detail when you can vaguely describe it, leave it to the developer to figure it out and then tell them how it's actually supposed to be?

lyric mountain
#

Programmers should've come with intellisense from birth to be able to predict user requests

dusky sundial
#

Yes, underline everything with yellow text and say "Warning, this might not be exactly what your customer wants"

proven lantern
#

I'm trying to get some members of the guild using the member.fetch function, but it seems to be fetching all the members in the guild and not just the members i want. const members = await msg.guild.members.fetch({users:team.playerIds}); console.log("team.playerIds"); console.log(team.playerIds); console.log("members"); console.log(members);

earnest phoenix
#

it's user

#

singular

proven lantern
#

dang

proven lantern
glacial pagoda
#

Help

rustic nova
#

pastebin please

glacial pagoda
#

Ok

#

Help

#

The Whole Code Looks Correct

#

But This Error

#

Anyone?

quartz kindle
#

would help to see the full error

#

should show the lines where it came from

earnest phoenix
#

Shit im just teen and dont have ids or drivers license at all i need to get my bot to verification is there any ways?

#

Can i use school id?

rustic nova
#

no

#

needs to be a government issued document

earnest phoenix
#

Damn but can i use other’s documents? Like my parents have it

rustic nova
#

ask your parents for example

#

yeah

earnest phoenix
#

Oh aight ima ask later

glacial pagoda
#

The handler?

slim heart
#

are there any like, custom component compiled html? nothing like react or anything like that, i want to have the ability to make custom components that in the end turn into full custom elements and just write it as html to a file

earnest phoenix
#

🤔

#

compiled html

#

are you thinking of css frameworks?

slim heart
#

no, html

earnest phoenix
#

i.e. bootstrap

mellow kelp
#

you mean render react code?

#

to an html file

slim heart
#

yeah sort of

mellow kelp
#

i'd recommend next.js

slim heart
#

everything i've tried cant do it

#

o

mellow kelp
#

it's a react framework which enables server-side rendering

slim heart
#

so i dont want ssr is the thing

mellow kelp
#

your pages get statically rendered to html

slim heart
#

i want to turn it into an html frile

earnest phoenix
#

there's this

#

there's no way to achieve what you want with just html

mellow kelp
#

i think react-dom has a renderToString method too

earnest phoenix
#

i'm fairly certain that the components won't behave properly

#

you'll just have the skeleton and the look of the component

#

since it lacks the whole react logic

mellow kelp
#

next.js pEnSiVe

slim heart
mellow kelp
#

not sure, never bothered to try it out

#

i think you pass a component and it returns the html string

glacial pagoda
#

Help

#

The Code Looks Perfect

#

But I Have This Error

mellow kelp
#

which line?

glacial pagoda
#

idk

#

I Just Want to Fix It

#

Can You Take A Look At The Code

#

And See Whats Wrong?

zenith terrace
#

can you send the whole error

glacial pagoda
#

That

mellow kelp
#

by "full error" he means the stack trace

zenith terrace
#

that isnt the whole error

glacial pagoda
mellow kelp
#

oh the debugger

#

idk

glacial pagoda
#

0-0

earnest phoenix
#

it's whatever you're passing to ms

glacial pagoda
#

This?

#

Ok Ill Delete and Try Running

earnest phoenix
lyric mountain
#

I wonder if it's some keyboard that capitalizes every word you type

#

I often see some dudes typing like this

mellow kelp
#

Whoa What Are You Talking About

lyric mountain
pale vessel
#

Don't Worry I Am Just A VB Developer

slim heart
mellow kelp
#

oh yeah it doesn't work for partial stuff

#

but it's really cool for whole websites and apps

slim heart
#

ive already made my whole website is the thing

#

i just want to replace my current regexp .replace stuff with actually built and proper components

mellow kelp
#

o

spring bane
#

Does anyone know why message.channel.bulkDelete(10) would not work? I am using discord.js

#

I am getting this error:

(node:22646) UnhandledPromiseRejectionWarning: TypeError: Object.entries(...).filter(...).flatMap is not a function
lyric mountain
#

Is your node updated?

spring bane
#

ill try that

sudden geyser
#

Try at least Node v12

spring bane
#

that might be the issue, I am on v10 still

sudden geyser
#

I'm 99% sure that's the issue.

lyric mountain
#

V10?

sudden geyser
#

The flatMap function was introduced in v12

spring bane
#

ok

#

what is the easiest way to update it on debian

#

because apt only has v10.23.1

earnest phoenix
pale vessel
sudden geyser
#

It probably was, but odd numbers of Node.js don't really count since they're not LTS.

lyric mountain
#

That's odd

sudden geyser
#

pls

pale vessel
#

Oh, no. Not Ram!

sudden geyser
#

Ram is superior to Rem.

pale vessel
#

I c

slender thistle
#

Clearly the right opinion

sudden geyser
#

So true!

mellow kelp
#

i'm waiting for the guy who's gonna say "who's rem?" and think he's a comedic genius

pale vessel
#

Ever get that feeling of deja vu

earnest phoenix
#

does anyone know how to make a api for my discord bot to show the server count, and user count. to put it on my website

#

?

lyric mountain
#

Just use websockets

#

Or if you really want, use express

rocky hearth
#

How can I load an .env file, without using any package? Like directly from the script

lyric mountain
#

Use fs

#

I mean, you can just load it as a normal file can't u?

rocky hearth
#

then will it be available in process.env?

lyric mountain
#

I don't think so

mellow kelp
#

you could parse it manually

#

that'd be one hell of a job tho

lyric mountain
#

You could also use a json file, csv file, newline file, etc

#

Files are files anyway

mellow kelp
#

oh yea

lyric mountain
#

Just load it on start and save its values to some global variable

#

And remember not to add it to git

pale vessel
mellow kelp
#

well yeah, at least one without comments and "

#

but who uses comments in .env files KEKW

warped fable
#

hello how can i use the jarvis bot ?

drowsy epoch
#

That’s a bot

#

Go to their support server

rocky hearth
#

When we do npm start does the process.env.NODE_ENV is auto set to "development"?? Or does it depend on the type of project.

warped fable
warped fable
drowsy epoch
pale vessel
#

Can't click it

drowsy epoch
#

Lol

warped fable
slender thistle
#

Right

opal plank
#

not the place to advertise it

slender thistle
#

You idiot

#

@oak cliff spam above

#

In multiple channels

#

ly

warped fable
opal plank
drowsy epoch
glacial pagoda
#

Help

#

I Sent Full Code In Pastebin

#

Everything Seems Alright

mellow kelp
#

make your function async

glacial pagoda
#

How

mellow kelp
#

add "async" to the function

glacial pagoda
#
    name: 'clear',
    description: "KICK!!!",
    async execute(message, args){```
#

?

mellow kelp
#

yeah

glacial pagoda
#

ok ill try

mellow kelp
#

wait

#

in that case you don't even need async/await

#

just remove the await and that's all

glacial pagoda
#

u sure?

mellow kelp
#

yeah

glacial pagoda
#

Ok ill try both methods

#

brb

#

ill say if it works

#

First Method Works!

#

Thanks!

mellow kelp
#

np

slim heart
#

is there a way to compile to earlier ecma versions in webpack? like for compatibility and whatever

rocky hearth
#
gameRouter.use('/:id', getGame, activeGameRouter);
gameRouter.get('/new', (request, response) => {});

For express: How do I make /new to be not use /:id and handled differently??

slim heart
#

put /new above /:id

rocky hearth
#

Ooh! Thanks. And where should I put /?

#

On top of both, or below?

slim heart
#

ontop of both

slim heart
#

mmm another compiler pog lmao

mellow kelp
#

Check out babel-loader and @babel/preset-env

#

Epic stuff

rocky hearth
#

For some reason the following script is not working. My react-app do get start but the dotenv/config is not getting pre-required.
"start": "react-scripts -r dotenv/config dotenv_config_path=./private/.env start"

mellow kelp
#

Pretty sure create-react-app loads .env files by default

hasty mulch
#

Anyone know of an API that displays random anime kissing gifs?

lusty quest
#

i know one but its banned from DBL

lusty quest
hasty mulch
lusty quest
#

idk im not into this stuff

craggy pine
rocky hearth
lament rock
lusty quest
#

nekos.life iirc is banned from DBL

lament rock
#

Really?

#

I can probably see why

lusty quest
#

yea bcs of the nsfw endpoint

lament rock
#

yeah

#

It's still there, just not advisable to use

buoyant root
#

gn @swift umbra

rocky hearth
#

When we do all: unset on button, does it also unset the click event??

earnest phoenix
delicate shore
#

I use MongoDB

#

I have a schema called users

daring gull
#

@earnest phoenix

#

Nope

#

Sad

#

Tho I have pinged someone named eve

delicate shore
#

And there is a property called Upvoter in that schema
I want MongoDB to change that Upvoter Value to "no" for each document

#

Is it possible?

daring gull
lusty quest
delicate shore
#

Yes

#

I code in JavaScript

lusty quest
#

updateMany({Upvoter: "no"}) iirc this could work

slender thistle
#

updateMany({}, {$set: {Upvoter: "no"}})

delicate shore
#

How? Like first Do I get the collection

#

like db.collection('users')

pale vessel
#

do you use mongoose or mongodb

#

you said you had a schema

delicate shore
#

MongoDB

#

Wait

#

Idk what I use

#

I use mongoose npm package

pale vessel
#

so you have the model?

delicate shore
#

Yes

pale vessel
#

use model.updateMany()

delicate shore
#

then?

#

Wait so is this how?

#
const model = require ('models/users/schema.js')
model.updateMany()
delicate shore
#

But for using $ I will have to use jQuery right?

#

can we use jQuery with nodejs?

summer torrent
#

jquery?

#

this is mongodb's query operator

delicate shore
#

Oh ok

#

Sorry I wasn't aware of that

#

@pale vessel but don't I need to like for loop it on getting it for Each user and then set value to no

delicate shore
slender thistle
#

updateMany is just a fuckton of updateOne

delicate shore
#

I don't need to enter any user id or anything anywhere?

delicate shore
slender thistle
#

Aka "affect every document"

delicate shore
#

O k thanks

#

Also one thing

#

Ok leave it it's really stupid question

slender thistle
#

There's no such thing as stupid question

misty sigil
#

why are you using "no" instead of false

#

@delicate shore

delicate shore
#

Hmmm

#

Is there any way I can just set Upvoter to null?

cinder patio
#

{Upvoter: null}

delicate shore
#

Alright thanks

#

Also

#

How can I get my bot's tag changes?

#

Changed?

#

Like any illegal way because legally not possible

eternal osprey
#

hey i am trying to randomly ping a member in my server

#
 const userList = message.guild.members.cache.array();
            var randomNumber = Math.round(Math.random() * userList.length)
            console.log(randomNumber)
            var pingPerson = userList[randomNumber] 
            message.channel.send("<@" + pingPerson.id + ">")
       ``` this is what i have achieved so far
#

Uncaught TypeError: Cannot read property 'id' of undefined

#

now it returns me this.

#

is it maybe because there are only 3 members in my test server?

#

so it rounds up, to 4.

cinder patio
#

You can just do message.guild.members.cache.random() which does the same thing you're doing but internally.

#

If you don't want to use the builtin method then use Math.floor instead of round

sacred trout
#

can you tell why this is not working

#

Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "rank" is not found

#

@pale vessel

#


    @commands.command()
    async def rank(self,message,ctx, user:discord.User = None):
      if user is None:
        db = sqlite3.connect('main.sqlite')
        cursor = db.cursor()
        cursor.execute(f"SELECT user_id,exp, lvl FOR levels WHERE guild_id = '{ctx.message.author.guild.id}' amd user_id = '{ctx.message.author.id}'")
        result = cursor.fetchone()
        if result is None:
          await ctx.send(f"{user.mention} is not yet ranked!")      
        else:
          await ctx.send(f'{user.mention} is currently level {str(result[2])} and has {str(result[1])} XP')
        cursor.close()
        db.close()
      elif user is None:
        db = sqlite3.connect('main.sqlite')
        cursor = db.cursor()
        cursor.execute(f"SELECT user_id,exp, lvl FOR levels WHERE guild_id = '{ctx.message.author.guild.id}' amd user_id = '{ctx.message.author.id}'")
        result = cursor.fetchone()
        if result is None:
          await ctx.send(f"{user.mention} is not yet ranked!")
        else:
          await ctx.send(f'{user.mention} is currently level {str(result[2])} and has {str(result[1])} XP')
        cursor.close()
        db.close()```
#

can anyone help

#

?

eternal osprey
#

hey

#
  let name = (Math.random*22)
       let channel =  message.guild.createChannel(name, 'text') 
        setTimeout(() => {
          channel.delete()
        }, 60000);

``` why is this returning me an error: message.guild.createChannel is not a function
#

nvm its solved

sacred trout
#

bruh

#
    @commands.command()
    async def rank(self,message,ctx, user:discord.User = None):
      if user is None:
        db = sqlite3.connect('main.sqlite')
        cursor = db.cursor()
        cursor.execute(f"SELECT user_id,exp, lvl FOR levels WHERE guild_id = '{ctx.message.author.guild.id}' amd user_id = '{ctx.message.author.id}'")
        result = cursor.fetchone()
        if result is None:
          await ctx.send(f"{user.mention} is not yet ranked!")      
        else:
          await ctx.send(f'{user.mention} is currently level {str(result[2])} and has {str(result[1])} XP')
        cursor.close()
        db.close()
      elif user is None:
        db = sqlite3.connect('main.sqlite')
        cursor = db.cursor()
        cursor.execute(f"SELECT user_id,exp, lvl FOR levels WHERE guild_id = '{ctx.message.author.guild.id}' amd user_id = '{ctx.message.author.id}'")
        result = cursor.fetchone()
        if result is None:
          await ctx.send(f"{user.mention} is not yet ranked!")
        else:
          await ctx.send(f'{user.mention} is currently level {str(result[2])} and has {str(result[1])} XP')
        cursor.close()
        db.close()```
#

can anyone help?

earnest phoenix
#

What on earth are you doing...

#

why do you name your Context message, why do you have an elif that does the exact same thing as the prior if

#

how do i control Recon Bot 75

sacred trout
#

k

eternal osprey
#

what is the name of a member in this server

#

that has a golden apple as profile pic

#

ah it's PG!

delicate shore
#

I want my bot to send message in each server in first channel it finds where it has perm

eternal osprey
#

could you send me your npm package?

delicate shore
#

Heyy

#

Which one?

eternal osprey
#

the randomizer

delicate shore
#

I am assuming you mean random one

#

Alright
Dns

#

DMS*

eternal osprey
#

sure

long yew
#

does anyone know how to make this python code neater

#
print('Please choose from the menu.')       
print('============================')       
print('1: Convert between UK (GBP) and EUR')     
print('2: Convert between UK (GBP) and Canada')  
print('3: Convert between UK (GBP) and USD')
print('4: Convert between UK (GBP) and China')   
print('5: Quit')                            
print('============================')       
menu = int(input('Enter your Choice: '))


while menu >=1 and menu <=4:
    if menu == 1:
         menu = int(input('Enter the amount in pounds: '))
         men1 = menu 
         men1 = menu * 112/100 
         print('\t','£', menu,'is', men1, 'euro')
    elif menu == 2:
        menu = int(input('Enter the amount in pounds: '))
        men1 = menu 
        men1 = menu * 174/100
        print('\t','£', menu, 'is', men1, 'cad')
    elif menu == 3:
        menu = int(input('Enter the amount in pounds: '))
        men1 = menu 
        men1 = menu * 136/100
        print('\t','£', menu, 'is', men1, 'dollar')
    elif menu == 4:
        menu = int(input('Enter the amount in pounds: '))
        men1 = menu 
        men1 = menu * 886/100 
        print('\t','$', menu, 'is', men1, 'yuan')

if menu == 5:
    print('Thanks for using the program')```
earnest phoenix
#

what you want make?

long yew
#

as it shows that for it being converted

long yew
earnest phoenix
long yew
#

yes

slender thistle
#

What do you want as your output?

long yew
#

where menu is

slender thistle
#

If you are using Python3.6+, you can use f-string for the output. For example, f'£{menu} is {men1} dollars.'

earnest phoenix
slender thistle
#

That seems very over-complicated

earnest phoenix
#

Nerf can i ask you

slender thistle
#

'sup

earnest phoenix
#

i add my bot in topgg

#

but like one and half day

#

no one answer my

slender thistle
#

See average response time in #support pins

earnest phoenix
long yew
#

it doesnt let me download it

slender thistle
#

Why would you need tkinter for such a simple task

#

is it a school assignment?

long yew
#

yes

#

lol

slender thistle
#

Yeah I'm calling bs on the fact that the teachers won't think that you cheated

earnest phoenix
#

is that for ur schooL?

slender thistle
slender thistle
#

*in case you decided to copy the code Mar0 sent

earnest phoenix
#

emmm

long yew
#

oh

#

but the code i made is simple?

slender thistle
#

Yeah, it's simple enough. You could just use only one input function within the while loop itself

earnest phoenix
#

Hydro Try tkinter

slender thistle
#

Basically leaving the ifs only for the calculations and output

#

Again, tkinter is a very strong over-complication of a simple task

#

I very highly doubt that they'll actually approve this without questioning the guy

earnest phoenix
#

uh

#

i frogot

#

HHydro Can you send ur sourccode

long yew
#
print('Please choose from the menu.')       
print('============================')       
print('1: Convert between UK (GBP) and EUR')     
print('2: Convert between UK (GBP) and Canada')  
print('3: Convert between UK (GBP) and USD')
print('4: Convert between UK (GBP) and China')   
print('5: Quit')                            
print('============================')       
menu = int(input('Enter your Choice: '))


while menu >=1 and menu <=4:
    if menu == 1:
         menu = int(input('Enter the amount in pounds: '))
         men1 = menu 
         men1 = menu * 112/100 
         print('\t','£', menu,'is', men1, 'euro')
    elif menu == 2:
        menu = int(input('Enter the amount in pounds: '))
        men1 = menu 
        men1 = menu * 174/100
        print('\t','£', menu, 'is', men1, 'cad')
    elif menu == 3:
        menu = int(input('Enter the amount in pounds: '))
        men1 = menu 
        men1 = menu * 136/100
        print('\t','£', menu, 'is', men1, 'dollar')
    elif menu == 4:
        menu = int(input('Enter the amount in pounds: '))
        men1 = menu 
        men1 = menu * 886/100 
        print('\t','$', menu, 'is', men1, 'yuan')

if menu == 5:
    print('Thanks for using the program')```
slender thistle
#

So you wanted to prettify the output...

long yew
#

yea

slender thistle
#

'£{} is {} dollar'.format(menu, men1)

#

Adjust the string to each option

#

and... you have $menu output for menu == 4

long yew
#

oh wow thanks

earnest phoenix
#

Nerf Are dev on discord?

#

should just use a dictionary

slender thistle
#

I don't think anyone really cares about this to actually make the code better both/either in terms of appearance and optimization tbh

earnest phoenix
#

it's a learning opportunity though

slender thistle
#

Mmm, true

earnest phoenix
#

let antibots = JSON.parse(fs.readFileSync('./antibots.json', 'utf8')); client.on('message', message => { if (message.content.startsWith(prefix + "antibots on")) { if (!message.channel.guild) return message.reply('**This Command Only For Servers**'); if (!message.member.hasPermission('ADMINISTRATOR')) return message.channel.send('**Sorry But You Dont Have Permission** ADMINISTRATOR'); antibots[message.guild.id] = { onoff: 'On', } message.channel.send(✅ The AntiBots Is 𝐎𝐍 !`)
fs.writeFile("./antibots.json", JSON.stringify(antibots), (err) => {
if (err) console.error(err)
.catch(err => {
console.error(err);
});
});
}

})

client.on('message', message => {
if (message.content.startsWith(prefix + "antibots off")) {
if (!message.channel.guild) return message.reply('This Command Only For Servers');
if (!message.member.hasPermission('ADMINISTRATOR')) return message.channel.send('Sorry But You Dont Have Permission ADMINISTRATOR');
antibots[message.guild.id] = {
onoff: 'Off',
}
message.channel.send(**⛔ The AntiBots Is __𝐎𝐅𝐅__ !**)
fs.writeFile("./antibots.json", JSON.stringify(antibots), (err) => {
if (err) console.error(err)
.catch(err => {
console.error(err);
});
});
}

})

client.on("guildMemberAdd", member => {
if (!antibots[member.guild.id]) antibots[member.guild.id] = {
onoff: 'Off'
}
if (antibots[member.guild.id].onoff === 'Off') return;
if (member.user.bot) return member.kick()
})

fs.writeFile("./antibots.json", JSON.stringify(antibots), (err) => {
if (err) console.error(err)
.catch(err => {
console.error(err);
});

})`

#

Help ples

#

i made this For auto kick Bot if he join

#

on console no problem

#

but when i use it

#

didnt work

eternal osprey
#

hey how do i randomly choose 10 members in the discord server and change theirnickname?

#

and after a certain amount of time reset.

long yew
#
print('Please choose from the Job List to get a quote.')       
print('============================')       
print('1: Engineer')     
print('2: Developer')  
print('3: Analyst')
print('4: None Of The Above')   
print('============================')       
Job = int(input('Enter your Choice from 1-4: '))


while Job >=1 and Job <=4:
    if Job == 1:
         print('The engineer has been, and is, a maker of history.')
    elif Job == 2:
        print('Logical thinking, passion and perseverance is the paint on your palette.')
    elif Job == 3:
        print('Seeing what other people can’t see gives you great vision.')
    elif Job == 4:
        print('I am sorry. We could not find a quote for your job.')```
#

does anyone know why this loops

#

(it doesnt say it once, instead it repeats it a lot)

earnest phoenix
#

because once you input something that's in range of 1 to 4 inclusive, it keeps looping and you don't change the value of Job either during that loop, so it's an infinite loop

cinder patio
long yew
earnest phoenix
#

Wtf?

#

Why does it do that..

slender thistle
earnest phoenix
#

you can make a while True and having the input inside that loop, break it in some condition.

slender thistle
#

The way you did the previous program could work

earnest phoenix
#

Huh btw why does mine do that?

#

if you want to listen to more than one inputs

#

otherwise what shiv said

long yew
#

so how would i remove while

earnest phoenix
#

just remove that line mmLol

#

and unindent things inside that while block 1 level

long yew
earnest phoenix
#

unindent things inside that while block 1 level

slender thistle
#

@earnest phoenix

            var mode = string.Empty;
            if (this.ViewData["Gamemode"] != null)
                mode = $"{this.ViewData["Gamemode"]}";

guess which part of this is unnecessary

earnest phoenix
#

lmao what's this mmLol

slender thistle
#

When did my dumb ass think I didn't need to format the string

#

or, rather, needed to

earnest phoenix
#

oh Gamemode is a string?

slender thistle
#

this.ViewData["Gamemode"] is basically string?

#
            var mode = string.Empty;
            if (this.ViewData["Gamemode"] != null)
                mode = this.ViewData["Gamemode"].ToString();

Looks much better

earnest phoenix
#

so you're basically casting a string to a string mmLol

quartz kindle
#

why not ternary

slender thistle
#

Tim don't judge my C# code from September

quartz kindle
#

lmao

slender thistle
#

I'm really not sure wtf any of this is

long yew
earnest phoenix
#

by removing spaces?

slender thistle
#

Do you know what indents are?

long yew
#

yes

#

but normally there is a keybind set

#

to unindent

#

for u

slender thistle
#

Shift+Tab?

#

I forgot what a ternary operator looks like

#

how it works, rather

#

condition ? true : false?

earnest phoenix
#

yeah ig

#

or true if condition else false mmLol

slender thistle
#

KEKW if it were Python

earnest phoenix
#

Idk if that can be called ternary xd

slender thistle
#

technically

slender thistle
#

@earnest phoenix Need help with HttpClient here. My current way about going auth is the following:

            if (this._client.DefaultRequestHeaders.Contains("Authorization"))
                this._client.DefaultRequestHeaders.Remove("Authorization");

            this._client.DefaultRequestHeaders.Add(
                "Authorization",
                $"{credentials.token_type} {credentials.access_token}"
                );

executed on each request, and I think it's a very bad way to go about sending requests with an Auth token that's updated every like 2 days

#

Got any idea how I could optimize this to look/work better? I'm shit outta clue with C# 😂

tardy hornet
#

how do i do that when someone add my bot, to a server, it will auto send a message in the server

slender thistle
#

You'll have to rely on channel names or randomly sending a message somewhere

#

what library?

tardy hornet
#

discord.js

slender thistle
tardy hornet
#

ty

slender thistle
#

... apparently not?

pale vessel
#

What

slender thistle
#

Well

drowsy raven
#

Do somebody knows how to move emojis from one server to another at once?

#

I mean with a bot or something

quartz kindle
#

you want to code it or are you looking for a bot that does it for you?

opal plank
#

im not aware of any bots that does that, but you could code something quite simple.

fetch guild/emojis/list , then simply iterate them with request() to download the image onto a buffer, and upload on target guild. Be mindful of rate limits

#

and im unsure if you can batch emoji uploads

#

@drowsy raven

#

and the way i explained is quite crude too, its not accounting for slots available or any of that

drowsy raven
#

I think I wont be able to code that

#

but ty for ur help

opal plank
#

no problemo

quartz kindle
#

you dont even need to download the images

opal plank
#

do you not?

#

i thought they needed to be in buffer format

quartz kindle
#

you can create a new emoji with an image from an url

#

im pretty sure

opal plank
#

oh, then even better

quartz kindle
#

it takes a buffer resolvable in djs

opal plank
#

perfect then

#

also

#

tim

#

do sharding for me

#

pls

quartz kindle
#

lmao

opal plank
#

its coming closer and closer

quartz kindle
#

alright

#

you want internal or clustering?

opal plank
#

anything that works lmao

earnest phoenix
#

Guys HEl ples

#

`client.on("guildCreate", otdel => {
let tnxrom = otdel.channels.cache.filter(c => c.type === "text").random();

const embed = new Discord.MessageEmbed()
.setTtile(`**Hello**`)
.setThumnail(client.user.avatarURL)
.setFooter(`**${client.user.tag}**`)
.setTimestamp()
.setColor("RANDOM")
.addField("**Thank You For Adding My On UR Server**")
.addField(`My Prefix IS ${prefix}**`)
.addField(`**IF You NEed Help ${prefix}help**`)
.addField(`**Support Server SOON**`)
tnxrom.send(embed);

});`

quartz kindle
#

i mean

#

internal sharding is literally a client option

#

and works out of the box

earnest phoenix
#

i made this If he join any server

quartz kindle
#

and should be good enough for several thousands of servers

opal plank
#

any downsides apart from being possibly single threaded?

earnest phoenix
#

put Message on random Channel

#

Please help

quartz kindle
#

being single threaded is the only down side

#

everything else is upsides

opal plank
#

what needs to be updated in code to do that? just client options?

quartz kindle
#

ye

opal plank
#

hmmmmmmmmmm

quartz kindle
#

hmmmmmmmmmmmmmm

opal plank
#

no manager or any of that?

quartz kindle
#

nope

opal plank
#

that sounds too good to be true tbh

quartz kindle
#

try it

opal plank
#

lets me spin it up on my local

quartz kindle
earnest phoenix
#

Guys i made this code for bot if he jjoin any server send Message on random channel embed But didnt work and no error on console
help please

`client.on("guildCreate", otdel => {
let tnxrom = otdel.channels.cache.filter(c => c.type === "text").random();

const embed = new Discord.MessageEmbed()
.setTtile(`**Hello**`)
.setThumnail(client.user.avatarURL)
.setFooter(`**${client.user.tag}**`)
.setTimestamp()
.setColor("RANDOM")
.addField("**Thank You For Adding My On UR Server**")
.addField(`My Prefix IS ${prefix}**`)
.addField(`**IF You NEed Help ${prefix}help**`)
.addField(`**Support Server SOON**`)
tnxrom.send(embed);

});`

#

he didnt put any error

golden condor
#

can you console.log(tnxrom)

umbral zealot
#

That should either error out or work, there's not much room for inbetween in programming

#

Also please use codeblocks instead of quotes when doing code 😛

earnest phoenix
#

Sorry But i dont undrestand

umbral zealot
#

Ok let's try again

#

If it's not doing an error, it's not running at all.

earnest phoenix
#

Oh

#

what i do?

opal plank
golden condor
#

can you try console.log(otdel) ?

quartz kindle
#

its not gonna actually shard until 1500

#

but ye

opal plank
#

HHHHHMMMMMMMMMMMMMMMMM

#

interesting

quartz kindle
#

if you want to test the actual sharding, do shards:[0,1] for example, for 2 shards

opal plank
#

this is kind of what i was trying to accomplish with sharding

golden condor
#

wait can you do sharding in the client constructor?

opal plank
#

having the client like usual, but merge all events from the other shards

quartz kindle
#

yes, internat sharding

cinder patio
#

it's basically making multiple connections to the gateway on the same process.

golden condor
#

oh, how can you do that?

opal plank
#

but this is all still into a single thread

silent cloud
#

yo guys

opal plank
#

which should work fine

silent cloud
#

why i have this error

cinder patio
#

yeah

silent cloud
#
at Function.fetchRecommendedShards (/home/container/node_modules/discord.js/src/util/Util.js:240:23)
at ShardingManager.spawn (/home/container/node_modules/discord.js/src/sharding/ShardingManager.js:173:27)
at Object.<anonymous> (/home/container/shard.js:7:9)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
(node:24) 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:24) [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.```
#

code part i have

#

token*

opal plank
#

but after a while the goal is to cluster it, but still have a single main client

golden condor
#

Did you modify the client.token variable?

quartz kindle
#

you tried to do something before the client logged in

golden condor
#

or that

silent cloud
#

im just trying to start bot

opal plank
#

show code

silent cloud
#

wait, i will try my 2 bot token

silent cloud
opal plank
#

its your implementation, 99% sure

quartz kindle
#

show your code

#

the sharding manager code

silent cloud
#

...

#

oh l

#

k

opal plank
#

i need to stop attaching shit onto my client

silent cloud
#
const manager = new ShardingManager('./index.js', {
  token: process.env.DISCORD_TOKEN,
  totalShards: parseInt(process.env.SHARD_COUNT) || 'auto'
})

manager.spawn()
manager.on('shardCreate', shard => console.log(`Launching shard ${shard.id}`))
quartz kindle
#

is the env variable not set?

#

console.log the env

silent cloud
#

i have env file

quartz kindle
#

that doesnt mean its loaded

#

console.log it

golden condor
#

/home/container/shard.js:7:9

silent cloud
#

it cant spawn bot, ye

golden condor
#

the token is undefined, either you misstyped the DISCORD_TOKEN bit or process.env is undefined

silent cloud
#

DISCORD_TOKEN=here is my token

golden condor
#

where do you load the file?

silent cloud
#

in .env file

quartz kindle
#

please do what i said

silent cloud
#

idk how to console.log it in const

quartz kindle
#

console.log(process.env.DISCORD_TOKEN)

silent cloud
#

rly

#

oh i can do this?

golden condor
#

I do

silent cloud
#

i think it doesnt works

opal plank
quartz kindle
#

lmao

opal plank
#

snake case

#

pascal case

#

weird shit

#

all over the place

#

10/10

golden condor
#

what client option is it for the sharding?

opal plank
#

shards:

earnest phoenix
silent cloud
#

ok, lets try it

golden condor
#

so you do just put 'auto' in there?

opal plank
#

correct

golden condor
#

ok thanks

opal plank
#

no preblomo

silent cloud
#

El Problemo

quartz kindle
#

El broccoli

opal plank
#

El Mosco

earnest phoenix
#

uhhh

slender thistle
#

It's time to use the HttpClient from my Timer object returned from a startup method

slender thistle
#

Because I don't know any other way to fucking do this

opal plank
#

i dont think array.random() is a thing, unless d.js adds it

quartz kindle
#

collection.random() is a thing

opal plank
#

oh, its in collection

harsh blade
#
let allowedRole = message.guild.roles.cache.find("PRIO TICKETS", "PRIO TICKETS");

Whats wrong with this code?
I Googled but all it said was "wrong format"

opal plank
#

rreeeeee

#

fricking d.js and their handy methods

slender thistle
#

Will .find(r => r.name === ""PRIO TICKETS"") work

quartz kindle
#

find takes a function ^

slender thistle
#

I wonder

silent cloud
#

nothing logged

harsh blade
#

My bad, tysm

opal plank
#

you're passing undefined to construct client

silent cloud
#

but

opal plank
#

that explains the error

silent cloud
#

oh

opal plank
#

if nothing logged, then it logged undefined

silent cloud
#

thats problem in .env file ye?

opal plank
#

correct, either the way you wrote it, or the env itself

earnest phoenix
#

ty guys i fix it

quartz kindle
#

where are you running your bot?

silent cloud
#

on hosting

opal plank
#

doesnt repl have some weird shit?

quartz kindle
#

because node.js does not use env files by default

opal plank
#

it was either repl or glitch that had some weird env path

#

cuz it would only pick .env

quartz kindle
#

hosts like glitch and repl have automatic env file loading

opal plank
#

not something.env

quartz kindle
#

node.js does not

opal plank
#

also that

silent cloud
#

my hosting 100% know .env

#

old bot works

opal plank
#

try logging env itself

quartz kindle
#

then console.log(process.env)

opal plank
#

console.log(process.env)

#

lmao

silent cloud
#

lol

opal plank
#

1 nanosecond too slow

quartz kindle
#

hue

golden condor
#

do you have the dotenv package?

earnest phoenix
#

client.on('message',function(message) {
if(message.content.startsWith(prefix + "guilds")) {
message.channel.send(Guilds: \`${client.guilds.size}```);
}
});

is that correct for count how much Bot on server??

silent cloud
golden condor
#

To load your .env file

quartz kindle
silent cloud
#

its worked without this

golden condor
#

on what host?

quartz kindle
#

with latest versions you need to use client.guilds.cache.size

opal plank
silent cloud
golden condor
#

To tell if its because of the host

quartz kindle
#

just show what process.env logs

harsh blade
#
if (message.member.roles.has(allowedRole.id)) {

Same "not a function" error

opal plank
#

careful not to leak private info

#

rtoles.cache

#

roles.cache*

quartz kindle
#

rtoles

golden condor
#

Run this in your terminal: npm install dotenv and at the top of the file put this

require('dotenv').config()```and see if it works @silent cloud
#

that will load the .env file to your process

harsh blade
#

roles.cache.has?
Do i need the has part still?

slender thistle
#

Do you?

opal plank
#

likely yes, idk if you have roles cached or not

#

by default everything is cached

#

thats based on intents too iirc

golden condor
#

just try it

harsh blade
#

Alr

silent cloud
#

i have it already

golden condor
#

ok

golden condor
#

Also are you using a seperate message event for every command? @earnest phoenix

opal plank
#

this brings me flashbacks

silent cloud
#

DISCORD_TOKEN: 'null'

opal plank
silent cloud
#

hm

golden condor
#

You shouldn't do that, they can all be contained inside one

harsh blade
#

TypeError: message.member.roles.cache is not a function
Uh?

golden condor
#

Uses more memory and is much less efficient

harsh blade
#

hold on

golden condor
golden condor
#

oh lord

#

oh no

opal plank
#

i had a valid reason for this though

#

👀

golden condor
#

that hurts

#

that makes me sad

opal plank
#

that is valid code though

#

its needed for my promisifed IPC line

golden condor
earnest phoenix
#

Guys why i dont get any answer from top gg i put my bot like 1 and half day and no answer

#

why?

opal plank
#

you gotta be patient, it takes a while to verify it

silent cloud
#

sooo

#

DISCORD_TOKEN: 'null'

earnest phoenix
#

ok

silent cloud
#

what to do...

golden condor
#

np

golden condor
pure lion
#

keep in mind that env syntax is K=V with no spaces

golden condor
#

^

pure lion
#

if you need a space put it in double quotes

golden condor
#

DISCORD_TOKEN=TOKEN_IN_HERE

pure lion
#

e.g PREFIX="pog "

silent cloud
#
DEVELOPER_ROLE=
LOGGING_CHANNEL_ID=
DISCORD_TOKEN=
EMBED_COLOR=#FFC0CB
LAVALINK_NODES=
MONGODB_URI=
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=
TWITCH_CLIENT_ID=
YOUTUBE_API_KEY=
CROWDIN_API_KEY=
CROWDIN_PROJECT_ID=
GENIUS_API=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GMAPS_KEY=
DARKSKY_KEY=
STEAM_API_KEY=
STEAM_LADDER_API_KEY=
TUMBLR_API_KEY=
DBL_WEBHOOK_SECRET=
LASTFM_KEY=
KSOFT_KEY=
PORT=
JWT_SECRET=
CLIENT_ID=
EMOJI_GUILDS=
CLIENT_SECRET=
REDIRECT_URI=
DASHBOARD_URL=
RIOT_API_KEY=
RUBYGEMS_API_KEY=
OSU_API_KEY=
OSU_CLIENT_ID=
OSU_CLIENT_SECRET=
OWLBOT_KEY=
LANGUAGELAYER_API_KEY=
DEBUG=```
pure lion
#

brug

golden condor
#

That is very long

#

DISCORD_TOKEN has the correct value?

silent cloud
#

yea

#

my token

opal plank
#

in double quotes?

golden condor
#

^

opal plank
#

" not '

#

also

#

callum

pure lion
#

.env syntax isnt your basic pussy js syntax

silent cloud
#

double quotes?

golden condor
#

DISCORD_TOKEN="Token here"

opal plank
#

it gets worse

#

a LOT worse

silent cloud
#

what is this, im bad in english

pure lion
golden condor
opal plank
#

" <= use that

#

not '

golden condor
silent cloud
#

ummm

pure lion
#
- do not:
- '
+ do:
+ "```
silent cloud
#

thats my old .env file

golden condor
#

DISCORD_TOKEN="TOKEN HERE"

silent cloud
#

TOKEN=NDc1ODgyOTAxNTExMzQwMDM

#

thats part token

pure lion
silent cloud
#

and old

golden condor
#

possibly why DISCORD_TOKEN is null

silent cloud
#

it worked

opal plank
#

check my getter

lethal trout
#
const { MessageEmbed } = require("discord.js");
module.exports = {
    name: "emojis",
    description: "View all emojis in the guild",
    run: async (bot, message, args) => {
        let Emojis = "";
        let EmojisAnimated = "";
        let EmojiCount = 0;
        let Animated = 0;
        let OverallEmojis = 0;
        function Emoji(id) {
            return bot.emojis.cache.get(id).toString();
        }
        message.guild.emojis.cache.forEach((emoji) => {
            OverallEmojis++;
            if (emoji.animated) {
                Animated++;
                EmojisAnimated += Emoji(emoji.id);
            } else {
                EmojiCount++;
                Emojis += Emoji(emoji.id);
            }
        });

        let Embed1 = new MessageEmbed()
            .setTitle(`Emojis in ${message.guild.name}.`)
            .setDescription(
                `**There are [${OverallEmojis}] in this server**\n\n **Animated [${Animated}]**:\n${EmojisAnimated}`
            )
            .setColor(`#ff0000`);

        let Embed2 = new MessageEmbed()
            .setTitle(`Emojis in ${message.guild.name}.`)
            .setDescription(
                `**Standard [${EmojiCount}]**:\n${Emojis}`
            )
            .setColor(`#ff0000`);

        let Embed = new MessageEmbed()
            .setTitle(`Emojis in ${message.guild.name}.`)
            .setDescription(
                `**There are [${OverallEmojis}] in this server**\n\n **Animated [${Animated}]**:\n${EmojisAnimated}\n\n**Standard [${EmojiCount}]**:\n${Emojis}`
            )
            .setColor(`#ff0000`);

        if (Embed.length > 1000) return message.channel.send(Embed1 + Embed2)
        message.channel.send(Embed);

    },
};
pure lion
#

erwin please dont kill us

silent cloud
#

thats old .env file, thats worked

opal plank
golden condor
pure lion
#

do you need parseint and isnan

golden condor
#

You have to have two separate messages for two embeds

opal plank
mellow kelp
#

I think you can just use isNaN directly

#

iirc

opal plank
#

i had the problem with isNaN before with that

opal plank
#

it was some weird quirk with what i was sending as resolveable

pure lion
lethal trout
#

how to fix it?

pure lion
#

codeing

golden condor
opal plank
lethal trout
pure lion
#

ah gotcha

golden condor
#

send each embed in a different message

#

like this

lethal trout
opal plank
#

that slave project i did have some really over engineered code

golden condor
#
if (/* condition */) {
message.channel.send(Embed1);
message.channel.send(Embed2);
return;
}```
silent cloud
#

hey

golden condor
#

replace /* condition */ with the if condition

silent cloud
#

"" doesnt helped

golden condor
#

change it to

#

process.env.TOKEN

lusty quest
#

where is your .env in relation to your main file?

golden condor
#

@silent cloud

silent cloud
#

why TOKEN

golden condor
#

you said you changed it to that

silent cloud
#

TOKEN was in my old bot

#

now it DISCORD_TOKEN

#

im so lazy to change it in all of my new bot

lusty quest
#

had once the issue that even tho everything where valid it wont load the .env bcs it where in the wrong path

golden condor
#

I'm confused, I think you've either not defined DISCORD_TOKEN or you need to load it with dotenv

earnest phoenix
#

client.on("message", (message) => {
if (message.channel.type === "dm") {
if (message.author.id === client.user.id) return;
let yumz = new Discord.RichEmbed()
.setTimestamp()
.setTitle("Message Send To bot")
.addField(Sended by:, <@${message.author.id}>)
.setColor("RANDOM")
.setThumbnail(message.author.displayAvatarURL)
.addField(Message: , \n\n\``${message.content}```) .setFooter(Maro Codes`)
client.users.get("697562988915327016").send(yumz)
}
});

help Guys i made this for if any one send message to Bot i got it in my dm

#

What problem?

#

wait gave console error

golden condor
#

you used your user id

golden condor
#

697562988915327016 is your id

earnest phoenix
#

let yumz = new Discord.RichEmbed()
^

TypeError: Discord.RichEmbed is not a constructor
at Client.<anonymous> (/home/runner/LuminousGrouchyMigration/index.js:254:32)
at Client.emit (events.js:327:22)
at Client.EventEmitter.emit (domain.js:483:12)
at MessageCreateAction.handle (/home/runner/LuminousGrouchyMigration/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/runner/LuminousGrouchyMigration/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/runner/LuminousGrouchyMigration/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/runner/LuminousGrouchyMigration/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/runner/LuminousGrouchyMigration/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/runner/LuminousGrouchyMigration/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (events.js:315:20

#

what error

earnest phoenix
golden condor
#

Discord.MessageEmbed() is the new embed in v12

opal plank
#

its MessageEmbed

lusty quest
golden condor
#

this is why I construct my own embeds 🤡

opal plank
#

let me get the thing rq

earnest phoenix
#

should i change
let yumz = new Discord.RichEmbed()
to
Discord.MessageEmbed()

golden condor
#

no

golden condor
#

change it to

#

let yumz = new Discord.MessageEmbed()

opal plank
#

^^

earnest phoenix
opal plank
#

though, you shouldnt use embed builder @earnest phoenix

#

and this is why

golden condor
#

It's a simpler way of doing things

earnest phoenix
golden condor
#

so its fine

#

should work

opal plank
#

that linter is tilting me

mellow kelp
opal plank
mellow kelp
#

oh so that actually affects performance

opal plank
opal plank
#

a bit yes, cuz you're declaring a variable

#

but its negligible

mellow kelp
#

yea makes sense

earnest phoenix
# golden condor so its fine

Uhhh on same code on logs say

                        client.users.get("697562988915327016").send(yumz)
                                     ^

TypeError: client.users.get is not a function

opal plank
#

users.cache

golden condor
#

client.users.cache.get

opal plank
#

members.cache

#

guilds.cache

#

roles.cache

#

everything cache now

#

channels.cache

#

literallly everything

#

EVERY

#

SINGLE

#

THING

#

fuck d.js for doing that

earnest phoenix
#

Calma

golden condor
#

error lens is nice

opal plank
golden condor
opal plank
#

or alternatively use Ts, and click on the error, it highlights the line for you

golden condor
#

this works for all languages, though

#

and you don't have to have the problems tab open

earnest phoenix
#

what should i change? On this

client.users.get("697562988915327016").send(yumz)

opal plank
#

you mean the terminal?

opal plank
golden condor
opal plank
#

also thats bound to fail eventually

earnest phoenix
#

ok wait

#

and ty

golden condor
opal plank
#

or

earnest phoenix
silent cloud
#

so

#

im tried all, but nothing help