#development

1 messages · Page 1713 of 1

earnest phoenix
#

Breh

#

It's personal

tired panther
#

what is your question....

cinder patio
#

It's the main function

earnest phoenix
#

My bot is hosted but it's offline

crimson vapor
#

you are being ratelimited

earnest phoenix
#

Ik

crimson vapor
#

you need to wait for the timeout to end

sudden geyser
#

Main can't return Option<T>

#

It can return Result<(), E>, but not Option<T>

earnest phoenix
#

But it's already 4 Hours

sudden geyser
#

Which the ? operator is trying to propagate up to

lusty quest
#

listen to the ratelimit event to see for how long you are locked out

cinder patio
earnest phoenix
crimson vapor
sudden geyser
#

Yeah, but I think the Ok variant would need to be an empty tuple

earnest phoenix
crimson vapor
#

go past ratelimits

sudden geyser
#

If you don't want to change the consume function's return type, you could use a match or pattern matching to get the Some variant value

crimson vapor
#

api spam

earnest phoenix
#

O

cinder patio
#

I'm currently doing .unwrap_or

earnest phoenix
#

Understand!

oak crag
#

Hello, I was wondering how reliable Heroku is for (one) discord bots?

sudden geyser
#

unreliable from what people say

cinder patio
#

I think it's good as a starting point

#

but once your bot starts growing you should get a VPS

cosmic forum
#

Didn't work :(

cinder patio
#

or upgrade to premium

patent flax
#

heroku is kinda complicated and it sometimes dies

sudden geyser
cinder patio
#

I find heruko pretty easy to use

oak crag
#

yes, replit kills it with the free version+uptime robot

earnest phoenix
#

@sudden geyser Uptime Robot

sudden geyser
#

still unreliable

earnest phoenix
#

@oak crag Like it doesnt respond?

#

Because for me it's working properly

oak crag
#

It kills my daily loop, even if I made reconnect=True

#

My bot still respond

#

but the daily loop is a requirement for my bot

lost wadi
#

Hi

let busqueda = args.slice(1).join(" ")
    let reg = /[^\s"']+|"([^"]*)"|'([^']*)'/g;

    if (args[0].toLowerCase() == "nombre") {
      let obj = busqueda.split(reg)[1]

      let busca_obj = data.Items.find(x => x.nombre.toLowerCase() == obj.toLowerCase())
      console.log(busca_obj)

      if (!busca_obj) {
        mal_.setDescription("El objeto que quieres editar no existe")
        return message.channel.send(mal_)
      }

    }

How do I change the value of a property of an object? ||I look for the object by means of its name||

#

mongodb

earnest phoenix
#

@oak crag For what do y use daily loop for?

tired panther
tired panther
earnest phoenix
#

Heroku Has Free Uptime?

#

Permanently Host?

oak crag
earnest phoenix
#

I'm Feeling Bored Ya Know? I'm Going To Game Now

lost wadi
earnest phoenix
#

@oak crag Well I never used such a thing. Good luck finguring it out. I know only one free host but the bot goes down every 3 days

tired panther
#

you did not anwser my question

copper cradle
#

you don't know how to reassign a value?

tired panther
copper cradle
#

shame

oak crag
#

Ok thanks, I'll try Heroku for now. ¯_(ツ)_/¯

earnest phoenix
#

@oak crag To use heeoku you have to verify a credit card or it will run 24 days per month

tired panther
oak crag
#

Mmh thanks for the info

lost wadi
#

They do not know?

zenith terrace
copper cradle
tired panther
lost wadi
copper cradle
#

then just reassign it

tired stirrup
#

Hm

#

Where do we make mots

#

Bots

#

With js

copper cradle
#
let x = {};
x.prop = "wadse";
x.prop = 1;
#

how's that even remotely hard

cinder patio
tired stirrup
#

@cinder patio

cinder patio
#

I'm p sure they're talking about changing a key in mongodb

#

not in memory

copper cradle
#

the code they showed had nothing to do with mongo tho

tired stirrup
#

Hm

#

@cinder patio @cinder patio

copper cradle
#

lemme check it again

cinder patio
#

huh? Y'all hearing something?

lost wadi
tired stirrup
#

Umm

copper cradle
tired stirrup
#

Ignoring me?

#

Where do we make bots?

copper cradle
#

don't ping random people

cinder patio
tired stirrup
#

Web name?

tired stirrup
copper cradle
#

that's not how it works my guy

tired stirrup
#

Bor

#

Bro

copper cradle
#

learn a programming language

tired stirrup
#

I mean

copper cradle
#

then find yourself a nice text editor

#

write your bot in that language

tired stirrup
#

The web name where we program the bot

tired stirrup
cinder patio
#

sigh... I guess you could check out repl.it... you can code bots there in js / python

near stratus
tired stirrup
#

Hm

#

Thx

#

I know js a bit :)

#

So let's try

lost wadi
cinder patio
#

If you know js you should also know that code is generally written in a text editor and executed on your PC, not on some website, but sure bloblul

cinder patio
tired stirrup
#

This is it

#

But how can I save them

#

?

copper cradle
#

my dude's gonna code on their phone...

#

good luck then

tired stirrup
#

I entered my bot token but it isn't working

tidal nymph
#

🧐

copper cradle
tired stirrup
cinder patio
#

wow... it took you a few minutes to create an entire working bot?

tired stirrup
#

Bro

#

I mean

tidal nymph
#

hes gonna submit a new bot on top.gg

tired stirrup
#

I added everything and my bot token but not working

tired stirrup
cinder patio
#

Any errors?

tired stirrup
#

Idk

cinder patio
#

Then we can't help

#

god knows what's wrong

copper cradle
#

they probably got an error

tired stirrup
#

See

copper cradle
#

