#development

1 messages · Page 3 of 1

boreal iron
#

soon message counter goes brrr

wooden ember
#

didnt think you could still have detailed info like that anymore cuz of caching

boreal iron
#

tf he's recording anything

wheat mesa
boreal iron
#

why do I want to know the amount of events

#

lmao

#

just because it "looks" fancy

wheat mesa
#

it's just stats

boreal iron
#

hmm... why not

wooden ember
#

mmm yes fan speed

quartz kindle
#

nice

wheat mesa
boreal iron
#

Also don’t wanna talk about using AMD

#

Can’t take this seriously

quartz kindle
#

if my bot uses 130mb at 9k servers, would it use 130gb at 9 million servers?

wooden ember
wheat mesa
#

so close to finishing my interpreter in rust but I'm lowkey burnt out after writing 2k+ loc in like 6 hours total working time

boreal iron
#

Everyone knows that

wooden ember
#

other than that its the only gpu i have to put in it, it only uses like 6 watts since its an hd5450

boreal iron
#

Tim…

quartz kindle
#

im lazy afk

wheat mesa
#

I had help from a github repo

#

Using it to learn

quartz kindle
#

i work 2 hours per week

#

lmao

boreal iron
wheat mesa
quartz kindle
#

nice

wheat mesa
#

wrote the whole parser in one day lmao

quartz kindle
#

random motivation bursts are awesome

wheat mesa
#

sadly it's ended

quartz kindle
#

rip

wheat mesa
#

almost 1k

wooden ember
#

works real well now though

#

can reload commands and stuff withought having to restart the bot

#

epic

wheat mesa
#

I'm glad I didn't have to fuck around with lifetimes too much

quartz kindle
#

nice

wheat mesa
#

I can't

#

esm moment

wooden ember
#

big sad

#

honestly suprised i havent done this sooner

#

cuz now if a commands broken cuz i typed somthing wrong like an idiot then it wont crash the whole bot

boreal iron
#

error handling the thing you usually start with

wheat mesa
#

ngl rust is amazing

boreal iron
wheat mesa
#

look at how easy it is to represent the entire structure of my language: ```rs
#[derive(Debug, Clone)]
pub enum Expr {
Literal(Literal),
This(SourceLocation),
Unary(UnaryOp, Box<Expr>),
Binary(Box<Expr>, BinaryOp, Box<Expr>),
Logical(Box<Expr>, LogicalOpType, Box<Expr>),
Call(Box<Expr>, SourceLocation, Vec<Expr>),
Get(Box<Expr>, Symbol),
Grouping(Box<Expr>),
Variable(Symbol),
Assign(Symbol, Box<Expr>),
Set(Box<Expr>, Symbol, Box<Expr>),
Super(SourceLocation, Symbol),
}

#[derive(Debug, Clone)]
pub enum Stmt {
Expr(Expr),
FunDecl(FunDecl),
ClassDecl(ClassDecl),
If(Expr, Box<Stmt>, Option<Box<Stmt>>),
Print(Expr),
VarDecl(Symbol, Option<Expr>),
Block(Vec<Stmt>),
Return(SourceLocation, Option<Expr>),
While(Expr, Box<Stmt>),
}

earnest phoenix
#

@wheat mesa do u know any good scrambler and unscrambler

wheat mesa
#

no

earnest phoenix
#

ok

wheat mesa
#

like a Caesar cypher?

wooden ember
#

ironically

wheat mesa
#

look that up, I'm sure there's something out there for it

earnest phoenix
#

I couldnt find and npm package for that :(

#

would be nice to have but theres none ig

wheat mesa
#

make your own

earnest phoenix
#

maybe

wheat mesa
#
earnest phoenix
#

oh

wheat mesa
#

it's old but so is the caesar cipher

earnest phoenix
#

I looked up for the wrong tag then

#

used "scrambler"

earnest phoenix
wheat mesa
#

it's pretty easy to make your own as well

earnest phoenix
#

exactly what I want tbh, maybe with more customization

boreal iron
wooden ember
#

i do that

boreal iron
#

If your command handler try’s/catches the executing of your command you don’t need to catch any promise you’re using inside

#

Just await them

wooden ember
#

did that too

#

wait

boreal iron
#

And what sort of errors did your bot crash then?

wooden ember
#

typos and just code not working

boreal iron
#

That’s what the top level error handler is for catching any unhandled exception

wheat mesa
#

lol this caesar cipher implementation is a little dumb

#

"one file for each function!"

#

I mean really

#

cmon

wooden ember
boreal iron
wheat mesa
#

75% of the functions aren't even really his code

#

it's just him re-exporting native js functions under his own function name

boreal iron
#

But you still need to await any promise

#

Or the tracelog won’t be much helpful

wooden ember
#

bruh i spent ages catching all the errors

#

reeeeeeee

boreal iron
sharp geyser
#

fun fact, it doesn't matter

boreal iron
#

If you catch an error inside the module the command handler will@never know

wooden ember
#

i mean it logs it so its not in vain

near stratus
#

@boreal iron thanks for the suggestion
apparently raw message / embeds count as xxxxPayload type
now everything works fine

boreal iron
#

If just one guy stops using builders my life makes sense

near stratus
boreal iron
#

I don’t try to move Waffle into this direction anymore

wheat mesa
#

looking good

boreal iron
#

After using Java, now Rust he’s completely out of control anyways

sharp geyser
#

Nice

sharp geyser
#

Well rust is just good

wheat mesa
#

rust is based

boreal iron
#

Out of control like I said

wheat mesa
sharp geyser
#

Who hasn't

boreal iron
#

Damn… PSU inlet temperature is just 7° away from its critical temperature

wheat mesa
#

I want it

sharp geyser
#

They'd be living under a rock if they hadn't

#

Fleet is like jetbrains version of vscode

wheat mesa
#

yes

#

I want it

#

for rusting

sharp geyser
#

It's coming soon

wheat mesa
#

but I hope it has good plugin support

sharp geyser
#

I think it's in closed beta

wheat mesa
#

because I can't give up rust-analyzer

sharp geyser
#

It's jetbrains watfle

#

They pretty much led plugin support

wheat mesa
#

rust analyzer is amazing though

#

so they better have it or something better

boreal iron
sharp geyser
#

Well either they will make the plugin or someone else will

wheat mesa
#

notepad++ is just torture

#

no autocomplete 😔

sharp geyser
#

Hey waffle you could make the plugin

boreal iron
#

I go crazy anytime I use an editor which has it

steady tide
#

Hi I’m new in this server

boreal iron
#

Randomly placing end parentheses and brackets where I don’t want ‘em

near stratus
steady tide
#

Hi I’m new in this server

boreal iron
#

We know

sharp geyser
boreal iron
#

You already told us that

sharp geyser
#

That doesn't correlate at all

wheat mesa
boreal iron
#

Nah I don’t know… I don’t like it tbh

sharp geyser
#

I could never get rust analyzer to work

wheat mesa
#

cus ur noob

sharp geyser
#

He's old waffle

boreal iron
#

lmao

sharp geyser
#

He likes guessing what shit does

near stratus
boreal iron
#

I just like to enter any char myself and lookup the parameter order of my functions

sharp geyser
#

I feel a plugin for an already existing editor is easier to make

#

But ok

steady tide
#

I want to leave this sever en never be in it

wheat mesa
#

making the text area is easy, making literally the other 99% isn't

sharp geyser
#

Do it

wheat mesa
#

2011... he's 11!

near stratus
boreal iron
wheat mesa
#

he's alr gone

boreal iron
#

There we go

sharp geyser
#

I don't consider notepad++ an editor

#

I only use it to quickly look at my code

boreal iron
#

Can’t complain… there are quite some useful tools and overlays

#

But yeah probably nothing to compare it to known editors

near stratus
boreal iron
#

Is this sort of… editorcism? I mean it isn’t racism obviously

#

Tbh I just don’t wanna switch as I don’t wanna deal with all the options and features I have to adjust once or multiple before going crazy

#

Cuz it doesn’t do what i expect

#

And I don’t wanna do things differently

#

you will understand in like 10-20 years

ancient nova
#
    at Object.exports.run (/home/container/commands/whois.js:72:165)
    at module.exports (/home/container/events/messageCreate.js:285:19)
    let slicedRoles = member.roles.cache.filter(r => r.id !== message.guild.id).map(roles => `<@&${roles.id }>`);
    if (slicedRoles.length === 0) slicedRoles.push("None");
    if (slicedRoles.length >= 16 && slicedRoles.length !== 0) slicedRoles = slicedRoles.slice(0, 16) + " and more...";
``` but only for certain people, why is that?
lyric mountain
#

