#development

1 messages · Page 1488 of 1

quartz kindle
#

yes im just confused about the automation

#

because like in C you need to define which files you want to compile in the compiler
in js you need to explicitly import/require the files you want

#

nothing is automatic

regal creek
#

alright great.

earnest phoenix
#

Ay yo guys why is my bot not online?

regal creek
#

or in general?

earnest phoenix
#

General

regal creek
#

alright

quartz kindle
#

nice token

earnest phoenix
#

logen and you leaked your token

quartz kindle
#

brb let me hack your bot

earnest phoenix
#

NO DUDE @quartz kindle

regal creek
#

lets delete that image should we?

quartz kindle
#

:^)

earnest phoenix
#

My bad..

tame kestrel
earnest phoenix
#

I’m so dumb

regal creek
earnest phoenix
#

Alr did it I’m so fucking dumb I’m such a idiot

#

make an OCR selfbot that'll bomb every token it detects

regal creek
#

Alright

#

send the image again

earnest phoenix
#

Why am I so dumb I’m an idiot

regal creek
#

if you regen your token then you can send the image

quiet topaz
#

and how do i initialize it?

earnest phoenix
#

Damn I’m shaking @regal creek are you sure it will not do anything?

#

idfk it's your code

earnest phoenix
#

Damn I’m still so dumb

quartz kindle
#

so yes, you're safe

earnest phoenix
#

I found out it was Logen that was wrong lol

#

@quartz kindle lol you tried to hack me >:(.

quartz kindle
#

i was just scaring you

earnest phoenix
#

I know you were joking dw

earnest phoenix
# earnest phoenix idfk it's your code

adding: you told your code "hey, this exists" and nothing else, you didn't tell it what value it has or anything, you just told it that it exists, so it takes a null value by default, because you didn't tell it otherwise

quiet topaz
earnest phoenix
#

@quartz kindle @regal creek lol sorry I’m new to coding @earnest phoenix

earnest phoenix
quiet topaz
earnest phoenix
gilded olive
#

@earnest phoenix look in dms

quiet topaz
#

but why is it or how is it pointing, when i am jut initializing it in the code line ,where the error is

#

ok so now i dont get an error, but the window doesnt apear too

earnest phoenix
#

but why is it or how is it pointing
everything is explained in that SO thread, which if you have bothered to read, you wouldn't be asking this
when i am jut initializing it in the code line ,where the error is
except you aren't initializing anything, you just told it that it exists, it exists period, you didn't give it a value

#

imagine having a chill conversation with a person and you mention you have an orange, the person asks you if they can have that orange and you say "i don't have it on me right now"

#

null means it doesn't have a value, it isn't a valid state

#

hence... null

#

Why does it show error?

craggy pine
#

I like that orange example KEKW

earnest phoenix
#

you're using apple quotes

#

Why is it showing error?

#

you're using apple quotes

#

Yes??

#

you're using apple quotes

quiet topaz
#

use normal quotes

#

"

earnest phoenix
#

Oh yeah my bad

#

LOL

#

@quiet topaz what did you delete?

quiet topaz
#

just saying that this " is a normal quote, but i sended that same message already

earnest phoenix
#

Huh why showing error?

#

what error

inner roost
#

py?

earnest phoenix
#

i regret to inform you but it's not cyberpunk nor 2077 yet, we cannot peek into other people's eyes

inner roost
#

@earnest phoenix It is python?

earnest phoenix
#

It’s just showing error it’s uh glitchy @inner roost

inner roost
#

but like is js, py or wot?

earnest phoenix
#

Ohh

#

Js @inner roost

#

Uh wtf

#

It just is not working..

#

I stopped by earlier and was told to do a personalized event. in short, I want the emission bot in the event again if the user is not found in the database, and with it already registered, execute the command

#

could someone tell me if this will work?

#

I am using eris

craggy pine
#

Test it and see if it does mexShrug (I'm not familiar with eris)

umbral zealot
#

If you want to know if it works, try it ^_^

inner roost
#

i only know py :(

earnest phoenix
#

@inner roost it’s okay lol

#

I’m new to coding too :)!

inner roost
#

:>

earnest phoenix
#

WHY DOES IT KEEP SAYING ERROR?

#

WTF

inner roost
#

||Why use glitch when repl.it exists ¿ lol||

umbral zealot
earnest phoenix
umbral zealot
#

alternatively, register it globally and figure out how to give it the information it needs to run outside of that command.

umbral zealot
# earnest phoenix

Because you're not closeing anything. I don't see any of your } or }) anywhere.

earnest phoenix
#

Wdym?

#

Can you uh circle them?

umbral zealot
#

I mean you have to close every { with a }

earnest phoenix
#

Understood, I will make a handler just to start the custom events

umbral zealot
#

syntax in javascript needs both opening and closing.

#

You should probably learn javascript before making bots, to be honest.

craggy pine
#

^

umbral zealot
umbral zealot
#

I can't

earnest phoenix
#

ok

umbral zealot
#

because they're not there.

earnest phoenix
#

Wdym?

umbral zealot
sudden geyser
#

You need to help yourself before we can help you.

kind kayak
#

How make handler for 3 carpet commands

umbral zealot
#

3... carpets?

kind kayak
#

I have 3 directory of commands how make handler

umbral zealot
#

good example code for it.

kind kayak
#

I have an folder commands in the 3 subfolders i need a handler

umbral zealot
#

Yes. Look at the code I linked.

kind kayak
#

Ok

