#development

1 messages · Page 1571 of 1

opal plank
#

it'd highly recommend splitting by [ instead

#

and then checking if it includes ] in it

#

more logic but would likely be faster if not on par with regex

cinder patio
#

You could also iterate through the whole string

opal plank
#

thats an option too

cinder patio
#
let pos = 0;
let inPlaceholder = false;
let lastPropertyStr;
let val;
for (; pos < str.length; pos++) {
  if (inPlaceholder) {
    if (str[pos] === ".") {
         val = obj[lastProperty];
         lastPropertyStr = "";
    }
    else if (str[pos] === "]") inPlaceholder = false;
    else lastPropertyStr += str[pos];
}
else if (str[pos] === "[") inPlaceholder = true;
}

This is the first thing that comes up in my mind. Not sure if it's faster than regex or just doing a ton of splitting but it's an option

opal plank
#
let entries = [];
let temp = '';
let str = string.slice(0,string.indexOf('['));
for(let c of string) {
  switch(c) {
    case ']' : if(temp.startsWith('[')) { entries.push(temp); temp = '' };
    break; 
    case '[' : temp = c; 
    break;
    default: temp+=c
  }
}
for(let e of entries) // entries.split('.')
#

remove previous unused chars before string

#

then simply keep adding until it hits a ]

#

when it does, clean the temp and push it to entries array

#

also check if it starts with [

#

actually

#

that wont work

#

there

#

let me test that rq

#

yup, works fine

#
    let string = args.join(' ');
    let entries = [];
    let temp = '';
    for (let c of string) {
      switch (c) {
        case ']':
          if (temp.startsWith('[')) {
            temp += c;
            entries.push(temp);
            temp = '';
          }
          break;
        case '[':
          temp = c;
          break;
        default:
          temp += c;
      }
    }
    console.log(entries);
#

@tight plinth

tight plinth
#

alright

#

lemme test that w/ my setup rn

opal plank
#

probably best to try a performance test

#

not sure how my regex will od against that

#

since im doing capture groups it should be a bit less performant

limpid moth
#
    const msg = message.content.toLowerCase();
    const afterowo = msg.slice(3).trim().split(/ +/);
    function checkCommand() {
        return afterowo.includes() === list;
    }
    // Counting code
        if (msg.startsWith('owo')) {

            if (list.some(checkCommand(afterowo)) === true) {
                message.channel.send('That was a command.');

            }
            else if (list.some(checkCommand(afterowo)) === false) {
                message.channel.send('That was not a command');
            }

#

Could someone help me fix this I keep getting the error that false is not a function

opal plank
#

what is list?

#

also whats the error?

#

also wtf is this

quartz kindle
limpid moth
#

Not really

#

Sorry

quartz kindle
#

if(list.some(itemFromList => afterowo.includes(itemFromList)))

#

if you want to convert that to a function, then the argument has to be on the function side

#
function checkCommand(itemFromList) {
  return afterowo.includes(itemFromList)
}
limpid moth
#

ok

quartz kindle
#

then you can do list.some(checkCommand)

limpid moth
#

How would I do the item from list?

cinder patio
tight plinth
#

that sounds interesting

cinder patio
#

gives you some more flexibility with error messages, too

limpid moth
quartz kindle
limpid moth
#

Ok

#

My problem was that the eslint was telling me not to have function checkCommands(list) because list is declared in an upper scope, but when it is not there it fails

#

Ty

tight plinth
#

@cinder patio can you dm me the code you made? trying to copy code from a screen shot is pain

cinder patio
#

yea sorry

stable nimbus
#

Is there any way to fix git pull while my processes are handled by PM2? When I run my update command I get one message returned, but other than that nothing happens and it doesn't return any errors.

quartz kindle
cinder patio
quartz kindle
#

:^)

cinder patio
#

YES

quartz kindle
#

should i join?

tight plinth
#

lel

quartz kindle
#

ex dee

cinder patio
#

If by that you mean you do em, yes please :^)

cobalt spruce
#

HEHE ```Your bot is 40% close to being reviewed. When your bot is accepted or declined you will receive a DM from Luca in our Discord server.

shut carbon
#

Luca
BOT
Today at 4:42 PM
@Discorder by @shut carbon was approved

#

YAY

stable nimbus
#

Fixed, I needed to update PM2 and NPM.

#

@shut carbon Congrats mate.

#

Good luck on your journy!

limpid moth
#

How can I get it so that if any part of a message contains a word it detects it.

For example:
"jdjdjdjlolhshsh"

It would understand that the message had lol in it.

quartz kindle
#

try this @cinder patio @tight plinth ```js
function replace(string, object) {
for(let index = string.indexOf("["), n = 0; index > -1; index = string.indexOf("[", n)) {
const end = string.indexOf("]", index + 1);
const extracted = string.slice(index + 1, end).split(".");
let val = object;
for(let i = 0; i < extracted.length; i++) {
val = val[extracted[i]];
if(!val) break;
}
string = string.slice(0, index) + val + string.slice(end + 1);
n = end + 1;
}
return string
}

modest maple
#

+ var + que?

quartz kindle
#

fixe

#

d

#

lmao

cinder patio
#

Doesn't that only allow for one placeholder, so you'll have to call the function multiple times

#

if there are multiple placeholders

quartz kindle
cinder patio
#

ooh I see

quartz kindle
#

this is basically the code i use in my FTSet lib for manipulating strings lul

#

performance is almost the same as native arrays

limpid moth
cinder patio
restive furnace
#

eww thats slow

#

11ms

cinder patio
restive furnace
#

9 not bad anymore

#

but try get 10us

cinder patio
#

That's 10k iterations though

restive furnace
#

well whats it is with 10 iters

cinder patio
#

Should I also test em in different consoles?

restive furnace
#

probably ¯\_(ツ)_/¯

cinder patio
#

@quartz kindle Tested on google chrome

#

Wait yours does a check if the value is undefined, mine doesn't, guess I'll fix that

#

Still the same

opal plank
#

yall just working on the replace object right?

cinder patio
#

yeaah

opal plank
#

how did mine rate for the actual parsing of the entries?

#

between my regex and the function

cinder patio
#

I managed to implement function calls pogey

opal plank
#

oooh

cinder patio
#

I dunno you didn't provide complete code so I didn't test it

opal plank
#

wdym i didnt provide complete code

#

it was complete

cinder patio
#

can you link the message

limpid topaz
#