why @&?

boreal iron
#

well join isn’t a function if your slicedRoles isn’t an array

#

What’s wrong with it?

lyric mountain
boreal iron
#

I mean the last time you overwrite slicedRoles it obviously is a string

ancient nova
#
statsEmbed.addField(`Roles (Total of ${slicedRoles.length} Roles)`, slicedRoles.join(", "));
``` now for some reason for the guy that the error popped up it's saying it's got a total of 500 roles? even though he has the same amount as me?
lyric mountain
#

slicedRoles might be null or undefined no?

ancient nova
#

no because when I do slicedRoles then it's working

#
statsEmbed.addField(`Roles (Total of ${slicedRoles.length} Roles)`, slicedRoles === undefined ? "Could not fetch the roles." : slicedRoles);
``` this worked for the guy that had the error but stopped working for me
#

and when I add .join it works for me but not for the other guy

#

what the hell?

boreal iron
#

=== undefined

#

Ur still using this

#

What if it’s null?

#

Told 1 million times already that’s nonsense

ancient nova
#

yeah my bad, still I don't see how that could even be a thing?

boreal iron
#

Only exception is if null is legitimate value

ancient nova
#

it works for everyone BUT that one person?

#

and he has identical roles to me

lyric mountain
#

when it comes to programming you don't question, you simply try

#

weird things happen

ancient nova
#

but that's literally not supposed to happen like at all

#

500 roles when he has 13? something's clearly wrong

lyric mountain
#

not supposed to happen
strange things happen

boreal iron
#

As I said above you map slicedRoles which ends up it will be an array, and if more than 16 roles are a thing you turn it into a string by concating “and 16 more to it”

#

That’s not really consistent at all

lyric mountain
#

you cant take anything for granted, you need to check all ends

#

like a solid codebase crashing out of nowhere due to cosmic ray

boreal iron
#

Check if slicedRoles is an array before calling join on it
…length will not replace a check of its type

#

Since strings also have a length

wooden ember
#

so i have this line in my reload command

delete require.cache[require.resolve(`./${file}`)];

and the way im reloading everything it loads all the file names, unloads the moduals from the command map then re loads them. however if ive added a comand im guessing this will through an error cuz it cant unload somthing thats not loaded in the first place, how would i catch that?

lyric mountain
#

try { } catch { }?

wooden ember
#

really?

#

thats far simpler than i would have thought

boreal iron
#

Does it cause an error?

#

I’m not sure

wooden ember
#

havent tryed it yet just guessed

#

one sec

boreal iron
#

Or does the delete keyword suppress errors if the var or prop doesn’t exist

wooden ember
#

it didnt error

#

what

#

the one time i guessed that it would error and it didnt

#

what strange times we live in

