#development

1 messages · Page 1644 of 1

dreamy trout
#

It's problem bcs a website and website with html won't connect with my FTP client so i can't downloand the html file

quartz kindle
#

wat

dusk scarab
#

that confused me

lyric mountain
#

With ftp client?

dreamy trout
#

like a copy

lyric mountain
#

Are we talking about a bot or...?

dreamy trout
#

like a backup

lyric mountain
#

Backup of a site?

dreamy trout
lyric mountain
#

By copying the html?

#

But anyway, do you even have a bot?

quartz kindle
#

a working bot, that does something?

dreamy trout
lyric mountain
#

And it do work?

zenith terrace
#

other than be online

quartz kindle
#

imagine making your bot online

zenith terrace
#

ah

#

true

dreamy trout
sudden geyser
#

You reek of string concentration

dark crest
#

help pls

lyric mountain
#

Help with?

craggy pine
#

rainbows

solemn latch
#

why is your header classed btnnn

#

👀

lyric mountain
#

Rainbows have surrogate pairs

dark crest
lyric mountain
#

So some places don't show them correctly

#

Like, if not utf-8

dark crest
dusty linden
dusty linden
#

thats the codification method. then you can include letters like á, é, í, ó, ú without problems

solemn latch
#

its generally better to upload to pastebin, or hastebin. most users wont download a text file

dreamy trout
#

there's an error

grizzled raven
#

i'm on mobile so i don't care lol

#

i can just view the text file in the browser

cloud warren
#

client.on('guildMemberRemove', async member => {
    member.guild.members.cache.filter(s => db.fetch(`serverData.${member.guild.id}.botsData.${s.id}`)).forEach(x => {
      let bot = db.fetch(`serverData.${member.guild.id}.botsData.${x.id}`);
      if(bot){
      if(bot.owner == member.id){
          member.guild.members.cache.get(x).ban({reason: "Leave."})
          db.set(`serverData.${member.guild.id}.botsData.${x}.status`, "Reddedildi")
          db.set(`serverData.${member.guild.id}.botsData.${x}.redReason`, "Leave.")
      }
    }
  })
})


#

(node:6576) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'ban' of undefined

#

how can i solve the problem

misty sigil
#

member doesn’t exist

cloud warren
#

I want it to be automatically banned when it leaves the server, but

solemn latch
#

ive seen this code before 👀

#

is there a reason your dont just ban the user directly?

#

member.ban()
rather than
member.guild.members.cache.get(x).ban({reason: "Leave."})

cloud warren
solemn latch
#

thats not what im saying

cloud warren
#

(node:6636) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'ban' of undefined

pulsar mortar
#

pls rich

solemn latch
#

why are you fetching a member, when you already have the member

solemn latch
earnest phoenix
#

we are pogging

cloud warren
solemn latch
#

okay

unreal estuary
#

?

solemn latch
#

i am not talking about that one bit

#

i am talking about in your ban code, why are you not doing it directly

cloud warren
#

I'm sorry I don't speak English very much. I don't know how to explain

unreal estuary
#

if u want to ban the member when they leave just do member.ban()

solemn latch
#

^

#

you already have member

unreal estuary
#

no need to fetch

cloud warren
#

I don't want it to ban every member, I just want members on db

solemn latch
#

then check if they are in the database, and ban them using member.ban if they are

#

you cannot get member from cache since they are banned

cloud warren
#

The bot checks if the person coming out is on db, but

copper jetty
#

Okay so I'm doing this silly little ''Guess the movie'' game for friends and I've been stuck for quite some time now. This is my first bot and I'm not that experienced with Python, but I really want to do it.
When the movie is selected, the variable ''title'' is changed to all the different names of the movie. Then, it sends a screencap, waits a few secs, sends a hint, a screencap, etc and then reveals the title of the game. All of this works.
But when I input an ''if any(word in msg for word in title):'' and a lil ''you won'', it completly ignores it. No error message, nothing. It continues with the screencaps and acts as if nothing happened. I'm a little confused and would appreciate if anyone had an idea?

proven lantern
# dusk scarab that confused me

each instance of someone using a swear word should create a record in the database. then when you want to know the swear count you count the records. if you want to see how many times user x swore you count the number of records with user x.

dusky sundial
lyric mountain
earnest phoenix
#

does anyone do js and uses a instagram search?

lyric mountain
#

like, as with most stuff in programmin, concept is always easier

earnest phoenix
#

nothing logs in the console btw

#

something only logs if i put a @ before the ig acc name

lyric mountain
#

you sure you're using the api correctly?

earnest phoenix
#

mhm

vivid fulcrum
#

you're not

#

you're fetching the html site and then trying to convert it to json

#

which is what the error would tell you... if you logged it

misty sigil
#

thats how it works right

earnest phoenix
#

oh

misty sigil
#

just convert html into json magically

#

oh and ofc don't log errors

proven lantern
misty sigil
#

damn bro thats cool

earnest phoenix
#

k just got an error

#
    at Message.delete (/home/runner/economy-bot/node_modules/discord.js/src/structures/Message.js:577:60)