It’s my discord giveawaybot

opal plank
#

right here

#

@slender thistle ads ^^

#

or, attempted ads KekDoggo

#

also giveaway bots Squint sketchy

#

anyhow

#

@cinder patio just replace args.join with your thing

slender thistle
#

@limpid topaz Don't advertise

limpid topaz
#

Sorry

#

But @slender thistle can you tell the owners that I’ve just added my bot to top.gg

opal plank
#

just be patient

slender thistle
#

We will review it when the time comes

limpid topaz
#

Ok

slender wagon
#

lol

cinder patio
opal plank
#

yeah, thats the bit i was talking about

#

the rest is the function you guys are giving

#

specially yours

#

its just to replace provided an entry and an object, no?

#

it doesnt do the searching, per se

cinder patio
#

It does the searching and the replacement of the placeholders

opal plank
#

wait what

#

oh, i see what u did

cinder patio
#

same with tim's

opal plank
#

thats kinda smart tbh

hybrid roost
#

Hello, my bot don't working.
It is all that I have.
Oh, this code don't working too

var ds = require('discord.js');

var bot = new ds.Client();

bot.on('ready', ()=>{
    console.log('Clear Maid app started');
})
bot.login('');
#

I started verification process yesterday

solemn latch
#

Are you getting any errors?

hybrid roost
#

Nope

#

Just black console

solemn latch
#

Your filling in the token right?

hybrid roost
#

of course

#

I started my main big code with another token

solemn latch
#

Did you save the file?

hybrid roost
#

And it working

hybrid roost
#

C'mon

#

Ugh

#

Yep

#

I saved

inland helm
#

sea

hybrid roost
#

Yes, I also want to swim in the sea now, and not to f**k with this stuff

quartz kindle
#

@cinder patio try this

#
function replace(string, object) {
  let res = "";
  for(let index = string.indexOf("["), n = 0; index > -1; index = string.indexOf("[", n)) {
    const start = index + 1;
    const end = string.indexOf("]", start);
    const extracted = string.slice(start, end);
    if(!extracted) continue;
    let val = object;
    for(let i = extracted.indexOf("."), t = 0; val = val[extracted.slice(t, i > -1 ? i : void 0)]; i = extracted.indexOf(".", t)) {
      if(!val || i === -1) { break; }
      t = i + 1;
    }
    res += string.slice(n, index) + val;
    n = end + 1;
  }
  return res
}
cinder patio
#

on it

#

Around 0.10ms (10 iterations)

#

Sometimes 0.11, sometimes 0.10, sometimes 0.9

quartz kindle
#

on 10 iterations i get 0.02 here lmao

cinder patio
#

Brave?

quartz kindle
#

ye

#

send me your code

cinder patio
#
function replace(str, obj) {
    let inPlaceholder = false;
    let lastPropertyStr = "";
    let val = obj;
    let res = "";
    loop:
    for (let pos = 0; pos < str.length; pos++) {
        if (inPlaceholder) {
            switch(str[pos]) {
                case ".":
                    val = val[lastPropertyStr];
                    if (!val) break loop;
                    lastPropertyStr = "";
                    break;
                case "]":
                    res += val[lastPropertyStr];
                    inPlaceholder = false;
                    val = obj;
                    lastPropertyStr = "";

                    break;
                default:
                    lastPropertyStr += str[pos];
            }
        } 
        else if (str[pos] === "[") inPlaceholder = true;
        else res += str[pos];
    }
    return res;
}
quartz kindle
#

mine

restive furnace
#

urs a lil bit faster

quartz kindle
#

mine got some weird spikes

#

but i guess thats just js glitching

#

or gc

cinder patio
#

interesting

restive furnace
#

disable gc 🧠

cinder patio
#

what engine does Brave use

quartz kindle
#

v8

#

brave is basically chromium

cinder patio
#

okay wait

opal plank
#

speaking of speed

#

fuck d.js

quartz kindle
#

xD

opal plank
#

3 seconds vs 11 seconds startup

#

bloated piece of garbage

#

spit

restive furnace
#

get it to 0

#

by making ur own

opal plank
#

also whats up with d.js not cahcing all users?

#

it only gets 255

cinder patio
#

not all users get cached 👀

restive furnace
#

imagine caching users

#

i could never

opal plank
#

laughs in 128gb of ram

restive furnace
#

smh i have 2 gb in my server

#

soon 0

opal plank
earnest phoenix
restive furnace
#

32 cores smh

cinder patio
#

I'm jealous

opal plank
#

cant wait to completely port it

cinder patio
#

even though I don't have anything to do with all that RAM and cores

opal plank
#

this is unnaceptable

cinder patio
#

port what

opal plank
#

port my bot

#

to NOT use d.js anymore

cinder patio
#

to what

#

oh

opal plank
#

cuz that shit bloated af

#

d.js-light seems like a good option too

cinder patio
#

you're getting that startup cause of all the initial fetching probably

opal plank
#

1600 server using 3gb is unconciveable dude

#

those 2 tests of startup were on my test bot

#

not on the main

#

thats the thing

#

the one that caches MORE took LESS time

#

look at users

restive furnace
#

just port it to WebSocket

opal plank
#

the total is just all users across all guilds, the second one, users, is all in cache

cinder patio
#

I see

#

I don't think discord.js caches all users by default

opal plank
#

yet it takes longer to finish

#

@quartz kindle what do you have to say in d.js's defense and in favor of your lib?

midnight blaze
#

is d.js v13 not out yet?

cinder patio
#

nopw

opal plank
#

d.js is the meme equivalent of chrome dude

#

has memory.
d.js: its free real state

cinder patio
#

I'm waiting for slash commands to come to d.js in particular

quartz kindle
opal plank
#

that startup log happens right after d.js emites ready btw

opal plank
#

implement your own is the best bet so far

#

cuz it'll be changing soon

earnest phoenix
#

they're worse than doing command handling through the message event

#

the only advantage you get is two whole entities are parsed for you and you get a fancy UI

cinder patio
#

I think it highly depends on what your bot does, and slash commands are perfect for one of my bots, currently I'm in the middle of rewriting it with slash commands, but I'm waiting for the official release instead of doing hacky stuff

opal plank
#

thats all i can say tbh

#

not only for js, a lot of libs arent adding support for slash commands yet

earnest phoenix
#

they'll be worth it once discord implements more UI related stuff - the shit they showed in the prototype (polls, interactive embeds etc)