ancient nova
#
statsEmbed.addField(`Roles (Total of ${slicedRoles.length} Roles)`, !slicedRoles ? "None" : (slicedRoles.length >= 16) ? (slicedRoles.slice(0, 16) + " and more...") : slicedRoles.isArray() ? slicedRoles.join(", ") : slicedRoles);
``` lol
#

wait isn't isArray a thing in js?

lyric mountain
#

const strRoles = Array.isArray(slicedRoles) ? slicedRoles.join(", ") : slicedRoles

boreal iron
#

It’s a global var

#

Array.isArray(slicedRoles)

ancient nova
#

nvm I gotchu

lyric mountain
#

save it to a variable so u don't have to call the same thing a fuckton of times

boreal iron
#

Would make more sense to just not mix multiple possibles types into one var

#

Either an array or null

#

Makes more sense

#

Even if it just contains one item (role) you can still use join() on it

#

Which prevents those checks, confusing and inconsistency

ancient nova
#

it appears to work so is it really worth writing more compliacted code

boreal iron
#

lol

lyric mountain
#

technically, it'll be less complicated code

ancient nova
#

more complicated, but more readable I think

boreal iron
#

You just usually make things way more complicated and inconsistent than needed

ancient nova
#

is that going to cause an error if I just leave it like this?

boreal iron
#

As long as the field value is never empty it shouldn’t

lyric mountain
#

technically, no, but getting this habit will lead to coding debts later on which will make maintenance a nightmare

boreal iron
#

But I don’t see your code at all so guessing isn’t really helpful

ancient nova
#

just tried this on a user with no roles returned me an error so kek

ancient nova
# boreal iron But I don’t see your code at all so guessing isn’t really helpful

I sent it before ```js
let slicedRoles = member.roles.cache.filter(roles => roles.id !== message.guild.id).map(roles => <@&${roles.id}>);

const statsEmbed = new MessageEmbed();
statsEmbed.setTitle(member.user.tag);
statsEmbed.setThumbnail(member.user.displayAvatarURL());
statsEmbed.setColor(commandColor);
statsEmbed.addField("Status", status[statusResult]);
statsEmbed.addField('Joined On', timeAgo(member.joinedAt));
statsEmbed.addField('Created At', timeAgo(member.user.createdAt));
statsEmbed.addField(`Roles (Total of ${slicedRoles.length} Roles)`, !slicedRoles ? "None" : (slicedRoles.length >= 16) ? (slicedRoles.slice(0, 16) + " and more...") : Array.isArray(slicedRoles) ? slicedRoles.join(", ") : slicedRoles ?? "None");
statsEmbed.addField("Acknowledgements: ", acknowledgments.join(", "));
statsEmbed.addField("Permissions: ", permissions.join(", "));
boreal iron
#

Well it’s actually quite hard to figure stuff out on mobile

ancient nova
#

my bad do you want me to put that into a pastebin

boreal iron
#

Especially in discords code blocks

#

Pastebin has the same code blocks on mobile as it does use the device size

#

Hastebin or sourcebin or however all those shitty platforms are called don’t do so

median ginkgo
#

a

lyric mountain
ancient nova
#

what does that mean?

lyric mountain
#

this.is().a().chain()

#
this
  .is()
  .a()
  .chain()
boreal iron
#

You can call the methods right behind the constructor

#

Yeah

wooden ember
#

idk what that even means

ancient nova
#

I prefer not to chain it though

boreal iron
lyric mountain
#

I mean, up to you but using statsEmbed on every line is unnecessary

boreal iron
#

Means execute can’t be called on null/undefined

wooden ember
lyric mountain
#

well, first of all process ur array and save it to a variable

wooden ember
#

thats the confusing bit

boreal iron
wooden ember
#

what do you mena?

boreal iron
#

Then make sure execute as module property exists

ancient nova
#
    const slicedRoles = member.roles.cache.filter(roles => roles.id !== message.guild.id).map(roles => `<@&${roles.id}>`);
    const slicedRolesCount = slicedRoles.length;
    const slicedRolesFinal = slicedRoles ? "None" : (slicedRoles.length >= 16) ? (slicedRoles.slice(0, 16) + " and more...") : Array.isArray(slicedRoles) ? slicedRoles.join(", ") : slicedRoles;
    
    const statsEmbed = new MessageEmbed();
    statsEmbed.setTitle(member.user.tag);
    statsEmbed.setThumbnail(member.user.displayAvatarURL());
    statsEmbed.setColor(commandColor);
    statsEmbed.addField("Status", status[statusResult]);
    statsEmbed.addField('Joined On', timeAgo(member.joinedAt));
    statsEmbed.addField('Created At', timeAgo(member.user.createdAt));
    statsEmbed.addField(`Roles (Total of ${slicedRolesCount} Roles)`, !slicedRolesFinal ? "None" : slicedRolesFinal);
    statsEmbed.addField("Acknowledgements: ", acknowledgments.join(", "));
    statsEmbed.addField("Permissions: ", permissions.join(", "));
    return message.channel.send({ embeds: [statsEmbed] });
