#development

1 messages · Page 1107 of 1

faint prism
#

Ree

tight plinth
#

you cant split twice

blazing ravine
#

example : nickname without space work like {gokselw}

restive furnace
#

learn Clap js Clap please

blazing ravine
#

example: nickname with space notwork like {gok selw}

#

im uisng args[1] and args[2]

#

1 is for nickname

#

2 is for platform

#

but when i use nickname with space nickpart 2 is in args2

opal plank
#

learn Clap js Clap please

earnest phoenix
#

yes

#

arrays are 0 indexed

#

welcome to programming

sudden geyser
#

lua walks in

earnest phoenix
#

t o i l e t

sudden geyser
#

better alternative: 🚪 🚶‍♂️

restive furnace
#

better alternative: botDeleted lua

faint prism
#

I don't agree with that

opal plank
#

Yay lang wars

blazing ravine
#

aha something work

opal plank
blazing ravine
#

but now

#

args 2 not work

#

😡

restive willow
blazing ravine
restive furnace
earnest phoenix
#

trash bot starter pack:

  • doesn't know language
  • asks to be spoonfed
  • glitch and/or heroku
blazing ravine
#

cry

opal plank
#

@earnest phoenix im going to make a bingo with that

#

thank you, yoikned that idea

restive willow
#

trash bot starter pack

  • "X is a multipurpose bot with loads of features!"
  • "X is a moderation bot with loads of features!"
misty sigil
#

trash bot starter pack

  • "X is a multipurpose bot with loads of features!"
  • "X is a moderation bot with loads of features!"
    @restive willow dont forget totally glich 24/7!1!!!!12132£!"!£!!!!!!123!"!!!!
    and mee7
earnest phoenix
#

too many people try to copy big bots

#

as if that'll gain them any popularity lol

#

the community is oversaturated enough

#

Why copy bots when u already have them smh

lusty quest
#

Mee5 1/2

blazing ravine
#

@faint prism dont pain ur mom

restive willow
#

only make a bot if you have an original idea smh

restive furnace
#

MEE3

#

or

restive willow
#

or if u can do it better

misty sigil
#

mee5

restive furnace
#

M336

earnest phoenix
#

only make a bot if you have an original idea smh
@restive willow true

#

yapdb op bot ngl

restive furnace
#

yagpdb

lusty quest
#

Meeπ

earnest phoenix
#

I misspelled it wantedly

#

.-.

restive furnace
#

Dynomous

earnest phoenix
#

Dookiecord

restive willow
#

i need bot ideas

#

anyone got one

restive furnace
#

terraria miner

lusty quest
#

make a 2D platformer

#

or a 2D Snake game

earnest phoenix
#

Me is making a cricket bot

faint prism
#

ping/pong bot

earnest phoenix
#

Waw

restive willow
#

thing is with those its hard to make them interactive

lusty quest
#

you asked

restive willow
#

like u can interact with reactions or whatever but super slowly

slender thistle
#

@earnest phoenix don't post any account credentials, thank you

earnest phoenix
#

Make pictionary bot

lusty quest
#

why? just edit the message instead of sending new ones and clear the reactions

restive willow
#

true

#

snake could work

restive furnace
#

make online game

#

with emojis

#

xd

restive willow
#

my last bot got disabled for being illegal

#

1 up that i dare u

earnest phoenix
#

I made a bot for Pokémon gyms

#

Pokecord stopped working

#

Rip

faint prism
#

How was it illegal @restive willow

earnest phoenix
#

How do u get the bot Dev role

restive willow
#

u could take emojis from other servers and upload it to urs

earnest phoenix
#

anyone can help me ?

restive willow
#

but discord said Nah

earnest phoenix
#

shivaco

slender thistle
#

have an approved bot on top.gg @earnest phoenix

#

-ask2ask @earnest phoenix

gilded plankBOT
#

@earnest phoenix

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

earnest phoenix
#

u could take emojis from other servers and upload it to urs
Owo has one such command tho

#

i just want code bot with banned user in dbl

#

can i ?

#

i wont add he dbl owner list

#

Thanks @slender thistle

slender thistle
#

A question for #support for future reference
I'd say yes, that's fine

earnest phoenix
#

i can right?

slender thistle
#

ye

#

s

earnest phoenix
#

thank's

lusty quest
earnest phoenix
#

whats the wrong?