opal plank
#

yeah thats the thing i wasnt sure i was suppose to talk about

earnest phoenix
#

don't know whether the question should be when or if

#

they're known to not exactly own up to their promises

cinder patio
#

I mainly want to switch to slash commands because of the client-only replies and the ability to hide the arguments of a command, makes the chat way less cluttered for a game bot like mine

opal plank
#

indeed

#

prob better implementing ur own to be completely honest

cinder patio
#

I'm currently using the private discord.js api methods

opal plank
#

if, actually, WHEN changes come, you can simply edit it yourself without relying on a broken lib until they update themselves

cinder patio
#

Also, you cannot add attachments to interaction responses currently, so the bot's development is in limbo until discord implements that lmao

opal plank
#

you could send embeds instead

#

either webhooks or simply sending it

cinder patio
#

I can't use webhooks because I want to make the response client-only

opal plank
#

you can send the usual way an embed though

cinder patio
#

or followups, however discord calls em

#

I don't think you can, it still needs to be an attachment

opal plank
#

as in, message.channel.send(attachment) instead of respond the interaction

cinder patio
#

but then it's not client-only

earnest phoenix
#

Who here knows about shards/sharding. My bot is in 170+ servers so obviously I don’t need it rn but I just wanna be prepared. How do I do that?

cinder patio
#

that's the thing

pale vessel
#

Upload the image somewhere else first and use the URL to embed it

glossy spoke
#

can someone teach me how to use SQLite with JavaScript??

cinder patio
#

that's too much work

opal plank
#

fair

pale vessel
#

It's not

cinder patio
#

for a workaround it is

#

discord will add attachments soon hopefully

pale vessel
#

I'm not sure about that

glossy spoke
pale vessel
#

Be Tim's patron and you can DM him anything about JS

#

Worth

earnest phoenix
#

Tim is basically your living StackOverflow

opal plank
#

just 9.99

#

tis a bargain

#

coaches hate him

#

||Im not sponsored by Tim(but you can if you want to Tim, wink wink*)||

cinder patio
mellow kelp
#

yes

#

no false duplicates

earnest phoenix
#

Welcome to the shop dev!

Here we have some nice packages that can help you in programming.

Introducing Tim pack (Extremely rare)

Tim pack
• Will help you a lot
• Chance of becoming friends with him
• 10 question a day

$10

Tim pack premium
• All the previous pack features
• Will help you even more and might even spoon-feed
• Will become friends
• Share his secret knowledge of how he became a living StackOverflow

$50

Tim pack: the ultimate StackOverflow edition
• All previous pack features
• Constant spoon-feed, will do anything
• He might write your projects for you
• Might plan to meet you in real life
• Might give you shout-outs

$NaN

midnight blaze
mellow kelp
#

this is gold

earnest phoenix
#

indeed lol

quartz kindle
#

LOL

tired panther
mellow kelp
#

I think you went a bit overboard with $NaN, I don't have that much money 😔

proven lantern
#

are there any good services that will alert me when by bot goes offline. is there an api i can call to see if my bot is online?

opal plank
#

pm2

quartz kindle
#

make another bot's whose sole purpose is to monitor your bot

#

:^)

opal plank
#

pm2, grafana, forever, theres a lot of tools that would do the job just fine

mellow kelp
#

i would recommend pm2

proven lantern
#

just make a heartbeat log and then use grafana to see if that heartbeat isn';t there?

opal plank
#

forever will actually prevent you bot from going offline by attemping to restart it, pm2 is a proper monitor, grafana is what i use since it can do http requests and handle errors by sending me message or some shit

proven lantern
#

statsd

opal plank
#

grafana has an alert feature, i usually just ping my api, on error => handle whatever you want

#

sending messages on whatsapp, mail, discord, whatever you want tbh

#

though its quite hard to setup

proven lantern
#

thanks, i'll try that out.

#

i use statsd/grafana at work

#

i use to. now we use pagerduty

opal plank
#

i still prefer elk + grafana for most monitoring

opal plank
proven lantern
tight plinth
#

@quartz kindle imma buy Tim pack premium but I will pay in hugs

opal plank
lone palm
#

**
ERROR:

Discord API Error encountered.
Invalid "code" in request.

LINE:

/* LIBARYS */
const express = require('express');
const router = express.Router();
const Cookies = require('cookies');

/* OWN FILES */
const authClient = require('./../javascript/auth_client');

/* GET DASHBOARD ROUTER */
router.get('/dashboard', async (req, res) =>{
    const cookies = new Cookies(req, res);
    const code = req.query.code;
    try
    {
        const key = await authClient.getAccess(code);
        cookies.set('key', key);
        res.redirect('/dashboard');
    }
    catch (err) 
    {
        res.redirect('/401');
    }
});

module.exports = router;

**

earnest phoenix
#

Why bold markdown 🗿

quartz kindle
#

marcodown

hybrid roost
#

Oh, hi Mark Down

mellow kelp
#

imagine naming your son mark down

lone palm
cinder patio
#

that looks sick

mellow kelp
#

wait how do you even

cinder patio
#

also I doubt the error is coming from there

mellow kelp
#

**

console.log('hello world');

**

analog tinsel
cinder patio
#

**```js
"nice"

analog tinsel
#

how can i do

cinder patio
#

why would you want to do that?

mellow kelp
#

um

analog tinsel
#

otherway i need to make if in if

#

and it not work for me 😦

mellow kelp
#
if(me != 0) {
 bla bla bla
}

here
#

ez

analog tinsel
#

-_-

proven lantern
#
{ 
    if (num % 2 == 0) 
        // jump to even 
        goto even;  
    else
        // jump to odd 
        goto odd;  
  
even: 
    printf("%d is even", num); 
    // return if even 
    return;  
odd: 
    printf("%d is odd", num); 
} 
  
int main() { 
    int num = 26; 
    checkEvenOrNot(num); 
    return 0; 
} ```
mellow kelp
#

i think that's c or c++

cinder patio
#

imagine if he copies that code and he's using js 👀

cinder patio
#

Why are you assuming they're using C++

misty sigil
#

why not

#

why assume they're using js

proven lantern
#

i dont assume they want to do that

cinder patio
#

because it's most likely

#

I don't think anyone who knows C++ will be asking that question, lmao

#

what lib are you using?

pallid bone
#

nvm

proven lantern
#

That message is global right? you cant have it set to different phrases for each discord server

