#development

1 messages · Page 1442 of 1

earnest phoenix
#

<:emoji name:emoji id>
<a:animated emoji:id>

sterile lantern
#

what?

earnest phoenix
#

oh wait

sterile lantern
#

oh thats bc i added money

earnest phoenix
#

thats a user

sterile lantern
#

yeah i forgot to slice

#

yea

earnest phoenix
#

i thought a emoji lmao

sterile lantern
#

        all = all.filter(e => e.ID.startsWith('money_'));
        all = all.sort();

        for(let i = 0; i < all.length; i++) {
            let lb = (`<@${all[i].ID.slice(6)}>: ${all[i].data}coins`);
        }
        message.channel.send(lb)```
#

lb wont be defined if i do this

faint prism
#

all = all.sort();
This is still sorting by string isn't it

sterile lantern
#

yea but im trying to get in one msg first

crimson vapor
#
    let all = db.all();

        all = all.filter(e => e.ID.startsWith('money_'));
        all = all.sort();

        let string;
        for(let i = 0; i < all.length; i++) {
            string = string + '\n' + (`<@${all[i].ID.slice(6)}>: ${all[i].data}coins`);
        }
        message.channel.send(string)``` should work
faint prism
#

define lb outside the loop
and assign it within the loop

sterile lantern
#

then i wold be undefined

#

would*

crimson vapor
#

you can also use string += lb

sterile lantern
#

ah

#

ok

crimson vapor
#

im not quite sure

sterile lantern
#

works, but im getting an undefined on the top

#

weird

crimson vapor
#

as user?

sterile lantern
#

no

#

its just

#

undefined
User - coins
user- coins

crimson vapor
#

oh

#

yes ik why

sterile lantern
#

oh

#

its doing

#

string + string

#

thats why