dense nest
#
@client.event
async def on_member_join(member):
  role = discord.utils.get(guild.roles, name = "Guest")
  await member.add_roles(role)
#

Wont work

#

No errors

#

Im confused

sudden geyser
#

where are you getting guild from

#

and do you have member intents enabled

dense nest
#

I dont have member intents enabled

sudden geyser
#

you need them

dense nest
#

Ok

#

Alright added member intents

#

Why isint it erroring though

#

...

earnest phoenix
#

because it's not really an error

dense nest
#

Still wont work

earnest phoenix
#

For glitchy

earnest phoenix
surreal sage
#

How to do put ```'s inside of a ``` bracket with ending without making it break the markdown?

crimson vapor
#

its weird

#

you add \

#

\\\\`

#

idk how to show

surreal sage
#

Did not work.

crimson vapor
#
\```
#

hmm

surreal sage
#

That appears as ```
```

#

no

earnest phoenix
#

Why not? @surreal sage

surreal sage
#

read pins maybe

earnest phoenix
#

My bad

#

I'm using .net (nodejs) as a server, problem is i cant send data to client manually, is there any way i can see each client

#

or send message to selected client

earnest phoenix
#

Why is this command not working and saying error?

#

@surreal sage

#

Ya know maybe?

crimson vapor
#

member.kick()

#

not member.kicked()

earnest phoenix
#

Thanks!

#

Lol

#

@crimson vapor huh?

crimson vapor
#

Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:

  • proper syntax
  • debuging code
  • basic features (vars, arrays, objects, functions)
  • read and understand docs
  • nodejs module system

As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.

Here are good resources to learn both Javascript and NodeJS:

Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/

Please take a couple of weeks/months to get acquainted with the language before trying to make bots!

earnest phoenix
#

Oh cmon not that

#

I just need help

inner roost
#

why dont use python 😳

crimson vapor
earnest phoenix
crimson vapor
#

.()

#

member.kick()

earnest phoenix
#

member.kick()then

#

?

crimson vapor
#

smh

inner roost
#

why put .() HC_VibeCat

#

lol

crimson vapor
#

member.kick().then()

inner roost
#

@subtle hedge HC_SeriousSadCat 😱 GooseDance

earnest phoenix
inner roost
crimson vapor
#

(.)(.)

earnest phoenix
#

Alr thanks

#

Wtf

inner roost
#

@subtle hedge wat

subtle hedge
#

spam

earnest phoenix
#

WHYWG ERROR

inner roost
#

Where

earnest phoenix
#

It’s saying error..

#

you should try not coding on a tablet

inner roost
#

Like where

earnest phoenix
#

@earnest phoenix if I had a pc then sure but it’s iOS LMFAO

inner roost
earnest phoenix
#

40wpm pain

inner roost
#

lol

earnest phoenix
#

@earnest phoenix what’s the problem you see?

#

i'm not a machine

inner roost
quartz kindle
#

this is definitely wrong

#

but just saying ERROR doesnt help

#

you have to show the actual error you got

#

all of it

#

also, idk what you have before line 7 and after line 41

#

there could be more issues there

uncut swallow
#

xd

inner roost
#

Sanwich

crimson vapor
#

its outside of the event

#

llol

inner roost
#

😱

earnest phoenix
#

Help please

#

@quartz kindle yo

undone rose
#

Can somebody help me figure out what's wrong with this file? https://github.com/TannerReynolds/Techies-Top.gg-Bot/blob/main/src/bot/commands/leaderboard.js

It won't log anything under this loop

for(let i = 0; i < sortedVotes.length; i++) {
            if(sortedVotes[i].id === msg.author.id) return authorPlace = i + 1;
        }
        console.log(sortedVotes.length)

Trying to make a leaderboard. This is the output from running the cmd

https://cdn.tanners.space/Afwv

crimson vapor
#

wait

#

you're tanner reynolds?

undone rose
#

yah

crimson vapor
#

poggers

earnest phoenix
#

@crimson vapor ay yo can ya help?

undone rose
#

u use the shareX thing?

earnest phoenix
#

It’s still saying error..

crimson vapor
earnest phoenix
#

How?

#

@crimson vapor

crimson vapor
undone rose
#

Ah dope, yah I haven't updated that in forever

#

Long list of stuff for next update

crimson vapor
#

lol

#

I saw

earnest phoenix
#

@crimson vapor so which one do I choose?

crimson vapor
#

what DB are you using?

quartz kindle
#

@earnest phoenix did you read anything of what i said?

earnest phoenix
#

Well a bit little got a bit confused @quartz kindle

quartz kindle
#

your code has a lot of problems, just delete most of it and stick with the basics

earnest phoenix
#

First I read introduction then manual thingy and then code editors etc?

quartz kindle
#

and note what i said about errors

earnest phoenix
#

Hm what was it I can’t remember I’ll write it down this time

quartz kindle
#

you are complaining about errors but you never say what error is it

#

you need to show the exact errors you have

earnest phoenix
#

I am confused too I have no idea what the errors is

quartz kindle
#

otherwise its a guessing game for most of us

earnest phoenix
#

Like look at it

quartz kindle
#

it says what the error is

earnest phoenix
#

I don’t see anything wrong

quartz kindle
#

click on tools

earnest phoenix
#

Alr

quartz kindle
#

theres more to it

#

scroll up

earnest phoenix
#

Almost saying the same things

jade juniper
#

Do you think I should change from BDFD to DBD?

quartz kindle
#

the most important part of the error is the beginning, the first couple lines

earnest phoenix
jade juniper
#

BDB*?

subtle hedge
#

spam

#

spam

#

spam

inner roost
subtle hedge
#

spam

#

spam

jade juniper
#

pls stop

subtle hedge
#

spam

earnest phoenix
subtle hedge
#

spam

#

spam

earnest phoenix
#

@quartz kindle

quartz kindle
#

are you not reading my messages?

earnest phoenix
#

I did scroll up...

quartz kindle
#

the beginning of the error is the most important

#

you are not showing it

earnest phoenix
#

I mean of the coding?

tulip wave
crimson vapor
#

@undone rose cam you return inside of a for loop?

#

can*

quartz kindle
#

@earnest phoenix scroll up the error log, there should be one line that does not start with "At.."

tulip wave
#

@earnest phoenix he means the start of the error in the logs

undone rose
#

Hmmmm

#

Maybe ur right

#

Its the only thing i can see

crimson vapor
#

im thinking its just returning the entire function, not sending the message or anything

undone rose
#

That could do that with no error log or anything

crimson vapor
#

yeah im thinking thats the issue

earnest phoenix
#

@quartz kindle syntax error?

quartz kindle
#

yes

crimson vapor
#

im sure its a message is not defined tbh

#

watch

quartz kindle
#

thats the part of the error that actually tells you whats wrong with your code

#

thats what you should look for whenever you have an error

earnest phoenix
#

It’s dosnt really say anything.

quartz kindle
#

and thats also what you have to show people when asking for help

crimson vapor
#

what does it say lol

earnest phoenix
#

Unexpected end of input @quartz kindle

crimson vapor
#

what line?

quartz kindle
#

that means your code has incorrect brackets

#

most likely missing closures

crimson vapor
#

no wonder

quartz kindle
#

opened { or ( that you never closed with a ) or }

crimson vapor
#

never closed

quartz kindle
#

thats why i said, delete most of your code and start over

earnest phoenix
#

Oh... I see it now

#

Aww man @quartz kindle that will be pain

crimson vapor
#

not really

#

thats like 20 lines

earnest phoenix
#

Do you guys know a place where I can get some like codes for kick commands, ban command etc....

quartz kindle
#

you are coding blindly without understanding what your code does, so it will be very hard for you to try to fix errors like that

#

thats why im suggesting you to go slowly

earnest phoenix
#

Yea, I’m just watching YouTube tutorials for codes @quartz kindle

crimson vapor
#

the issue is that everyone codes differently

earnest phoenix
#

But none of them seem to work

quartz kindle
#

because code is not copy-pastable

crimson vapor
#

so things from other people won't work

quartz kindle
#

code is like a puzzle

earnest phoenix
#

How do I make my own coding?

quartz kindle
#

for a piece of code to work, all other pieces need to fit

earnest phoenix
#

I’m very new to coding that’s why I might be a bit yea....

quartz kindle
#

if you copy paste code from the internet it will likely never work, because it was made to fit with other pieces you dont have

#

thats why you have to learn to understand what the code is actually doing, once you know, you can easily change the code to fit yours

earnest phoenix
#

But I don’t really know how he pieces work

tulip wave
#

If you wanna learn w3schools is a great way to learn basics

earnest phoenix
#

@tulip wave website?

#

Or online classes kinda

quartz kindle
#

you can try stuff like codecademy

earnest phoenix
#

Are those websites?

tulip wave
quartz kindle
#

yes

earnest phoenix
#

Thanks guys you guys are very supportive! @quartz kindle @tulip wave @crimson vapor

crimson vapor
#

@undone rose is it working now?

earnest phoenix
#

@tulip wave confused again I’m at the uh coding place but I don’t know what to write

tulip wave
#

@earnest phoenix just read through it. It has all the basic functions that JavaScript can do (yes it is web based js but most of it can be used in nodejs)

quartz kindle
#

its like learning a new language, its a process that takes some time

earnest phoenix
#

The uh website is very very very very confusing

gilded olive
#

w3schools?????

earnest phoenix
#

Ye

gilded olive
earnest phoenix
gilded olive
#

IMO (and probably other people) w3schools is easy to understand

tulip wave
#

There's a sidebar that shows you different topics

gilded olive
#

Whats confusing about it?

quartz kindle
crimson vapor
#

probbaly too fast tbh

earnest phoenix
#

Lemme try @quartz kindle

terse finch
#

discord.py for the @command.has_permissions() decorator, is there a way to say has_permission() OR has_any_role() in the decorator?

terse finch
#

yeah but does the command decorator allow me to say if @command.has_permissions() or @commands.has_any_role() then run the command?

opal plank
gilded olive
#

you'll have to use an if statement then

terse finch
#

inside the command?

gilded olive
#

Yea

#

Python has an or keyword

terse finch
#

rip the easy way out...

#

yeah i know

#

but i was hoping i could do it in the decorator to make it easy

gilded olive
#

xD

terse finch
#

rip easy way

#

thanks

gilded olive
#

Just 1 if statement

quartz kindle
terse finch
#

yeah but now i gotta reformat it and ugh

gilded olive
#

It's fineeee

terse finch
#

its FINEEEEE

opal plank
terse finch
#

THIS... This is fine

gilded olive
quartz kindle
#

ye evie's stuff is good

opal plank
#

@umbral zealot we expect the ads payment by the 2nd of january btw

tight heath
#

i need java.evie.dev

quartz kindle
#

lmao

quartz kindle
tight heath
#

im already in go land

#

js is just a pal now

#

but i need the javas

quartz kindle
#

ravy no longer friends with js. go new best friend

tight heath
#

im still frien with js

#

it's like this

#

I was born in Germany but I primarily speak English

#

because my job demands that

boreal iron
#

Sometimes relationships are ending, Tim.. the world is brutal okeh

tight heath
#

but if I want to speak German I can and way better than English

earnest phoenix
#

Anyone know how I make a list

tight heath
#

same with js

earnest phoenix
#

Like

tight heath
#

im like

#

mother tongue fluent in js

earnest phoenix
#

Help

Die

Suffer

Nerd

Bruh

tight heath
#

but i dont need it rn

tight heath
quartz kindle
#

my native birthlanguage is my third language, and way worse than the first two languages lmao

earnest phoenix
#

every time I try to make a list it dosnt work

tight heath
#

or how to add newlines

earnest phoenix
#

@tight heath new lines

tight heath
#

\n

#

is the newline character

earnest phoenix
#

So

tight heath
#

put that into the string to make a newline

#

so

earnest phoenix
#

Alr thanks

tight heath
#

Line1

Line2

#

is

#

Line1\n\nLine2

quartz kindle
#

ich must habe ein grosser wurst

boreal iron
#

lmao

earnest phoenix
#

@tight heath so thus?

boreal iron
#

Probably makes ur girlfriend happy, us not

drifting wedge
#

how can i get flask to send/update a variable on html with js without reloading the page

quartz kindle
drifting wedge
#

like for example

#

a vanity url

#

if vanity url is taken

#

it responds with ano

#

if its not taken

boreal iron
drifting wedge
#

it responds with yes

#

and then itll show a worked or not worked message

earnest phoenix
quartz kindle
earnest phoenix
#

Uh

quartz kindle
#

you just add the new line character, like ravy showed

#

but keep the code in the same line

undone rose
#

Idk why it aint working smh

earnest phoenix
#

But what if it fills up? @quartz kindle

#

I want it like this

quartz kindle
#

the code editor should automatically break likes that are too long

#

if not, an alternative is to use template strings

earnest phoenix
#

Ban bans a user

Kick kicked a user

Lol loled the user

Noob noises the user

tight heath
#

what even is that code editor

quartz kindle
#

glitch probably

earnest phoenix
#

Glitchy what should I use? @tight heath

tight heath
#

oh no it hurts me physically

boreal iron
#

The output will be parsed like that, not the code

earnest phoenix
#

How lo?

quartz kindle
#

anyway, you can use template strings instead of quotes

#

for example

#
"abc\nxyz"

`abc
xyz`
#

notice the different quotes

drifting wedge
#

how can i get flask to send/update a variable on html with js without reloading the page like for example
a vanity url
if vanity url is taken
it responds with a no
if its not taken
it responds with yes
and then itll show a worked or not worked message

tight heath
#

also

earnest phoenix
#

Yes @quartz kindle

tight heath
#

node v14 be like

earnest phoenix
#

@tight heath what should I use instead glitchy#

quartz kindle
#

node 15 is bae tho

tight heath
#

please dont ping me

earnest phoenix
#

Sorry my bad

tight heath
sudden geyser
#

how about catch and default to null then do the optional null

quartz kindle
#

im still using v12 in prod lul

earnest phoenix
#

Lol

quartz kindle
#

but im gonna change to 14 soon

tight heath
quartz kindle
#

but i updated a few of my benchmarks from node 12 to node 15

#

and had a performance increase of 250% on some cases

#

especially zlib

tight heath
#

i should probably use two docker containers

#

for building and running

#

to save space

#

but I have no clue which deps are build and which are runtime

#

especially for canvas

quartz kindle
#

isnt runtime code all self-contained in node_modules/module/build?

#

after its built

drifting wedge
#

how can i get flask to send/update a variable on html with js without reloading the page like for example
a vanity url
if vanity url is taken
it responds with a no
if its not taken
it responds with yes
and then itll show a worked or not worked message @placid iron from earlier

quartz kindle
#

use XMLHttpRequest or fetch from client side js

earnest phoenix
#

@quartz kindle just does this

quartz kindle
#

show code

placid iron
#

@quartz kindle I've tried saying that multiple times with flazepe OmegaKEKW

earnest phoenix
quartz kindle
earnest phoenix
#

wtf

#

LOL

#

Can ya show a example?

#

I’ve tried lines but they don’t seem to work

quartz kindle
#

ban\n> bans someone\n\nkick\nkicks some one

crimson vapor
placid iron
#

Something like that but actually correct code

quartz kindle
#

why patch method?

placid iron
#

Uh, it was for a modules thing so he wants to patch the data in the database I assume

quartz kindle
#

i understood he only wanted to check if something is available or not

placid iron
#

Dude keeps changing what he wants 😩

#

Okay

quartz kindle
#

xD

#

it doesnt matter much tho

#

i personally just use post for everything

placid iron
#

Yeah, on my bots dashboard I use post for everything but I'm trying to get into the habit of using the correct methods

quartz kindle
#

ye

#

my issue is that i have an API with very long and complex GET requests

#

so i cant use GET because it risks running out of length

#

so im forced to use POST

placid iron
#

There is a max length for URLs?

quartz kindle
#

ye

#

depends on browser and http client

#

and also depends on servers

earnest phoenix
#

@quartz kindle ayyyy thanks man!

placid iron
#

ah

#

interesting

quartz kindle
#

first answer has lots of interesting data

placid iron
#

query strings kinda stinky

#

json payloads are nicer

earnest phoenix
#

@quartz kindle how do I make spaces lol?

quartz kindle
#

ye

earnest phoenix
quartz kindle
#

with... spaces?

#

lol

earnest phoenix
#

Yes lol

quartz kindle
#

you make spaces with spaces

earnest phoenix
#

Uh I did that..

quartz kindle
#

you want more spaces? or what

placid iron
# drifting wedge how can i get flask to send/update a variable on html with js without reloading ...

on the website you are going to have a form i assume with a submit button and a text input for the vanity url. when the submit button is clicked you can run a js function, that function will send a get reqeuest (or any type you want) to your server. something like domain/check_vanity_url?url=:user_input and your server will then check if it is available. if it is then the server will respond with a status code of 200 or 503 (unavailable) this will be in the response from the fetch function in the website. the website can then check the status and change a dom element to indicate that

drifting wedge
#

mhm, how would it send the request? like it would redirect the user there? then it redirects the user back?

placid iron
#

you know python has teh requests module

#

javascript has bascially the same thing but it is called fetch

inner roost
placid iron
#

@drifting wedge

gilded olive
#

aiohttp > requests

sudden geyser
#

requests easy 😎

quartz kindle
#

isnt requests blocking?

placid iron
#

yes

#

its just a comparison because you use them both in the same way

inner roost
gilded olive
gilded olive
jade juniper
#

guys I use a cell phone and I don't know how and where to program my bot with DBD help me pls :(

wintry stream
#

what is dbd @jade juniper

jade juniper
#

mmm dbd.js?

#

I don't even know that, I'm a failure

wintry stream
#

why don't you give up

jade juniper
#

is a page?

earnest phoenix
#

online ide

earnest phoenix
#

I programmed my Reaper bot solely on repl.it

#

700 lines of python code later...

drifting wedge
#

gimme a min ig

placid iron
#

bruh

#

you have had like 109823 hours

topaz epoch
#

Server count with?

jade juniper
#

it's a good option danbot?

drifting wedge
#

how do i make a form submit button not reload the page?

#

@placid iron should i have the js get the inputs and send the request, or should i use flask to get inpit

#

input* then validate

#

then send back

placid iron
#

Google it

drifting wedge
#

alr ig

placid iron
#
  1. How do you think flask can even get the input.
drifting wedge
#

uhh it works lmao

#

u want me to send u?

placid iron
#

Not really

drifting wedge
#

alr

#

well i got it working, it gets the input with no js

#

but like should it go to a js func, js func do fetch on url to get a response

placid iron
#

Query strings from the form ig

drifting wedge
#

and then depending on response, do it

placid iron
#

If it works why change it

drifting wedge
#

well cuz i need to show a thing or another thing depending on validation

#

like if its valid i want it to say: worked for example

placid iron
#

Yeah you got to write js for that

drifting wedge
#

and if not: say: didnt work

#

mhm

#

so id get all the awnsers from the form, and send it with js with a fetch from the "mini api"

#

and the output is what it shows?

#

cant i keep doing the way i do, but then adding something for js>

placid iron
#

Idk how you are doing it but do what you just told me

drifting wedge
#

alr

#

ty btw

#

really helped

placid iron
#

Yeah basically what you have to realise is that the website is basically independent to the server once you sent the other and you communicate data through web requests (a mini API as you call it)

drifting wedge
#

how can i get if a checkbox is checked in js?

placid iron
#

Element.checked

drifting wedge
#

get element by id .checked?

#

returns a bool?

terse finch
#

so im getting an error of Member <ID> not found when referencing a user that has been banned from a server. Im fetching the user info via await bot.fetch_user(member.id) is there a better method for fetching user information by id?

drifting wedge
#

i dont think so

#

if user isnt in any servers the bot is in

#

itll give that error

terse finch
#

is there a way to grab the user even if they dont share a server?

#

thats gonna be a huge bummer

#

Circle Bot does this somehow

drifting wedge
#

uhh i dont think so

#

what data do you want?

hasty moat
#

Yes

#

If its in the cache

#

Or you have their Id

#

You can also retrieve users from the banned ones list on a guild which seems like what you want to do, correct?

odd stratus
#

(crashes the bot)

hasty moat
#

I don't understand much just by looking at that, but I guess there's an error presumably at line 291

atomic vault
#

can we count how much message has user send in js?

odd stratus
#

It's some sort of ffmpeg error

hasty moat
#

Ah

odd stratus
#

So not something I coded

odd stratus
odd stratus
#

👍

atomic vault
gilded olive
umbral zealot
#

You can connect to another server though

#

but repl doesn't run server apps

gilded olive
terse finch
terse finch
gilded olive
umbral zealot
#

you can actually get a significant amount of useful information with a user fetch by ID.

terse finch
umbral zealot
#

Ignore the last 2 those are added by discord.js I think.

terse finch
#

well i was doing bot.fetch_user(ID)

umbral zealot
#

different language, different syntax ¯_(ツ)_/¯

terse finch
#

yeah but in python if the user wasnt in a realted server it would error out

#

that looks like it works in ANY server which is ideal

umbral zealot
#

The API permits it, and I'm... fairly certain discord.py does it

#

though I don't write python so I wouldn't know

gilded olive
#

you only really need fetch_user if the user isnt in your cache

#

else get_user or get_member is fine lol

terse finch
#

im not caching the entire server (at least i dont think i am)

gilded olive
terse finch
#

i wouldnt have the users cached in this bot unless its cached on entry to the server

lucid owl
#

i wanted some code help

terse finch
#

mainly because I dont have the storage to cache 10,000 + users or the wherewithall to code it in any efficient manner

lucid owl
#

can anybody help?

umbral zealot
#

we can't help if you don't ask a question

terse finch
#

post question

lucid owl
#

ok

terse finch
#

then ask for help (:

lucid owl
#

i want a command code that triggers when a bot is invited to a server

umbral zealot
#

you want the GUILD_CREATE event, then.

lucid owl
#

will it work with js?

lucid owl
umbral zealot
#

yes

#

I'm telling you the event name

lucid owl
#

so

umbral zealot
#

how you implement it depends on the library you're using.

terse finch
lucid owl
umbral zealot
#

js is a language

lucid owl
#

i mean

umbral zealot
#

what library are you using

lucid owl
#

whats a library?

umbral zealot
lucid owl
#

plz eloborate i m new

#

elablorate*

#

elaborate*

umbral zealot
terse finch
# gilded olive That's a big server

so im passing in the id as a arg in my command. and based on previous help from you an others the member id arg is member : discord.Member so thats where its failing to find the user. any suggestions on ways around this? We used member : discord.Member cause i wanted either a ID, or Username+discriminator to be taken as an arg and this worked splendidly...

gilded olive
#

failing to find the user?

#

What error gets thrown at you?

terse finch
#

discord.ext.commands.errors.MemberNotFound: Member "652373046900031489" not found.

gilded olive
#

Which member is that?

terse finch
#

a banned member from our server

gilded olive
#

and you want too?

terse finch
#

log their information

#

essentially

#

but code wise just fetch their information

gilded olive
#

Log their information?

terse finch
#

yeah, ID, Username, Reason, Server, Moderator, Date

earnest phoenix
#

well if a member is banned, they're no longer a member

#

big brain

gilded olive
#

That may not be possible using discord.Member

#

you'd have to store that info in a database

terse finch
#

in 2 large servers that often share a userbase, so making a bot that has cross server ban logs essentially

#

well im storing the info i just need to get the info after they are banned

gilded olive
#

🤔

terse finch
#

its not the most important of shit atm but it be very useful to figure out

lucid owl
#

whats a library?

old cliff
#

oof

delicate shore
lucid owl
#

plz tell

#

i m new

#

i used to use botghost

delicate shore
#

Library is like

#

Wait

#

What's a library

#

Idk how to define it

terse finch
#

like circle has a !ban ID reason command. mine piggybacks off it and takes the info and stores it and then pings the other servers if that user joins (as a sort of watch out for this guy)

earnest phoenix
#

a library is a library

delicate shore
#

Yes

lucid owl
#

i have made a music bot but... need that guild_create command

terse finch
#

and cry is not being helpful

earnest phoenix
#

you're annoying

gilded olive
#

Trying to fetch a user that is banned

#

Would not work

#

afaik

delicate shore
lucid owl
#

event

delicate shore
#

You can get it using djs

#

then check the docs

earnest phoenix
# delicate shore Yes

the word is native to its meaning, doesn't have anything special in programming

it's quite literally a library

delicate shore
#
earnest phoenix
#

quoted the wrong message

#

oop

delicate shore
#

Lol

gilded olive
#

What you could do uh shin is store the persons id

#

And you could check if member.id == that user who's in the database

terse finch
# gilded olive Trying to fetch a user that is banned

again it pulls the information THE FIRST TIME correctly no problem. but if for some reason there was an issue (ie banned user but no reason and wanted a retcon) then it fails where others have succeded IE circle bot

earnest phoenix
#

how are you so shallow

#

the member is no longee in the guild

#

longer

terse finch
earnest phoenix
#

it does not exist

terse finch
earnest phoenix
#

other bots can get the username because they make a REST request to get the user on a global scale, not guild-bound

#

what do you not understand about if user go ban, user no longer in guild

terse finch
lucid owl
#

how do i make a command which triggers when a bot is invited to a server

terse finch
lucid owl
#

yup

#

i didnt understand it

umbral zealot
#

But you decided to ignore it I guess. ok.

#

You didn't understand "please take the time to learn the language you're using"?

gilded olive
#

Yea thats what you might have to do, find if the ID the user is trying to get is in the database

old cliff
lucid owl
#

can someone give me the code

terse finch
earnest phoenix
terse finch
umbral zealot
lucid owl
#

ok

umbral zealot
#

WE're not going to do your job for you as a bot developer.

#

Learn JavaScript first then make a bot.

earnest phoenix
#

all you have to do is take an id as a parameter and from there you can do whatever you want

old cliff
#

What code do you want ? we can guide you

terse finch
gilded olive
#

If I find a good way ill let you know

umbral zealot
#

Just getting the terms straight, here.

terse finch
earnest phoenix
#

might be too complex to understand

umbral zealot
#

WONTON CHAOS omg

old cliff
#

btw cry how did you grab a partial user without it being in the guild the other day ?

terse finch
earnest phoenix
#

i grabbed a user, not a member

#

i sent you the endpoint that can be used

gilded olive
#

Hold up ill do that rn shin

umbral zealot
#

I Cannot abide by wonton chaos. Wonton must be presented in a precise, defined manner.

#

I'm sorry, I'm feeling a little facetious 😂

earnest phoenix
terse finch
#

its a fun side project none the less and could actually be useful

gilded olive
#

I believe discord.py provides you with the discord.User object but.....I've never played around with it so if errors arise pepe pepe pepe

terse finch
#

ive been using discord.Member cause you suggested it

odd stratus
#

How can I figure out which file is causing this? Can't seem to figure it out

umbral zealot
sudden geyser
#

See if the stacktrace does point to a file in your project and not your node_modules folder

#

or go looking through your files to see if you make some api call for doing something with an emoji

odd stratus
sudden geyser
#

so nothing useful

odd stratus
#

Shows its from node_modules

umbral zealot
odd stratus
#

That error happens if it tries reacting to a message with an emoji it doesn't have access to right?

umbral zealot
#

What the heck else would that be?

terse finch
earnest phoenix
#

take an id as your parameter

umbral zealot
#

Ok and what, specifically, is missing from that user object?

gilded olive
#

that would error out

umbral zealot
#

I thought ctx.author was actually a member?

#

but you can't do that because the user isn't a member anymore

#

sounds like you got a Catch 22 going on.

gilded olive
#

Do this:

@bot.command()
async def foo(ctx, user: int) -> None:
      x = await bot.fetch_user(int(user))```