pallid bone
#

ok 🍗

tired panther
proven lantern
#

goto statements are like switch statements. they should never be used The use of goto statement is highly discouraged as it makes the program logic very complex.

#

also if/else statements

tired panther
#

lol , yes they are

tired panther
cinder patio
#

if/else and switch statements get compiled down to that, so yeah, also you should use it only when you have no other options

tired panther
#

you never use such big code

#

You can do the code in the pic in one or two lines

proven lantern
#

that was the first google result about it

restive furnace
#

far more better

proven lantern
#

i like it

cinder patio
#

it was an example of how goto works lol

restive furnace
#

oh

tired panther
#

lol

restive furnace
#

but why even use it inside C++?

#

or is he using C

proven lantern
#

someone wanted to use gotos

restive furnace
#

but in what language?

proven lantern
#

they didnt say

restive furnace
#

well if it were C it's fine. in other modern languages there should not ever be need even to use them

analog tinsel
#
if (me > 1) {
bla bla bla
if (me > her) { // this and
bla bla bla
}
else {  // this not working
let jumpTo = 25
const index = Math.max(jumpTo - 1, 0);
cache.index = index - 1;
this.callNextAction(cache)
}
}
else {
//if the variable isn't the value, do this other js here (dbm false)
let jumpTo = 37
const index = Math.max(jumpTo - 1, 0);
cache.index = index - 1;
this.callNextAction(cache)
}
tired panther
earnest phoenix
#

They're using JS

analog tinsel
#

second if else not work

#

can anyone help

cinder patio
restive furnace
#

it's "modern" C++

cinder patio
#

bruh

restive furnace
#

well i like that wae and in one discord 90% of people prefers it that way

cinder patio
#

There are literally no advantages to it, though...

#

makes code more messy

restive furnace
#

well yeah not really

mellow kelp
#

hmm this makes me wonder

#

what do you guys think about the rust return conventions?

cinder patio
#

this instead of return this;?

mellow kelp
#
use std::io::stdin;

fn read_line() -> i32 {
  let mut input = String::new();
  stdin().read_line(&mut input).unwrap();

  input
}
#

yea

cinder patio
#

I don't mind it, but I'm used to using return so I'll stick to it

mellow kelp
#

makes sense

cinder patio
#

it's up to preference

#

they get compiled to the same thing

restive furnace
#

yes

mellow kelp
#

yeah

#

rust is still cool cartypat

restive furnace
#

mehh i'll stick with c++ and some other random good programming old-school languages what are older than 2k century

proven lantern
#

scala does the same thing with returning the last line

cinder patio
#

I'm not really a fan of rust tbh

proven lantern
#

scala lets you do this. val x = if (true) "A" else "B"

restive furnace
#

basically a lambda i see

mellow kelp
#

kinda

#

rust is pretty similar

mellow kelp
#
fn is_big(num: &i32) -> &str {
  if num > 100 {
     "yes"
  } else {
    "no dumbass"
  }
}
earnest phoenix
restive furnace
#
bool is_big(int num) { return num > 100; }```
mellow kelp
#

ah yes

#

the superior boolean

#

ternary

restive furnace
#

returning a std::string, basically C++ string in a function could become expensive since yes

#

just better to return boolean

#

wait i dont even need ternary

mellow kelp
#

no KEKW

restive furnace
#

done

#

shorter

mellow kelp
#

k

restive furnace
#

is there ternary on rust?

mellow kelp
#

kinda

#

but it's more ugly

#

thing = if condition { something } else { somethingElse }

restive furnace
#

ok same as kotlin then

mellow kelp
#

you can do weird stuff with rust

proven lantern
#

i always thought the ternary operator and the OR operator should have the same level of precedence

mellow kelp
#
let thing = {
  let i = 2;
  i + 1
}
// thing is 3
restive furnace
#

smh thats too weird for me 😰

opal plank
#

ffs, my ts compiler just screamed looking at that snippet Cholo

proven lantern
#
val twentySomethings =
  for (user <- userBase if user.age >=20 && user.age < 30)
  yield user.name```
mellow kelp
#

imagine compiling rust with ts

restive furnace
#

well ugh u can do lots of weird stuff in C++ too but it's highly not recommended to do them in modern C++

opal plank
#

i meant as in TS will screech at everything

mellow kelp
#

ah yes

#

tipical

opal plank
#

lowkey, js might actually let that pass

mellow kelp
#

hmm

#

better try it out

opal plank
#

cuz Js™️

cinder patio
#

nah

mellow kelp
#

Unexpected identifier

#

nah

cinder patio
#

js isn't that weird

opal plank
#

frick, thought so

#

its the = thats fucking it up

mellow kelp
#

no

#

apparently that's a statement

cinder patio
#

no because you return i + 1

mellow kelp
#

so it returns i + 1

opal plank
#

i++

mellow kelp
#

and the return value goes to thing

opal plank
restive furnace
#

yes rust is weirdish compared to other popular langs

opal plank
#

i was joking, dont quote me

earnest phoenix
#

fun fact

#

c# is actually c++++

mellow kelp
#

then what is java

#

c+++++™️?

restive furnace
#

jaava

earnest phoenix
#

++
++
4 pluses aligned like this and made italic looks like a hashtag so that's the whole premise behind it being named c#

#

we don't talk about java mmLol

quartz kindle
#

c, c+, c++, c+++
java, jaava, jaaava
js, jss, jsss

earnest phoenix
#

i think c# was made way after java

quartz kindle
#

c#, c##, c###

mellow kelp
#

there should be a programming language for every musical note smh

#

why only c#

earnest phoenix
#

there's f#

cinder patio
#

C# is microsoft's java

proven lantern
#

f#

mellow kelp
#

wait yes

#

i forgot about f#

quartz kindle
#

Fminor

rugged cobalt
#

With mongoose, how would you change the Boolean value of something to just be the opposite of whatever it currently is?

cinder patio
mellow kelp
#

yay

#

g#

earnest phoenix
#

i tried f#, i just couldnt get into it, functional languages are just LSD for programmers

glossy spoke
#

So many languages with #

cinder patio
#

I'm not a fan of functional languages either

#

I wouldn't call C functional

mellow kelp
#

what about binary

opal plank
cinder patio
#

is binary really a programming language though

earnest phoenix
quartz kindle
#

jemalloc > malloc :^)

earnest phoenix
restive furnace
#

jefree > free then?