crimson vapor
#
    let all = db.all();

        all = all.filter(e => e.ID.startsWith('money_'));
        all = all.sort();

        let string;
        for(let i = 0; i < all.length; i++) {
            string = string ? string + '\n' (`<@${all[i].ID.slice(6)}>: ${all[i].data}coins`) : string;
        }
        message.channel.send(string)``` try this
#

or let string = ''

#

probably better tbh

sterile lantern
#

stopped responding

#

oof

crimson vapor
#

hmm

green kestrel
#

anyone got any thoughts on what are the most popular languages that bots are written in after english?

crimson vapor
#

nope

green kestrel
#

i dont mean programming languages

crimson vapor
#

its turkish

green kestrel
#

i mean the spoken language of the interface

sterile lantern
#

ah fixed it

#

i did string = ""

crimson vapor
#

its turkish and js

sterile lantern
#

hm, so how would i work with making numbers

#

so it goes

green kestrel
#

i dont think it is.... i thought that, and the first language i translated into was turkish, and it turns out to be an echo chamber specific to developers. in the real world few servers select turkish as the bots language

sterile lantern
#
  1. user
  2. user
#

and it only goes up to 10

green kestrel
#

the next four languages im translating into are: italian, polish, japanese and korean

#

the first two were user request

sterile lantern
#

string += `${i + 1}. ${user} - ${tl[i].data}$\n`;

#

do u think this would work

#

for + 1'ing it

crimson vapor
#

get some portugese and spanish

green kestrel
#

the second two in preference to chinese, as ive never seen a chinese bot on top.gg. like ever.

crimson vapor
#

me neither

green kestrel
#

got portugese and spanish, spanish is the 2nd most popular choice after english

faint prism
#

string += how does JS handle strings? Can you build them dynamically like that?

green kestrel
#

@faint prism yes

crimson vapor
#

kinda

#

js has almost no rules

sterile lantern
#

yea im unsure how to add like

  1. user
  2. user and then make it stop
#

at 10

green kestrel
#

i cant vouch for the performance of that, and if one of the things you try to append is a string that contains a number... or looks like a number... well chaos is going to ensue

#

because type coercion

crimson vapor
#

one sec

#

numbers work fine

quartz kindle
#

is discord even allowed in china?

#

it might be blocked for all we know

gilded olive
#

spanish more than french but those two yes

crimson vapor
#

objects are nah but arrays will be just weird in string +=

quartz kindle
#

spanish, french, portuguese and polish sounds right

solemn latch
#

turkish

crimson vapor
#

you know what I wanna make a object.toString() now

green kestrel
#

heres the current live list

quartz kindle
#

oh i know which languages you need

green kestrel
quartz kindle
#

british and australian :^)

green kestrel
#

surprisingly turkish is unpopular... and i got a lot of people asking for hindi, nobody is currently using it

#

russian is in use by like ten servers out of 47000

#

lmao

quartz kindle
#

svenska? really?

summer torrent
#

are you asking for triviabot

slim umbra
#

that is surprising but i'd wonder what it looks like a bigger bot

green kestrel
#

¿uoıʇɐʃsuɐɹʇ uɐıʃɐɹʇsnɐ sıɥʇ sı 'ǝɹǝɥʇ

crimson vapor
#

yes

#

that

green kestrel
#

that might be funny as an april fools day joke 🤣

crimson vapor
#

not april fools

#

add it as a real language

faint prism
#

Made my neck hurt

slim umbra
#

if they hadnt removed <user>.locale i could seen kinda what its like

green kestrel
#

@quartz kindle yeah one of a few languages people were very vocal for support for and never used

slim umbra
#

or made it a oauth authroziated thing scope field

green kestrel
#

just like hindi

gilded olive
#

ah that's a good time to ask I am adding multi language support so I need a few suggestions veryfastpats

green kestrel
slim umbra
#

turkish probs will be second most used after english if u market as turkish

gilded olive
slim umbra
#

bc there are a ton of turkish people on discord

green kestrel
#

several hundred using spanish

slim umbra
#

its just getting ur product to them

green kestrel
#

i think the whole turkish thing is more that there are tons of turkish devs

gilded olive
#

I see..

green kestrel
#

rather than turkish discord users

gilded olive
#

(writing down)

quartz kindle
#

since discord is mostly oriented towards gaming, polish and turkish should be pretty big as well

#

they have very large gaming communities

green kestrel
#

polish is coming in the next language update

quartz kindle
#

kurwa

green kestrel
#

maybe im just not targetting turkish people enough

#

as it doesnt have as big uptake as i'd hoped

#

or maybe its just a naff translation they dont want lol

sterile lantern
quartz kindle
#

tukey can be a bit nationalistic perhaps, if your bot is not 100% turkish maybe they dont like it as much

green kestrel
#

true

#

i noticed the strong patriotic/nationalistic vibes of all the bots, with turkish flags all over their embeds

quartz kindle
#

ye

crimson vapor
#

add a turkish flag on every response

green kestrel
#

lmao, when language is turkish

#

add a second copy of the bot the defaults to turkish with a turkish top.gg page. must have that pic of a deer in the background

quartz kindle
#

put pictures of erdogan

green kestrel
#

must use this emoji: celebrate

#

must have that bot logo with thunder and lightning

#

wait, erdogan?

#

most of the turkish bots ive seen have this ancient victorian looking video of some military dude in a hat

earnest phoenix
#

I am Turk dude

sterile lantern
#

AYY i did the lb

#

took long enough

green kestrel
#

so whos the military guy?

summer torrent
#

if you need turkish translator, i am here LUL

green kestrel
#

he must be famous in turkey, seen him in tons of bots

earnest phoenix
#

he's not famous

quartz kindle
#

no idea, but ergodan is the president

summer torrent
green kestrel
#

yes, theres a pic in many turkish bots of some guy that looks like hes from the army, black and white

#

animated gif of him turning his head

#

looks to be from at least the 1920s

summer torrent
#

i guess he is Atatürk

quartz kindle
#

this guy?

earnest phoenix
#

yes

green kestrel
#

yes thats the guy

summer torrent
#

yes he is Atatürk

earnest phoenix
#

All Turks love him

green kestrel
#

is he the founder of the country?

earnest phoenix
#

yes he is

summer torrent
#

yes

#

founder of Turkey

crimson vapor
#

how old is the country

#

young?

green kestrel
#

ah nice i learned some international history 😄

#

1934 apparently

summer torrent
#

Atatürk means "Father turk"

earnest phoenix
#

yes

crimson vapor
#

hmmm

summer torrent
green kestrel
#

as i knew it turkey is an ancient country, but hes the father of democracy in turkey?

earnest phoenix
#

yes he is

hollow sedge
#

pretty sure turkey is related to the ottoman empire

green kestrel
#

im pretty sure turkey and most of the countries in that region have more history than even britain

summer torrent
#

checkout Turkish Independence War

earnest phoenix
green kestrel
#

yup

#

ottoman empire was around all the way since the romans

crimson vapor
#

ye

earnest phoenix
#

@summer torrent turk musun gardas

summer torrent
green kestrel
#

if y'all start speaking turkish, this is where me with only google translate must bow out lol

earnest phoenix
#

🤣

crimson vapor
#

I don't even use google translate, I just wait for someone to answer in english

earnest phoenix
#

🤣🤣🤣🤣🤣🤣🤣🤣🤣

cerulean ingot
#

can someone help me please

crimson vapor
#

whats the issue?

cerulean ingot
#

this only shows up when you are going to a page like domain/servers

#

not when you just do domain

#

but then,

crimson vapor
#

whats your nginx config for domain?

cerulean ingot
#

when you reload the page

#

it all works fine

crimson vapor
#

oh that may be cache then?

cerulean ingot
#

oh

#

how do i clear it then

crimson vapor
#

not sure

earnest phoenix
#

@cerulean ingot turk musun

cerulean ingot
#

what

earnest phoenix
#

are you Turkish

crimson vapor
#

probably not

cerulean ingot
#

no

earnest phoenix
#

I thought his name was Turk because of his name

cerulean ingot
#

mystik?

#

ok

earnest phoenix
#

Would you like to see some Turkish words

#

?

cerulean ingot
#

no thanks

earnest phoenix
#

ok

sterile lantern
#
 let money = db.all().filter(data => data.ID.startsWith(`money`)).sort((a, b) => b.data - a.data)
        money.length = 10;
        let finalLb = "";
        for (var i in money) {
          finalLb += `**${money.indexOf(money[i])+1}.**     <@${money[i].ID.slice(6)}> - \`${money[i].data}\`\n`;
        }
        if (finalLb === null) finalLb = "Aw man.... no balances yet.."```
#

how come

#

if finalLB === null

#

doesnt work

#

actually, i should do if money === null

crimson vapor
#

if finalLb = "" or .length < 1

green kestrel
#

anyone here up for fixing my translations? 🙂 im sure theyre horrid - i accept pull requests 😄

sterile lantern
#

quick

crimson vapor
#

doesnt matter

sterile lantern
#

o

#

ok ty

green kestrel
#

pleaaase 😉 lol

crimson vapor
#

whats the links?

green kestrel
#

sec

solemn latch
#

I can translate your English into english

crimson vapor
#

ill check your english

#

same Woo

earnest phoenix
green kestrel
earnest phoenix
green kestrel
#

all the languages probably have bs in them

sterile lantern
#

hard???

#

bruh?

earnest phoenix
#

xD

sterile lantern
#

lmao its easier trust me

#

also

#

.length > 1 doesnt work

earnest phoenix
#

Is there anything you wonder about Turks?

solemn latch
#

Mongo will do a lot of this stuff for you

earnest phoenix
sterile lantern
#

it just says the it cant send an empty msg

solemn latch
#

Which makes it easier.

crimson vapor
green kestrel
#

kinda yeah lol

crimson vapor
#

bruh

#

why outline on screenshot

#

annoying

green kestrel
#

whats put the dotted outline in?

crimson vapor
#

sharenix

#

on laptop rn

wild ore
#

seninkinde hata

#

token yok

#

dbl token

sterile lantern
#
    if (finallb.length < 1) finallb = "Aw man.... no balances yet.."```