#

Mobile so indenting is fucked

terse finch
gilded olive
#

No problem

#

Just accept an int as an arg

terse finch
umbral zealot
#

I dunno it sounds like you may want to allow the use of passing an ID directly within a message.

#

¯_(ツ)_/¯

terse finch
#

yeah but to appease the overloads of the servers they want Mentions as well added in

gilded olive
#

🤔

umbral zealot
#

Well, then, do some conditional checks

terse finch
#

i originally had it as an ID int only

umbral zealot
#

if conditions are a thing in python, right?

terse finch
#

yeah

gilded olive
#

yea

umbral zealot
#

So, check if there's a mention and if the ID exists. If it does, fetch with that ID. If not, well, tell 'em you can't get that user?

terse finch
#

but discord.Member handles both ID, and Mentions as well as some other edge cases

thick wind
#

Hey does anybody know if you can put a function across all cogs? discord.py btw

umbral zealot
#

edge cases is why we have conditions in programming.

earnest phoenix
#

they wouldnt be able to mention them regardless, no? the member gets dropped from cache when banned, so no @ menu

terse finch
#

so utilizing that helps immensly

terse finch
#

which is why i think im gonna pass by id in a retcon command just to save myself the headache

thick wind
#

Ok so i have a function called sendMessage, which sends an embed. Is there anyway i can define it in my main bot.py and have it across all my cogs?