at /home/runner/economy-bot/commands/instagram.js:11:36```
#

gonna fix it rn

vivid fulcrum
#

i straight up get redirected when i try to use the url

#

oh it's probably because im on phone and i have the instagram app installed

copper jetty
#

if movie == "sonic":
title = [
"Sonic", "sonic", "sonic the hedgehog", "Sonic The Hedgehog", "Sonic the Hedgehog", "Sonic the hedgehog"
]
* if any(word in msg for word in title):
await message.channel.send('You won!')* <--- My miserible attempt
await message.channel.send('first pic\nURL')
time.sleep(10)
await message.channel.send('Second pic\nURL')
time.sleep(6)
await message.channel.send('Title : _ o _ _ _ _ _ _ _ e _ _ _ h _ _ ')
time.sleep(6)
await message.channel.send('Last pic\nURL')
time.sleep(6)
await message.channel.send('Title : _ o n _ c _ h _ H e _ _ _ h _ _ ')
time.sleep(10)
await message.channel.send('The answer is : Sonic The Hedgehog')

I'm sorry, I have no idea how to format code in Discord. I just got into coding..
Anyways this is what it looks like.

earnest phoenix
#

do it like this

#

or do it in a bin maybe??

dusky sundial
#

Unfortunately the code is going to be a lot more complicated than that. In your code, you only check for a guess once, and then keep sending hints. You would need one event handler that checks for guesses, and another method that keeps sending the hints as long as no correct guess has been made.

earnest phoenix
#

anyone know with postgres using INSERT INTO table (...) VALUES (...) ON CONFLICT (key) DO UPDATE SET key = ... how am I able to set multiple new values? for multiple keys

misty sigil
#

I done it

#

DO UPDATE SET (thing1, thing2, thing3) = (thingval1, thingval2, thingval3)

#

iirc

earnest phoenix
#

I was thinking that but I figured it would be too simple lol

proven lantern
#

is there an endpoint i can call to check if my bot is online?

misty sigil
#

what

proven lantern
#

a url that i could call that would tell me the status of my bot

misty sigil
#

you can implement one

proven lantern
misty sigil
#

nah that just says online

proven lantern
#

they should expose that

#

there must be some api they call internally to get the status

solemn latch
#

we dont track status's anymore anyway

#

the "online" is just a placeholder and doesnt represent anything.

proven lantern
#

these guys set theirs

solemn latch
#

bots which show other status's are bots that had status's other than online when that feature was removed.

proven lantern
#

this is the offline color

solemn latch
#

no idea tbh

proven lantern
#

i just tested that bot and it was online

#

so maybe that doesn't mean they are offline

#

idk

summer torrent
solemn latch
#

👀

proven lantern
#

when top.gg did track if a bot was online did they use a discord api to get the info?

misty sigil
#

that was when they were all in here

solemn latch
#

yeah, we tracked it because bots got invited

proven lantern
#

ohhhh

solemn latch
#

yeah

proven lantern
#

that makes sense

vestal stirrup
#

can someone help me ?, I wanted the bot to recognize the chat attachment

proven lantern
#

what does await canva.Canvas.clyde(text) return?

proven lantern
vestal stirrup
#

I sent it wrong wait

#

I want him to get an attachment from the chat

copper jetty
copper jetty
dusky sundial
#

I'm sorry, I don't really know where you would find a tutorial for that.

earnest phoenix
misty sigil
#

hey look I fixed something!!!

green kestrel
#

i got some beta testers for my webhook stuff lol

#

one of the bigger servers jumped right on it... theres now a pepe themed triviabot with a big brain pepe as its pfp

jolly mortar
#

i made some of my commands limited to people who voted on the bot and im not sure if thats allowed or not

green kestrel
#

yes

#

thats allowed

#

in fact personally i'd encourage it

jolly mortar
#

ok phew

green kestrel
#

its the best way to get votes

#

just make sure to give them a grace period, e.g. make your votes last 12 hours and 5 mins

jolly mortar
#

i have

green kestrel
#

that way if they vote again, theres no period where their privileges are stripped from them temporarily

craggy pine
#

Woah green name brain

#

No advertising

#

@drowsy crag kittyLove

drowsy crag
#

@unreal kiln dont advertise please!

craggy pine
proven lantern
#

i asked for help testing features of my bot when i was developing it and i got banned

dusk scarab
#

i had an economy system set up and I kinda wanted it to be like that

#

where it just counts your coins or in this case "bonks"

proven lantern
#

what kind of database are you using?

nocturne dagger
#

Anyone here know unbuntu fairly well?

proven lantern
#

centos is my main linux distro

nocturne dagger
#

So I have not ran a website on a vps before so I am not sure exactly how to do it.

#

When I start the main file locally it goes to localhost, i belive I connected the domain to the vps correctly if I go to the domain rn it shows this.

#

How can I set it up to show the dashboard on the domain.

surreal stump
#

The widget does not work for me, what do I do?

proven lantern
#

/var/www/html seems to be where the website files go

#

you shouldn't really use a vps to host a website

lament rock
proven lantern
#

heroku firebase and vercel have free hosting and they are easy to hook up to a domain

#

if your website uses sockets then a vps might make sense

lament rock
#

Heroku and the likes are not good for non-static website hosting. Some websites act as IPC layers and also require a cached state to stay active for as long as possible

nocturne dagger
#

Well the bot code and the website are one in the same

proven lantern
#

separate them

#

it will make it cleaner

nocturne dagger
#

Ill look into how to do that

#

What would I use to host the site?

#

Can you connect your databases and stuff to a shared hosting?

proven lantern
#

yep

#

each database does it differently, but each one supports connecting from anywhere

nocturne dagger
#

Alright, ill try to do that.

sick cloud
#

hi so
is there some api around that can get a full city name
i'm using this weather api but it only provides the city name and two letter country code (ie. "brisbane, au") and i want to get the full name (ie. "brisbane, queensland, australia")

#

can't find one through googling so

proven lantern
#

google maps api should have all that data

sick cloud
#

maps api isn't free iirc

#

gotta pay ridiculous amounts

drifting wedge
#

wheres the padding comming from?

proven lantern
#

body

drifting wedge
#

i dont have padding in body

proven lantern
#

the browser does

sick cloud
#
body {
  margin: 0;
}```
#

its margin

drifting wedge
#

AHH

#

alr cool

#

ty

quartz kindle
sick cloud
#

oh ok

#

where do i find the docs then

#

also happy bday

quartz kindle
#

tyty

#

look into geocoding and geolocation apis

#

you get $200 per month of free credit

#

equivent to 40k requests per month

#

there are other options as well, like mapbox and openstreetmap

#

mapbox is much cheaper than google and offers like 100k per month free or something like that

#

of course api results may be a bit different

lyric mountain
#

Download whole gmaps full-res and selfhost it, izi pizi

earnest phoenix
#

@opal plank todays progress. gonna work on collecting more data tomorrow so I can make more stuff

#

someone help me fix the error

quartz kindle
#

what error

sudden geyser
#

Are languages like Perl, Prolog and Lisp still relevant today

lyric mountain
#

Behold, my prophecy has been fulfilled

sudden geyser
#

come here!

lyric mountain
#

Dead became a regular here for asking for code help

vestal stirrup
#

how do I make fields like this?

earnest phoenix
#

discord.Color.red(() the ) is wrong

solemn leaf
#

/n

solemn latch
#

yeah just seems to be 2 fields and a bunch of newlines and bolds

earnest phoenix
#

can someone tell me how to close my string

solemn latch
#

tim asked what your error was 👀

solemn leaf
#

They cant close their string

#

Thsts the error

solemn latch
#

ah

slender thistle
#