earnest phoenix
#

but you can't really... use it

#

hardware communicates in binary

restive furnace
opal plank
#

fucking unreal editor using more ram than that video mem usage

#

never

#

ever

quartz kindle
#

lmao

opal plank
#

in your life try to open a .uasset

#

i mean it

quartz kindle
#

doesnt mean its jemalloc's fault

#

xD

restive furnace
#

they just forgot few free()'s

opal plank
#

i know, im just saying ue4 can fuck your pc faster tim

quartz kindle
#

have you tried mimalloc?

restive furnace
#

what about opening every jetbrains ide at once?

mellow kelp
#

kekw

opal plank
quartz kindle
#

lmao

opal plank
#

no more memory issues

mellow kelp
#

forgetting free() in a recursive function hashflushed

restive furnace
#

smart pointers 🧠

earnest phoenix
#

✨ chromium ✨

mellow kelp
#

oh no

restive furnace
#

3 chromiums open at once

opal plank
#

lets run electron 20 times, 10 for renders, 5 for process and another 5 for who the fuck knows what

earnest phoenix
#

so basically... a normal electron app

opal plank
#

stares intently at discord

earnest phoenix
#

you can always disable hardware acc mmLol

opal plank
#

fuck that

earnest phoenix
#

2021 seems like a really great year for chromium alternatives

opal plank
#

like baidu

earnest phoenix
#

a lot of projects meant to rival chromium are coming out of alpha stages

opal plank
#

lets be honest, firefox is the closest we'll get to a competitor to chrome

restive furnace
#

✨ firefox ✨ (is not at alpha state though)

#

yes

opal plank
#

people dont usually keep up with the news, specially about browsers

earnest phoenix
#

chromium isn't just chrome

#

but yes

opal plank
#

well yeah

earnest phoenix
#

i still don't understand how people prefer chrome

opal plank
#

ItJustWorks™️

earnest phoenix
#

even if it's for the styling alone you can modify firefox to look like chrome

#

that's what i did

opal plank
#

its like arguing against windows vs linux in a sense

mellow kelp
#

i use edge kek

#

should i use firefox?

earnest phoenix
#

yes

restive furnace
#

yes

quartz kindle
#

firefox is just bad, at least for me

earnest phoenix
#

edge is again, chromium

opal plank
#

you should commit AngryDoorLeave

mellow kelp
#

shit

mellow kelp
opal plank
#

edge tresh

restive furnace
mellow kelp
#

i mean edge ran faster than chrome for me

quartz kindle
#

i always have issues with firefox, not rendering stuff correctly, css shadows on firefox are ugly af, firefox's js engine produces weird results...

opal plank
#

thought im purely speaking from memes, i dont know if theres any big difference in performance for edge

mellow kelp
#

but if firefox is faster there i go

earnest phoenix
#

i have not had a single bad experience with firefox

#

and i've been using it since 3rd grade

quartz kindle
#

you're just used to it

opal plank
#

firefox is amazing for css editing, though chrome is a lot better for debugging and inspecting shit

#

specially for memory analysis

earnest phoenix
#

agree on that

quartz kindle
#

im used to chrome's rendering, so ff just looks weird to me

modest maple
#

Im the opposite lmao

#

i go on chrome and am like yikes

opal plank
#

come join the cool kids club

#

all cool kids use chrome

modest maple
#

i use bRAve

opal plank
#

say yes to chrome kids, stay in school

modest maple
#

cus they give my PrIvaCy

mellow kelp
#

no

modest maple
#

JK brave is a scam mmLol

opal plank
#

Onion Project then

#

Tor

earnest phoenix
#

and then you have opera - the Ga Me R B rOWsER

#

i don't trust opera at all

modest maple
#

I trust opera more than brave

opal plank
#

Opera + mac = gamer combo

earnest phoenix
#

opera got sold to a chinese company :/

quartz kindle
#

im using brave rn as well, but i was very apprehensive at the beginning

opal plank
#

tim is brave

quartz kindle
#

because there was a shitshow of chrome clones going on for a while

opal plank
#

ba dum ts

modest maple
#

Brave has been found to do more dodgey shit than what im willing to forgive

quartz kindle
#

like wut

opal plank
#

why dont we all unite under the clearly superior bloated chrome? mmulu

#

dunno if its bloated, but holy shit the memory usage is high compared to other borwsers

earnest phoenix
#

mozilla seems to be the only company with good intentions tbh

#

even though they started pushing their own services through the browser but that's understandable as they're losing a ton of money

modest maple
#

For a company that is supposed to be for privacy being found to inject their own referral links, lack of support for users, Brave's ad system ends up being that brave make the money instead of the website while you still deal with le ads, then theres the 2019 incident where they used to claim fundraisers on behalf of others which was... A interesting find.

quartz kindle
#

i dont use brave rewards anyway

#

xd

modest maple
#

at that point why not just any chromium browser with a ad block mmLol

solemn latch
#

Putting your own ads while blocking websites ads is actually super sketchy imo.

modest maple
#

it is INCREDIBLY Sketch

earnest phoenix
#

very much topgg vibes

modest maple
#

in there terms they have a clause which going back to the 2019 incident meant they could claim to be giving someone donations using your 'rewards' for seeing their ads and just had the right to keep the money because they are 'providing the service'

quartz kindle
#

at least it was last time i measured ram usage and such

#

anyone tried iridium browser?

modest maple
#

nop

#

but honestly I ditched brave since they got caught doing some of this stuff so early on

#

privacy my ass

earnest phoenix
#

a lot of browsers got cucked when google disabled google sync with other chromium browsers

modest maple
#

mozzila as cry said are the only real development company that actively practice what they preach

quartz kindle
#

i would use firefox more, but there are things about it i simply dont like

modest maple
#

mm fairs

quartz kindle
#

i have it installed for testing and shit

#

there's also ungoogled-chromium

#

heard its pretty good

modest maple
#

Idk

#

I dont have anything againt any browsers really other than brave

long marsh
#

Seriously though, my discord bot previously would hover around 48% -> 55% and steadily increase until an update was pushed out to it. Now, it just stays fairly consistent between 40% and 43%

limpid moth
#

I took the fuction out of my main file and put it into its own json file. I have it declared, how do I get it to activate?

long marsh
#

What function 👀