gilded olive
#

oh

terse finch
thick wind
#

ik you can with variables

terse finch
#

and thats what im gonna be doing

gilded olive
#

from .file import sendMessage

thick wind
#

just i dunno about functions

#

oooh

#

awesome

gilded olive
thick wind
#

ikr

#

me rn

gilded olive
#

I always use the uuid module for cases

#

And generate them

#

So You can view full details with them

thick wind
terse finch
#

right now its a csv file lmao but im setting up sqlite to store the infor

gilded olive
#

Say for example digital_tech

#

We had something like

- Folder
   - root
      - main.py
   - utils folder
     - messages.py (utils/messages.py)
        - sendMessage function```
In `main.py` now, we can do
```py
from utils.messages import sendMessage```
thick wind
#

ok

terse finch
gilded olive
#

It's basically an easy way to generate long random ids

#

Hold a sec

earnest phoenix
#

you could just have an incremental primary key when you migrate to sqlite, it's going to serve as an id

terse finch
terse finch
#

thats the plan for noww

gilded olive
pale vessel
#

Incrementing number sounds easier to type tbf

terse finch
#

yeah thats kinda what ares is gonna do.

gilded olive
#

Yea might switch to that

terse finch
#

i figured since all User ID's are unique those would be the primary key in sqlite

gilded olive
#

But my ORM has a UUID field so I was just like fuck it why not

pale vessel
#

Can't a same user have multiple cases?

thick wind
pale vessel
#

unless it's not a modlog thing, just something else

gilded olive
#

from cogs.your_file import sendMessage

terse finch
#

yeah we just append to the data field for the keu

terse finch
sudden geyser
#

Incremental numbers for case IDs is also easier for the user to type (especially on mobile)

#

but they're predictable

terse finch
#

we arent tracking cases tho

pale vessel
#

Mobile moderation 💪

thick wind
gilded olive
#

yes

sudden geyser
#

then UUIDs are probably fine for your case

terse finch
#

we are just tracking if a user gets banned and what reason for that ban

gilded olive
#

tho if its a function thats gonna be used every where, i would put it inside of like a utils folder

gilded olive
thick wind
#

Im sorry if im being dumb, im new to cogs and im trying to organize things

gilded olive
thick wind
#

yea

terse finch
#

cogs is great once you get past the intial learning hump

thick wind
#

yeah i bet

#

once i learn how to do this i should be set i think...

#

i have to go sadly, ill see about getting help tomorrow

gilded olive
#

Cya KomaAbigailWave

earnest phoenix
#

In .replit file
language = "go"
start = " "
What should I write in start?

sacred trout
#

hello

#
async def play(ctx):
    if not ctx.message.author.voice:
        await ctx.send("You are not connected to a voice channel")
        return
    
    else:
        channel = ctx.message.author.voice.channel

    await voice_channel.connect()```