Hoe

#

How

solemn leaf
#

" ' `

slender thistle
#

What

solemn latch
slender thistle
#

Can you

#

Like

#

Show the rest of those lines that you took a photo of

solemn leaf
#

Shiv

quartz kindle
#

cant see shit from a picture of incomplete code

solemn leaf
#

Tim we know

solemn latch
#

is screenshotting an option here? or?

solemn leaf
#

Its someone who doesnt know discord has a site or to code

#

Or win + s

quartz kindle
#

or pastebin

solemn latch
#

i dont know how discord has a site, how are they not out of funds?

solemn leaf
#

Or cntl c ctrl v

earnest phoenix
#

k

solemn leaf
#

k

#

Is it weird to question if people are under 13

solemn latch
#

yes

solemn leaf
#

Under 13 much

solemn latch
earnest phoenix
#

wait

#

wrong server

solemn latch
#

lol

vestal stirrup
quartz kindle
#

wat

lyric mountain
solemn leaf
#

@vestal stirrup we said \n

lyric mountain
#

It's actually \n

solemn leaf
#

Newline

slender thistle
#

I sometimes question the future of the development community

quartz kindle
#

i question the future of humanity

lyric mountain
earnest phoenix
slender thistle
#

dsicord.Embed yes

solemn leaf
#

When discord gets sold or something like that

earnest phoenix
#

yes

quartz kindle
#

you didnt close the f string

earnest phoenix
#

lol

slender thistle
#

Oh my fucking God

solemn leaf
#

Dead

#

Learn how to use brain cells

lyric mountain
#

@slender thistle see

earnest phoenix
#

k

slender thistle
#

Close your title string with an "

lyric mountain
#

That 2 days ago

slender thistle
green kestrel
#

ugh, i got a 429 reply

solemn latch
lyric mountain
#

They're always here, everytime with weird and plain obvious errors

solemn leaf
#

I used to be a regular then I just gave up and llearned it

lyric mountain
#

My prophecy held true the whole time

green kestrel
#

i suppose one 429 in 15000 requests isnt the end of the world, just have to refine my rate limit checking code

solemn leaf
#

What

lyric mountain
#

The cause? A single gram of spoonfeed

earnest phoenix
#

so it's "(()

#

"())

quartz kindle
#

wat

solemn leaf
#

Dead its "()()()()()()()()"

earnest phoenix
#

Jesus fuk

quartz kindle
#

i mean

green kestrel
#

happy birthday @quartz kindle !

solemn latch
#

im just guessing, but i think its the " that needs to be closed, not the ( 👀

solemn leaf
#

How celebrate my bday 🤔

slender thistle
quartz kindle
#

if you want your title to be usernames's balance, color = discord.Color.red sure

slender thistle
#

You can already tell I'm not in the state of mind to deal with this

lyric mountain
#

Aged like milk

quartz kindle
slender thistle
#

f"wkw's balance**"**, color = color.red

earnest phoenix
#

milk

#

milk

slender thistle
#

See where those " are at

green kestrel
solemn leaf
#

Dude

#

No body is that stupid

lyric mountain
#

Wanna bet?

green kestrel
#

oh please

long crow
#

You have to log in the bot first

solemn leaf
#

Okay that person tslking changed my mind

green kestrel
#

youve been here as long as or at longer than me, you know some people can be that stupid

lyric mountain
#

Someone show Aki the dbl bad codes repo

long crow
#

kekw

solemn leaf
#

There is a repo of them

solemn latch
green kestrel
#

lmao

solemn leaf
#

A repo?

green kestrel
#

@solemn latch its not working because you gotta put your token in the require. paste it back here to show me that you did it right. kek

earnest phoenix
#

alr so how do close string one answer cause you all said different stuff

solemn latch
#

every " needs a "

#

you have one, you need to place the other

#

i think shiv even gave you the right answer up above somewhere

solemn leaf
#

Guys im a dev look:

require("discord.js").login("token"):

Wait no work

earnest phoenix
#

(()"

#

())"

#

"())

slender thistle
#

Dude are you okay

#

Is your vision alright

lyric mountain
#

Wanda

earnest phoenix
#

when you die of not being able to TYPE

slender thistle
#

Bro

solemn leaf
#

What is your pfp

slender thistle
#

And read your code

#

Do you see a difference between the "

solemn leaf
#

Wait stop guessing that they can even read

#

Maybe they can't read

lyric mountain
#

I don't need to read the docs they said
I can memorize stuff just by looking at they said

#

Dude, your issue is simple: if you opened something, CLOSE that something

earnest phoenix
#

I know the problem just don't know how to write it correct

slender thistle
#

You know the general problem

lyric mountain
#

You open a door, you close it

slender thistle
#

You don't know where the cause is

solemn leaf
#

I always leave the freezer open

slender thistle
#

And I showed you the idea of where it can be an issue

earnest phoenix
#

ree

slender thistle
#

Are you blind

solemn leaf
#

Ree they wont spoonfeed me like a baby

vestal stirrup
#

I got it, thanks

solemn leaf
#

Np

slender thistle
#

f"{ctx.author.name}'s balance", color=discord.Color.red()

#

See this

#

For your own sake

#

And see your code

earnest phoenix
#

alr

drifting wedge
slender thistle
#

And compare them

drifting wedge
#

the discord colors dont work for some

solemn latch
#

👀

drifting wedge
#

use 0xHEX

slender thistle
#

I don't CARE if they work or not

lyric mountain
solemn leaf
#

Or general markdown

drifting wedge
#

@slender thistle spoon feed me pls

#

how do i print 1 + 1

#

as a bool

slender thistle
#

I just want this guy to get his issue fixed and fuck outta here

lyric mountain
#

He won't

solemn leaf
#

Tostring

#

?

drifting wedge
#

how do i print 1+1 as a bool? its for a cs class im in

lyric mountain
earnest phoenix
#

did that but didn't work it gave me another error

#

the em.add.field is a invalid syntax

lyric mountain
#

Add.field KEKW

earnest phoenix
#

fck

vestal stirrup
slender thistle
#

I'm amazed

jolly mortar
#

can you put in emojis on a bot status?

#

i tried using a <:name:ID> for it but that didnt work

lyric mountain
#

Probably no ig

jolly mortar
#

aw

earnest phoenix
#

bruh

lyric mountain
#

Like, bots have some kind of limited nitro

earnest phoenix
#