``` I'm really lazy so sorry for the bad code
boreal iron
ancient nova
#

I basically didn't change anything just prevented the error at the end if it's an array but has 0 roles

boreal iron
#

But

#

It could still be possible execute isn’t existing

wooden ember
#

so its not working on the commands that have async

boreal iron
#

If you didn’t define the property in your exported module

#

Just to say

ancient nova
#

what's the char limit for fields? 2048?

lyric mountain
#

ye

#

but embeds also have a global limit

ancient nova
#

a global limit?? so each fields can't have 2048?

#

if you have 2 fields would it be 1024 for each?

lyric mountain
#

not if the sum of everything surpass that limit

#

fields can have up to 2048 chars

boreal iron
#

The docs are actually very accurate about this question

lyric mountain
#

but the sum of everything in ur embed cant surpass the global limit

boreal iron
#

So a field value can only have a length of 1024

lyric mountain
#

ah, it's footer that has 2048 limit

#

for some odd reason

wooden ember
boreal iron
#

Tf you wanna out there if you can’t even use line breaks

#

The dude who made that decision must have been on crack

#

And drunk at the same time

#

I guess

wooden ember
#

uses only the footer so i can have smoll letters

boreal iron
#

The author has a smaller font size as well

#

And supports a too big icon in comparison to the font size

wooden ember
#

didnt know there was an author field tbh

#

wait

#

no i did i just forgot

lyric mountain
#

all I wish is that they separated the body from the thumbnail

#

so u can have text below the thumbnail space

boreal iron
#

It’s literally just a title with a smaller font size and and icon you can use

#

I don’t know why that’s missing in the title

boreal iron
#

Wouldn’t be an issue since the thumbnail has a fixed size anyways

lyric mountain
#

how the layout is

#

how it should be

boreal iron
#

floating yeah

lyric mountain
#

and it aint all that hard, just nest the thumbnail in the author div

boreal iron
#

Or just use float right on it

lyric mountain
#

wouldn't that cause layout issues on small embeds?

boreal iron
#

Well don’t have a inspector tool on mobile

#

So maybe, maybe not

#

Not needed to think about it anyways

#

Won’t ever happen

ancient nova
#

I'm sneezing every 30 seconds help me 😭

boreal iron
#

your body is fighting against your code

#

I guess

#

Your nose screams, don’t do it that way, don’t

opaque acorn
#

i cant invite my bot, and i didnt change the link

lyric mountain
#

u supplied an invalid permission bitfield

#

send here how &permission=XXXXXXX is in ur url

#

or print it whatever

opaque acorn
wooden ember
#

change the link you put there to the working one

#

I don't know how the invite button works on the bot profile so I can't help you there

opaque acorn
#

ok

#

thx

wooden ember
#

np

lyric mountain
#

lemme check if it's a valid bitfield

wooden ember
#

looks like two put together

lyric mountain
#

nah, it's valid

wooden ember
#

bruh at that point just give it admin lol

lyric mountain
#

and be declined on top.gg and lose user trust 👍

wooden ember
#

lol

lyric mountain
#

that's usually present in oauth2 scopes, not bot scope

wooden ember
#

yeah its also out of order

#

i just re typed it with the same structure as the link for my bot

boreal iron
#

Out of order?

opaque acorn
lyric mountain
#

I don't think url params order matter

#

since they're unordered like any other map

wooden ember
lyric mountain
opaque acorn
lyric mountain
#

the OFFICIAL?

boreal iron
#

The one in the developer portal?

lyric mountain
#

I mean the one in discord dev dashboard

#

ye, that

opaque acorn
opaque acorn
wooden ember
#

mmmmm

lyric mountain
boreal iron
#

Then it hasn’t been an official one

opaque acorn
lyric mountain
#

that aint the official

opaque acorn
#

isnt the official?

#

lol

lyric mountain
#

discord developer portal is the only 100% (?) reliable site

boreal iron
#

I mean

#

haha | Updated 2021-11-15 |

lyric mountain
#

didn't notice the footer

boreal iron
#

Errm

#

Not affiliated with Discord

lyric mountain
#

that's outdated af

boreal iron
#

That’s what I wanted to copy

opaque acorn
#

i didnt know that

#

i always use that calc

#

so i use this one?

lyric mountain
#

yes

opaque acorn
#

ok

lyric mountain
#

click bot first

#

the calculator is below that one

opaque acorn
#

ok

#

works now

#

thx everyone

wooden ember
#

np

#

whilst im here how to I make a bot leave using a command handler? cuz idk how to make the vc object global for all the comands to see

#

or atleas the commands for the vc stuff

lyric mountain
#

just put it at class scope

wooden ember
#

join fine but wont leave thought i could put the variable in one of the execute things but thats doen't seem to work

wooden ember
boreal iron
lyric mountain
wooden ember
#

ok so i have a join command and a leave command join works however leave doent

boreal iron
#

Leaving a guild?

wooden ember
#

vc

#

on the join side i have but on the leave side i have

#

bruh that didnt work

#

anyway idk how to make Join global between command files

#

since the join command is one file and the leave command is another

lyric mountain
#

...put the variable outside of function scope

wooden ember
#

what does that mean

lyric mountain
#
// outside scope

function blabla() {
  // inside scope
}
wooden ember
#

bruh i have it function reeeeee(Join)

lyric mountain
#

variables at class scope = acessible using <instance>.variable

#

make it static an u can use <class>.variable

wooden ember
#

basically made the variable in the index file and then passed it through to the msg event file that then makes it accesable to all the other files

#

in theory

#

i know i made a bunch of people who can actually code cringe at that

lyric mountain
#

I wonder what yall learn when starting a new lang nowadays

wheat mesa
#

Let’s just make more global state surely it won’t get out of hand Aware

lyric mountain
#

cmon, I'm not that old but in my times that was one of the first 10 things u learned

wheat mesa
#

I just saw the words “var” and “accessible to all other files”

wooden ember
#

bruh i never "learned" js i just tinkered with a bot from github and added stuff to it from various guides then made my oen thing from scratch using bits of commands from various things and then just got good enough that i started to do it withought having to look at other peoples code

#

its been like 2 years

#

so eh

lyric mountain
#

...

#

in 2 years u never had the need to declare global variables?

wooden ember
#

tbh i probably know more about d.js than js

wooden ember
lyric mountain
#

...

wooden ember
#

i mean i can declare global variables i just dont know hwo to do it in a multiple file situation

#

my bots arent verry complicated just have a bunch of obscure commands

#

not like that one pokimon trading bot that was 13000 lines of code in one file

lyric mountain
#

I-Idk what to say, it's a mix of surprise, shock and confusion

wooden ember
#

I am the code redneck

wheat mesa
wooden ember
#

true

wheat mesa
#

Which I guess he never got to using global variables in his experience

wooden ember
#

i would never have had the motivation to just sit down and learn js before doing stuff

#

heck if that was the way i had to do everything i would basically not be able to do anything

#

thats how i got into cars, either pay the tech £1000 to fix one of my brakes or do it myself for £100

#

once you watch a couple of YT videos on how to do it and get an idea how it all goes its suprisingly easy to fix most issues on basically anything mechanical

wheat mesa
#

“Easy to fix” wait until you blow a transmission

wooden ember
#

i mean yeah idk how to do that but thats cuz i haven't done it yet

#

plus our car is a 2008 toyota yaris

#

thats transmission is going nowhere

lyric mountain
wheat mesa
#

My car is a 2013 Ford Focus and the mechanics (was taking it back for a repair on the airbags due to a recall) said that the warranty only applies to my transmission (I asked them about some issues I was having) when it completely blows

lyric mountain
#

blue satan iirc

wooden ember
#

anyway i need to go get dinner be back in a bit, ping me with any suggestions

wheat mesa
#

Oh the joys of owning a ford

boreal iron
#

Damn I don’t have my gif anymore

boreal iron
#

There we go

wheat mesa
#

It’s true

#

It drives pretty well for having ~83k miles though

boreal iron
#

Dunno why but that’s so funny I might die of laughing

wheat mesa
#

I have some sort of air intake valve issue I need to fix that causes the car to lurch when a accelerating from a stop though

wheat mesa
boreal iron
wheat mesa
#

Knowing my luck the transmission will blow at precisely 100,001 miles, 1 mile over the warranty

boreal iron
#

Trust me the brand doesn’t matter much, cars nowadays are all shit

wheat mesa
#

And that’ll total the car because the transmission costs more than the car is worth

boreal iron
#

Still good enough for a new driver

wheat mesa
#

Yeah

#

Hopefully it doesn’t kill me

#

The gas mileage is actually pretty good too which is nice during these gas prices

#

Something like 23mpg city driving

boreal iron
#

Americans crying about gas prices while a gallon costs less than our liter

#

🤦‍♂️

wheat mesa
#

Americans are used to paying very little for gas

#

America is a lot different than Europe, it takes a lot more gas to get places

#

Since we’re not as densely populated

#

Unless of course you live in the city, in which case everything is really closeby

boreal iron
#

They still pay less and could also go on paying less since fracking capabilities being used again but oil companies wanna make cash atm blaming Russia’s war for the price increase

sudden geyser
#

Until we invest even the slightest bit in public transit gas and its price are essential.

#

I hate this place

boreal iron
#

Not only an issue over there

#

Same here

sudden geyser
#

define here

boreal iron
#

Especially on the country side

#

Here in that country

#

anywhere in that shithole country

wheat mesa
#

Yeah our public transit is really run down and trashy here

#

The dart trains are getting a revamp though

#

Still I dislike public transport especially during covid

sudden geyser
#

state said country

#

I live near Boston which has "good" public transit by US standards but it's still awful and chaotic to use.

boreal iron
wheat mesa
#

Wdym

wheat mesa
#

And our history of having presidents assassinated here

sudden geyser
#

Yeah I'd never want to live near there

#

Katy freeway

wheat mesa
#

I’m in the suburbs, it’s actually pretty good

#

Dallas itself is a shithole

#

At least it’s not Houston though

sudden geyser
#

suburbs suck as well

boreal iron
#

Doesn’t like any city suck in the US?

wheat mesa
#

No

#

I quite like Austin

sudden geyser
#

boston is actually pretty nice

wheat mesa
#

Visited there a couple days ago for a tour of my (hopefully) future uni, it’s a very nice city

boreal iron
#

The heck

wheat mesa
#

Very urban so traffic sucks but it’s pretty nice

boreal iron
#

Ok time to get some sleep to start in an hour again

quartz kindle
#

all you teenagers with shiny new cars

wheat mesa
#

my car was a hand down from my mom, it's a good starter car

#

I doubt it'll last much longer though

#

trying to take care of it but if there's an expensive repair I'm kinda fucked

sharp geyser
#

I have no car

#

Lucky fuck

quartz kindle
#

my car is from 1996

#

230k miles / 380k kilometers

#

gonna drive 1k+ miles with it in a couple weeks :^)

wheat mesa
#

jesus

wooden ember
earnest phoenix
#

do you guys have any recommendations for some sort of free database that has over 500MB+?

my purpose is to upload strings that have 2K bytes each; those strings are base 64 encoded and carry a json object.
to be more detailed, I use those base 64 encoded strings to give more image details to a reverse searched image which you run via a command.

so about 1 reverse searched image equals 2000 byte.

and until I reach the mongodb limit, I would have to run 250000 commands in total until I am forced to delete the oldest one to store a new one

mongodb has 512MB and I have used mongoose before ( and I really love it ), perhaps you guys know any better alternatives?

I tried hastebin api but hastebin has request limitations, and mongodb seems the most realistic option for me as of right now

pine nova
wheat mesa
earnest phoenix
#

it's like I want to let people decide whether they want more information or not for an embed preview

#

and there's multiple embeds with multiple different results

#

so I have to track detailed information for each of those embeds

#

they can be temporary sure

#

over a month will be passed by the time my mongodb is filled with encoded strings

#

so I can just start deleting one by one oldest to newest

#

and each information will have a lifetime of 1 month or depending on the amount of information that's requested

wheat mesa
#

Aren't you fetching the base64 image data though? Why do you need to store that; can't you just request it again or cache it for a little while

#

And then just use the db for settings

#

I don't think I understand what you're trying to do here

#

You can use postgresql and self host it on your vps if you need more storage

wooden ember
#

just make a burner discord server and upload it there and fetch the msg later

#

ez

#

lol

#

(jk pls dont do that)

wheat mesa
proven escarp
wheat mesa
#

No

#

That's a temporary solution

languid pier
#

i am looking for the command for mudae role

wheat mesa
#

When there's a much better option called using postgres 😉

wheat mesa
#

Go to their support server

languid pier
earnest phoenix
#

but the problem is that I don't think I can use mongodb with uptimerobot

wheat mesa
#

get a vps

wheat mesa
# languid pier

again, not the right server. This is a bot list, not mudae's support server

earnest phoenix
#

Maybe I could use this

#

Seems promising

wheat mesa
#

You should use a proper vps if you wish to upgrade your discord bot's capabilities

languid pier
earnest phoenix
#

I just plan to host the bot with uptimerobot

#

And mongodb for temporary data

#

I'm completely fine with 512mb

#

I'll just delete old results once it reaches the limit, this way I'll never actually reach the limit

#

Seems realistic?

wheat mesa
wheat mesa
languid pier
#

Okay

earnest phoenix
#

1 of those commands I run is 2000 byte

#

as for the data my bot can handle, that's not really related to what the database can handle as I'm not beating the shit out of the database

wheat mesa
#

The VPS allows you to handle more data because you can host your own database

#

You wouldn't be limited to mongo cloud

earnest phoenix
#

That's fine im fine with the mongodb resources/limits

#

I'm not requiring any more than I need for my purpose

wheat mesa
#

but whatever floats your boat

earnest phoenix
#

but not necessary

#

so I'll just stick to mongodb + uptimerobot which I'm fine with

lyric mountain
#

also u can compress base64 images to reduce storage usage

sick agate
wooden ember
#

i mean the other option is just look out for a pc that someone it throwing out and use that as a server

ancient nova
#

Question to everyone:

|| as developers what kinda coffee you like the most? ||

boreal iron
#

None

sharp geyser
#

Not all devs like coffee

#

But I myself love a caramel frapp

sterile lantern
#

what does this error mean (code below)

boreal iron
#

I like water freerealestate

#

Nothing else tbh

ancient nova
#

I fancy a ice cold latte

#

:pepepray:

#

:pepepray:

#

wha

sterile lantern
#

maybe i should check if bloxlinkJSON is null

earnest phoenix
earnest phoenix
ancient nova
#

am I the only one who doesn't see that emoji

#

:pepepray:

proven escarp
#

🤷‍♂️

boreal iron
#

Of course you need to

proven escarp
#

at least in this case

boreal iron
#

If bloxlink is null how can it have a property

lyric mountain
sterile lantern
#

it shouldve catched

lyric mountain
#

databases that are contained in files instead of services

#

what are u using to host the bot?

sterile lantern
sharp geyser
#

Like SQLite

boreal iron
sharp geyser
#

It's a file based db

sterile lantern
#

ya ik

lyric mountain
proven escarp
boreal iron
#

If the promise fails your var is null anyways

lyric mountain
#

small, good enough as a dump database, fast, reliable

earnest phoenix
proven escarp
lyric mountain
#

...what are u using to host the bot

earnest phoenix
#

Honestly I just wanna store the json objects

lyric mountain
#

not to keep alive

ancient nova
#

enmap? pretty easy to use wrapper for sql

earnest phoenix
boreal iron
earnest phoenix
#

isn't uptimerobot keeping it running

lyric mountain
proven escarp
earnest phoenix
proven escarp
earnest phoenix
#

The fuck you mean

proven escarp
#

Well yes

#

but it doesn't host it

lyric mountain
#

uptimerobot only pings the host to refresh the keepalive time

sharp geyser
#

Probably uses glitch or replit

#

Keeps the shit pinged

earnest phoenix
#

I'm gonna use replit ig

lyric mountain
#

ok, so file-based database is out of question

earnest phoenix
#

that doesn't help me

proven escarp
sharp geyser
#

Can't even use mongo either unless you use a cloud version

proven escarp
lyric mountain
#

and heroku too

boreal iron
proven escarp
#

heroku 🤮

ancient nova
#

how do you spell invisible? I could've sworn it's spelled invincible instead

earnest phoenix
#

I just need a good free 24/7 host with free datastore that's all

lyric mountain
#

regarding the compression, simply apply your preferred compression algorithm on the string bytes

lyric mountain
#

works just like 7zip or whatever

proven escarp
sharp geyser
#

Invisible means can't be seen, invincible means can't be destroyed

earnest phoenix
ancient nova
#

makes sense pepebubz

lyric mountain
boreal iron
#

Well more like 5 bucks per month

#

At least

sharp geyser
#

Just get an oracle vps

proven escarp
lyric mountain
#

great quality: not free
free: low quality
great quality & free: limited time
free & unlimited time: you're the product (either ads or data selling)
great quality & free & unlimited time: you're being scammed

proven escarp
#

I use Oracle Cloud

sharp geyser
#

They are free

earnest phoenix
#

like 50 bucks a year

proven escarp
proven escarp
earnest phoenix
proven escarp
#

Cause I need x86_64 cpus

lyric mountain
proven escarp
#

and apparently oracle doesn't wanna use anything else than RAM on free plan

boreal iron
earnest phoenix
boreal iron
#

Reliability

proven escarp
lyric mountain
#

if ur gonna do IO all the time, it does matter

boreal iron
#

If a server is down 2 times a day it matters

lyric mountain
#

else it'll be your bottleneck

earnest phoenix
#

what's IO again

lyric mountain
#

input/output

earnest phoenix
#

O

sharp geyser
#

If you want a free host find an old PC the only thing you'll be paying for is wifi and electricity

earnest phoenix
#

fair enough lol

sharp geyser
#

See the joke here is that nothing is free

wheat mesa
earnest phoenix
#

I have one doe

lyric mountain
#

basically you'll be dealing with a shitton of files going and coming 24/7 if I understood ur bot right

wheat mesa
#

Internet goes down, pc shuts off, you lose power, etc

earnest phoenix
lyric mountain
#

the major bottlenecks will be bandwidth, storage and RAM

sharp geyser
proven escarp
wheat mesa
#

Oracle cloud has a very good VPS

#

For free

#

Don’t ever give them a dime though

lyric mountain
#

great for proxy servers I say

wheat mesa
#

Greedy bastards

sharp geyser
boreal iron
#

Yeah I meant desktop PCs

lyric mountain
wheat mesa
#

Yeah

boreal iron
proven escarp
#

I pay for my servers

sharp geyser
#

I'm not wiring a long ass cable to my room

wheat mesa
#

“Rename it because we want to prove that we own Java!”

#

As if we didn’t already know

lyric mountain
#

like bruh, I had slight hope that oracle wasn't doomed at all

#

but doing that to the backbone of enterprise java is a joke

sharp geyser
#

Oracle not being doomed?

lyric mountain
#

that was my hope for oracle

boreal iron
#

Why not

sharp geyser
#

You're wrong

boreal iron
#

No

sharp geyser
#

Never had an issue

boreal iron
#

Totally not

sharp geyser
#

So you're wrong

boreal iron
#

If you would need “a long ass cable” that already refers to the range

sharp geyser
#

Okay and

#

Your opinion is just that an opinion

#

I'll continue using what I want

boreal iron
#

If you don’t own a like 2000 bucks high tech access point it’s always inconsistent and trash

boreal iron
wooden ember
#

bruh its not opinion though wifi is worse than ethernet, wifi is wayyyy more suseptable to external factors like interference rainge and usage

boreal iron
#

You can but it won’t make it better

wooden ember
#

i mean you can buy one of those routers with a milion antenas

#

and then buy an expensice wifi NIC with big antenas

boreal iron
#

Those don’t change anything since it’s still 2.4GHz or 5

wooden ember
#

yeah but means its more stable and wont drop out asmuch

boreal iron
#

Which has to deal with walls, radar, channel switching etc

wooden ember
#

speed will still suck

#

but thats about all you can do with wifi is my point

sharp geyser
#

My speed is top notch for the plan I have so I don't have any complaints

boreal iron
#

WiFi is only recommended for devices which can’t use Ethernet

wooden ember
#

I ran a lan cable to my room under the floor to my room

#

its an old house so there was alot of space

#

ik not everyone has that option thouhg

#

our router is like 10 years old so the wifi isnt that great

#

but its still better than the new router they sent over

#

cuz the new one doent even have an antena

boreal iron
wooden ember
#

yeah

boreal iron
#

They are just cheap mostly delivered by your isp

wooden ember
#

the old one has an external antena thats positionable, however the new one has a trace on the internal pcb

#

doent do shit

wheat mesa
#

I don’t care that wifi is worse, it was invented because it’s more convenient to use

wooden ember
#

yup

#

its got its uses i'll give it that

wheat mesa
#

Idk about you guys but u don’t feel like running a cable from my living room to 30 other rooms just for a slight performance gain

boreal iron
#

Anyways WiFi is just a big mess, if you closely measure the consistency, speed and reliability you will be shocked

wheat mesa
#

I lose packets every now and then, who cares

boreal iron
#

Phones tend to use mobile data in the background if WiFi sucks

#

You usually don’t notice issues there

wheat mesa
#

I have no complaints about my wifi, only very rarely have I had issues with it

#

And more often than not it’s not even my router, it was my cheap ass network card I bought for 20 bucks for my pc

wooden ember
#

bruh in my experience windows is dumb and keeps disconnecting me for no reason if the internet is too slow even though its not the wifi

wheat mesa
#

(Which I have since replaced with a nicer one)

ancient nova
boreal iron
#

Didn’t say anyone has benefit using Ethernet

wheat mesa
#

Yeah tbh I drink a lot of iced tea

#

I prefer that to coffee

boreal iron
#

But especially for gaming and file sharing inside your network WiFi sucks

wooden ember
#

screw you i use ethernet for my phone

wheat mesa
#

I usually only drink coffee when I need a lot of caffeine and I have work to do

boreal iron
wooden ember
#

hehehe

sharp geyser
#

Fake you're preaching to a bunch of people who don't care

boreal iron
#

That’s okay

wooden ember
#

that one got spicy

boreal iron
#

Doesn’t prevent me from arguing about weird and wrong facts

wooden ember
#

lol

boreal iron
# wooden ember that one got spicy

Aye the love of Voltrex about features 99,9% of the phone users don’t use or know but the fact you need to throw your phone away every 2 years since life support has ended

wooden ember
#

bruh why would you bin the phone if its "not supported though"

boreal iron
#

Better question is why to keep an android phone without security updates

wooden ember
#

like yeah some issues wont be pached out anymore but the same for pc "not being dumb" goes along way in protecting againced viruces and that

#

other than that you are fine

boreal iron
#

You can’t compare stuff to a new pc

#

Most OS have like decades of life support

wooden ember
#

not on about "new pc" on on about any pc

boreal iron
#

Common OS covers like 99,9% of the hardware out there even fucking old ones

#

Especially Linux of course and Windows 10

sick agate
#

well yeah???

boreal iron
#

Phones are not meant to last that long or be supported that long

wooden ember
#

what are you doing on a phone to get a virus anyway

sick agate
boreal iron
#

Companies wouldn’t make much cash if things would last or be supported for years

wooden ember
#

i used my old android for 5 years

sick agate
#

i literally used nokia 302 this year

#

for a year

#

so y'know you can use unsupported stuff

boreal iron
sick agate
#

yeah what

#

my friend use like S3 neo or something

#

for a year as well

boreal iron
#

Well I’m using an iPhone X and 7

#

Google how old those devices are

#

But still supported freerealestate

#

Also pushed with updates

sick agate
#

good luck using software when the support ends

#

just saying

boreal iron
#

Well this about when the device is 10y old or older

#

I can live with that if so

inland moon
#

Hi

boreal iron
#

Pretty awesome for a phone

sick agate
boreal iron
#

siteloading?

sick agate
#

which it will probably

boreal iron
#

Well yeah anything except Nokias can break

sick agate
#

well yeah

#

sadly my mom's s5 broke

boreal iron
#

Imagine buying an phone every 10y only

#

Companies would run out of money quickly

sick agate
#

yup

lyric mountain
#

You're supposed to change phones before 10y?

boreal iron
#

Which brings us back to the life support philosophy

wooden ember
sick agate
sick agate
lyric mountain
#

I usually change every 5y or so, not because of battery or anything, I just get bored of it

sick agate
#

welp

#

i have changed phones too much

boreal iron
sick agate
#

okey

boreal iron
#

Not much trouble

#

Tbh

lyric mountain
#

The trick is buying phones with the right battery type

boreal iron
#

Has to do with the charging behavior

sick agate
#

yup

#

i agree

lyric mountain
#

And remembering 2005+ phones lose battery capacity per cycle not continuous charge

boreal iron
#

Yeah tbh also depends from phone to phone

#

There’s no reliable quality even in the same charge of phones

lyric mountain
#

The old "don't use while charging" consensus don't really work nowadays, at least from what I can notice

#

Like, don't put, take, put, take, put, take the phone from the charger all the time

wooden ember
boreal iron
#

Also software updates fucking you up etc

#

Maybe wanted sometimes

boreal iron
#

Not really much of a big deal tbh

#

Once you done it a few times

lyric mountain
#

As hard as changing notebook's

#

Just in a smaller and tighter space

wooden ember
# boreal iron Actually is replaceable

the new ones you can't, they added some id chip in the BMS that is pared with the phone main board making it phone have like half battery capasity if you replace it

boreal iron
#

Yeah heard about that already

#

Not only on batteries

#

Also for camera modules etc

#

But yeah times aren’t getting better anyways

#

So no surprise

lyric mountain
#

half-life phone

#

(insert lambda here)

ancient nova
#

this doesn't work

#

I edited the page 2 weeks ago

#

it was supposed to help, but I didn't even get ONE SINGLE invite from top.gg

#

not even one, the entire time it's been up on top.gg

dry imp
#

L

ancient nova
lyric mountain
ancient nova
#

I don't think it's that bad. one of the mods here told me to use pictures so I did

lyric mountain
#

u could've sent a pic

ancient nova
#

don't be lazy

#

so is it bad or not 😐

lyric mountain
#

ok, here are my few cents:

  • Anonymous hater, ok, but what are the odds of a search returning a bot with such name?
  • Yes you added pics, but there's no description, no "salesman talk", nothing but the name + pic
  • The page barely talks about the bot, be creative, sell your bread, think "Why would I invite this bot?" and answer to yourself, then add that to the page
#

the more information you put there, the higher are the odds of some search engine returning your page (tag-based search or context based search)

sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

and the more effort you put into it, the higher the odds of you grabbing the user's attention

sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

as it is now, I barely know what your bot does (most of what I do is from what I saw u asking for help here) or what it'd add to my server

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
#

also this, please don't do that, it's basically begging for attention

#

people will feel insecure about you or your bot

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
#

I found one niche to fit into

ancient nova
#

somehow it landed on my page so now it's stuck there because I can't delete it

ancient nova
#

@wheat mesa don't doubt me it's literally what happened

#

STOP

winged linden
#

yoo i need help, it works in some channels but in some it stopped working any idea why??

wheat mesa
#

chans is not a string, you can’t use .includes() on it

#

I’m surprised it doesn’t throw an error

winged linden
wheat mesa
#

Can you show the json

winged linden
#

works normally for some channels, some it doesnt

#

just some ids

pine nova
#

prolly the json array doesnt contains the channel id?

wheat mesa
#

That’s not a valid json lol

winged linden
#

how not lol

wheat mesa
#

That’s the reason it works

#

Json is key/value pairs, that’s just an array in a file

winged linden
winged linden
wheat mesa
#

Ok so I just looked it up, apparently you can do that with json

#

Learn something new every day I guess

pine nova
#

lol

winged linden
#

lol

#

whats wrong from my side then bruv

wheat mesa
#

Log the value of the json

#

See what it comes up with

winged linden
#

i literally been thinking for the past couple of mins lmao

#

1sec

pine nova
pine nova
winged linden
winged linden
#

bro it works... not for all the channels though

pine nova
#

the array doesnt contain the channel id?

winged linden
#

it does it does i am 100% sure

pine nova
#

💀 💀

lyric mountain
#

are all erroring channels with an extra character perchance?

winged linden
#

found the problem bruvv wtf thats a stupid bug javascript got?

lyric mountain
#

?

winged linden
#

this doesnt work as it doesnt log everything, i add var it works bruh

lyric mountain
#

var?

#

also, you do need let/const when declaring variables

winged linden
lyric mountain
#

forget var please

#

but yeah, idk what even happens if u try to assign a value to a non-declared variable

winged linden
#

why not use var

lyric mountain
#

maybe it simply throws to the void

lyric mountain
winged linden
#

lol

#

it works with var lmao

lyric mountain
#

it's there for the sole purpose of supporting legacy codebase

winged linden
#

okay cool cool, gonna use const then

lyric mountain
#

let does exactly what var does but without the drawbacks

#

const is for constants

ancient nova
#
    const wordToSearch = args.join("%20");
    if (!wordToSearch) return message.channel.send("You have to give a query to search.");
    
    const generateImage = await fetch(`https://api.giphy.com/v1/gifs/search?q=${wordToSearch}&api_key=${process.env.GIPHY}&limit=1`);
    if (!generateImage) return message.channel.send("Could not generate the image. Try again in a bit.");
    
    const generateAttachment = new MessageAttachment(generateImage.data[0].url, `giphy.${generateImage.data[0].type}`);
    if (!generateAttachment) return message.channel.send("Could not generate the attachment. Try again in a bit.");

    return await message.channel.send({ files: [generateAttachment] });