#

can anyone help?

#

plox

#

@anyone?

#

breuyhfghfgjkhjlk;kl';

slender thistle
#

What's the problem

sacred trout
#

umm

#

not joining vc''

#

;-;

#

@tame kestrel hehe

#

oh fuc mod...

#

@slender thistle

delicate shore
#

I need to contact the server which has added my bot and has 1k+ members

#

How can I get the ID

#

of the server

sacred trout
#

umm

#

turn on dev mode

lost stone
#

Hii
anyone knows why when i try this it says 4 users?
${client.users.cache.size}

sacred trout
#

um

#

lang?

lost stone
#

d.js

delicate shore
#
client.guilds.cache.filter(guild => guild.memberCount > 10000).map(guild => {guild.name})```
#

It just says

xl```
rocky hearth
#

can I make a Map readonly?? for ts

delicate shore
#

nvm

#

s!eval client.guilds.cache.filter(guild => guild.memberCount > 10000).map(guild => guild.id)

#

this worked

sacred trout
#

what is this

rocky hearth
delicate shore
#

Yess

#

Thanks

#

But

#

I wanna get owner

#

It gives me null

rocky hearth
#

u can always get a OwnerId

#

and then fetch it

delicate shore
#

kk but

rocky hearth
#

bcoz it is not mandatory that the owner will be present in the cache.