invalid syntax

lyric mountain
#

They can use all normal and animated emotes, but can't have gif pfp or expanded file sizes

earnest phoenix
#

so emoji is ignored ig

jolly mortar
#

hmm

#

welp

#

i was planning on using emojis on the status of the bot to make it look cooler

earnest phoenix
#

mhm

slender thistle
#

Invalid syntax more like I'm kinda trying to put shit together without basic Python practice and docs

earnest phoenix
#

shivaco more like a person who doesn't have self respect

slender thistle
#

Oh I gave up on myself a long time ago, but that's not the case here

#

I'm pointing out a few issues you are experiencing in an unusual manner

earnest phoenix
#

I just want to get this done I've re written the code twice over 3 days

slender thistle
#

A-ok, my rant is over. Is there any place where I can see where the attribute error is raised?

earnest phoenix
#

should i ss or right the code

#

it's not that long

#

that'd be helpful to provide the full code

#

em.add.field(name = "wallet balance", value = wallet_amt)

#

That em.add.field is an issue, but there's another issue before that line as well I suppose

#

ya i fixed that issue and then it gave me that

#

Send the line above that blobweary

lyric mountain
#

I did fckin tell you the error and you still didn't notice it

earnest phoenix
#

that's not all

#

1 sec

lyric mountain
earnest phoenix
#