considering everything we've already seen... they probably don't know where to check for it

cinder patio
#

delete that

tired stirrup
#

Is there any way to save?

copper cradle
#

they didn't even start the bot

#

my dude just leaked their token

tired stirrup
#

Yes

#

Cuz it's for test

#

Want?

copper cradle
#

I'm outta here

tired stirrup
#

:o

#

Hmm

#

Is there any options to save or anything

#

Or no option just exit ?

cinder patio
#

Almost nobody here uses repl.it so we don't know

tired stirrup
cinder patio
#

a code editor

tired stirrup
#

Glitch hub?

tired stirrup
cinder patio
#

We don't code on our phones

tired stirrup
#

So phone is hard

#

:/

cinder patio
#

get a PC or just use already existing bots

tired stirrup
#

O

cinder patio
#

Coding on mobile is doable, but it's a lot harder and the tooling is nonexistent

copper cradle
#

people should be punished for trying to code on their phones

tired stirrup
#

Uh

lusty quest
#

didnt Million maintain stuff like node from a phone

pale vessel
#

False

lusty quest
#

as for now coding on a phone is horrible, there are no good editors for it. sure repl.it exist but it sucks imo

torpid cairn
#

There are many bot coders I have seen who use dB language for coding bots....

lusty quest
#

?

lusty quest
#

coding on phones is horrible for now, there exist editors but they are not even close to stuff like np++

torpid cairn
#

It's easy with it

#

And not horrible

lusty quest
#

probably something like scratch

torpid cairn
#

U can find out

torpid cairn
lusty quest
#

there is always a cost

#

free doesnt exist

torpid cairn
torpid cairn
#

It's hard to believe

#

I personally tried

lusty quest
#

you wont get free hosts

#

you pay them in some way

torpid cairn
#

No verified app

lusty quest
#

doesnt mean anything

torpid cairn
lusty quest
#

there are verified Discord bot scamming people

lusty quest
dusky sundial
#

90 min ad? zbhuh

torpid cairn
lusty quest
torpid cairn
lusty quest
#

any maybe a tracker within the ad

dusky sundial
#

Watching an is is the same as paying, you're still giving them money

torpid cairn
dusky sundial
#

and/or data

rocky dagger
#

when i do const { checkCommandModule } = require('./utils/validate'); in my index.js file i just get a Cannot find module './utils/validate' error

lusty quest
quiet topaz
#