eternal osprey
#
PS C:\Users\AKFar\Desktop\Chaos Bot> pm2 start randombot.js
pm2 : File C:\Users\AKFar\AppData\Roaming\npm\pm2.ps1 cannot be loaded because running scripts is disabled on this system. For 
more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ pm2 start randombot.js
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\AKFar\Desktop\Chaos Bot>``` why is this happening?
sudden geyser
#

File C:\Users\AKFar\AppData\Roaming\npm\pm2.ps1 cannot be loaded because running scripts is disabled on this system. For
more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

limpid moth
# long marsh What function 👀
const { list } = require('./owocommands.json');
module.exports = {
    name: 'count',
    excute(message) {
const msg = message.content.toLowerCase();
const afterowo = msg.slice(3).trim().split(/ +/);
// eslint-disable-next-line no-shadow
function checkCommand(list) {
    return afterowo.includes(list);
}
const thisWord = 'owo';
// Counting code
if (msg.startsWith('owo')) {

        if (list.some(checkCommand) === true) {
            message.channel.send('That was a command.');

        }
        else if (list.some(checkCommand) === false) {
            message.channel.send('That was not a command');
        }


        }
        else if (message.content.includes(thisWord)) {
            message.channel.send('👍');
        }
},
};

quartz kindle
limpid moth
#

I want to have it alone to make it easier to work with and avoid having spaghetti code

analog tinsel
#

how can i print the number in thousands?
ex: 20 -> 020

sudden geyser
#

You're in the hundreds.

#

You could measure the length off the number in a string format (or just see what the number is) and prepend 0s as needed.

analog tinsel
#

oh then if number lenght = 3 no "0" if lenght = 2 then add 0

#

ill try to make it with code

long marsh
#

Quick question guys

quartz kindle
#

like if a number is 54, you want to print 054?

#

you can use string padding

modest maple
long marsh
#
        confirmMsg.react('✅');
        await confirmMsg.awaitReactions(
          (r, u) => r.emoji.name === '✅' && message.author.id === u.id,
          { max: 1, time: 60000, errors: ['time'] },
        );
        await town.upgrade();

The await confirmMsg.awaitReactions resulted in an error with DiscordAPIError: Unknown Message (basically, a user reported that deleting a message would still upgrade the town). It's odd though - shouldn't the error have been caught and not executed await town.upgrade();?

#

That is wrapped in a try/catch?

analog tinsel
#

@quartz kindle yes

quartz kindle
#

isnt that what you want?

analog tinsel
#

but you writed here how many "0" you want to add

#

i need it auto

quartz kindle
#

the number is not how many zeros

#

is how many characters total

analog tinsel
#

oh

#

can you send me code

quartz kindle
lyric mountain
#

just copy...

#

lul

quartz kindle
#

yourNumber.toString().padStart(3, "0")

analog tinsel
#

thanks ❤️

opal plank
#

question

#

what happens with (123).toString().padStart(1,'0')

limpid moth
#

I'm getting the error Cannot read property 'excute' of undefined

part of index.js:

// When there is a message detected...
client.on('message', message => {

    // If the message was made by a bot ignore it
    if (message.author.bot) return;

    if (message.channel.type === 'dm') return message.channel.send('Sorry, no commands are run in dms.');


    const { counting } = require('./countingfolder/counting.js');
    try {
    counting.excute(message);
    }
    catch (error) {
        console.error(error);
        message.channel.send('There was an error counting');
    }

counting.js:

const { list } = require('./owocommands.json');
module.exports = {
    name: 'count',
    excute(message) {
const msg = message.content.toLowerCase();
const afterowo = msg.slice(3).trim().split(/ +/);
// eslint-disable-next-line no-shadow
function checkCommand(list) {
    return afterowo.includes(list);
}
const thisWord = 'owo';
// Counting code
if (msg.startsWith('owo')) {

        if (list.some(checkCommand) === true) {
            message.channel.send('That was a command.');

        }
        else if (list.some(checkCommand) === false) {
            message.channel.send('That was not a command');
        }


        }
        else if (message.content.includes(thisWord)) {
            message.channel.send('👍');
        }
},
};
opal plank
#

assuming its smart enough to return the original

sudden geyser
#

excute

opal plank
#

fairly certain you need to require everything

earnest phoenix
#

yes

opal plank
#

dont destructure it

sudden geyser
#

well you spelled them both wrong

earnest phoenix
#

you have a default export

limpid moth
opal plank
#

your object doesnt have a counting property

proven lantern
#
    name: 'count',
    execute: message => {}
};```
earnest phoenix
#

don't do drugs and code at the same time

opal plank
#

where counting in there ben?

#

your object has name and execute

#

so where is counting ?

#
 const { counting } = require('./countingfolder/counting.js');
opal plank
#

this is trying to get the property counting from your export

quartz kindle
#

only pads if needed

opal plank
#

which, well, is not there

limpid moth
#

Ok

opal plank
#

either import default or add a counting property/function on your object

opal plank
quartz kindle
#

its very useful for binary conversion

long marsh
#

Does anyone know if the different types of errors are documented?

        await confirmMsg.awaitReactions(
          (r, u) => r.emoji.name === '✅' && message.author.id === u.id,
          { max: 1, time: 60000, errors: ['time'] },
        );
#

I need to basically catch all errors there. If I don't, it accepts the promise and continues on with the logic execution .. lol

quartz kindle
#

that's not what its for

#

by default awaitReactions doesnt throw any error

#

that option is there if you want to force it to throw an error when the time expires

#

if you remove that option, it will not throw, it will just return

long marsh
#

I know

long marsh
quartz kindle
#

i found this

long marsh
#

DUDE! No way

#

I was on the exact same page.

#

Oh, wait. No I wasn't

#

Can you link me to the github page where that was?

#

this.stop(reason) -> I found that

quartz kindle
#

there's also "time", "idle" and "user"

modest maple
long marsh
#

Yeah, I found those at the link above. I appreciate you looking into that, Tim!

long marsh
quartz kindle
long marsh
#

Dude, you're awesome. Thanks

#

Here is your gold star: 🌟

outer perch
#

wow xD

tight plinth
#

looks like that i have some issues with settimeout, anyone knows why?

#

handleInterval is a function tho

#

it also happens to corrupt the entire db, but whatever, i'm still testing it kek

#

setTimeout(() => { handleInterval() },...) fixed it

opal plank
#

setTimeout(handleInterval, x)

tight plinth
#

yeah thtat works too

opal plank
#

makes it looks cleaner and shorter

tight plinth
#