em = discord.Embed(title = f"{ctx.author.name}'s balance", color=discord.Color.red()

#

See, you don't close the parenthesis

#

wym

slender thistle
#

.red()

earnest phoenix
#

I mean, you literally didn't close the parenthesis

slender thistle
#

closed parentheses

#

You have 2 opening and 1 closing parentheses

earnest phoenix
#

o

#

em = discord.Embed(title = f"{ctx.author.name}'s balance", color=discord.Color.red)

#

you mean doing that

#

no

#

Keep calling the red classmethod, meaning, keep the parenthesis there

slender thistle
#

Ye wee fahken soolless cun'

earnest phoenix
#

tf

slender thistle
#

Just put one closing parenthesis at the end of the line

frosty forge
#

i hoppe i get appoved

slender thistle
#

don't remove any other parentheses

earnest phoenix
#

wait

#

another error -_- lol

#

Man, why do you choose to suffer from this shit by skipping python basic blobweary

slender thistle
#

Because "oh dude I need this really quick and then I'll go learn"

#

"I'm stuck on this for 3 days"

earnest phoenix
#

nah i was fine

#

but then I was messing around

#

then decided to do this

slender thistle
#

You were fine in what sense

solemn latch
#

even with messing around you should be able to spot these issues.

earnest phoenix
#

like it worked then I added the stuff I'm stuck on rn

#

What error you got hashflushed

slender thistle
#

My man I had issues different than this when I started d.py

#

And mind you I didn't learn Python prior to that

earnest phoenix
#

well undefined name wich I know what that means just bruh

#

kekw, discord bot as first project ftw

slender thistle
#

Point still stands go learn Python

solemn latch
#

I remember having issues like this, its not unheard of, but im pretty sure i solved them on my own? 🤷‍♂️

slender thistle
#

Exactly norizon you don't know how much I hate myself for that

earnest phoenix
#

wallet_amt = users[str(user.id)]["wallet"]

#

I mean, I did it too hashflushed

#

Kindly provide the full code for that command, it's hard for people to help with those snippets.

slender thistle
#

Ah so same boat

earnest phoenix
earnest phoenix
earnest phoenix
#

ok

hot kiln
#

How can i see how many roles are in the server from higher to lower

lyric mountain
#

Get roles list, it'll be ordered from lowest to highest iirc

#

HOW depends on the library you're using

hot kiln
#

i mean to say not for bot making for general

lyric mountain
#

You can't get roles if not for a bot

#

Well, you can, manually

thick nexus
#

So I want my bot to do a command that involves pinging someone else... Can I make it so that it works with replying?

solemn latch
#

As in replying to someone else from a command?

#

I dont think its possible

lyric mountain
#

It is, if you get the mentions list the reply's mention will be the first element

solemn latch
#

Oh I thought he meant using like djs replies EYES

lyric mountain
#

Doesn't djs already have support for replies?

long crow
#

inline replies? nope on stable, master yes

earnest phoenix
#

wait why does it say that wallet_amt = users[str(user.id)]["wallet"] unidentified name 'user'

solemn latch
#

Is user defined?

earnest phoenix
#

uhh

#

how would I define it in my code

lyric mountain
thick nexus
#

Like

#

user = ctx.author

#

Or like

#

idk

#

How explain

earnest phoenix
#

no dip ik that

thick nexus
#

Uhh

earnest phoenix
#

just with my code

thick nexus
#

So

long crow
#

const user = user

thick nexus
#

Wdym then

lyric mountain
#

@thick nexus shh

#

He wants a spoonfeed

#

Again

thick nexus
lyric mountain
#

Spoonfeeding, copy-ready code, plug 'n play code, call it what you want

#

Basically code that you can ctrl + c/ctrl + v into your code

#

Without changing a bit

#

Nor understanding what you're copying

earnest phoenix
#

I don't copy it

#

I type it

#

I don't ctrl c ctrl v

lyric mountain
#

No, imagine weirdsip

thick nexus
#

Oh

thick nexus
earnest phoenix
#

I wanna create a economic bot but python freaky

lyric mountain
#

You're not making a economy bot, you're making a budget bot

earnest phoenix
#

wait

lyric mountain
#

Please learn python

earnest phoenix
#

i wanna make like a +beg

#

like that

lyric mountain
#

It's not hard, you'd have finished already if you stopped asking for answers here and started taking courses

earnest phoenix
#

"courses"

#

send link

solemn latch
#

Didn't someone send you the links yesterday

earnest phoenix
#

ye

solemn latch
#

Then its probably faster for you to find them

earnest phoenix
#

there's alot of talk

#

so no it would

#

not

solemn latch
#

Never used search before?

earnest phoenix
#

i have

#

u meant like that o

solemn latch
#

Yeah discord search. It comes in handy sometimes

craggy pine
earnest phoenix
#

alr

lyric mountain
#

Thx miyuu

craggy pine
#

❤️

earnest phoenix
#

🔥 😎 🔥

#

what should i learn with the link chat bot?

craggy pine
#

you should learn "python"

#

That's your beginning

#

Not a bot.

slender thistle
#

Learn Python

#

Learn Python

#

Learn Python

#

Learn Python

craggy pine
#

I think we need one more Shiv

slender thistle
#

Then learn Python

craggy pine
#

ty

slender thistle
#

Then practice Python

lyric mountain
#

StackoverflowException: shivaco stackoverflowed

slender thistle
#

Then practice your appropriate knowledge in actual projects

#

It doesn't work well the other way around

earnest phoenix
#

you have to pay

craggy pine
#

Codecademy is free, there is paid options

earnest phoenix
#

wait

slender thistle
#

There's Sololearn

#

There's YOUTUBE

thick nexus
#

Lmao

solemn latch
#

Theres pay shiv to teach you

thick nexus
#

Sololearn is decent

slender thistle
#

Yo bro if I was paid to teach you bet your bottom dollar I wouldn't be here

lyric mountain
slender thistle
#

YouTube for Python is more or less acceptable to an s

#

extent

lyric mountain
#

He'll search for "how to make X command in dpy"

#

And youtube will """show""" how

slender thistle
#

Well we did say learn Python

#

If he decides to search that it's his fault

earnest phoenix
craggy pine
#

"Try it for free" works fine.

#

There's just extra with paid

#

I did a full JS course free of charge.

earnest phoenix
#

I can't pay

#

also i don't have a cc

#

👍

craggy pine
#

Then try sololearn python

#

not hard to google search python courses.

earnest phoenix
#

they all are paid

lyric mountain
#

W3Schools

#

Udemy

#

Baeldung (maybe?)

earnest phoenix
#

From a tag in a server

Recommendation: https://www.sololearn.com/Play/Python (good online course on the basics)
https://automatetheboringstuff.com/ (for complete beginners to programming)
https://learnxinyminutes.com/docs/python3/ (for people who know programming already)
https://docs.python.org/3/tutorial/ (official tutorial)
http://python.swaroopch.com/ (useful book)
http://greenteapress.com/wp/think-python-2e/ (another decent book)
http://www.codeabbey.com/ (exercises for beginners)
https://adventofcode.com/ (high quality programming challenges)
https://dev.to/thepracticaldev/daily-challenge-1-string-peeler-4nep (daily programming challenges)
http://rosettacode.org/wiki/Category:Python (Code samples on different things)

lyric mountain
#

Erwin probably

vestal stirrup
#

it is a very good site

cosmic forum
#

Hi, so I have the following code:

let split1 = eggs[item - 1].split(" ");
let eggtype = `${split1[0]} ${split1[1]}`;
let split2 = split1[2].split("/");
let hatchnum = `${parseInt(split2[0]) + 1}/${split2[1]}`;
console.log(`${eggtype} ${hatchnum}`);

What it does is take a string like, Rare Egg 0/3, and splits it into Rare, Egg, 0, and 3. It then takes the 0 and adds a 1 to it. Then it puts it all back together and logs it.

Yet, when I console.log it, it gives a response like this: Rare Egg NaN/undefined.

Does anyone see what's wrong? All help is appreciated.

lyric mountain
#

Like, it's one of the founders of modern internet anyway KEKW

lament rock
#

ah. Nvm. I didn't read the parseInt. My apologies

#

I would still recommend the Number constructor over parseInt

formal tusk
#
Cannot connect to the MongoDB at localhost:27017.

Error:
Network is unreachable. Reason: couldn't connect to server localhost:27017, connection attempt failed: SocketException: Error connecting to localhost:27017 (127.0.0.1:27017) :: caused by :: No connection could be made because the target machine actively refused it.
``` I dont know what I'm doing wrong...
dusk scarab
#

[#development](/guild/264445053596991498/channel/272764566411149314/)

#

yup

#

right here

#

aight imma slep

cosmic forum
lament rock
#

Do what I suggested first though which is logging the values before you do the addition

cosmic forum
#

Ok, sure

vestal stirrup
#

I was able to learn the basics of HTML

lyric mountain
#

Cool, looks quite well structured

earnest phoenix
#

how do you even make that -_-

lament rock
#

Looks pretty clean. Not sure how I would feel about the image if that was the first presentation

lyric mountain
#

When you learn how to code, you can make anything

long crow
#

Can i hax

vestal stirrup
earnest phoenix
#

dude i can't get a quote outa my head

formal tusk
lyric mountain
#

Like, a monochromatic version of that image

#

Upscaled obviously

#

And with a low opacity

lyric mountain
#

It'd break the contrast between the image and the bg color

earnest phoenix
#

is JavaScript java

cosmic forum
# lament rock Do what I suggested first though which is logging the values before you do the a...

Ok, so I logged each of the values, (Rare, Egg, 0, and 3).

Rare and Egg showed up perfectly. 0 showed up as -, and 3 showed up as undefined.

I feel like the line which I commented on is what is messing it up.

let split1 = eggs[item - 1].split(" ");
let eggtype = `${split1[0]} ${split1[1]}`;
let split2 = split1[2].split("/"); // <-- Most likely cause for the issues.
let hatchnum = `${parseInt(split2[0]) + 1}/${split2[1]}`;
solemn latch
vestal stirrup
#

look at my first site

#

after i learned about html, it improved a lot

cosmic forum
lyric mountain
earnest phoenix
#

what

cosmic forum
lyric mountain
#

But javascript was born for java, which became a standalone lang

earnest phoenix
#

oh

lyric mountain
#

So, like, they're totally different stuff

#

It's only called javascript because it was used to pass client side data to java applets

#

So java script

#

Nowadays it doesn't really matter since they took different paths

quartz kindle
#

they just took the name because java was popular

#

it was a publicity stunt lul

snow urchin
old cliff
#

new express

#

()

lament rock
#

does express come with it's own typings, because the 3 dots underneath the express string import look like it might be a message stating you should install @types/express

pale vessel
#

express doesn't have its own typings, only D T

lament rock
#

Then the issue just may be that typings need to be installed

snow urchin
#

yup turns out that was it, thanks

lament rock
#

because if someone else can make it work, then it's an issue up further

cosmic forum
lament rock
#

pain.

quartz kindle
#

bread

lament rock
#

pan

#

de muerto

quartz kindle
#

paneleiro

lament rock
#

Happy cake day btw

quartz kindle
#

gracias

agile lance
#

Anyone else having high ping with their bots using Discord.js?

#

Typically my ping is 40-100

#

Lately its been in the 10k+ zone

craggy pine
#

I'm fine

agile lance
#

My friend randomly had this issue for 3+ days now

#

So it isnt just me affected

#

I even switched hosts to see if it was my host, same issue

craggy pine
#

My ping is via self hosting + discord.js so idk mexShrug

long crow
#

My ping is around 200+, but then I hosted from SG

snow urchin
novel osprey
#

I didn’t even apply for listing my bot on top.gg
I deleted it afterwards applying it because I coded it to be private

solemn leaf
#

Okay cool

novel osprey
#

And I got this dm.

#

😂

solemn leaf
#

Okay?

#

This is development

novel osprey
#

ok

solemn leaf
#

Not support

novel osprey
#

I’m just telling

#

not asking for support 😂

craggy pine
solemn leaf
#

None of us devs care

novel osprey
#

ok

solemn leaf
#

:heart:

novel osprey
#

ok

#

ok

earnest phoenix
#

when I run my code it says im exceeding the rate limit

solemn leaf
#

Good

earnest phoenix
#

"too many requests"

solemn leaf
#

Know what rate or limit means

earnest phoenix
#

limit is what it goes to and rate not really

snow urchin
solemn leaf
#

Well you are limited bcs you spammed over the allowed rate

#

inherits doesnt have get() in it on the code that you showed

feral aspen
#

Ayo.

#

I have updated my package.json and removed some packages.

#

I want it to update for the package-lock.json and the node modules.

#

Should I delete them both and do npm install discord.js ?

crystal wigeon
#

how do you prevent escape characters from being used in embeds?

#

like if someone's username

#

has weird things like ||sad||

#

the ||

#

It's causing things like this to happen

#

Idk what this guy had in his username

snow urchin
earnest phoenix
#

hey what's an attribute error

craggy pine
#

google it

earnest phoenix
#

no im working on a giveaway bot

#

it's going good just not with saying who won

earnest phoenix
#

@earnest phoenix

gilded plankBOT
earnest phoenix
gilded plankBOT
earnest phoenix
umbral creek
#

bruh

#

sorry

earnest phoenix
#

So what

earnest phoenix
earnest phoenix
#

Then just ignore it

#

Why bother

#

don't know

#

cause I was wondering what a attribute error was

#

and u said that

#

but I googled it

#

@umbral creek

snow urchin
wary flame
#

What is the error? @snow urchin

snow urchin
#

^

wary flame
#

Wouldn't know sorry

#

Also I recommend you use classes since you're working with typescript, typescript is able to transpile to older js versions if you need to

snow urchin
#

cute

eternal osprey
#

hey i had a question

#

i am using discord.js audiostream to receive audio calls

#

however, how do i actually export the pcm file as mp3?

quartz kindle
#

you need to convert it with something like ffmpeg

eternal osprey
#

is there any specific docs for that specific feature?

#

of ffmpeg.

quartz kindle
#

google it, there are many discussions and explanations about it

river panther
#

helo guys

rigid viper
#

If I edit my bot, does my bot accept time take longer?

willow mirage
#

@quartz kindle what does this mean?

#

i still don't undestand

#

and those here, if i install them, d.js-light will automaticly pick them up?

quartz kindle
#

just use intents

willow mirage
#

so should i disable it?

quartz kindle
#

just leave it default

willow mirage
#

and do i still need d.js ? or delete it

rigid viper
#

@quartz kindle If I edit my bot, does my bot accept time take longer? (sorry for the ping)

quartz kindle
#

uninstall djs

willow mirage
#

ok ok

quartz kindle
#

it can cause conflict issues

willow mirage
#

@quartz kindle how i can cache a emoji that i needed

quartz kindle
#

what do you need it for?

drowsy epoch
quartz kindle
#

to display the emoji name, url and id?

#

or just for sending/reacting?

long crow
#

If I do, npm i discord.js-light, it will install master or v3?

quartz kindle
#

v3

long crow
#

Oh k

#

Master is based on master branch of djs on github?

quartz kindle
#

yes

long crow
#

I see

willow mirage
#

smth like this

#

but everything i do it, it auto react and delete my msg

old cliff
#

Make reaction collector after reacting

#

Or check if reaction user id is not bots id

willow mirage
#

i did bro

old cliff
#

Show code

willow mirage
#

i fixed

#

no need

old cliff
willow mirage
#

will do it, after v13

old cliff
#

Ok

earnest phoenix
#

.addField(`Roles [${guild.roles.cache.filter(r => r.id !== message.guild.id).map(roles => `\`${roles.name}\``).length}]`,`${member.roles.cache.filter(r => r.id !== message.guild.id).map(roles => `<@&${roles.id }>`).join(" **|** ") || "No Roles"}`, true)

What’s wrong here?

willow mirage
#

error?

earnest phoenix
#

guild.roles.cache.filter exists right

willow mirage
#

guild.cache.roles

#

.-.

earnest phoenix
#

SOuh I wasn’t here LOL

willow mirage
#
${guild.roles.cache.filter(r => r.id !== message.guild.id).map(roles => `\`${roles.name}\``).length}