why does Date.getMonth give me the month 03 althought its 04 (nodejs

let colg2 = console.log;

//n = ms
const format = '{DD/MM/YYYY; HH:mm;ss:nnnn}';

console.log=(lo)=>{
    let dateObj = new Date();
    var date;
    var y = dateObj.getFullYear();
    var mo = dateObj.getMonth();
    var d = dateObj.getDate();
    var h = dateObj.getHours();
    var m = dateObj.getMinutes();
    var s = dateObj.getSeconds();
    var ms = dateObj.getMilliseconds();
    mo=mo>=10?`${mo}`:`0${mo}`;
    d=d>=10?`${d}`:`0${d}`;
    h=h>=10?`${h}`:`0${h}`;
    m=m>=10?`${m}`:`0${m}`;
    s=s>=10?`${s}`:`0${s}`;
    ms=ms>=100?`0${ms}`:ms>=10?`00${ms}`:ms>=1?`000${ms}`:`${ms}` //(ms<10?`0${ms}`:`${ms}`);
    date=format.replace("DD",d).replace("MM",mo).replace("YYYY",y).replace("HH",h).replace("mm",m).replace("ss",s).replace("nnnn",ms);
    //date=`${h}:${m};${s}:${ms}`;
    colg2(`${date} ${lo}`);
};

torpid cairn
#

I used bluestacks to download it on my pc

rocky dagger
torpid cairn
lusty quest
#

dB seems to be btfd or how the bot creator app is called

lusty quest
dusky sundial
#

It's definitely possible that a verified app scams you

torpid cairn
lusty quest
#

happened a lot

torpid cairn
dusky sundial
#

I don't see how that would change anything?

quiet topaz
#

why are you ignoring me

torpid cairn
#

Money

dusky sundial
#

Exactly, so you pay by watching ads, or pay real money

quiet topaz
#

ok thx but why

lusty quest
torpid cairn
#

db script easiest script

quiet topaz
torpid cairn
#

I tried personally

dusky sundial
#

Easy usually means that it's very limited, you might aswell just learn an actual programming language

torpid cairn
quiet topaz
#

ok

lusty quest
dusky sundial
#

Python and JavaScript are also considered to be "easy". But it's personal preference anyways

dusky sundial
#

Oh yeah, I'm not trying to argue

torpid cairn
#

Huh we are just discussing

lusty quest
#

mobile app for creating bots, its a bit like scratch

dusky sundial
#

bdfd = Bot Designer For Discord, it's a mobile app that lets you make a bot without any coding knowledge essentially

torpid cairn
lusty quest
#

another shot for today, nice

quiet topaz
torpid cairn
vivid fulcrum
#

"i used a microwave to cook the chicken"

cinder patio
#

scratch is a visual programming language

lusty quest
#

never used it

cinder patio
#

bdfd is just trash

quiet topaz
#

hmm well i tried it once when i hab like almost no programming knowlage and it was harder than a normal programming language for me

#

dont know why anyone would use it

#

is there a difference between
function name(params){}; and const name=(params)=>{};?

sudden geyser
#

How do you disable the implementation and reference buttons in Visual Studio Code?

quiet topaz
thick nexus
#

can you detect if someone is typing

sudden geyser
#

You can listen for typing events I believe

thick nexus
#

mk

quiet topaz
#

youre welcome

quiet topaz
#

ye

#

'typingStart' is the event

copper cradle
pale vessel
#

what did you agree to lol

quiet topaz
#

like it was the first search result on on bing with typing

thick nexus
#

mk

copper cradle
#

also arrow functions are another way of declaring anonymous functions

quiet topaz
#

so is it bad if i declare my functions with arrows?

#

cuz i do it always this way

copper cradle
#

I don't really see the point on doing

const x = (y) => ()

as it's just the same as

function x(y) {};
#

it's not bad tho I see no point on doing so

quiet topaz
copper cradle
#

If I'm correct declaring them as arrow functions doesn't make them globally available

quiet topaz
#

well it does for me i think

umbral zealot
#

IT's not the same thing

#

arrow functions are different in a few ways

copper cradle
#
x(); // true

function x() {
    return true;
}
h();// reference error

let h = () => {}
#

besides they're different

umbral zealot
#

That's not "global" that's just cheating the system into declaring it after using it

#

like var

quiet topaz
copper cradle
#

functions get hoisted at runtime

copper cradle
umbral zealot
earnest phoenix
#
def get_quote2():
  response2 = requests.get("https://evilinsult.com/generate_insult.php?lang=en&type=json")
  json_data2 = json.loads(response2.text)
  quote2 = json_data2[0]['q'] + " -" + json_data2['a']
  
  return(quote2)
#

Any advice here?

dusky sundial
#

You don't need the [0] because the data isn't an array

earnest phoenix
#

Ty

charred nest
#

anyone have any advice on how to fix “error: cannot find module “../config.json” ? this only started happening after i coded to support subdirectories, which is why i’m using ../

quiet topaz
#

and why would you want the config file to be in a subdirectory

charred nest
#

where i have the “../config.json” is to go to the directory above (where config.json is) and be able to find it TT_NekoCry config isnt in a sub directory, but the command that requires it is

cinder patio
charred nest
#

that was it, thank u goodalpaca

umbral zealot
coral hedge
#

i want to make a dashboard but i don't know how show users servers

earnest phoenix
#
 const user = message.mentions.users.first();
    if (user) {
      const member = message.guild.members.resolve(user);
      if (member) {
        member
          .ban({
            reason: "he was bad",
          })
          .then(() => {

            message.channel.send(`Sikeresen bannolva ${user.tag}\n Reason: ${reason}`);
          })
          .catch(err => {
            message.channel.send('Nem tudtam kidobni!');

          });
      } else {
        message.channel.send("Ez az ember nincs a szerveren!");
      }
    } else {
      message.channel.send("Nem pingeltél meg senkit se!");
    }```
#

help me

cinder patio
earnest phoenix
#

a!ban @ mention and then the reason is he was bad but i want to make: a!ban @ mention [reason that i write]

#

reason: args.join(' ') ?

cinder patio
#

It's tricky...

#

If you want the mention to always be the first arg, just use .shift() or slice and then .join

#

but if not, you'll have to find the mention, remove it from the array, and then join

earnest phoenix
#

args.shift?

cinder patio
#

yeah

earnest phoenix
#

hmmm

#

oki

#

and finally

#

i downloaded mongo-db

#

ReferenceError: reason is not defined
at C:\Users\user\Desktop\discordbot\commands\ban.js:25:78
at processTicksAndRejections (node:internal/process/task_queues:93:5)

#

bruh

copper cradle
#

what did you expect

#

you never defined a variable called reason

#

yet you tried to use it

earnest phoenix
#

:/

still sky
#

Is there a list of regular test cases? I'm a bit afraid that I can miss something

earnest phoenix
#

How should i define reason?

quartz kindle
#

do you know how variables work?

earnest phoenix
#

yes

quartz kindle
#

then you know the answer

earnest phoenix
#

._.

#

Let's try now it became 2+ Hour

#

var reason=args.join(' '); ?

#

Yay

#

Bot is now working

#

Online

#

gud

#

:)

#

: )

#

i am thinking what is my mistake

still sky
#

Better use async/await

earnest phoenix
#

What? o_o

still sky
#

.ban return promise, check argumets of .then callback

earnest phoenix
#

oh

#

C:\Users\user\Desktop\discordbot\node_modules@discordjs\collection\dist\index.js:161
if (fn(val, key, this))
^

TypeError: fn is not a function

#

what is this

#

._.

still sky
#

fn is not a function

#

try to be more informative

umbral zealot
#

what is your current code

#

that triggers this

near igloo
#

hey tim

#

do you know if there is a way to use auto in a vector

#

i want to like make a function that can take in any kind of data as it will only be looking for equality so idk

still sky
#

Mb you should use overloaded functions?

near igloo
#

im a noob in c++

#

im a js person

#

vscode moment

cinder patio
#

no

#

you can't

earnest phoenix
#
if(!message.channel.type.toLowerCase() === "nsfw")```
Is this correct to detect NSFW channels in djs?
cinder patio
#

auto is used to just to make your code prettier

#

use std::variant or a union

still sky
#

It's when you write more than one declaration of only 1 function

copper cradle
#

you can re define the same function with different datatypes

#

that's basically what an overloaded function is

near igloo
copper cradle
#

float sum(float a, float b) {
    return a + b;
}

int sum(int a, int b) {
    return a + b;
}
cinder patio
#

Imagine implementing the same function for every type

#

when you can use std::variant

copper cradle
#

I was just showing an example of what an overloaded function is

still sky
#

std::variant, mb it works for similar dadatypes, but with totally different i know only overloading

cinder patio
#

It's basically a modern union

sudden geyser
#

or using generics

near igloo
cinder patio
#

std::string

near igloo
#

a

#

im used to all this being not imported

#

im so used to js dynamic typing

earnest phoenix
#

I tried my bot code on VS Code Many Times But It Didn't Work And I Got Errors

#

When I ran it in repl it worked

#

SAME Code

near igloo
#

static typin drives me nuts aaa

cinder patio
#

why are you using c++ then

earnest phoenix
#

it happened when i want to write out a custom emoji

near igloo
#

for something

sudden geyser
#

clojure walks in

cinder patio
#

I doubt you really need it

sudden geyser
#

compiled + completely dynamic

cinder patio
#

but oke bloblul

cinder patio
sudden geyser
#

It's a beautiful language really

modest maple
#

Clojure isnt really dynamic in the same way OOP and procedural langs are

sudden geyser
#

Looks cryptic at first but makes perfect sense

modest maple
#

its functional so everything is immutable from the get go by default

#

the immutably makes it much easier to manage dynamic typing

#

still it's a bit weird that they choose to go with it

#

just oofs the JVM from doing much optimizing

onyx hare
#

is this right? if (message.channel.id === "833771277914996816")

cinder patio
#

looks right to me

sudden geyser
#

try it out and see

cinder patio
#

of course it depends where you put it

#

but out of context it looks correct

true ravine
#

Do any of you guys have any automated git-pull stuff (as soon as a change is made to your github repo it gets pulled to your server) and if so how did you achieve it?

#

From my brief research it seems like there are multiple ways, I just wanna know what people really use

modest maple
#

@rustic nova

cinder patio
#

@rustic nova

rustic nova
#

cringe

true ravine
#

i agree

rustic nova
#

-m 663069883009073202

gilded plankBOT
#

🤐 Muted PROFESSOR#1628 (@atomic walrus)

modest maple
#

spam in all the channels™️

cinder patio
rustic nova
#

yes ™️

#

ban ™️

near igloo
#

nice ban

#

ty for that tho

#

not on mobile but yeah yikes

rocky dagger
#

when i do const { checkCommandModule } = require('./utils/validate'); in my index.js file i just get a Cannot find module './utils/validate' error. the index.js file is inside the commands folder
full code:
index.js: https://srcb.in/gu8mMVUyfg
validate.js: https://srcb.in/hDUIK25xEw

near igloo
#

i dont understand what its saying freerealestate

round cove
rigid maple
#

Hello there! How can I translate something spoken out loud into text? (edited by translate)

cinder patio
round cove
#

^^^^

#

Was about to say that.

#

Enum would be perfect for this.

near igloo
round cove
#

Is this homework or something homie

quiet topaz
#

how can i do a loop that wait for promises to finish ```js
var res = "someString";
["someValue1","someValue2"].forEach((v,i)=>{
res=res.replace("something",/the result of the promise with input of array/);
};
//do something with res

cinder patio
near igloo
near igloo
round cove
quiet topaz
near igloo
round cove
#

Oh?

random tendon
#

Hello there

quiet topaz
#

then probably the libs are crap or something

random tendon
#

can you help me

quiet topaz
lyric mountain
#

await in async is javascript vanilla's tho

round cove
#

^

rocky dagger
random tendon
#

However, I do not understand most of the things you say, I would appreciate it if you set the keyboard translation to Turkish and write it.

near igloo
#

Each enumerator becomes a named constant of the enumeration's type (that is, name), visible in the enclosing scope, and can be used whenever constants are required.

#

what

round cove
random tendon
#

Anyway, let me see the concubines of my own press.

cinder patio
#

Rust question:

Let's say I have 3 files in the same folder:

I want to access the public stuff from A in B, but I'm getting the error

mod A;
^^^
file not found for module `A`

help: to create the module `A`, create file "src\B\A.rs"

This works fine when I'm using mod in main.rs but not in any other file

lyric mountain
#

gtranslate failed successfully

near igloo
round cove
#

Sounds like a good way to teach yourself horrible practices.

near igloo
#

i learn first how to

#

then secondly how to do it so that i can read it later

round cove
#

You're just making it harder for yourself but sure, have fun with that.

near igloo
rocky dagger
#

when i do const { checkCommandModule } = require('./utils/validate'); in my index.js file i just get a Cannot find module './utils/validate' error. the index.js file is inside the commands folder
full code:
index.js: https://srcb.in/gu8mMVUyfg
validate.js: https://srcb.in/hDUIK25xEw

lyric mountain
#

./commands/utils/validate

round cove
#

^ Goes from the root folder.

#

src being the root because that's where your package.json is

lyric mountain
#

3 levels

rocky dagger
#

thx

earnest phoenix
#

help meh

lyric mountain
#

with?

earnest phoenix
#

nevermind

sudden geyser
cinder patio
#

I figured it out, thanks anyways 💗

opaque vale
#

hi, I have a question, is there any bot that you can check your warzone stats?

lyric mountain
#

do you even google?

rocky dagger
#

is it possible to warn someone that they have leaked a bot token when you dont know who the owner of the bot is?

rocky dagger
#

on stack overflow

lyric mountain
#

if it was leaked in discord, github, reddit (?) or most major sites discord instantly knows it

#

probably even stack

quartz kindle
#

how does discord even know that

rocky dagger
#

the server is only running on one server tho so i dont think its that big off an issue

near igloo
#

hey if i run return(true) in the middle of a for loop, the rest of the loop shouldnt exec right?

#

it should terminate the funct right then and there right?

slender thistle
#

Sounds reasonable, so yes

lyric mountain
near igloo
quartz kindle
#

yes, returns are function level, loops are block level

onyx hare
#

welp my check if right channel didnt work :c what have i done wrong?

exports.run = (client, message, args, guild) => {
    let wyr = "833792272252010506"
    if (message.channel.id === "833792272252010506") {
        return message.channel.send(
            `Sorry But You Cant Play **Would You Rather** Here Go To The Proper Channel; <#${wyr}>`
          );
        }
    let a = ["Fight The President Of The United States", "Shoot A Tree"]
    let b = ["Kiss The Queen", "Kill A Frog"]
    message.channel.setTopic(`Amount Of Question 1's: **${a.length}** | Amount Of Question 2's: **${b.length}** | Last Player: **${message.author.tag}**`)
    message.delete().catch(() => {});
    message.channel.send(`**Would You Rather**\n1:**` + a[Math.floor(Math.random() * a.length)] + `**\nOr\n2:**` + b[Math.floor(Math.random() * b.length)] +`**\n`).then((message) => {
    message.react('1️⃣').then(() => {message.react('2️⃣')});
    });
    }