somehow, i is undefined

#

but i need it

opal plank
#

then you'd have to do it the way you wrote it

#

setTimeout just executes the callback

#

i dont think it passes anything

tight plinth
#

it can pass arguments to the function

tight plinth
opal plank
#

like i said, it just runs the function

#

it wont feed it the params you want

tight plinth
#

oh

#

okk

#

thanks ^^

opal plank
rapid eagle
#

How do I know how many servers my bot is in?

opal plank
#

what library u using ?

#

@rapid eagle

earnest phoenix
#

I have the Server Members Intent enabled, what do I pass through as my client options to enable them? Checked through the discord.js docs and tried Intents.FLAGS.GUILD_MEMBERS but makes my bot "not respond".

opal plank
#

you need to pass ALL of the intents you need @earnest phoenix

earnest phoenix
#

ah i see

#

ill try that

rapid eagle
opal plank
#

<client>.guilds.cache.size

#

assuming you have all guilds cached

#

if you're sharding or changed your caching behaviour, it will be different

limpid moth
#

I got it working thanks for the help Not Erwin, Thomas, and Tim

opal plank
#

👍

limpid moth
#

Now I have to create the database system. I plan on storing counts on a server by server basis on a few different categories. Should I have it make a table per server and have the rows be per user and each column be different data? Or something else? (I plan on using sqlite)

opal plank
#

why do you need that?

limpid moth
#

To store the counts

#

That's the main function of the bot

opal plank
#

Table
| guild_id | count 1 | count 2 |
| 272764566411149314 | 10 | 30 |
| 412006692125933568| 13 | 1 |

limpid moth
#

That was my plan. Is there a better way?

opal plank
#

idk what exactly you doing, so thats best i can offer

limpid moth
#

Ok

quaint wasp
#

Hey

#

umm

#

how do I put a path?

#

so like..

#

it was ....\Discord Bot\smug\code

quartz kindle
#

cd

#

you are in the smug folder
cd code
you are now in the code folder
cd ../
you are now back to the smug folder

quaint wasp
#

oh

#

thanks! 🙂

quaint wasp
#

🙂

#

Thanks.

opal plank
#

tim aint wrong tho

#

../ works

#

its just that going to the / key is too far

quaint wasp
#

Also... Doesn't discord.js already know what send is?

opal plank
#

yes and no

#

send() is a method, but it needs a Channel first

quaint wasp
opal plank
#

or a User

quaint wasp
#

well

#

it has a channel..

opal plank
#

clearly not

#

dont fight the compiler xD if it says it doesnt, 99.9999% its right, it doesnt

quaint wasp
opal plank
#

are you doing that in a DM?

quaint wasp
#

no..

#

server.

opal plank
#

console.log(message.channel) before that

quaint wasp
#
        .setTimestamp();
        
        console.log(message.channel)
        message.channel.send(embed)
        }
    ```?
opal plank
#

if that doesnt log anything, then your compiler is right, channel is indefined

#

then use console.log(message)

quaint wasp
#

wait, did I put it right? its on onather line?

opal plank
#

no, you did it right

#

actually

#

do message right away

quaint wasp
#

switch?

opal plank
#

yup

quaint wasp
#

sorry im dumb...

quartz kindle
#

just check your command handler

opal plank
#

im assuming he's passing something that isnt message

quartz kindle
#

in the main file, where you run command.execute()

#

show that code

quaint wasp
#

still got that..

opal plank
#

fairly certain you're passing something that isnt a message

quartz kindle
#

fairly certain you're right

quaint wasp
quartz kindle
#

there you go

opal plank
#

well, thats why

#

you're pasing client

quartz kindle
#

function arguments are passed by order, not by name

opal plank
quartz kindle
#

in the command file, you have message as the first argument

opal plank
#

your first argument is Message, but you passing CLIENT

quartz kindle
#

in the main file you have it as second

quaint wasp
#

OH

#

alr ill change that

opal plank
#

you dont need to pass client fyi

#

d.js has client inside message

quaint wasp
opal plank
#

that would work, yes

quartz kindle
#

tell that to everyone who uses event handers with .bind(null, client)

#

lmao

opal plank
#

but like i said, client is inside message

quaint wasp
#

WOWOWOWOOWOWOWOW! It actiualy works!

#

Thank you guys so much! I've been trying to fix this for like 3 hours now.

#

🙂

opal plank
#

👍

quartz kindle
#

👍

opal plank
quartz kindle
#

super dupla em ação!

#

pukes

opal plank
#

airbourne high five

quartz kindle
#

_ belly slam_

opal plank
#

ah, i see you're a man of culture as well

delicate zephyr
#

Oh look

quartz kindle
#

2 retards

opal plank
#

^^

delicate zephyr
#

Its Erwin and Tim

opal plank
#

flooding that chat with blue

quartz kindle
#

terwin

#

ertim

delicate zephyr
#

Honestly

#

I'm just here to add some spice

quartz kindle
#

:^)

delicate zephyr
#

Hell no

opal plank
#

quick, just say some development related stuff to fool the mods

delicate zephyr
#

if(1 == 0) go to general

mellow kelp
#

pls help why my bot no work

opal plank
#
while(true) client.channels.cache.find((a) => a.name === 'development').send('stuffThatShouldBeInGeneral')```
delicate zephyr
#

that would be spammy

#

lmfao

opal plank
#

pffff i let discord api handle my ratelimiting, like a true champ

delicate zephyr
#

you mean

#

Like d.js

#

I wonder if d.js uses buckets in the rewrite

summer torrent
#

buckets?

opal plank
#

bucket is how much ratelimit you got, to put it very bluntly

quartz kindle
#

they already do in the main lib

delicate zephyr
#

Oh

#

so basically

#

what you're telling me

#

is the getting 429's on /gateway/bot

opal plank
delicate zephyr
#

is just discord.js really smashing that limit

#

lmfao

quartz kindle
#

the 429's on gateway/bot are a bug afaik

delicate zephyr
#

Yea it is

#

its just annoying

#

since if discord force disconnects all 128 Shards on chip

#

its uh

#

not fun

opal plank
#

tim, finish porting my commands pls

#

im tired

quartz kindle
#

to detritus?

summer torrent
opal plank
#

wew

#

you had that handy

delicate zephyr
#

it was in my chrome

#

lmfao

opal plank
#

3fast5u

delicate zephyr
#

I found the same one as you

#

lmfao

#