#

doesnt work

wild ore
#

yoksa bilerek mi sildin

cerulean ingot
#

how do i clear nginx cache

crimson vapor
#

idk if there is any nginx cache

cerulean ingot
#

then idk why this is happening

crimson vapor
#

cf?

quartz kindle
cerulean ingot
#

i only have nginx.conf

earnest phoenix
cerulean ingot
#

well

#

look

earnest phoenix
#

Gorunmesin diye

quartz kindle
#

you have a rule for port 80 (http), which redirects to port 443 (https), but you dont have any rule for port 443

crimson vapor
#

OOF

cerulean ingot
#

would something like this look right

#

right for 443

#

or is it more simple than that like

server {
    listen 443;
    server_name riverhost.xyz;
    return 301 https://$server_name$request_uri;
}```
quartz kindle
#

where is that config file located?

#

sites-enabled?

crimson vapor
#

wait why are you redirecting to the same url?

cerulean ingot
quartz kindle
#

the second one you sent

#

with the https rules

cerulean ingot
#

what

quartz kindle
#

you send another link to another configuration

#

the one that contains configuration for port 443

cerulean ingot
#

thats for my pterodactyl panel

#

sites-enabled, yes

quartz kindle
#

where is that file located

cerulean ingot
#

sites-enabled

quartz kindle
#

ok

#

and what are you trying to do exactly?

cerulean ingot
#

um

quartz kindle
#

if you already have a config file for that website

cerulean ingot
#

idk, i need a nginx.conf

quartz kindle
#

you already have it

cerulean ingot
#

where

quartz kindle
#

the links you sent lol

cerulean ingot
#

pterodactyl.conf

#

so,

#

how do i set my config file to that

#

when i restart nginx

quartz kindle
#

if the file is in the sites-enabled folder, its already configured

cerulean ingot
#

so i can delete nginx.conf

earnest phoenix
#

I'm calling out to everyone from here
Please do not exclamate your prefix. Because they interfere with other bots on our servers.

cerulean ingot
#

can i delete nginx.conf then??

quartz kindle
#

no

#

you need both

#

nginx.conf is the base configuration, then in the nginx.conf you have include sites-enabled

#

which means that all conf files in the sites-enabled will also be included

cerulean ingot
#

ahh

#

thank you ill try it out

#

any idea, Tim?

sterile lantern
#

i tried making errors.js

const error1 = require("../errors.js")

if(!role) return error1

errors.js error1

message.channel.send (embed stuff here)

#

it doesnt work

#

it just doesnt respond when the error is triggered

crimson vapor
#

are you returning error function or are you calling error function

sterile lantern
#

returning

#

return error1

crimson vapor
#

is error1 a function?

sterile lantern
#

o

#

it isnt

#

its just defined as requiring the error file

#

and in the error file

cerulean ingot
#

could anyone help

sterile lantern
#

error1 = embed

cerulean ingot
#

please

crimson vapor
#

I thought tim was helping

cerulean ingot
#

tims gone pandasad

crimson vapor
#

bruh

#

tim

#

y u leave

cerulean ingot
#

i did what tim said and it didnt work sadly

solemn latch
#

just as mysteriously as he appeared, he was gone.

cerulean ingot
#

should i ping pong him

solemn latch
#

nah, he is a busy guy

sterile lantern
#

so message.channel.send embed thing wont work if its in errors.js?

crimson vapor
#

no you just have to make it a function

#

for example

cerulean ingot
#

ugh

sterile lantern
#

function error1 {
// embed stuff here
}

cerulean ingot
#

i wish i could fix thios

sterile lantern
#

i think

cerulean ingot
#

wait i may know

crimson vapor
#
module.exports.error1 = (message) => {
  try {
    message.channel.send('ERROR');
  } catch (err) {
    console.log(err);
  }
  return
}```
cerulean ingot
#

i see here

crimson vapor
#
const { error1 } = require('errors.js')

//in code
return error1(message)```
#

@sterile lantern

sterile lantern
#

o

#

ok tysm

#

if i wanted to require a file

#

outside of my cmds folder

#

wouldnt it be

#

../file.js

#

?

obsidian cairn
#

pls

#

pls help

forest escarp
#

What’s the issue?

quartz kindle
#

notice the /*

cerulean ingot
#

yeah i got that

#

but look

quartz kindle
#

show your pterodactly.conf again

umbral zealot
sterile lantern
#
      return error1(message)
    }```

*error 1 is not a function* is the error
cerulean ingot
#

thank you for coming back tim

#

lol

mint charm
sterile lantern
#

i think that means too many requests?

mint charm
#

yes

sterile lantern
#

i dont think so but maybe

umbral zealot
#

429 means you're being rate limited.

cerulean ingot
#

^^

quartz kindle
#

remove server_tokens off;

mint charm
#