Cannot read properties of undefined (reading '0')
{"data":[{"type":"gif","id":"3ogwFGEHrVxusDbDjO","url":"https://giphy.com/gifs/spongebob-spongebob-squarepants-episode-15-3ogwFGEHrVxusDbDjO","

what's the problem?

lyric mountain
#

what's the error?

ancient nova
lyric mountain
#

.data[0]

#

it's a single img

#

not an array

ancient nova
lyric mountain
#

u need to parse that into a json first

ancient nova
#

it now returns this

main sky
#

Is there an API to bulkUpdate member's roles? Like assigning multiple roles in one request, rather than looping through one by one..

lyric mountain
#

try posting the url directly as a msg

#

not as a file

lyric mountain
#

bcuz it's not a direct url

#

giphy wouldn't lose the ad oportunity

ancient nova
#

how do you get a random number between 2 in JS

#

will Math.random(0, 5) work?

lyric mountain
#

no

#

max * Math.random()

#

add 1 if u want inclusive

ancient nova
#

@lyric mountain so a couple hours ago I added my bot to this list, it said it failed because I had to join their server but I couldn't because the invite link was invalid. somehow it went through and now a mod is approving it

#

would it be bad if I just messaged the mod?

ancient nova
lyric mountain
#

yes

#

u need to floor it

earnest phoenix
lyric mountain
#

idk abt that

#

varies from mod to mod

lyric mountain
#

there's a formula for min-max rng, I don't remember the second part

#

it's (max - min) * ((Math.random() * max) - min) or something

ancient nova
#

not sure if my bot gets approved if I'm not in it

lyric mountain
#

I can't say anything regarding that, I saw many lists that are both sides of the spectrum