delicate shore
#

oh

#

wait

#

how can I fetch

#

I am sorry but I never used fetch in djs

rocky hearth
#

<Guild>.members.fetch("owner_id")

delicate shore
#

ok thanks

rocky hearth
#

the fetch method first checks the cache, and if it is not there, than it will actually fetch it.
So u r always safe there

delicate shore
#
let guild = client.guilds.cache.get('ID') guild.members.fetch('ID')```
#

Like this

pale vessel
#

await it

delicate shore
#

oh ok

#

or use .then

#

But

#

I have owner ID

#

can't i directly fetch user

#

client.users.fetch('ID');

#

like this

rocky hearth
#
const guild = client.guilds.cache.get('712666566939902033');
const owner = await guild.members.fetch(guild.ownerId);
delicate shore
#

ok thaks

#
s!eval let object = client.users.fetch('683307434894164016')
object.username```
#

Returns undefined

sacred trout
#
async def play(ctx, url):
    if not ctx.message.author.voice:
        await ctx.send("You are not connected to a voice channel")
        return
    
    else:
        channel = ctx.message.author.voice.channel

    await voice_channel.connect()```
#

please help

rocky hearth
#

bcoz that returns a promise

delicate shore
#

Oh

sacred trout
#

please help

delicate shore
#

k

sacred trout
#

@rocky hearth

#

``@client.command(name='play')
async def play(ctx, url):
if not ctx.message.author.voice:
await ctx.send("You are not connected to a voice channel")
return

else:
    channel = ctx.message.author.voice.channel

await voice_channel.connect()``
#

?

delicate shore
gilded olive
#

I see it

rocky hearth
#

How do I know, what I need to help??

sacred trout
#

my bot not joining vc

#

;-;

#

`@client.command(name='play')
async def play(ctx, url):
if not ctx.message.author.voice:
await ctx.send("You are not connected to a voice channel")
return