my bot just relogged by itself and that error occurs

sterile lantern
cerulean ingot
#

bruhhh

#

does it need to be in http

quartz kindle
#

did you change anything else in your nginx.conf?

cerulean ingot
#

thats all i have

quartz kindle
#

why did you add the includes

#

you already have them down there

#

remove the ones on the top

#

if you want to include more files, it has to be inside the http block

cerulean ingot
#

alright

#

ill try it

#

nope

crimson vapor
#

the error is in pterodactyl.conf tho I thought

cerulean ingot
#

i fixed the error

#

but uh

#

i get that

#

when i reload though

#

it seems to load fine

quartz kindle
#

which url are you trying to load?

#

riverhost.xyz? or www.riverhost.xyz? or /something?

#

http or https?

sterile lantern
#

yea i tried to do stuff and it doesnt let me

#

it keeps saying error1 is not a function @crimson vapor

crimson vapor
#

show code

sterile lantern
#

the one u gave me

#

is what im using

crimson vapor
#

yeah but how are you using it

sterile lantern
#

uhh nevermind

#

it was

#

errror1 and error1

#

thats why

quartz kindle
#

lmao

marble bridge
#

hola

#

hellp

#

hello

sterile lantern
#

how do i get out of two folders

#

so the cmd file is in economy folder, which is in commands folder

valid grotto
#

../../?

sterile lantern
#

hm

#

lemme try that

long marsh
#

Hey everyone! Should I continue to use the DiscordCollection object if I'm using another caching system anyways? Is there any advantage to leveraging the DiscordCollection?

sterile lantern
#

ayy worked thanks knowble

crimson vapor
#

discord collections are pretty good for caching I hear

long marsh
#

I'm using it for a specific use case now, specifically concerning timeouts, but I'm weary about the sharding process. When I switch over to redis, I would rather just have 1 simple caching solution. It seems that DiscordCollections are tied directly to a shard - so it would need to be emitted for all the shards to listen too?

crimson vapor
#

are they?

#

I thought they were just an extention of the map

long marsh
#

I'm not quite sure.

#

I believe I read that in the documentation somewhere though.

crimson vapor
#

one sec

wind vault
#

xd

crimson vapor
#

yep extends map

long marsh
#

With sharding, since multiple processes will be launched, each process (each shard) will now have its own subset collection of guilds it is responsible for. This means that your original code will not function as you expect it to.

crimson vapor
#

o

long marsh
restive furnace
#

can someone explain why isn't this regexp working on js, but works on regexr.com?
how i split + the regex:

const args = m.content.split(/('.*?'|".*?"|\S+)/g);```
what should happen:
```js
['!embed', 'hi"', 'no u"']```
what happens:
uncut river
#

what's the css property for the background of a bot page

#

tryna make a gradient

earnest phoenix
#

property or class

long marsh
long marsh
restive furnace
#

but how I can make it work properly on nodejs?

crimson vapor
#

wait Thomas what are you trying to do?

#

cache guilds in redis?

uncut river
#

nevermind i got it

long marsh
#

No. Cache timeouts 👍

crimson vapor
#

timeouts

#

as in

long marsh
#

Cooldown

outer zenith
#

i think i overuse txt files in my code

crimson vapor
#

oh

#

you could use a map correct

earnest phoenix
long marsh
#

I could instantiate a global map - yeah

crimson vapor
#

so do the exact same thing with a collection, no?

long marsh
#

But why do that if I'm just going to use Redis anyways 😄

outer zenith
crimson vapor
#

oh

earnest phoenix
#

a proper database, i.e. postgresql

outer zenith
#

ah makes sense

long marsh
#

No - because the collections are tied to a particular instantiation of the 'shard' ... meaning .. that collection is only available for those guilds in that shard.

crimson vapor
#

guilds are locked to shards but collections are just an extention of a map

earnest phoenix
#

My music bot worked!!!!!!!!

#

postgres for large scale, sqlite for small scale

outer zenith
#

what is large vs small scale

crimson vapor
#

im pretty sure you can use discordjs/collections in any project

long marsh
#

Wait, they're not tied to a client?

#

Oh, nvm then

earnest phoenix
#

but that varies on the data you store

outer zenith
#

ah

crimson vapor
outer zenith
#

fair

long marsh
#

1000 is the minimum to shard.

outer zenith
#

ill try and change it then

#

its only in 5 guilds rn 😭

#

lmao

long marsh
#

Ah, gotcha. So it's only regarding the guilds portion.

crimson vapor
#

yea

sterile lantern
#
fs.readdir('./commands/' && './commands/Economy/', async (err, files) => {```
this responds to commands in Economy but not in commands/
long marsh
#

Thanks for the highlight there, it helped haha.

crimson vapor
#

lol np

sterile lantern
#

it should work with commands

#

but it doesnt

#

so only economy cmds work

#

and non-economy cmds dont work

crimson vapor
#

read the code for collections, they are pretty cool

earnest phoenix
#

js sucks (눈‸눈)

crimson vapor
#

js is great

sterile lantern
#

is it bc im trying to fs.readdir to two dir?

outer zenith
#

sql does use database files right

#

just making sure

gilded olive
#

sqlite does

outer zenith
#

ok

crimson vapor
#

samm dont do that

sterile lantern
#

o

crimson vapor
#

make it recursive

gilded olive
earnest phoenix
#

All the js convo is going up from my mind

#

hm