torpid otter
#

My bot go wired post help messing twice

near igloo
near igloo
quartz kindle
#

ew who uses parenthesis in returns?

#

dafuq

round cove
#

people that learned C

#

idk

torpid otter
#

Don’t know I haven’t use my bot today

near igloo
#

what is the error mean tho freerealestate

modest maple
round cove
#

I never did that for C++

modest maple
#

oh did c++ not need that?

round cove
#

no lmao

quartz kindle
#

you dont need that anywhere

modest maple
#

ooh

#

Rust ya do

quartz kindle
#

return is a statement not a function

round cove
#

^

cinder patio
#

Wait you need to in Rust?

round cove
#

It thinks it's going to a case.

modest maple
quartz kindle
#

wtf

modest maple
#

Does C++ have the functional returns?

round cove
#

Just remove the () and put spaces around

near igloo
round cove
#

No

torpid otter
#

Think I need to change host that hosting my bot

modest maple
#

Might be why then ig

cinder patio
#

I'm not putting parentheses around the return value and I'm not getting any errors

modest maple
#

no but multiple values

#

oh wait

round cove
#

CF is just crazy

#

multiple values

modest maple
#

i might be miss reading this convo

round cove
#

lmfao sure okay

modest maple
cinder patio
#

then it's a tuple