else:
    channel = ctx.message.author.voice.channel

await voice_channel.connect()`
gilded olive
#

You never define voice_channel

pale vessel
sacred trout
#

lol

#

so what do i do?

gilded olive
#

You defined it as channel

#

So change the var?

#

🤨

sacred trout
#

?????????????????????????????????????????

#

i am a scrub

gilded olive
#

...

pale vessel
#

But the scope

gilded olive
#

Look here

slender thistle
#

Edit the reference from voice_channel to channel

sacred trout
#

channel = ctx.message,authour.voice.channel

#

this?

pale vessel
#

Can they access channel outside it? Thonk

gilded olive
#

yes

slender thistle
#

Yes

pale vessel
#

oh

earnest phoenix
#

Authour

sacred trout
#

confised

#

lol

pale vessel
#

because it's not under the else

rocky hearth
#
@client.command(name='play')
async def play(ctx, url):
    if not ctx.message.author.voice:
        await ctx.send("You are not connected to a voice channel")
        return
    
    else:
        voice_channel = ctx.message.author.voice.channel
        await voice_channel.connect()
gilded olive
#

change voice_channel.connect to channel.connect

pale vessel
#

yes

slender thistle
#

Great

pale vessel
#

that looks more correct

sacred trout
#

ok

gilded olive
#

Well that works also

slender thistle
#

Fixing code for others

#

Good job

pale vessel
sacred trout
#

i am so dumb

slender thistle
#

Yes

sacred trout
#

gg

slender thistle
#

Kinda

pale vessel
#

It's global?

sacred trout
#

not kinda

#

wtf did i not add this under else

slender thistle
#

iirc vars are function-wide so

rocky hearth
sacred trout
#

thanks guys

gilded olive
#

No problem

pale vessel
#

Python is weird

sacred trout
#

still didn't join xD

#
async def play(ctx, url):
    if not ctx.message.author.voice:
        await ctx.send("You are not connected to a voice channel")
        return
    
    else:
        voice_channel = ctx.message.author.voice.channel
    
@client.command()
async def stop(ctx):
    voice_client = ctx.message.guild.voice_client
    await voice_client.disconnect()```
gilded olive
#

What's the error

#

Traceback please

sacred trout
#

nothing

#

it just doesn't join

#

vc

gilded olive
#

No error gets printed in your terminal?

slender thistle
#

God

#

Are you silencing your errors

sacred trout
#

no error

pale vessel