to this

${guild.roles.cache.size}
#

@earnest phoenix might be better

earnest phoenix
#

Ah okay thank you

willow mirage
#
${member.roles.cache.filter(r => r.id !== message.guild.id).map(roles => `<@&${roles.id }>`).join(" **|** ") || "No Roles"}

to this

${member.roles.cache.map(roles => `<@&${roles.id }>`).join(" **|** ") || "No Roles"}
#

@earnest phoenix

earnest phoenix
#

Ah

#

Okay I’ll see if it works now

opal plank
#

well this is odd

#

why does invites api endpoint doesnt show welcome channels names?

zenith terrace
#

good question

#

idk

opal plank
#

@earnest phoenix oye, what are your welcome channel names?

slender thistle
#

ITenteretsting

opal plank
#

i doubt he set the channel names as only emojis

slender thistle
#

You never know.

opal plank
#

the key in the json would be name tho

#

like the one below

devout thorn
#
    if (!owners_id.includes(message.author.id))
  
if (message.author.bot) return
  var embed;

        {

    message.delete()


if (message.content.startsWith("")) 
{
    message.delete()

embed = new Discord.MessageEmbed()
 .setTitle(message.content)
 .setDescription("by " + message.author.username)
 .setColor("RED")
}
        }
    message.channel.send(embed)
}```
#

try it

old cliff
#

Whats the error?

tired panther
#

Error is undefined blobLUL , what error @devout thorn ?

old cliff
#
if (message.author.bot) return
  var embed;

        {

    message.delete()
``` this line causes error
#