round cove
#

lmfao

modest maple
#

okay well

#

yes i miss read that

#

oops

torpid otter
#

I just check on hosting there lot of error on hosting

near igloo
#

okay what is this meaning

#

i thought i had it right?

#

idk im dumb

modest maple
#

i mean

#

it does tell you

lyric mountain
modest maple
#

semi colon no go

#

Lua is awsome

lyric mountain
#

lua is awfulsome

near igloo
round cove
cinder patio
#

It would've been awesome for me if it had curly brackets

modest maple
#

Lua is a great example of what a dynamic language could be performance wise and interoperability wise

modest maple
#

okay

#

switch to rust

#

problem solved

near igloo
#

rust freerealestate

lyric mountain
#

yeah, like, lua is indeed fast and supported in pretty much anywhere

#

but...why

#

they made a deformed language

cinder patio
near igloo
round cove
#

Yeah VSC might just need some cache cleared

near igloo
#

close and reopen

lyric mountain
#

couldn't expect less from brazillians but anyway

near igloo
#

but aa

modest maple
#

Who would win, A entire dedicated team at google and open source community or one man on a missions bloblul

V8 vs LuaJIT

quartz kindle
#

i vote man on a mission

#

:^)

modest maple
#

LuaJIT is just insane

cinder patio
#

Did y'all know that there is a special operator just to get the length of a map

modest maple
#

the fact it reaches near C speeds at times being Dynamic is just

cinder patio
#

in Lua

near igloo
round cove
#

ctrl+shift+p then do reload window

modest maple
#

Well technically there arent maps in lua the same way they are in other langs

near igloo
cinder patio
#

okay tables or whatever they're called

modest maple
near igloo
#

i give up freerealestate

cinder patio
#

You removed it

near igloo
#

i need it?

round cove
#

Yes

cinder patio
#

yes

near igloo
round cove
#

semicolon goes on the closing paren for class definitions

near igloo
#

im used to js. i got so happy not using simis

round cove
#

I love semis lmao

near igloo
#

i hate simis

#

and absolutely despise static typing

round cove
cinder patio
#

it gives you so much control tho

quartz kindle
#

i always use semis in js

round cove
#

People that hate strongly typed languages probably write dogshit js or pytohn code 24/7

cinder patio
#

same ^

near igloo
round cove
#

cant change my mind

round cove
#

didn't say you didn't

cinder patio
modest maple
#

generally yeah

#

alot of code is pretty bad

#

LuaJIT performance for Python Soon™️ though

round cove
#

Typescript gang where youa t

near igloo
modest maple
round cove
#

show me on the map where cf

near igloo
#

wait what if i did a thing to convert all to string and brrrr

round cove
#

convert what to strings lmao

near igloo
#

can i convert a vector of ints to a vector of strings?

#

without for loop

round cove
#

Uh

#

I mean lambdas exist

#

Also it would be int to chars

modest maple
round cove
#

But why would you convert them to strings anyway?

near igloo
modest maple
#

👀 What

round cove
#

what do you mena

cinder patio
#

tbf, Lua is much simpler than javascript

round cove
#

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

#

22 is going to be equal to 22

#

what kind of question

#

holy fuck js programmers really be like

cinder patio
#

so I kinda see how it's JIT can be faster than V8's

near igloo
round cove
#

you can check the equality of numbers???????????

#

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

near igloo
near igloo
#

but ehhh

round cove
#

IF YOU KNOW WHY WOULD YOU CONVER TOT A STRING

#

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

near igloo
#

idk

modest maple
#

🤨

cinder patio
#

You can also use variants and ya know

variant1 == variant2

round cove
#

holy moly

#

cf im hurtin rn ngl

modest maple
round cove
#

lmfao

vernal shell
#

hii could i ask a question about bots here?

round cove
#

Yeah what's up

modest maple
#

whats down

vernal shell
#

is there a way to set a limit on the amount of servers my bot can be in?

round cove
#

Uh

vernal shell
#