1st result on google be like

opal plank
#

^^

#

also

delicate zephyr
#

ratelimit buckets search term

opal plank
#

@quartz kindle did you finish the docs?

#

close enough

delicate zephyr
#

lmfao

#

god I need to finish writing my bot

quartz kindle
#

gonna push soon

opal plank
#

alrighty

delicate zephyr
#

you know making it so I can remote desktop into my pc was the best decision ive ever made sometimes

#

makes life so much easier when away from home

opal plank
#

IKR!

quaint wasp
#

uhh

quartz kindle
#

if you can afford to run your home pc 24/7

opal plank
#

bruh both ssh and remote desktop from mobile is a bliss

quaint wasp
#

Is it bad?

opal plank
quaint wasp
#

or is it just message log?

quartz kindle
#

my i put it in sleep mode

#

when not using

#

because electricity bills

opal plank
#

frick that

#

electricity aint that expensive either way

quartz kindle
#

for you maybe

#

lmao

opal plank
#

i think i pay around 80 bucks/month with 3 pcs running 24/7

quartz kindle
#

80 brl?

delicate zephyr
#

which is what I use

#

put it to sleep, send a WOL packet to my main pc from work

#

and then RDP

#

ez pz

quartz kindle
#

does wake on lan work on wifi?

delicate zephyr
#

yes

quartz kindle
#

rly?

#

does that mean wifi is always on even in sleep mode?

delicate zephyr
#

Wait

#

I've had it work on wifi

#

idk if that was just luck based on device tho

#

there is also another remedy

quartz kindle
delicate zephyr
#

If you have a spare mobile phone setup a USB Ethernet cable

opal plank
quartz kindle
#

well

#

my last electricity bill here in portugal was 57 eur

delicate zephyr
#

I make up like

quartz kindle
#

368 brl

delicate zephyr
#

45% of my mums electric bill

#

E

opal plank
#

well euro clearly going to be more expensive

#

conversion isnt worth in this case

quaint wasp
#

how do I save it? I press save button but nothing happens...

#

says this:

quartz kindle
#

lmao

#

then use a different bin

#

try hatebin

#

or pastebin

#

or whatever, theres a shit ton of bins

delicate zephyr
eternal osprey
#

hey

delicate zephyr
#

@quaint wasp try any other hastebin service

#

hell even try stack overflow

eternal osprey
#
  const profanity = googleProfanityWords.list(); 

   
      if (message.content) {
        if(message.author.id !== client.id){
        const profane = !!profanity.find((word) => {
          const regex = new RegExp(`\\b${word}\\b`, 'i'); 
          return regex.test(message.content);             
        });
      }
        if (profane) {
          if(message.author.id !== client.id){
         let m = insulter.Insult();
         message.channel.send("<@"+message.author.id+"> "+ m)
            .catch(console.error);
        }
      }
      }
    }```why is this returning me the error:
delicate zephyr
quartz kindle
eternal osprey
quartz kindle
#

you have ```js
if() {
const profane
// profane only exists inside this block
}

// profane doesnt exist here
if() {
// profane doesnt exist here
}

opal plank
#

fairly certain hastebin moved somewhere iirc

#

dunno why they dont redirect it

slender wagon
#

React or vue whats the best to learn first?

eternal osprey
#

so i need to change the identation?

opal plank
#

either indentation of declare it outside

marble juniper
#

how could I turn a number like this

0.9584867874

into

95.84867874

? (javascript btw)

opal plank
#
  • 10?
#

👀

delicate zephyr
#

you mean

quartz kindle
#
  • 100
delicate zephyr
#

*100

opal plank
#

ah, yes, my abd

quartz kindle
#

my abd

opal plank
#

the booze finally starting to hit my brain

marble juniper
#

maybe I am stupid then

#

lol

delicate zephyr
#

nah

#

prolly tired

quartz kindle
#

maybe

marble juniper
#

im tired

#

kekw

delicate zephyr
#

called it

marble juniper
#

I mean

quaint wasp
marble juniper
#

its 12:45 am after all

delicate zephyr
#

there we go

quartz kindle
#

lmao

delicate zephyr
#

hold on tim

quartz kindle
#

"hey guys i want help, but i want help from only one person and nobody else"

delicate zephyr
#

i need to add syntax highlighting to that

#

jesus christ

marble juniper
#

even then the pastebin syntax highlighting sucks lol

quartz kindle
quaint wasp
#

oh lmao

#

lol

#

so

#
module.exports = {
    name: 'kick',

    execute: async(client, message) => {

      const args = message.content.slice(prefix.length).trim().split(/ +/);
        if(!message.member.roles.cache.some(r=>["👻・Trail Moderator", "🧨・Moderator", "🛠️・Director Team", "👽・Director of Partners", "🛠️・Director of Staff", "🔰・Management Team", "🎓・Chief Operating Officer", "Administrator", "director", "👑・Chief Executive Officer", "🔰 Owner", "Moderator" || "founder" || "Founder" || "FOUNDER" || "owner" || "Owner" || "OWNER" || "M.S.T owner" || "-👑- Owner" || "ADMINISTRATORS" || "Administrators" || "administrators", "boss", "boss crew", "bosses", "bosss", "founders", "mod", "moderaters", "moderater", "Moderaters", "Moderater"].includes(r.name)))
          return message.reply("Sorry, you don't have permissions to use this! (is you do hava permissions, but this command still doesnt work, check if you have role named exacly **Administrator, or admin.**) If you have your own roles that you would like to add, so you didnt needed to have that role, or if you have your own role, just join our support server and message it in the help section.");
        let member = message.mentions.members.first() || message.guild.members.get(args[0]);
        if(!member)
          return message.reply("Please mention a valid member of this server");
        if(!member.kickable) 
          return message.reply("I cannot kick this user! Do they have a higher role? Do I have kick permissions?");
            let reason = args.slice(1).join(' ');
        if(!reason) reason = "No reason provided.";
            await member.kick(reason)
        return message.reply(`${member.user.tag} has been kicked by ${message.author.tag} because: ${reason}`);
      
    }
}``` this is my kick cmd.... And it cant deffine what prefix is... shouldnt it take the info about that from `index.js`?
delicate zephyr
#

thats because

#

prefix isnt defined

quaint wasp
#

So I need to put this: ```js
const config = require(./config.json)
const prefix = config.prefix

delicate zephyr
#

or just

#

const prefix = require('./config.json').prefix