@devout thorn

devout thorn
#

im give const

old cliff
#

hmm

#

no

#

the structure is incorrect

#

show the full code then we can help

devout thorn
#
if (message.author.bot) return
if (message.content.startsWith("")) 
{
    message.delete()
let embed = new Discord.MessageEmbed()
 .setTitle(message.content)
 .setDescription("by " + message.author.username)
 .setColor("RED")
 message.channel.send(embed)
}
devout thorn
#

anyways

#

try dis

#

it works

old cliff
#

nice

devout thorn
#

just try dis code it fun kindA

devout thorn
quartz kindle
#

who is helping who?

#

lmao

old cliff
#

why do you want to delete all messages?

#

@quartz kindle I am helping

devout thorn
devout thorn
#

i just gave that cmd

old cliff
#

Wdym ?

devout thorn
#

i ade it by mashing my 3 other cmd cause i was bored

old cliff
#

Weren't you asking for help in code?

devout thorn
old cliff
#

Bruh

devout thorn
#

srry

#

i guess there was a misunderstanding

opal plank
#

okay

#

im gonna be very honest

#

i never thought about abusing that bug for that

old cliff
#

Lul

opal plank
#

kudos for that creativity

devout thorn
#

a frame for me

quartz kindle
#

zalgo xD

devout thorn
opal plank
#

i knew about that bug for quite a few months,m never once occured me to use it for something like that

devout thorn
#

erwin

#

erwin didnt die

#

his soul just left his body

zenith terrace
#

@opal plank loli gets pat

#

pat

spark oracle
#

could someone help me?

green kestrel
#

hmm. interesting. send a message of exactly 2000 characters and clyde blocks it.

zenith terrace
#

oof

green kestrel
#

oh and... i dunno why, hatebin and hastebin are giving me error 500 atm 😦

zenith terrace
#

hastebin never saves anything for me

green kestrel
#

yeah

#

i usually use hatebin instead, but even thats erroring today

zenith terrace
#

make your own codebin KEKW

green kestrel
#

lol i could

#

but i got better things to do

zenith terrace
#

yea

restive furnace
old cliff
spark oracle
thorny hatch
#

what's the better language for Discord, Python, Java or JavaScript?

spark oracle
thorny hatch
#

For most things probably

dusky sundial
#

Depends on which one you're good at, I'd pick the one you feel more comfortable with

misty sigil
#

they're all similar ^^

thorny hatch
#

I'm in the process of learning JavaScript so I was wondering if I should port my bot over from Python

misty sigil
#

you can if you want

spark oracle
tired panther
thorny hatch
#

Isn't the performance better or something?

dusky sundial
#

The performance difference is barely noticable unless you're doing huge operations

thorny hatch
#

Discord themselves recommend Python so I'm gonna stick with that for now.

tired panther
thorny hatch
thorny hatch
#

It's really really annoying and hard to write

opal plank
#

its in typescript, since you use python you might already be familiarized with types and typeguarding

opal plank
#

let me get the info for you

opal plank
#

i should make a proper introduction to detritus and what it has to offer over d.js, but in almot every sense its better than d.js

thorny hatch
#

wow thats much easier by the look of it

opal plank
#

most stuff is handled in the lib, so you dont have to write unecessary code for command handling, caching, etc

#

not only easier, its a lot better too

#

d.js doesnt have custom caching

#

which made Tim write d.js-light, which enables custom caching behaviour

thorny hatch
#

looks a little like d.py

opal plank
#

detritus has that out of the gate too

#

custom caching, custom command loading, reloading, custom prefixes, command handling, everything

earnest phoenix
#

hey i need some opinion ,is this to much color?

opal plank
#

those 2 pics are ONLY the options given to you on the command options

#

you have more options on the handler as well

#

its all optional

#

so you cherry pick whichever feature you want

limber meadow
tired panther
#

lol

opal plank
# thorny hatch looks a little like d.py

for typescript, check this
https://www.youtube.com/watch?v=ahCwqrYpIuM first minute of this
https://www.youtube.com/watch?v=zQnBQ4tB3ZA and this

if that interests you, watch the rest of the first video, its about 13m long, but it gives a nice introduction about typescript
typescript is basically javascript, but type guarded, so you catch bugs beforehand

TypeScript has forever altered the lives of JavaScript developers. Learn why TS is so awesome and the basic concepts required to be successful using it https://angularfirebase.com/typescript-the-basics/

Deep Dive https://github.com/basarat/typescript-book
TypeScript Docs https://www.typescriptlang.org/

▶ Play video

Learn the basics if TypeScript in 100 Seconds! If you love TS, upgrade to Fireship PRO for 40% off using code mbus5Kcj at https://fireship.io/pro

TypeScript docs https://www.typescriptlang.org/

#typescript #js #100SecondsOfCode

Install the quiz app 🤓

iOS https://itunes.apple.com/us/app/fireship/id1462592372?mt=8
Android https://play.google.c...

▶ Play video
spark oracle
#

is there someone who could help me in repl.it?

thorny hatch
willow mirage
#

does Collection is lighter then Map? what should i use for things that change every second?

opal plank
#

they should perform similarly, though collections has some extra stuff, memory wise using a raw map would be more efficient

river panther
opal plank
#

typescript IS javascript

opal plank
opal plank
earnest phoenix
#

Let me get the copy paste

#

╔⪢👋-welcome

#

That’s mine

opal plank
#

that one i know, i sent before

spark oracle
#

Does someone here know how i can update to the latest node js version in REPL.IT

opal plank
#

i mean the other ones