i tried googlgin and cant really find anything on it

modest maple
#

yeet yourself out of them after a certain amount

round cove
#

I mean I guess you could force the bot to leave a server if it surpasses a number

modest maple
#

or just make it private

round cove
#

If you want

vernal shell
cinder patio
#

why... would you want that

vernal shell
#

uhh

modest maple
round cove
#
client.on("guildcreate", guild => {
  if (client.guilds.size > someLimit) guild.leave()
})```
#

I guess

vernal shell
round cove
#

yeah

vernal shell
#

which would be better tho

round cove
#

private probably

vernal shell
#

ah cuz the leaving code would run every time its added to a server

#

i see

round cove
#

yeah

vernal shell
#

that makes sense yeah

#

thanks so much! @round cove @modest maple

#

❤️

round cove
#
for n in 0..100 {
    match (n % 3, n % 5) {
      (0, 0) => println!("FizzBuzz"),
      (0, _) => println!("Fizz"),
      (_, 0) => println!("Buzz"),
      _ => println!("{}", n),
    }
}``` Match in rust is v powerful
lyric mountain
#

the what

modest maple
#

Now see thats one thing

#

wait till you start algebraic matching with enums

#

like

#

match foo {
  Ok(SomeThing::Tm) => {

  },
  Ok(other) => {

  },
  Err(ref e) if e.kind() == Foo => {

  },
  Err(fuck) => panic!("fuck")
}```
quartz kindle
#

dafuq

round cove
#

stealing

#

alright cf

#

now explain it

modest maple
#

ok

#

so

#

It will basically do it in order you nest them if you get me

round cove
#

right

modest maple
#

so if you have a Result enum for example like this

near igloo
#

thoughts on this?

round cove
modest maple
#

if your enum matches Ok you'll then match the internals (rust will do this in a pass though

near igloo
#

thats the problem

round cove
#

I was joking xd

modest maple
#

if the value contained in the enum matches the matched value

#

it will branch

#

otherwise

round cove
#

How does it get to the last error?

modest maple
#

it defaults to the other var just called other

#

but it can be anything

#

the error side of stuff

#

if you have Err of a Result enum

round cove
#

Ah

modest maple
#

you can take the reference of the internal value (but not take it) and compare it to a condition

#

if that seperate condition is true branch

#

otherwise

round cove
#

I should learn rust some

modest maple
#

go to that var or default etc...

#

Tis v powerful;

cinder patio
#

🤤

modest maple
#

and probably one of my favourite things

round cove
#

Time to drop cpp and ts

#

lmfao

quartz kindle
#

fek ts

#

ts is a downgrade for everyone except the church of ts

round cove
#

wtf no

quartz kindle
#

js -> ts = congrats now everything screams at you
cpp -> ts = congrats, now your're doing exactly the same thing but slower

round cove
#

good I want it to scream at me

#

type safety? yes sir

modest maple
#

What it should be

#

TS -> Screaming at you but much speed and safety

round cove
#

also I use ts because my fulltime job is web dev lmao

#

Unless you want me to do wasm

quartz kindle
#

ts != speed

modest maple
#

it should be though

quartz kindle
#

its fast if you know what you're doing, its slow if you dont

#

and if you know what you're doing, you shouldnt need ts

round cove
#

Sadly that's not how it works when you're on a team of 30+ people.

quartz kindle
#

true

modest maple
#

They basically went "Who needs this massively performant runtime we made for wasm that works great with typed languages"

near igloo
#

haha i used templates to cheat the static typing

round cove
#

congrats you learned generics

cinder patio
#

AssemblyScript*

near igloo
#

that doesnt look good

round cove
#

Man I love C++ errors lmao

near igloo
#

i legit dont understand what its trying to say

round cove
#

size is a function

near igloo
#

oh

round cove
#

It says it

near igloo
#

this isnt js lmfao

round cove
#

invalid use of member function

near igloo
#

okay im not used to cpp errors

#

also im used to js where .size is an obj not funct

round cove
#

you're not ready

near igloo
#

no im not freerealestate

#

alr how can ```cpp
//checks if the vector of ints (param 1) contains an object that is equivalent to the refrence (param 2)
bool some ( std::vector<dynamic> dataSet, dynamic refrence){

for(int i = 0; i < dataSet.size(); i++){

    if(dataSet[i] == refrence){return(true);}

}

return(false);

}``` in any way return a integer

round cove
#

It can't

#

It returns a bool

near igloo
#

so how did i get an int freerealestate

round cove
#

Because true = 1, false = 0

near igloo
#

ohhhhh

round cove
#

When you output it to the screen it gets converted.

near igloo
#

🤦‍♂️

#

okay i see

round cove
#

It's not going to print true or false

near igloo
#

why not

round cove
#

Ask the buffer that question

near igloo
#

hey buffer...

quartz kindle
#

also

#

you cant do vector<dynamic> if dynamic is a template

near igloo
#

im confuse

quartz kindle
#

templates must be known at compile time

#

what templates do is basically create multiple copies of the same thing with different types

#

for example

near igloo
#

then idk how this works```cpp
#include <iostream>
#include <vector>
#include <unistd.h>
template <typename dynamic>

//checks if the vector of ints (param 1) contains an object that is equivalent to the refrence (param 2)
bool some ( std::vector<dynamic> dataSet, dynamic refrence){

for(int i = 0; i < dataSet.size(); i++){

    if(dataSet[i] == refrence){return(true);}

}

return(false);

}