long marsh
sterile lantern
#
  fs.readdir('./commands/Economy/'), async (err, files) => {```
#

probs wrong but

#

is that how im supposed 2 do it?

crimson vapor
#

samm

long marsh
#

Just started using it like a month ago - it actually gets me going faster than Python.

crimson vapor
#

do it recursively

long marsh
#

If I wanted a performant language, on the other hand, I would just use GOlang though.

earnest phoenix
#

I'm also gonna try to understand js

long marsh
#

Yeah

#

Rust is cool too

gilded olive
#

tbh I do not see why people make discord bots with discord.js, can someone explain why

earnest phoenix
#

its easy and fast

restive furnace
uncut river
#

is it possible to thin the border in .entity-content__description

uncut river
#

there seems to be another border when using border-width

crimson vapor
#
// Load Commands function (ish)
function loadCommands(dir) => {
  fs.readDir(dir, async (err, files) => {
    //check if file is folder or file
    if (isDir) return loadCommands(dir + filePath)
    else {
      // code here
    }
  })
}```
earnest phoenix
#

Py is easier to understand

long marsh
long marsh
gilded olive
outer zenith
#

whats the diff between mysql and sqlite3

#

cause ive used mysql before

gilded olive
#

i tried discord.js and was just left so confused

long marsh
#

I used discord.py and completely switched to discord.js

uncut river
#

sqltie3 is within the server

#

mysql is usually external server

outer zenith
#

ah

#

does it cost money?

uncut river
#

not sure i dont use

#

i use bettersqlite3

long marsh
#

Trust me, I'm a python guy. I use it in my day job everyday; however, I will say DiscordJS has been a crazy breeze compared with Discord.py

earnest phoenix
outer zenith
#

ah

uncut river
#

easy to use, no cost, great performance

earnest phoenix
#

It gives me goosebumps after seeing js codes

long marsh
#

If you're a newer developer, on the other hand, Python will be the easiest to understand / implement. Once you understand the foundational Computer science / software development principles, on the other hand, learning any language is normally just a means of getting over the initial hurdle of syntax.

gilded olive
crimson vapor
#

Thomas does it seem like I even know js?

long marsh
gilded olive
#

right

crimson vapor
#

next you're gonna say html isnt a language

long marsh
#

Because it's not, lmao

crimson vapor
#

lol

long marsh
#

HTML / CSS / etc. developers are mainly using frameworks at this point.

gilded olive
#

L in HTML stands for language so its a language right guys KEK

long marsh
#

The frameworks generate the HTML on their behalf and compress.

crimson vapor
#

ejs go brrrrrr

earnest phoenix
gilded olive
#

i think i prefer CSS than maybe the popular framework Sass

earnest phoenix
#

Hypetext markup language

gilded olive
#

what it used to be popular for is now in CSS itself so Shrug

earnest phoenix
#

Hm

long marsh
#

PHP doe 😬

crimson vapor
#

lol

earnest phoenix
#

sass is way more powerful and nicer to work it

gilded olive
wind vault
#

How do I make the servers command to show how many servers the bot is on? in discord.py

long marsh
#

There's a property for it

earnest phoenix
#

but it becomes obsolete when you start working with JSS in react, for example

sterile lantern
#

is there a way to do this without being this long

if (premiumuser === "true" && devbadge === "true") badges = "**__User Badges:__** \n\n![devcheck](https://cdn.discordapp.com/emojis/786290977207877652.webp?size=128 "devcheck") Bot Developer \n![devcheck](https://cdn.discordapp.com/emojis/786290977207877652.webp?size=128 "devcheck") Premium User"
    if (devbadge === "true" && premiumuser === null) badges = "**__User Badges:__** \n\n![devcheck](https://cdn.discordapp.com/emojis/786290977207877652.webp?size=128 "devcheck") Bot Developer"
    if (premiumuser === "true" && devbadge === null) badges = "**__User Badges:__** \n\n![devcheck](https://cdn.discordapp.com/emojis/786290977207877652.webp?size=128 "devcheck") Premium User"
    if (devbadge === null && premiumuser === null) badges = ""
    if (userbal === null) userbal = 0
    if (bot === null && item2 === null) items = "This user has no items in their inventory.";```
long marsh
sterile lantern
#

cuz if i add more items ill need to do even more checks

#

yea

wind vault
#

The idea is that they tell me how but I don't see that they want to do it

crimson vapor
#

make badges an array

long marsh
#

In fact, an if/else if/else would work more appropriately.

crimson vapor
#

if devBagde array.push (stuff)

#

imo better to use arrays than if/else if/else

gilded olive
#
server_count = len(bot.guilds)``` @wind vault
long marsh
#

I disagree with that statement.

#

It may be easier; however, it adds overhead from both memory and compute time.

earnest phoenix
long marsh
#

If conditional logic is O(1)

wind vault
long marsh
#

Oh, lol

obtuse jolt
crimson vapor
#

isn't condition logic O(n) n being conditions checked?

long marsh
#

Nope

crimson vapor
#

hmmmm

long marsh
#

O(4) if 4 conditions are checked

gilded olive
long marsh
#

If you have if statements wrapped in a for loop, yeah

wind vault
#

Ok thanks

gilded olive
#

if you want it to be in text use an f string

rare horizon
crimson vapor
#

hmmm

wind vault
#

Pl

crimson vapor
#

big O notation kinda weird

gilded olive
#
await ctx.send(f"Servers: {len(bot.guilds)}")```
earnest phoenix
#

@wind vault what's your bot about

long marsh
crimson vapor
#

did you read about all this code or did you go to uni?

long marsh
#

I went to uni

#

Graduated with a BS in Computer Science

gilded olive
#

wait thomas how old are you

crimson vapor
#

O(n) is worse than O(n^2)?

gilded olive
long marsh
#

Absolutely @crimson vapor

#

I'm 23

slender thistle
#

Still can't stop reading BS the bull way

crimson vapor
#

wait how

gilded olive
#

my god

wind vault
long marsh
#

OH

earnest phoenix
long marsh
#

I read that wrong

crimson vapor
#

oh ok

long marsh
wind vault
#

await ctx.send(f"Servers: {len(bot.guilds)}")
server_count = len(bot.guilds)

crimson vapor
#

big O notation is the amount of operations based on inputs?

long marsh
#

O(n^2) is WAY worse than O(n)

#

Yeah

crimson vapor
#

alr

gilded olive
#

i gave you what it is

earnest phoenix
#

@gilded olive your age?

crimson vapor
#

wikipedia didn't explain it to me

gilded olive
#

then i gave you an example of what it can be in text

#

14

crimson vapor
#

sadly

gilded olive
#

bruh

long marsh
#

I never use Wikipedia.

gilded olive
#

3 and 4 key do be close to each other

crimson vapor
#

I like it

#

more trustful than blogs

#

less trustful than papers

gilded olive
#

people use wikipedia?

long marsh
#

If/elif/else statements are normally O(1), O(2), O(3), etc. ... however, worse case, is that it goes through all the conditional statements ... technically that would be O(n)

gilded olive
crimson vapor
#

ok

earnest phoenix
gilded olive
#

i answered you

earnest phoenix
#

14?

gilded olive
#

yes

earnest phoenix
#

I'm 15 lel

crimson vapor
#

realistically with random ordered statements, it should be O(n/2) right

gilded olive
#

:(

long marsh
#

If you have 2 for loops, O(2n) .... if you have nested for loop O(n^2)

earnest phoenix
long marsh
long marsh
crimson vapor
#

ok

long marsh
#

oops

crimson vapor
#

big O notation kinda big brain ngl

long marsh
#

Not logarithmic 😉

crimson vapor
#

linear

#

yea ik

long marsh
#

O(n/2) doesn't exactly mean anything ... Computer Scientists normally round O(n)

crimson vapor
#

o

long marsh
#

I mean, obviously it's important; however, for simplistic calculations like Big O, just round.

#

O(2), on the other hand, rounds to O(1)

crimson vapor
#

that makes no sense lol

long marsh
#

Agreed.

#

Well, in a infinite space, you wouldn't know what n is.

#

O(122) ... could technically still be O(1) ... since n could = 2033040430

crimson vapor
#

hmmm

long marsh
#

O(2n) -> O(n)

#

Or maybe, my professors just simplified it for the means of simplifying it 😄

lament meteor
#

Naw 2n is a linear function

#

n/2 is also 1/2 n thus it is also linear

long marsh
#

So is n 🤔

#

Right

#

Wait - are you agreeing or disagreeing?

#

You're saying all linear operations simplify to just 'linear' in Big O?

lament meteor
#

Its just simplified to the simplest equation

long marsh
#

Gotcha

lament meteor
#

Kinda yeah

long marsh
#

O(n log n), of course, it's it own thing .. not O(n)

lament meteor
#

log n is different

crimson vapor
#

is it possible to have O(root(n))

long marsh
#

True

lament meteor
#

Probs not

long marsh
#

O(n) at that point, right?

lament meteor
#

Idk

crimson vapor
#

not exactly

lament meteor
#

Square roots arent linear

long marsh
#

True

crimson vapor
#

because 4 inputs would be 2 operations

#

and 16, 4

long marsh
#

Is that log(n) at that point 🤔

lament meteor
#

Idk

long marsh
#

Lol

#

Break my head, why don't ya 😄

crimson vapor
#

root(x) isnt logarithmic

#

is it?

long marsh
#

?

crimson vapor
#

I don't think so

long marsh
#

That's the chart.

crimson vapor
#

one sec lemme get paper

long marsh
#

It would technically be between O(n) and O(log n), right?

#

Square root time complexity means that the algorithm requires O(N^(1/2)) evaluations where the size of input is N.

#

So, yeah - it's n

crimson vapor
#

1/2 log n I think

long marsh
#

root(x) simplifies to linear.

crimson vapor
#

hmm

lament meteor
#

My operations are n!

long marsh
#

IMAGINE

lament meteor
#

They are very efficient

long marsh
#

lmao

crimson vapor
#

LOL

long marsh
#

Factorial operations are always fun 😄

lament meteor
#

How do u make smthn that slow

long marsh
#

Real talk, a quantum computer can handle those things like they're linear.

crimson vapor
#

n!?

#

that would get big fast

earnest phoenix
#

we've progressed so far with quantim technology but there's still so much to go

#

quantum*

graceful dock
#

Not really, quantum computers are useless rn

#

They are only good at specific tasks

lament meteor
#

Yea like helping ur mom do the dishes

graceful dock
#

You got the whole squad laughing

#

Stfu man

lament meteor
#

Why use a quantum computer for computing when u can reinvent the wheel

graceful dock
#

Because using a computer that is ultra unstable and must be keeped as close as possible to the 0 Kelvin is fun 👍

crimson vapor
#

yes lets change all of computing to work more efficiently

hollow sedge
#

it has a ton of computing power though

#

which is why it's useful

crimson vapor
#

json dbs are shit but people still make them

#

so why not quantum computers

graceful dock
#

I'm not saying that it's not useful, I'm just saying that right now, it's not really usable

#

It is just useful at certain tasks. I think it beat the IBM Super computer at a specific task

hollow sedge
#

what is "it"?

lethal valley
#

could i get the code to get that background image effect on your bots box(this is not on the bots page), where it also says view and vote

#

if anyones got it thats thonx

graceful dock
hollow sedge
#

oh

earnest phoenix
#

hey

#

@lethal valley no spoonfeeding my boy

pale vessel
still merlin
#

I haven't coded a bot or anything in ages and I need to make a bot but I tried running my bot but message isn't defined, despite being in a message event, code:

crimson vapor
still merlin
#

ohh

#

but how do I fix that message thing

#

a

graceful dock
#

Yea I think Google's quantum computer managed to resolve a specific problem that should've took years in seconds

hollow sedge
#

wait what

#

how did you post the image there so quickly

crimson vapor
#

huh

hollow sedge
#

i mean

#

you took it

#

then it was there

crimson vapor
#

fast

lethal valley
#

how do i add a image to my top.gg bot page?

earnest phoenix
#

html img tag

lethal valley
#

do you know the code?

still merlin
#

I'm in a message event though and message is still undefined

earnest phoenix
#

it's not that hard to search "html img" on google

lethal valley
#

i mean how would i lay it out lol

#

ill try though myself

crimson vapor
#

@still merlin define message in the callback of the message event

#

I would say learn javascript also

still merlin
#

I haven't coded in a year

crimson vapor
#

then relearn

still merlin
#

I am, But I need this bot done

hollow sedge
#

you just need it

manic cairn
#

Are you able to add css to the bot img still?

hollow sedge
#

yes

earnest phoenix
crimson vapor
#

yea

earnest phoenix
#

why star tho

manic cairn
#

Is it .entity_header__avatar ??

hollow sedge
#

why dont you try it

crimson vapor
pearl briar
#

hello i want to ask,any tutorial when someone vote my bot, and unlock the command?

crimson vapor
#

not a tutorial but people in #topgg-api can help you

pearl briar
#

hm okay thanks

manic cairn
#

Bc its effort

gilded olive
lethal valley
gilded olive
#

whatever you want, no ones forcing you

young flame
#

how do you do the thing

#

where on like bot support servers it says login and it redirects you

gilded olive
#

you mean on a website?

lusty quest
#

you mean website?

young flame
#

yea

gilded olive
#

depends what framework

crimson vapor
lusty quest
#

if yes they use oauth2

gilded olive
#

^

young flame
#

O

#

how

#

do you do that

lusty quest
#

discord.js guide is your friend

#

they have a explanation

young flame
#

wait wtf is a uri

earnest phoenix
#

a url

#

lol

lusty quest
#

@gilded olive if you dont have Dev role all links are nuked

young flame
gilded olive
#

sad

young flame
#

i was like wtf

gilded olive
#

So i can't reply tuff

lusty quest
#

well, the alternative would be trolls posting rickrolls everywhere

gilded olive
#

the discord developer docs give documentation of their oauth2, so you can check that out @young flame

young flame
#

ill look at it

flat pelican
#

Can you guys please keep the starboard clean

strong birch
#

is this betterticket's discord server ?

gilded olive
#

no

strong birch
#

i found it on bettertickets page lol

gilded olive
crimson vapor
#

can we get a -wrongserver @green kestrel

#

well

#

I didn't think to

strong birch
#

luca nice

#

what this do ?

earnest phoenix
#

nothing useful to you

strong birch
#

ohh k k\

shy turret
#

dude

#

custom command endpoints are so fun

crimson vapor
#

how do you even use them

ember crystal
#

pls add my bot i need to get him in 75 servers?

misty sigil
#

@modern sable

trim saddle
#

@ember crystal you should delete that

misty sigil
#

bruh

trim saddle
#

you're not supposed to advertise for guilds

modern sable
#

-faq 1 -c @ember crystal

do not post bot invite links in this server

gilded plankBOT
ember crystal
#

i thought we where supposed to put are bots here

trim saddle
#

the website

#

not the server

quartz kindle
trim saddle
#

he wasn't getting any by posting it here KEKW

quartz kindle
#

they dont like bots that grow too fast, that are advertised, or that are in a lot of servers from the same owner

pastel spear
#
if(command === "fkick") {
    console.log("Fake kick command used in "+message.guild.name+" By "+message.author.tag);
    message.delete().catch(O_o=>{});
    client.channels.get("ExampleID").send("Fake kick command used in "+message.guild.name+" By "+message.author.tag);
    if(message.mentions.members.size == 1) {
        let member = message.mentions.members.first()
        message.channel.send(`${message.author} kicked ${member}`, {
        });
    }
}

I looked at discord.js documentation and Im thinking they may have deprecated what I was using for this command. My first thoughts are maybe the way it handles message.mentions.members.first() changed. Any thoughts?

ember crystal
quartz kindle
#

its written in discord's help pages

crimson vapor
#

you aren't supposed to cheat

ember crystal
#

oh

fallow lichen
#

is there an easy way to split this line for example bot!display a=gol um n>=10 dis=weeb into multiple arguments to use it in a function where a='gol um',n=10, dis='weeb' with python?

#

I could read it letter by letter and splitting it but is there an other way?

ember crystal
#

i made that on mobile

#

i make bots on mobile

pastel spear
#

@ember crystal Ive gotta commend you on that. I couldnt code on mobile that stuff annoys me. Gotta have my monitor. 😂

ember crystal
pastel spear
#

Yea. I got that eyestrain cuz I wear glasses so makes it harder to use mobile lol

sudden geyser
fallow lichen
#

Hmm, yes i didn't thought of that

trim saddle
#

@quartz kindle oh did i tell you i started on that lib

trim saddle
#

i only get 3 events

fallow lichen
#

and so it would be easier to isolate 'gol um'

earnest phoenix
#

🗿

hollow sedge
#

You should probably just have the user use a separator between the things if your arguments can vary

obtuse jolt
whole ocean
#

guys do you remember the blog post about new features in the discord api?

#

is there a new update for this?

umbral zealot
#

Typically Discord, the time it'll be implemented is...

trim saddle
#

i use light mode

#

i can't see that emoji

crimson vapor
#

thats a rip

#

soon™️

young flame
#

coding on mobile is stressful af

ember crystal
quartz kindle
#

whats your code

young flame
#

i have 1 event

#

voltrex coded a bot on mobile

earnest phoenix
#

🗿 Me here literally actually programming everything on mobile watching this guy be like

quartz kindle
#

can BDFD even be considered coding?

earnest phoenix
#

No

quartz kindle
#

lmao

crimson vapor
#

BDFD?

#

explain

quartz kindle
#

bot designer for discord

hollow sedge
#

How is coding stressful lol

young flame
crimson vapor
#

is that a real question?

young flame
#

no

crimson vapor
#

its a hard no

hollow sedge
#

The only stressful part is when you're working with git and you accidently delete everything

young flame
#

lol

quartz kindle
#

well tell that to the guy who's "coding" on mobile xD

earnest phoenix
#

BDFD is just clicking some buttons and using markdown kind of language, how is that "coding" omegalul_QKSER

young flame
#

lol

ember crystal
quartz kindle
#

yes, "coding"

earnest phoenix
#

That isn't coding my dear friend

young flame
#

i dont need your agekiddo

hollow sedge
#

GUYS HOLD ON

#

He's 13

earnest phoenix
#

And

ember crystal
#

bro the app is 13 and up

young flame
#

i strated legit coding when i was 7 trying to break into nasas satelite

ember crystal
#

i’m fine

trim saddle
#

@quartz kindle so uhh hm.

hollow sedge
crimson vapor
#

13 y/o's are cringe

#

ngl

earnest phoenix
#

omegalul_QKSER What am i supposed to say

ember crystal
young flame
#

@ember crystal go play fortnite smh

earnest phoenix
#

that is scripting, not coding nor programming

crimson vapor
#

LOL

hollow sedge
gilded olive
ember crystal
young flame
#

watch your language

earnest phoenix
young flame
#

i dont think your mom would like you cussing

trim saddle
young flame
ember crystal
young flame
misty sigil
feral aspen
ember crystal
hollow sedge
#

@ember crystal I believe in you, don't listen to the other people. BDFD is one of the best programming languages in the world. It's used by many data scientists and has a lot of practical usage.

gilded olive
earnest phoenix
young flame
#

lol

young flame
#

shut the fuck you right

earnest phoenix
#

🗿 I'm just watching this chat, calmly

gilded olive
#

is BDFD even programming 🗿

feral aspen
young flame
#

ok

hollow sedge
#

The others don't appreciate the beauty of an expressive language like BDFD.

earnest phoenix
#

this reminds me of the im 11 so shut the fuck up vine

feral aspen
#

😂

shy turret
crimson vapor
#

hot

gilded olive
#

huh

hollow sedge
#

What

crimson vapor
#

I wanna know how

feral aspen
#

DAMN! 😂

gilded olive
#

what's that

#

replies?

earnest phoenix
#

Wait

#

slash commands

#

What the fuck

gilded olive
#

wait what

hollow sedge
#

Wait since when

earnest phoenix
#

they're in A B testing right now

young flame
#

hey guys watch me code in BDFD

shy turret
#

i dont have access to slash cmds but my friend does

hollow sedge
#

Awesome

young flame
#

$message1$message8$messagemessage

gilded olive
#

datamining?

earnest phoenix
hollow sedge
#

Would anyone like to join me in hacking NASA with BDFD?

feral aspen
hollow sedge
#

Awesome

feral aspen
#

Let me bring my mobile quick.

hollow sedge
#

I'll be messaging you soon and anyone else who wants to join

feral aspen
#

Yes, FBI is willing too.

ember crystal
hollow sedge
#

Great!

ember crystal
#

bro just i have been waiting

earnest phoenix
#

🗿 Literally 1 character of binary is better than the entire syntax of BDFD, BDFD is just "fail"

hollow sedge
#

Did you just respond to a bot @ember crystal

young flame
#
echo Goodbye world
cunning oxide
#

Alright, quick question cuz I can't figure this shit out. I'm trying to send an embed based from a separate file if users request it. message.channel.send(embeds.helpcmd(message, '${command.help.name}', '${command.help.usage}')); However I'm getting a "cannot send an empty message" error. The message is still sending all contents though.

ember crystal
#

hurry up @gilded plank

hollow sedge
#

Dude it's a bot

gilded olive
#

it takes 1 week -2

ember crystal
gilded olive
#

01010101010101110101001010101010101010101010101010101

cunning oxide
#

@feral aspen what do you mean? I am already -- lemme show ya.

gilded olive
#

mee6

#

boom

#

ez pz

hollow sedge
#

Why BDFD though

young flame
#

lol

cunning oxide
#
module.exports.helpcmd = (message, command, syntax) => {
    let embed = new Discord.MessageEmbed()
        .setTitle(`:page_facing_up: Help for ${command}.`)
        .addField("Correct Syntax:", syntax)
        .setColor(colors.white);

    message.channel.send(embed);
}
hollow sedge
#

Like at least make a graphical interface if you're going to make one of those things

young flame
#

mee6 be like buybuybuybuybuy

cunning oxide
#

its defined

#

so im a lil confused

earnest phoenix
#

You should return the constructed embed and send it yourself, way easier to debug what's going on

cunning oxide
#

good idea

#

its just super weird