#
{
"code": "9tRzVFvaSg",
"guild": {
"id": "808323095098163220",
"name": "The Suite",
"splash": "85801f84f1ae3c24208dc4e2f2893f39",
"banner": null,
"description": null,
"icon": "a_feb92dbc6876e42f5ee336804e9501f8",
"features": [
"ANIMATED_ICON",
"WELCOME_SCREEN_ENABLED",
"NEWS",
"INVITE_SPLASH",
"COMMUNITY",
"MEMBER_VERIFICATION_GATE_ENABLED",
"PREVIEW_ENABLED"
],
"verification_level": 2,
"vanity_url_code": null,
"welcome_screen": {
"description": "The Suite, server made to relax in, make new friends, game with others and have a lot of fun together and strive to ensure that you have fun",
"welcome_channels": [
{
"channel_id": "808326394044088371",
"description": "Here you can assign yourself roles!",
"emoji_id": null,
"emoji_name": "⭐"
},
{
"channel_id": "808726809813450782",
"description": "Here is all the information you need!",
"emoji_id": null,
"emoji_name": "💎"
},
{
"channel_id": "808323098100760618",
"description": "Here you can socialize with others!",
"emoji_id": null,
"emoji_name": "🗣️"
},
{
"channel_id": "808388730242072606",
"description": "Participate in fun events!",
"emoji_id": null,
"emoji_name": "🎮"
},
{
"channel_id": "808728155518664715",
"description": "Here you can introduce yourself!",
"emoji_id": null,
"emoji_name": "🥺"
}
]
}
},
"channel": {
"id": "811298317836877834",
"name": "╔⪢👋-welcome",
"type": 0
},
"inviter": {
"id": "364071634816204812",
"username": "Oncologist",
"avatar": "67a12c2cfde48ca5fb3ab1948231fac9",
"discriminator": "4536",
"public_flags": 256
},
"approximate_member_count": 226,
"approximate_presence_count": 64
}```
#

@earnest phoenix this is your invite data

#

notice how welcome_channels do not provide name

#

thats what im puzzled by

earnest phoenix
#

uh

#

that isn’t my code though?

opal plank
#

its discord API data

#

not urs

#

thats the data of ur invite

#
{
"code": "dbl",
"guild": {
"id": "264445053596991498",
"name": "Top.gg",
"splash": "0eaa94d4bfc74af03cdacd3155435afd",
"banner": "fda62f17d6fa9e057674d9ade7f2034d",
"description": "Spice up your Discord experience with our diverse range of Discord bots and servers",
"icon": "a_a8aec6ad1a286d0cfeae8845886dfe2a",
"features": [
"WELCOME_SCREEN_ENABLED",
"DISCOVERABLE",
"COMMERCE",
"PREVIEW_ENABLED",
"BANNER",
"COMMUNITY",
"INVITE_SPLASH",
"ANIMATED_ICON",
"NEWS",
"ENABLED_DISCOVERABLE_BEFORE",
"VANITY_URL"
],
"verification_level": 4,
"vanity_url_code": "dbl",
"welcome_screen": {
"description": "Spice up your Discord experience with our diverse range of Discord bots",
"welcome_channels": [
{
"channel_id": "280067058417401856",
"description": "Read the rules",
"emoji_id": null,
"emoji_name": "📜"
},
{
"channel_id": "502193464054644737",
"description": "Check out the frequently asked questions",
"emoji_id": null,
"emoji_name": "❓"
},
{
"channel_id": "769566680807899156",
"description": "Get up to date information",
"emoji_id": null,
"emoji_name": "🔔"
},
{
"channel_id": "714045415707770900",
"description": "Ask for support here if faq didn't help",
"emoji_id": null,
"emoji_name": "❔"
},
{
"channel_id": "264445053596991498",
"description": "Chat with the community",
"emoji_id": null,
"emoji_name": "💬"
}
]
}
},
"channel": {
"id": "280067058417401856",
"name": "rules-and-info",
"type": 0
},
"approximate_member_count": 140952,
"approximate_presence_count": 28576
}```
this is from here for example
#

OH

earnest phoenix
#

so uhm

#

I’m confuzzled

#

Xd

opal plank
#

i think thats the screening data

#

wait no

#

i think it might

#

let me check mine

earnest phoenix
opal plank
#
{
"code": "6QEExsN",
"guild": {
"id": "628731905423966219",
"name": "GenshinUtils Support",
"splash": null,
"banner": null,
"description": null,
"icon": "700027dd8b870fd8da5f25c3612bdfea",
"features": [
"PREVIEW_ENABLED",
"NEWS",
"MEMBER_VERIFICATION_GATE_ENABLED",
"WELCOME_SCREEN_ENABLED",
"COMMUNITY"
],
"verification_level": 2,
"vanity_url_code": null,
"welcome_screen": {
"description": "GenshinUtils/Leviathan Bot support server",
"welcome_channels": [
{
"channel_id": "693222035303956591",
"description": "Please read the rules",
"emoji_id": null,
"emoji_name": null
},
{
"channel_id": "782788611107586059",
"description": "News from genshin",
"emoji_id": null,
"emoji_name": null
},
{
"channel_id": "628731905944322080",
"description": "Chat away",
"emoji_id": null,
"emoji_name": null
},
{
"channel_id": "729083536430333983",
"description": "Latest updates regarding GenshinUtils",
"emoji_id": null,
"emoji_name": null
}
]
}
},
"channel": {
"id": "693222173246095401",
"name": "joined-left",
"type": 0
},
"inviter": {
"id": "188836645670223872",
"username": "Not Erwin",
"avatar": "a_24b8564dfcb2b0e4b7e2fb953c5b9454",
"discriminator": "8753",
"public_flags": 128
},
"approximate_member_count": 712,
"approximate_presence_count": 230
}```
yeah thats screening data
#

interesting

#

well i guess it makes sense

earnest phoenix
#

i’m confused

#

Do I need that code or

opal plank
earnest phoenix
opal plank
#

its screening data

#

i didnt know it was under welcome_channels

#

the name is a bit confusing

earnest phoenix
#

a bit confusing

opal plank
#

ignore it then

earnest phoenix
#

xd

opal plank
#

its API data

earnest phoenix
#

So uu

#

That code shows that

opal plank
#

im getting all that with this

#

9tRzVFvaSg

#

which is ur invite code in ur status

#

the other ones i used is dbl

#

and mine 6QEExsN

#

im querying the discord api with the invite data

#

but i was puzzled that it only shows the channel ids and not their name

#

because in the screening data it shows the name

#

so i was confusing as to why it didnt show there

earnest phoenix
#

o

#

So u got that data from the invite code

earnest phoenix
#

And u were confuzzled because it didn’t show the channel name

#

oo

opal plank
earnest phoenix
#

@opal plank but

#

The first code u showed me or api data

#

Is not right

river panther
opal plank
#

which?

earnest phoenix
#

Wrong emoji’s at the channels

opal plank
#

thats the same, using /invites/ endpoint

#

its not