#
const DBL = require("dblapi.js");
  const dbl = new DBL(ayar.dbltoken)

        .addField("`Oy Bilgileri`",`**Kiritonun** \nToplam Oyları : **${dbl.getBot(client.user.id).points ||"0"}\nAylık Oyları : ${dbl.getBot(client.user.id).monthlyPoints || "0"} **``)```
#

?

hardy steeple
#

i dont use that library

#

so i dunno, sorry

#

also, what exactly is the problem here?

#

is it not connecting to discord?

solemn latch
#

I dont understand whats going on in that code

hardy steeple
#

or is the command not working

misty sigil
#

theres no embed

hardy steeple
#

if the command isnt working its because you dont have that field info connected to a variable and you didnt actually ask your bot to send the embed

#

thats all i know

#

if its not connecting its because if thats all the code youve got you arent asking it to and you arent providing a token for it to use

zenith terrace
#

theres no embed
^^

#

@earnest phoenix

hardy steeple
#

yeah

#

you have to actually connect that info to an embed and then ask your bot to send that embed

dire stag
#

Anyone know an offline code academy?

hardy steeple
#

no

balmy knoll
#

In Javascript, how can I split a string into several parts that do not exceed 2000 characters and must use the character \n to split?

hardy steeple
#

that one i dont know

blazing ravine
#

@quartz kindle

#

fixed

hardy steeple
#

@dire stag you could use khan academy they have free js and c# classes i think

#

if you make an account

#

i dont think it works offline

sudden geyser
#

@balmy knoll if you don't care about the characters after the 2000-limit, you can just use .substring(start, end) and .split(delimiter)

quartz kindle
#

if you do, split them first, then loop over them and keep adding them until the limit is exceeded

balmy knoll
#

Okay, but using .match and a regex can't do it?

sudden geyser
#

It can

#

You can also use regex in .split

faint prism
#

Which blows my mind ^

balmy knoll
#

The problem is that I can't figure out absolutely how to do it, I've only come to do that has to split every 2000 characters, but I don't know how to put the condition of \n.

amber fractal
#

/[\s\S]{0,2000}/ mmLol

sudden geyser
#

ew

faint prism
#

/.{2000}|\n/g

balmy knoll
#

Ok, i try

#

I'm sorry, but I just don't understand, could someone help me find the right regex?

wispy viper
#

anyone know how to split embeds that are over 1024 characters ?

midnight blaze
safe kelp
#

Anyone knows Python?

lusty quest
#

@wispy viper split down the chars into mutiple (sub-)arrays

wispy viper
#

cause its like for a message update thing

midnight blaze
#

@safe kelp what is that?

lusty quest
#

?

digital ibex
quartz kindle
digital ibex
#

whats wrong with heroku and glitch 😦

quartz kindle
#

probably more complicated than regex, but im pretty sure its more performant

digital ibex
#

nothing wrong wid dem doe

midnight blaze
#

well, why not simply get a vps

bright dove
#

not everyone has money

midnight blaze
#

free glitch is useless lol

digital ibex
#

heroku isnt meant for production (can still be used for it though, they dont mind)

midnight blaze
#

u need to pay glitch to be somewhat useful

digital ibex
#

and glitch isnt a host

midnight blaze
#

you could ping it in the past

rustic nova
#

It is

lusty quest
#

both services offer "Free" Hardware but you pay with unreliable stuff. and if you get the "Premium" Plan from them its still shit and they will limit it

misty sigil
#

no

digital ibex
#

no its not

midnight blaze
#

but that doesnt work anymore

misty sigil
#

glitch is bad

digital ibex
#

where the fuck does it say that???

midnight blaze
#

it is bad

misty sigil
#

just buy a vps

#

or at least use heroku

rustic nova
#

Exactly

#

Nah Heroku is also bad

slender hinge
#

a vps will be more effective in the long run over premium for those services

digital ibex
#

glitch is-

pure lion
#

waitcaniusemywebapponheroku?

misty sigil
#

yea

slender hinge
#

no heroku is good for small projects

rustic nova
#

Vps is the best option

slender hinge
#

and hosting free

midnight blaze
#

glitch is really bad, a lot of modules dont even work

digital ibex
#

glitch isnt a host... :fp:

slender hinge
#

vps is obv thebest option of course

bright dove
#

free glitch is useless lol
@midnight blaze I use it for when I'm trying out something that I don't know will work, and then I go to virtual studio and put it in my actual bot

misty sigil
#

glitch is really bad
@midnight blaze fixed it mmulu

rustic nova
#

glitch isnt a host... :fp:
@digital ibex you host your project on there = Host

midnight blaze
#

xD

misty sigil
#

use repl for testing

digital ibex
#

are you have the retard

rustic nova
midnight blaze
#

hey hope welcome back

#

❤️

rustic nova
#

Slowly getting back into bot development

midnight blaze
#

🙂

pure lion
#

can somosa tell me where i can host my web vid chat app for free when its done?

digital ibex
#

then with ur logic, are u saying a text editor is a host or something? thats literally what it sounds like

midnight blaze
#

I have made some progress, one of my bots got even verified

digital ibex
#

or a console

misty sigil
#

can somosa tell me where i can host my web vid chat app for free when its done?
@pure lion heroku might work

#

but
use a vps

pure lion
#

ok ill have a look

misty sigil
#

if possible

pure lion
#

im poor

#

uwu

misty sigil
#

oWo

midnight blaze
#

3 euro per months guys..vps is so much better in so many ways xD I am sure u could get that

digital ibex
#

i dont use either

misty sigil
#

mine is 3.59 a month

digital ibex
#

both have their own purposes

bright dove
#

then with ur logic, are u saying a text editor is a host or something? thats literally what it sounds like
@digital ibex it li- it literally hosts it?? I don't get what you're trying to say

misty sigil
#

i need to verify now

pure lion
#

does heroku have a console/available ports?

rustic nova
#

then with ur logic, are u saying a text editor is a host or something? thats literally what it sounds like
@digital ibex You're using resources from Glitch to run your Bot, technically hosting your bot on glitch

pure lion
#

eh fuck it ill buy a vps

misty sigil
#

it li- it literally hosts it?? I don't get what you're trying to say
@bright dove it runs it. not hosts it

rustic nova
#

eh fuck it ill buy a vps
@pure lion good decision

pure lion
#

digitalocean here we GOOOOOOOOO

misty sigil
#

hosting is near 24/7

digital ibex
#

wheres this info come from about me hosting my bot on glitch, or even me using it

misty sigil
#

not just a test

bright dove
#

@bright dove it runs it. not hosts it
@misty sigil well... yeah you got me there

pure lion
#

jeremy where are you hosting?

misty sigil
midnight blaze
#

I agree with Jeremy^^ sry hope, but u are wrong there. Hosting is something else, then pressing play for 15minutes.

bright dove
#

🐂ide.host

misty sigil
#

ox KEKW

pure lion
#

xo

digital ibex
#

simply google: what is glitch.com "Website. glitch.com. Glitch (previously known as Fog Creek Software) is a software company specializing in project management tools. Its products include project management and content management, and code review tools."

pure lion
#

sHeSiNLoVeWiThThECoNcEpT

#

im assuming i would host on the englishMoneys3 one? atJeremy

bright dove
#

oh it's euros

pure lion
#

thats pound you nut

misty sigil
#

im assuming i would host on the englishMoneys3 one? atJeremy
@pure lion indeed

pure lion
#

okay epic

misty sigil
#

thy english money of 3 a month

bright dove
#

thats pound you nut
@pure lion shutty!

pure lion
#

i have 20 per month so we good

digital ibex
#

no idea why 2 of you are coming to the conclusion of me using glitch when i've never used it or ever tried it.

pure lion
#

lMao lost use glithc?! haha funny front page news story

bright dove
#

no idea why 2 of you are coming to the conclusion of me using glitch when i've never used it or ever tried it.
@digital ibex nobody said you used it

#

bruh

midnight blaze
#

you will land on starboard lost for using glitch

pure lion
#

fuck i need motivation

midnight blaze
#

O:

digital ibex
#

no one?

#

oh, i misread what you said. so one person

faint prism
#

https://lmgtfy.com/?q=what+is+glitch.com

simply google: what is glitch.com "Website. glitch.com. Glitch (previously known as Fog Creek Software) is a software company specializing in project management tools. Its products include project management and content management, and code review tools."
@digital ibex

digital ibex
#

the rate of this chat becoming cancer ever since the whole corona thing:

faint prism
#

I'm gonna need the axis on that line graph

digital ibex
#

cba lol

midnight blaze
#

y/t?

digital ibex
#

:yike:

#

y/x

balmy knoll
#

@balmy knoll this is my solution
@quartz kindle Using this method, however, I lose the return characters (\n)

bright dove
bright dove
#

he was just getting the search results for what is glitch, through lmgtfy

#

lol

#

to show that you were correct

faint prism
#

Just a website you can send people for future reference @digital ibex
Instead of sending the google definition

quartz kindle
#

@balmy knoll just add them in on each loop

#

c[...] += b[i] + "\n"

digital ibex
#

oh

dire stag
#

Someone send me a Javascript code

opal plank
#

ty

misty sigil
#

no

dire stag
#

Small ones

opal plank
#

needed that one

misty sigil
#

rule 4

#

same @opal plank

dire stag
#

No like for a test

misty sigil
#

write it yourself

opal plank
#

No Spoonfeeding

dire stag
#

No no

opal plank
#

out of curiosity

dire stag
#

Like for a test

opal plank
#

Do you know js?

dire stag
#

No that’s why I’m asking li

#

It’s for an app

misty sigil
#

@opal plank whats your bingo card?

opal plank
#

ty

misty sigil
#

heres mine

patent geyser
#

LMAO

digital ibex
#

idk how to play bingo

#

how do i do this?

#

lmfao

bright dove
#

wait can someone send an empty?

patent geyser
#

lol rip

misty sigil
#

sure!

patent geyser
#

ty

bright dove
#

thanks

digital ibex
#

are u supposed to tick the ones u do?

misty sigil
#

yea

patent geyser
#

hol' up we can only cross three rgith

digital ibex
#

oh ok

#

:sunglased:

faint prism
#

ooh that's good

patent geyser
#

woah

midnight blaze
#

why the internet is now hating if else statements, smh

opal plank
#

@digital ibex not the ones you do, the ones you find here coming to ask

digital ibex
#

oh

opal plank
#

cuz switch exists @opal plank

midnight blaze
#

xDLOL

patent geyser
#

LMAO

opal plank
#

just chill here giving advice for people asking for help and mark the stupid/bad coding practices you see here

faint prism
digital ibex
patent geyser
#

owch

midnight blaze
#

what about ternary operator. A lot cooler than switch

patent geyser
#

i can feel the hurt

digital ibex
#

and glitch whoops

faint prism
#

Switch/case is technically faster than an If/else.
However, it isn't always appropriate for what you want to perform a comparison between

digital ibex
#

corona: bot devs ⏫

midnight blaze
#

I miss the corona bot devs

#

they are all gone

digital ibex
#

i dont :p

patent geyser
#

stonks

midnight blaze
#

what about ternary operator? nobody mention this as an alternative

summer torrent
earnest phoenix
#

.

patent geyser
earnest phoenix
#

javascript
high performance

🤣

patent geyser
#

LOL

opal plank
midnight blaze
#

how bout ternary operator

summer torrent
opal plank
midnight blaze
#

finally somone

summer torrent
#

so

#

ternary > switch case > if..else

opal plank
#

eeeeeh

#

not quite

#

in some cases yes

#

switch is good for larger number of conditionals

oak edge
#

@teal pasture

#

why

#

he's muted

#

?

opal plank
#

wrong channel

quartz kindle
#

switch is good when you're comparing against the same thing

opal plank
#

that too

quartz kindle
#

but if all your comparisons are different, better use if else

pure lion
#

Welp I finished it

#

Hi Tim

blazing ravine
#

@opal plank

#

fixed

opal plank
#

oh god..... here we go again

blazing ravine
#

@quartz kindle fixed

pure lion
#

Hi Jeremy

#

Thank you for the motivation

misty sigil
#

hello

pure lion
#

I gotta make UI then I'll release it

misty sigil
#

i am scoring off my bingonium ticket

pure lion
#

Your who

pure lion
#

The last time I used var

#

Uh

#

I have never used var

digital ibex
#

last time i saw var, i just opened visual studio code :sunglasd:

misty sigil
#

same

digital ibex
#

that was a uhhh joke

misty sigil
#

to dice

pure lion
#

Jajajaja

digital ibex
#

oh

strange trout
#

Use object literals if you don't like if else or switch statements

opal plank
#

its less about liking and more about not pulling a yandere sim dev

strange trout
#

Don't know what that is

opal plank
#

there are cases

pure lion
#

Elsie iffy

opal plank
#

watch this

pure lion
#

there are cases
No there are no cases whatsoever

midnight blaze
#

dont watch it, you will be stuck with those videos for a while

digital ibex
#

yanderedev = best dev

opal plank
digital ibex
#

well, now i've got to say that was a joke because people dont know what a-

#

im... going.... to... take a long walk

strange trout
#

Very cool

#

I watched a couple minutes

#

Amazing code

digital ibex
#

yup

strange trout
#

I have less than 10 else statements in my entire code

opal plank
#

17 if's here

strange trout
#

How much lines of code is it though?

opal plank
#

163

strange trout
#

Ah

digital ibex
#

in the whole of my bot, i've got around like 30 if/else statements

sudden geyser
#

doubt

digital ibex
#

ydoubt

strange trout
#

I have a lot of if statements but little else

sudden geyser
#

I don't use else/else if unless I need something else to happen and I'm not exiting the function scope

strange trout
#

Same

#

Got less than 10 in my entire bot

digital ibex
faint prism
#

Change the filter to search in "Project" rahter than "current document"

digital ibex
#

i dont really use visual studio code, so i dont really know much about it

#

oh

strange trout
#

Oh wait

opal plank
#

crtl shift f iirc

strange trout
#

Just search

#

The little search icon

#

Searches the entire directory

opal plank
#

ctrl + shift + f

faint prism
#

just cat * | grep if | wc -l

sudden geyser
#

then again it's not a bad thing to have a lot of else

strange trout
#

Nope

opal plank
#

ooof i got quite a few else ifs in a json builder

strange trout
#

I just don't like nesting them

#

Thats when code gets messy

sudden geyser
#

agree, else if ftw

opal plank
#

actually wtf am i on about? i dont have that many

#

14 in one of them

indigo oriole
#

can someone help me with a bot music script

indigo folio
#

yikes

opal plank
#

dont ask to ask

digital ibex
#

its not showing all for some reason

opal plank
#

linter usually spaces

sudden geyser
#

it'd be cooler if it scanned your node_modules folder

opal plank
#

if (

#

not if(

digital ibex
#

o ok

opal plank
#

i need to remove my output folder

strange trout
#

Or just if lol

digital ibex
stiff stream
#

what is wrong

opal plank
#

what

digital ibex
#

so around 30 in bot then

opal plank
#

u checking if it exists

#

if (args 2 exists) you didnt provide guildmemeber

#

what?

faint prism
#

args[2] is a string right?

stiff stream
#

yes

faint prism
#

What are you comparing exactly?

opal plank
#

if it exists

#

@stiff stream you missing a ! there

#

invert operator

faint prism
#

If it doesn't exist, then the array index would throw an exception

stiff stream
#

oh

#

wait

#

@stiff stream you missing a ! there
@opal plank yeah

#

wait

opal plank
#

if (args 2 exists) you didnt provide guildmember

#

this is what you're doing

#

in human redable

faint prism
#

if args[2]?.Length > 0 ? return "Good" : return "No guild blah blah"

opal plank
#

wtf is that

stiff stream
#

@opal plank ty for seeing that, works now

opal plank
#

np

faint prism
#

ternary conditional operator bro @opal plank

opal plank
#

thats one cause where you're overcomplicating

#

i know what it is

#

if(args[2) //do something

faint prism
#

well you haven't checked if args array is that long

#

You can't just access it (unless JS allows that)

opal plank
#

rather than if args[2](conditional chain check).(accesing another property)

stiff stream
opal plank
#

you can check

stiff stream
#

when i ping someone its sill sending him the you did not provide a GuildMember!

opal plank
#

let array = ['a', 'b'];
if(!array[2]) console.log('pass')

#

even ty allows

faint prism
#

so if var args = {"some", "string"}
and you try to if (args[2] would that not throw an exception because [2] is an invalid index?

opal plank
#

Ts*

#

no

faint prism
#

Must be a language-specific thing

stiff stream
opal plank
#

@faint prism

#

even in Typescript

faint prism
#

reee

opal plank
#

and less operations than what you suggested

#

with conditional chaining

faint prism
#

Well I do C#
Which will crash if you attempt to access memory outside an array
@opal plank

opal plank
#

wait what

#

Ron

#

wtf did u do

ancient nova
#

why doesn't the style css I wrote doesn't show on full screen on my laptop but when I make screen smaller it changes to my custom css?

opal plank
#

why did you put my example there?

stoic hull
#

so quick question, how to get the permissions the bot has in the guild?

opal plank
#

BRUH

#

@stoic hull which lang/lib?

ancient nova
#

why doesn't the style css I wrote doesn't show on full screen on my laptop but when I make screen smaller it changes to my custom css?

stoic hull
#

nodejs

ancient nova
#

I can send screenshot of how it looks if it helps

summer torrent
#

discord.js ?

opal plank
#

lib?

stoic hull
#

yes discord.js

#

v12

opal plank
#

lemme grab docs

ancient nova
summer torrent
#

<Member>.permissions.toArray()

ancient nova
#

oh you're not talking to me

#

why doesn't the style css I wrote doesn't show on full screen on my laptop but when I make screen smaller it changes to my custom css?

summer torrent
#

message.guild.me.permissions.toArray()

stoic hull
#

alright thankyou!

opal plank
#

use this instead

ancient nova
#

why doesn't the style css I wrote doesn't show on full screen on my laptop but when I make screen smaller it changes to my custom css?

opal plank
#

use Final permissions

stoic hull
#

thanks for the help ill read that

opal plank
#

that takes into account channel overrides

earnest phoenix
#

@earnest phoenix
@zenith terrace no it has embed

#

i just get error

faint prism
#

oh no

#

a magical error

slim tundra
#

Any1 can send me an ez command

ancient nova
#

can anyone help me

slim tundra
#

So i can learn

#

Pls

summer torrent
#

no

faint prism
summer torrent
#
slim tundra
#

Fack?

opal plank
#

no spoonfeeding @slim tundra

summer torrent
opal plank
#

use documents

faint prism
#

Figure out if you want to start making a bot using code;

#

np

opal plank
#

we dont give pre-made code

faint prism
opal plank
#

^^

earnest phoenix
#

here is a tip for security for python bots
you make a text file named token.txt then enter your token in it and paste this code in it

f = open("token.txt", "r")

client.run((f.read()))
faint prism
#

or use environment variables

slim tundra
opal plank
#

this is for development

stiff stream
#

if im mentioning me its still sending me the you did not provide a GuildMember!

summer torrent
#

what is args[2]

faint prism
#

Also, may want to mention that they should be careful not to commit their secrets by accident by excluding them in .gitignore if they use SCM @earnest phoenix

summer torrent
#

use mentions

stiff stream
#

where?

faint prism
#

The third argument I guess

stiff stream
#

use mentions
@summer torrent me?

earnest phoenix
#

ye

summer torrent
opal plank
#

you do know arrays start at 0 and not 1 right @stiff stream ?

summer torrent
#

parsing member from args is bad idea

#

just use mentions

opal plank
#

that too

earnest phoenix
#

does any 1 know a good discord.py tut website kind of thing

faint prism
#

An array's index is an offset of a memory address from where array[0] begins.

opal plank
#

the @earnest phoenix docs?

summer torrent
earnest phoenix
#

hjey thanks

opal plank
pure lion
#

how can i align a div element to the center?

faint prism
#

With CSS

#

@pure lion

opal plank
#

@pure lion if you didnt change those little things i gave you i'll legit slap you thru the internet

pure lion
#

give me all the slaps

opal plank
#

i DID YOU CUCK

#

look how much better it looks

pure lion
#

:l

#

the site is down anyway

opal plank
#

just 2 things make it 20000x better

pure lion
#

circle
bg

opal plank
#

a background and round the icon

#

thats it

#

i dont have the original to show difference

finite bough
#

maybe add a very low transperency background block behind the text

opal plank
#

but just compare them

#

thats what i changed shiemi

#

idk where its at

#

@pure lion show original

#

that was like 5 minutes css

finite bough
#

dunno how to css

#

lmao

opal plank
#

me neither

#

¯_(ツ)_/¯

#

it was THAT simple

strange trout
#

Contrast

faint prism
#
style=""
strange trout
#

Is non existent

gray zealot
#

.setImage(message.author.displayAvatarURL()); << that makes an image of your pfp
.setAuthor(message.author.displayAvatarURL());<< it shows the link? 🙂 any ideas why it doesnt work?

pure lion
misty sigil
#

ok

#

nice hair

pure lion
#

o h f u c k t h e r e s t h r e e

misty sigil
#

and nice site

pure lion
#

thanks x2 :D

gray zealot
#

😄

earnest phoenix
#

how do I make the user chhose something in discord.py example .purge num or .hug person {num}

hardy steeple
#

i have a roll command that combines randomly number generated variables

#

its attached to the first argument

#

put its only connecting to the second, even though ive set it to arg 0

#

someone help

#

it works fine if i put the number in the second argument, but for some reason it cant connect to the first one

#
        var numberdos = Math.floor(Math.random() * args[0]) + 1
        var numbertres = Math.floor(Math.random() * args[0]) + 1
        var ffnumber = numberuno + numberdos + numbertres```
#

isnt it supposed it be arg 0 for the first argument?

#

arguments have worked with arg 0 for other commands

earnest phoenix
#

how to make a bot send a message

slender thistle
#

ctx.send or message.channel.send

hardy steeple
#

why is it connected to the second arg?

#

im so confused

#

do i have to put it at -1 args? why does it do that

pure lion
#

how can i create a button at frontend that triggers a res.redirect at backend?

#

assuming theres something on stacc actually but ill be back

hardy steeple
#

can someone help me, im so confused

pure lion
#

dontasktoask

hardy steeple
#

no matter what number i put in the slot it always is connected to the second one

#

im going to put in 69

#

lets see if it connects to the second

pure lion
#

slot?

solemn latch
#

Like args[0] is putting you on the second arg?

hardy steeple
#

yeah

#

idk why tho

solemn latch
#

Console log your arg variable

pure lion
#

negative slicing

#

!!!!!!!!!!!!!!!!!!!!!!!!

earnest phoenix
#

how to make a purge command but the user choosing how many messages is d.py

hardy steeple
#

i already tried putting it at arg -1

#

lol

#

im desperate

solemn latch
#

Log your args variable, see whats actually in it

earnest phoenix
#

Please help me I want to make a application bot I know only how to create the channel

pure lion
#

oh god its a stampede

#

application with what purpose

earnest phoenix
#

how to make a purge command but the user choosing how many messages is d.py

#

Clan application

pure lion
#

bro

hardy steeple
#

bulkDelete(args[0]) if i had to guess

earnest phoenix
#

Oops I don’t see all the message wdym?

pure lion
#

fluffy boi he means oppy

hardy steeple
#

are you speaking english

pure lion
#

sxp, i need more info

#

are you speaking english
no

#

no no

hardy steeple
#

barfs

pure lion
#

give me your oppy senpai

solemn latch
#

Worlds slowest delete

pure lion
#

anyway how to butt

#

on

#

?

hardy steeple
#

wtf are you even doing at this point

#

also im not really sure how to attach the console log to the args

#

ive only done one console log thing where i just see if the bot is ready

sudden geyser
#

console.log(something)?

hardy steeple
#

yeah ik but

#

the problem is what to attach it to

sudden geyser
#

whatever the name is of the variable you store the arguments passed to the function is what args is

#

so you need to log that

#

for example, if it was named args, you'd do console.log(args)

hardy steeple
#

where though and when would it trigger

sudden geyser
#

put it where you think it would log/run, then test it

solemn latch
#

Where you are trying to use args

hardy steeple
#

im going to make it log whenever i rerun the code

#

okay well now its not even putting anything in the terminal at all

#
        console.log('your EPIC BOT IS ONLINE!!!');
        console.log(args)
    })```
solemn latch
#

That makes no sense

pure lion
#
app.get('/', (req, res) => {
    res.send('<button type="submit" method="POST" action="/e">redirect me daddy</button>')
})

app.post('/e', (req, res) => {
    res.redirect(`/${roomID()}`)
})

i want <button> to redirect me to /roomID but its not :d

opal plank
#

args on ready event?

solemn latch
#

Ready event has no args

opal plank
hardy steeple
#

do i put it with args

pure lion
#

where is args defined?

hardy steeple
#

probably

#

const args = message.content.slice(PREFIX.length).split(/ +/);

#

how do i connect it to that

solemn latch
#

Connect what to what

pure lion
#

*inhales*

#

meep

#

woo can you express

#

?

hardy steeple
#

ive been enlightened

solemn latch
#

I've used express a bit

hardy steeple
#

do i just put the console.log next to the defining statement?

#

like how do i actually put it with the args

solemn latch
#

You put the variable in () of console.log()

hardy steeple
#

but where do i put console.log tho

solemn latch
#

Where you want it to log

hardy steeple
#

i dont understand because im dumb

pure lion
#

ok so woo i want button to get /e which will redirect me to room but h o w

hardy steeple
#

do i put it within the command itself?

#

lemme try dat

solemn latch
#

Href?

misty sigil
#

href yea

molten pewter
#

currently looking into using kubernetes stuff to handle image processing

pure lion
#
app.get('/', (req, res) => {
    res.send('<button type="submit" method="GET" action="/unlocking_door">redirect me daddy</button>')
})

app.get('/unlocking_door', (req, res) => {
    res.redirect(`/${roomID()}`)
})

in the context of this?

hardy steeple
#

it still doesnt put anything in the logs

pure lion
#

you what

hardy steeple
#
        var numberdos = Math.floor(Math.random() * args[-1]) + 1
        var numbertres = Math.floor(Math.random() * args[-1]) + 1
        var ffnumber = numberuno + numberdos + numbertres
        var threembed = new MessageEmbed()
        .addField('First Roll! :game_die:', numberuno)
        .addField('Second Roll! :game_die:', numberdos)
        .addField('Third Roll! :game_die: ' , numbertres)
        .addField('Total!', ffnumber) 
        .setColor('FBFF64')
        .setTimestamp()
        if(!args ||!isNaN(args)) return message.channel.send("Supply a number!")
        else message.channel.send(threembed)
        console.log(args)```
#

put it doesnt put it

#

am i dumb

pure lion
#

ehhh

hardy steeple
#

we use different libraries

#

probably

pure lion
#

no

#

thats djs

hardy steeple
#

yeah

pure lion
#

what did you do to my baby

#

jk

hardy steeple
#

im so confusion

solemn latch
#

Console.log()
Logs things you put into it, at the point you log it.

hardy steeple
#

this is gonna sounddumb put i dont know what that means

#

like i understand that it logs

#

but at the point you log it doesnt make sense to me

#

when you run that point of code it logs it?

#

i guess would be what it means but it aint workin

solemn latch
#

The code that executes before console.log will have run

#

Code after console.log will run after console.log

#

Excluding some async stuff

hardy steeple
#

one sec, lemme try something

misty sigil
#

console.log(stuff to be logged)

hardy steeple
#

yes i know, i have that in the code but its not logging it

#
        else message.channel.send(rollEmbed)
        console.log(args)```
#

its not logging anything, though

#

not even my regular "your bot is ready" is logging

#

let me restart vsc

#

okay give me a sec

#

ugh

#

my regular "your bot is online isnt logging anymore"

#
        console.log('Success!');
    })```
#

is my "your bot is online" code

earnest phoenix
hardy steeple
#

const Client = new Discord.Client();

#

okay

#

all of my "Clients" are uppercase already, though

#

does it matter?

#

it still doesnt do anything

#

my entire file?

#
const client = new Discord.Client();

const token = 'lol you dont get to know my token';

const PREFIX = '='

const fs = require('fs');
const { execute } = require('./commands/help');

client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for (const file of commandFiles){
    const command = require(`./commands/${file}`);

    client.commands.set(command.name, command)
}




client.on('message', message=>{
    if(!message.content.startsWith(PREFIX) || message.author.bot) return;

    const args = message.content.slice(PREFIX.length).split(/ +/);
    const command = args.shift().toLowerCase();


    client.on('ready', () =>{
        console.log('Success!');
    })

    if(command === 'help'){
        client.commands.get('help').execute(message, args);
    } else if (command === 'roll'){
        client.commands.get('roll').execute(message, args);
    } else if (command === 'roll2'){
        client.commands.get('roll2').execute(message, args);
    } else if (command === 'roll3'){
        client.commands.get('roll3').execute(message, args);
    }
        
});


    

   

client.login(token);```
stiff stream
#

im trying to make a giveaway command, and i know how but heroku blocking JSON files so the giveaway command with a timer isnt working, so i made a new one with out a timer. and i want to add that if i type (prefix) end (giveaway id) it will random choose one. any one knows how?

hardy steeple
#

thats the whole code :/

misty sigil
#

im trying to make a giveaway command, and i know how but heroku blocking JSON files so the giveaway command with a timer isnt working, so i made a new one with out a timer. and i want to add that if i type (prefix) end (giveaway id) it will random choose one. any one knows how?
@stiff stream 1. don't use json as db

hardy steeple
#

i think i accidentally deleted something

#

when was making too many edits

midnight blaze
#

oof, yeah taake that outside your message event

hardy steeple
#

?

#

wait

midnight blaze
#
  client.on('ready', () =>{
        console.log('Success!');
    })
#

this event outside your message event

hardy steeple
#

okay

#

wait

#

wait

#

did i just break everything

#

are consts global, like if you put one in a bracket would it apply outside of that bracket?

earnest phoenix
#

Does anyone have a sharded bot here I have a question

hardy steeple
#

yeah okay thats what i thought

#

i guess i just f'ed up my bot when i was making too many changes

#

lets see here

#

ok well

#

the success command works

#

but the bot still connects to the second arg

#

rather than the first

#

also, even though i have console.log(args) before the if statement it doesnt log

#

it just doesnt log the args

#

is there nothing in them?

#

im so confused tho

#

why on earth does it connect to the second arg

#

thats so weird

#

like even if i put it to connect at the 1000th args it still connects to the second

earnest phoenix
#

maybe send code

hardy steeple
#

i already did look up

#

i sent it probably ten times by now

earnest phoenix
#

send the updated code

#

cant just guess what you changed smh

hardy steeple
#
    name: 'roll',
    description: 'rolls a dice',
    execute(message, args){
        var number = Math.floor(Math.random() * args[0]) + 1
        if(!args ||!isNaN(args)) return message.channel.send("Supply a number!")
        else message.channel.send('You rolled a ' + number + '!')
    }}```
earnest phoenix
#

debug it

hardy steeple
#

the command itself works fine but when i say args[0] it connects to the second arg rather than the first for some reason

sudden geyser
#

args[0] would probably be a string

#

and you're trying to multiply it by a number right

hardy steeple
#

well yeah

sudden geyser
#

ah well sadly javascript allows it so nvm

hardy steeple
#

hmm

#

its worked in the past but it aint working now

#

but i dont know why

sonic lodge
#

what does console.log(args) return

hardy steeple
#

nothing

#

at all

#

for some reason

#

wait

#

one sec

#

ok

#

if i do =roll 10 it sends back ten but it still doesnt actually connect to the ten

#

if i do =roll 10 10 it would react to the second ten and roll a ten sided die

#

im so confused

sonic lodge
#

=roll 10 logs ['10']?

hardy steeple
#

yup

#

wait lemme try something

#

okay

#

uhhh

#

so

#

i changed it so console.log(args[0] and it recognizes that args 0 is the first arg

#

like if i do =roll 10 it would return ten

#

but the command only actually reacts to args[1] for some reason

#

i dont even have the term args[1] in the code once

sonic lodge
#

did you save the file

hardy steeple
#

yup

#

im going to restart vsc even though its not going to do anything

#

and it did nothing

#

im so confused

sonic lodge
#

hmm, i have something to show you

#

one moment

sudden geyser
#

javascript

sonic lodge
#

when the array is of length 1, or 0, !isNaN(array) returns true

hardy steeple
#

which array though

#

the args?

sonic lodge
#

yes

hardy steeple
#

why tho

#

why does it it automatically assume that the first argument is invalid

sonic lodge
#

you're trying to check if an array is not a number

hardy steeple
#

yes

sonic lodge
#

instead of !args || !isNaN(args), try !isFinite(args[0])

hardy steeple
#

okay

pure lion
#

How to get content of <form> <input type="text">

sonic lodge
#

discord only cares about how your bot uses their data

#

yes, they don't bother with bot lists

earnest phoenix
pure lion
slender thistle
#

@misty idol pip install -U discord.py

misty idol
#

ok thanks

slender thistle
#

Try replacing pip with pip3 and all other variations

misty idol
#

will do :)

#

ah yes its working tysm

pure lion
#

e?

slender thistle
#

Splendid

misty idol
#

its for a massive server and would have been screwed if it didnt work

#

hehe

bright dove
#

bruh why do we have to do all these dumb math functions... like why can't they just make a block for picking something at random 😑

pure lion
#

Math.floor(Math.random() * int)

#

Okay I see your point

opaque eagle
#

Because that's such a niche, unnecessary thing @bright dove

#

this isn't too hard to do

#
// Stolen from:
// https://discordapp.com/channels/264445053596991498/272764566411149314/739239189744320604
Math.floor(Math.random() * int);
pure lion
#

:c

#

nO CrEdiT SmH

bright dove
#

lol

opaque eagle
#

there

pure lion
#

lmao ty

jolly wave
#

I forgot what's the ram command can someone tell me please?

#

yes thx

#

Let's test my command

#

And I'll come back if it don't work

#

What is this error

#

Error: Cannot find module '/data/data/com.termux/files/home/ram'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []

sudden geyser
#

what did you try doing

jolly wave
#

This

#

So when I say-- ?ram it say the ram it take

placid iron
#

so like i am making a bot with just api requests because ram usage will be really low now and it is such a small bot that is all it needs. and i am kinda needing an on message command and i dont know exacly how i can do that with api requests. i assume i have to subscrive to a webhook but i dont know how

sudden geyser
jolly wave
#

Idk

potent folio
#

Türk Varmı

sudden geyser
#

but at the same time you're trying to run node from a mobile android phone it seems. have you tried on a desktop

potent folio
jolly wave
#

no

#

I can't go on a desktop rn

#

But I run myy bot on desk top

#

It's this?

pale vessel
#

that's an object

quartz kindle
#

process.memoryUsage() is an object

pale vessel
#

or not

jolly wave
#

oof idk what y'all mean

quartz kindle
opaque eagle
#

If you want a property you can just do obj[a]... if you want the object as a string, use JSON.stringify(obj)

quartz kindle
pure lion
#
        <form id="userInput" onsubmit="return false" style="text-shadow: 0 0 20px white; color: black;">join a room<br>
            <input class="text" id="href" type="text">
            <input class="button" type="submit" onclick="localStorage.setItem(href, document.getElementById('href').value);">
        </form>

i want the user to attempt to be redirected to a room, and if it fails then an error message will appear but if not the redirect goes through. how'd i go about this?

earnest phoenix
#

Make meta tag

#

In the headet

#

Header

#

Whats the place u want to redirect it to

pure lion
#

/:roomID

#

the thing i put into local storage

earnest phoenix
#

O wait nvm u want an on click redorect

#

Maybe ur path is wrong

pure lion
#

there is no path

#

i want to set the path as the input

earnest phoenix
#

Where it says setitem hr(

#

The bracket doesnt close

pure lion
#

there are no errors

#

i just want to know how to redirect to a place the user typed in

#

:( ok

faint prism
#

Any other .NET developers

pure lion
#

kinda

digital ibex
#

hello

#

im having a small problem

pure lion
#

hello

#

same

digital ibex
pure lion
#

you go first

digital ibex
#

i've got this, but is shows that tiny bit at the bottom, with css, how can i remove that and only show the white part, any ideas?

#

whats ur problem lmao

pure lion
#

idk how to take user input and then redirect to the content of said input

#

also right click on the tiny annoying rectangle and inspecc

digital ibex
#

ur making an online chat?

pure lion
#

yes

#

yes

digital ibex
#

???

pure lion
#

i am indeed

#

but vid chat

#

and i want to use rooms

digital ibex
#

oh

pure lion
#
/${roomID()}
#

path if you were curious

digital ibex
#

apart from the video chat its kinda ez, ez-madium

pure lion
#

everything else just works

#

but i want to be able to join by ID

digital ibex
#

is that the app.get ?

pure lion
#

wait ill show my server.js

digital ibex
#

ok

pure lion
#
const express = require('express')
const app = express()
const server = require('http').Server(app)
const io = require('socket.io')(server)
const port = 3000
const { v4: roomID } = require('uuid')

app.set('view-engine', 'ejs')
app.use(express.static('public'))

app.get('/', (req, res) => {
    res.render('welcome.ejs')
    req.query()
})

app.get('/unlocking_door', (req, res) => {
    res.redirect(`/${roomID()}`)
})

app.get('/:room', (req, res) => {
    res.render('room.ejs', { roomID: req.params.room })
})

io.on('connection', socket => {
    socket.on('join-room', (roomID, userID) => {
        socket.join(roomID)
        socket.to(roomID).broadcast.emit('user-connected', userID)

        socket.on('disconnect', () => {
            socket.to(roomID).broadcast.emit('user-disconnect', userID)
        })
    })
})

server.listen(port, () => { console.log(`listening on port ${port}`) })
#

(i added the empty req.query func because idk)

digital ibex
#

you wouldnt really wanna do it like that

#

just complicates everything

#

just do this:

pure lion
#

uh oh

digital ibex
#
app.get('/unlocking_door/:roomID', (req, res) => {
    if (req.params.roomID !== roomID) return res.render('room.ejs', { message: 'hey nerd, stop tryna mess with my epic site!!' });
    res.redirect(`/${req.params.roomID}`);
});```
#

also pls use semi colons

#

the only difference is in the url 😦

pure lion
#

you what

digital ibex
#

?

pure lion
#

i want to get input (text field that puts data to local storage) and use the data as a URI element

digital ibex
#

get the input from the frontend and do something with it in the backend?

pure lion
#

yeah

digital ibex
#

ohhh

pure lion
#

sorry i was unclear

digital ibex
#

what does ur frontend look like already?

pure lion
#

brb

#
        <form id="userInput" onsubmit="return false" style="text-shadow: 0 0 20px white; color: black;">join a room<br>
            <input class="text" id="href" type="text">
            <input class="button" type="submit" onclick="localStorage.setItem(href, document.getElementById('href').value);">
        </form>
#

this is the submit boi

digital ibex
#

i really need to learn more frontend web dev.. but i dont think thats how form works..

#

(dont take my word on that)

#

just put it in a div instead of using the form

#

and wrap the div inside the form

#

so ur code is just

pure lion
#

the form tag does get the data btw

digital ibex
#

i know

#

you need to provide the method and action

#

not styles id onsubmit

#

well id yh

pure lion
#

form can have method and action

digital ibex
#
<form action="/DATA_SENDING_BACK" method="post">
   <div id="userInput" onsubmit="return false" style="text-shadow: 0 0 20px white; color: black;">join a room<br>
            <input class="text" id="href" type="text" name="hello">
            <input class="button" type="submit" onclick="localStorage.setItem(href, document.getElementById('href').value);">
   </div>
</form>
#

form is used to send frontend data to ur api

#

thats the frontend ^^

#

and in the backend: js app.post('/DATA_SENDING_BACK', (req, res) => { const { hello } = req.body; console.log(hello) // this is what the user put in the input tag });

faint prism
#

Tempted to make an api for my bot, and move the logic over to it

digital ibex
#

people who do that are just 😩

#

hackydiscordbot101

faint prism
#

Maybe I should just move the logic to a library instead, so it's easier to unit test

digital ibex
#

why do you even need an api for your bot?

pure lion
#

ok got it

faint prism
#

So if I made a website, I could make calls to it for data the bot uses

digital ibex
#

(im assuming the bot and dashboard are different things?)

#

idk man

#

it seems really hacky to me

#

i'd use ipc then, like i totally know how to use it and stuff

#

100% familiar with it

#

totally

pure lion
#
app.get('/finding_key', (req, res) => {
    const { input } = req.body
    try {
        res.redirect(`/${input}`)
    } catch {
        alert('No')
    }
})

h

digital ibex
#

no

#

i put app.post

#

not app.get

pure lion
#

oh shit youre right

earnest phoenix
#

Hi

digital ibex
#

using the try/catch is a bit redundent there since its always going to redirect them to /whatever

#

hello there

pure lion
#

how do i not redirect?

digital ibex
#

wdym?

pure lion
#
TypeError: Cannot destructure property 'input' of 'req.body' as it is undefined.

u m

digital ibex
#

what does the frontend look like?

pure lion
#
        <form action="/finding_keys" method="POST" style="text-shadow: 0 0 20px white; color: black;">join a room<br>
            <div id="userInput" onsubmit="return false">
                <input class="text" name="input" id="href" type="text">
                <input class="button" type="submit"
                    onclick="localStorage.setItem(href, document.getElementById('href').value);">
            </div>
        </form>
digital ibex
#

did u put something in the input thing and press enter?

#

oh

#

i misread the error

#

just like

#

add near the top of the code app.use(express.urlencoded({ extended: false }));

pure lion
#

join room works now :D

#

but how do i stop a user from inputting a valid ID/catch the error and stop crash?

digital ibex
#

how are you generating the id?