int main () {
std::vector<char> e = {'1', '2'};

std::cout << some(e, '1') << "\n";

std::cout << some(e, '3') << "\n";

}```

#

im not smart freerealestate

#

but it compiles and runs fine

quartz kindle
#

im pretty sure thats not actually using the template

near igloo
#

idk how it works

#

i just know it does

round cove
#

It is Tim lol

#

The functiuon call sees the vector<char>

woeful pike
#

I'm pretty sure you can't insert bool into stdout

round cove
#

that's why it's implicitly converted.

near igloo
quartz kindle
#

so you dont need to explicitly call some<char>()?

round cove
#

Not for functions No

woeful pike
#

I still don't understand what can and can't be implicitly converted in cpp lol it's wack

quartz kindle
#

im pretty sure i got errors when i tried doing that but oh well

round cove
#

You declare templated classes

#

You're probably thinking of a tempalted class non default constructor

#

Most liekly

quartz kindle
#

probably

#

it was then i was playing around with node's N-api

round cove
#

Wait til you realize you don't have to template any member functions inside a class because it's also implicit

fierce ether
#

if i copy one file code to another file it dosent copy the css file for some reason

round cove
#

what

woeful pike
#

I did a little bit of work with the node api last week it was really interesting

quartz kindle
#

im still trying to figure out how to define templates based on input arguments from the js side

#

especially when instantiating classes

round cove
#

yikes

woeful pike
quartz kindle
#

ew NaN

deft forge
#

How do I code my bot to make a log file of deleted messages with python

woeful pike
#

native abstractions for node

quartz kindle
#

nan is such a clusterfuck

woeful pike
#

yeah I've realized lolol

quartz kindle
#

i've rewriten an entire lib from nan to n-api

#

feels so much better

woeful pike
#

oh I thought nan was a better version of it

quartz kindle
#

nan is old

#

is what you would use before n-api became a thing

round cove
#

better lmfao

woeful pike
#

this was my first time touching native dependencies so I'm pretty new to all of it

quartz kindle
#

n-api was made to fix nan's issues

#

which include deprecations from node and v8

#

n-api provides stable abstractions so that it never gets deprecated or changed across node versions

round cove
#

I feel every lib devs says that lmfao

quartz kindle
#

says what

round cove
#

will never get deprecated

#

last updated 3 years ago, build failed

quartz kindle
#

isnt that what stable ABI's are for?

woeful pike
#

I once made a gif library in C++ I should try adding nodejs support to it

#

although it can read gif files/buffers but can't really do anything with it kek

quartz kindle
#

xD

#

you can easily pass js buffers to cpp so it shouldnt be hard

woeful pike
#

nono I mean the goal was to be able to edit the gifs and serialize it back into the gif format like remove looping and stuff like that but it took me a long time to figure out how to decompress the LZW compression gif uses for its frames and I couldn't get compression working so I could work backwards to a gif JUSTLOL

#

it was still pretty fun though

quartz kindle
#

name it "gif trasher"

#

input a gif and output garbage data

#

:^)

woeful pike
#

yo pog

#

I mean it outputs the gif data correctly but that's all, not very useful

#

gif-metadata-viewer could be interesting though

quartz kindle
#

output an array of png buffers

near igloo
#

thats good

quartz kindle
#

thats usually useful

near igloo
#

what did i do to fault the segment this time freerealestate

round cove
#

walk off the array

#

accessing memory that does not belong to you

near igloo
#

ik that

round cove
#

With the questions you've asked I literally cannot tell

quartz kindle
#

yo why the fuck does chrome need 2gb ram to take a 300mb heap snapshot

round cove
#

chrome ltierally takes free ram if it's available

#

"more memory to cache into"

near igloo
#

use firefox

#

100% superior

quartz kindle
#

except when its not

torpid otter
#

Keep sent messages twice

round cove
#

firefox also just has the same issues with ram with my experiences lmao

quartz kindle
#

sadly their js engine sucks compared to v8

woeful pike
#

we use the unix memory usage philosophy of nomnomnom

quartz kindle
#

also same dylan

near igloo
#

like way better

woeful pike
#

bro just stop using js just use wasmm

sudden geyser
#

proceeds to leave 300 tabs open

woeful pike
#

we're gonna be using wasm partially in top.gg somewhat soon BPRoseDab

torpid otter
#

With all command it sent it twice

near igloo
#

try restart the machine your hosting on and try again

torpid otter
#

Did that

near igloo
#

🤔

round cove
#

here's your cpp of fun

modest maple
#

Cutting out a fairly reasonable amount of client support there

torpid otter
#

I think it the hosting

round cove
#

mixing what's implicit and not just for you

modest maple
#

Especially considering some of the limitations and overheads

deft forge
#

How do I make my bot store deleted messages in a log with python

woeful pike
near igloo
#

aparently using cpp std::vector<dynamic> causes me to fault the segment with large vectors

woeful pike
#

this I'm kinda interested in

vivid fulcrum
round cove
#

show code

near igloo
deft forge
round cove
#

what input did you give it

still sky
near igloo
near igloo
vivid fulcrum
quartz kindle
#

Lol

deft forge
#

Thanks

near igloo
modest maple
#

Search engine fun

round cove
still sky
#

As I read vector items locates one by one in memory, therefore adding any items force to move all vector to relocate

round cove
#

You just made an empty vector with no memory size

near igloo
round cove
#

Vectors are dynamic and if you try to override memory the way you are of course it'll segfault

near igloo
#

im dumb

quartz kindle
#

smart :^)

round cove
#

lmfao

modest maple
woeful pike
vivid fulcrum
#

everything from the std namespace is trash just make your own implementation

#

/s

near igloo
modest maple
earnest phoenix
#

why is my bot crashing on heroku

#

2021-04-19T21:29:19.913468+00:00 app[worker.1]: at runMicrotasks (<anonymous>)
2021-04-19T21:29:19.913469+00:00 app[worker.1]: at processTicksAndRejections (node:internal/process/task_queues:94:5)
2021-04-19T21:29:19.913469+00:00 app[worker.1]: at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:39:14) {
2021-04-19T21:29:19.913471+00:00 app[worker.1]: method: 'post',
2021-04-19T21:29:19.913471+00:00 app[worker.1]: path: '/channels/113743192305827841/messages',
2021-04-19T21:29:19.913472+00:00 app[worker.1]: code: 50013,
2021-04-19T21:29:19.913472+00:00 app[worker.1]: httpStatus: 403
2021-04-19T21:29:19.913472+00:00 app[worker.1]: }
2021-04-19T21:29:20.039683+00:00 heroku[worker.1]: Process exited with status 1
2021-04-19T21:29:20.105502+00:00 heroku[worker.1]: State changed from up to crashed
2021-04-19T213139.472568+00:00 heroku[worker.1]: State changed from crashed to starting

vivid fulcrum
#

you cut off the stacktrace

#

i can see the error code anyway

woeful pike
#

I've heard from C++ people the constant time prepend isn't worth losing the caching benefit you get from the adjacent memory addresses of vector elements

torpid otter
#

I fix my bot

vivid fulcrum
#

which inherently crashed your app

#

also

#

cancer nickname

#

or rather username

still sky
#

Well, I'm just learn cpp at university. Basically I'm js only

near igloo
#

uhhh why is my code generating 900 0's

#

😩

#

ohh cuz im big dumb

#

🤦‍♂️

modest maple
#

Ever wonder why fuzzy search doesnt work? Ever realize that you're on the wrong versioning mmLol

round cove
#

who would've thought

modest maple
#

in fact

#

not only was i on the wrong versioning

#

i was connecting to the wrong machine

quartz kindle
#

first world problems

#

:^)

modest maple
quartz kindle
#

lmao

#

looks fun

woeful pike
#

I'm digging the layout here though

deft forge
#

what code should I write if I want my bot to deleted messages if certain words are in them (im using python)

dusky sundial
#

It's probably best if you try to get started on your own, and ask here if you run into any questions on the way

deft forge
#

i wrote
@client.event async def on_message(message, ctx): if ctx(no_words): await ctx.message.channel.purge()

#

but it sends me TypeError: on_message() missing 1 required positional argument: 'ctx'

lyric mountain
#

afaik messages aren't passed as args for events

#

only the event itself

dusky sundial
#

pretty sure ctx should be the first parameter as well

deft forge
#

oh ok thanks

dusky sundial
#

and I'm not sure what you're trying to do with ctx(no_words)

near igloo
deft forge
#

no_words is a list of words

lyric mountain
#

it doesn't work like that

#

ctr(something) would mean ctx is a function

dusky sundial
#

you can do ctx.message.content to get the message as a string, then compare that string to your list of words, best way would probably be splitting the string and using any()

deft forge
#

ok thanks

lyric mountain
#

and definitely don't use purge

deft forge
#

y

lyric mountain
#

it's both wrong and unnecessary

#

why would you purge N messages if ONE has blacklisted words

deft forge
#

its the only command that I know can deleted messages

dusky sundial
#

You'll find that message actually has a method called delete :)

near igloo
#
int quantity ( std::vector<dynamic> dataSet, dynamic refrence){

    int filtered;

    for(int i = 0; i < dataSet.size(); i++){

        if(dataSet[i] == refrence){filtered++;}

    }

    return(filtered);

}```why is it returning whatever refrence is
fierce ether
#
                            <button type="button" class="ervatw-5 iboXtn">
                                <img src="assets/plusOne.svg">
                            </button>``` how do i make this open a menu ive tried form but still nothing?
quartz kindle
#

what menu?

fierce ether
#

so its meant to show the guild roles

tender prairie
#

hello

near igloo
#

when i do cpp int quantity ( std::vector<dynamic> dataSet, dynamic refrence){ dataSet.size() is always 0 freerealestate

#

i want to ping tim so badly rn

#

but i shall not

dusky sundial
#

Is the size of the vector you're passing in not 0?

near igloo
#

i mean i guess i can run a check to make sure

near igloo
#

but how

dusky sundial
#

Could you show the code you use to create the vector?

near igloo
#

hold on my entire vector apears to be empty

#

something is very wrong here

dusky sundial
#

c++ moments

near igloo
#

i initalised it using std::vector<std::vector<int>>

#

so uh aparently that dont work

dusky sundial
#

You have a vector with vectors with ints inside of it?

near igloo
#

perhaps

dusky sundial
#

Hmm okay

near igloo
#

||yes yes i do||

dusky sundial
#

tbh I'm pretty damn new to c++ myself so I probably won't be able to help much

near igloo
#

its cool

#

im big dumb rn

quartz kindle
#

show code?

near igloo
#

ill try run this

#

yea .empty() returns true

#

i think im setting it wrong

quartz kindle
#

you're not actually initializing the vectors are you?

tiny ridge
deft forge
tiny ridge
#

Ah alright

quartz kindle
# near igloo

vector<vector<int>> results(batches, vector<int>(amount));

#

you dont need reserve

near igloo
#

now i feel dumb

#

ty

fierce ether
#

how would i define the text color as the role color? js <span style="color:<%=role.color %>"><%= role.name %></span>

earnest phoenix
#

i have this announcement command but in the error with 'pass' it doesn't send it to even the servers who do have the channel. how do i fix this?

carmine summit
#

member.roles is undefined?

lament rock
earnest phoenix
#

in the announcement channel

lament rock
#

thats not what announcement channels are for lol

carmine summit
#

can someone help me? member.roles is undefined...

oak crag
carmine summit
#

message.guild.members.fetch(message.author.id.toString()).roles roles is undefined

lament rock
#

string.toString() lol

#

also, MemberManage.fetch returns a Promise<GuildMember>

#

not a GuildMember

carmine summit
#

ah k