#development

1 messages ยท Page 1415 of 1

quartz kindle
#

if you're not too lazy to add one

#

like i am xD

tired panther
#

same

lucid prawn
#
                if(message.content.startsWith(prefix + "matchmake" )){
                    if(!message.mentions.users.first()) return;
                    var embed = new Discord.MessageEmbed()
                          .setTitle (message.channel.send(Math.floor(Math.random() * 100 + 0 )))
                          .setTimestamp()
                          .setImage('https://64.media.tumblr.com/54387c664752cff1b5f868ab1e37e1ee/tumblr_nm7pt6VxgF1u9ia8fo1_500.gif')
                      message.channel.send(embed);
                }

it wont put the number in the title

quartz kindle
#

why plus 0

#

why message.channel.send

lucid prawn
#

it Randomly put a number

quartz kindle
#

that doesnt answer my questions lmao

lusty quest
#

so you get a random number *100 +0 = random number *100

sterile lantern
#

so i have sq lite db browser but if i want to edit the DB i have to export the file manually. in case something goes wrong in the db (such as the DB gets malformed), is there any possible way i can make it so theres always a backup? (aka 2 databases, but the 2nd one doesn't do that much)

lusty quest
#

since its a number and not a string

lucid prawn
quartz kindle
sterile lantern
#

node.js

quartz kindle
#

sqlite library

sterile lantern
#

oh uh

#

how do i check that?

quartz kindle
#

require("sqlite-what?")

sterile lantern
#

i have require("quick.db");

quartz kindle
#

ah

lusty quest
#

Math.random() * (max - min) + min; this would be for a number range

quartz kindle
#

does quick.db not have a backup function?

lucid prawn
sterile lantern
#

im not sure lemme look into it

lusty quest
#

min and max are just number values

#

if you use + on a Javascript string you will join both strings

#

so 1+0 = 10

lucid prawn
#

ok

earnest phoenix
#

meth

quartz kindle
#

there is an easy workaround tho

lucid prawn
# lusty quest min and max are just number values

like this?

                if(message.content.startsWith(prefix + "matchmake" )){
                    if(!message.mentions.users.first()) return;
                    var embed = new Discord.MessageEmbed()
                          .setTitle (message.channel.send(Math.random() * (100 - 10) + 3))
                          .setTimestamp()
                          .setImage('https://64.media.tumblr.com/54387c664752cff1b5f868ab1e37e1ee/tumblr_nm7pt6VxgF1u9ia8fo1_500.gif')
                      message.channel.send(embed);
                }
sterile lantern
#

yea there is no backup function unfortunately

earnest phoenix
#

tf are u doing in the title

quartz kindle
#

so you can require("better-sqlite3")

sterile lantern
#

sqlite3 has a backup function?

quartz kindle
#

then initialize the database using the same file as quick.db uses, this will open the database instead of creating a new one

lusty quest
quartz kindle
#

then use better-sqlite3's backup function

sterile lantern
#

oh ok thanks

quartz kindle
#
db.backup(`backup-${Date.now()}.db`)
  .then(() => {
    console.log('backup complete!');
  })
  .catch((err) => {
    console.log('backup failed:', err);
  });
sterile lantern
#

how many times is it going to back up?

quartz kindle
#

only once

sterile lantern
#

or can i like set an interval

quartz kindle
#

you can set an interval

sterile lantern
#

ok

#

ty

haughty bough
#

Is anyone else having problems downloading something on ytdl?

lusty quest
#

it got nuked a while ago and then added back. probably you need to update

haughty bough
#

uhol, okay

quartz kindle
#

it got nuked? lmao

lusty quest
#

yea YT sued them

quartz kindle
#

oh you mean the copyright thing

lusty quest
#

then they took it down

quartz kindle
#

but that wasnt targetting ytdl, it was targeting youtube-dl no?

shy turret
#

keyv (npm) downloads perfectly and easy on my computer but when I try it on a VPS, this happens:

node:internal/modules/cjs/loader:922
  throw err;
  ^

Error: Cannot find module '/root/two/hidodie/node_modules/sqlite3/lib/binding/node-v88-linux-x64/node_sqlite3.node'
Require stack:
- /root/two/hidodie/node_modules/sqlite3/lib/sqlite3-binding.js
- /root/two/hidodie/node_modules/sqlite3/lib/sqlite3.js
- /root/two/hidodie/node_modules/@keyv/sqlite/src/index.js
- /root/two/hidodie/node_modules/keyv/src/index.js
- /root/two/hidodie/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:15)
    at Function.Module._load (node:internal/modules/cjs/loader:763:27)
    at Module.require (node:internal/modules/cjs/loader:991:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/root/two/hidodie/node_modules/sqlite3/lib/sqlite3-binding.js:4:15)
    at Module._compile (node:internal/modules/cjs/loader:1102:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
    at Module.load (node:internal/modules/cjs/loader:967:32)
    at Function.Module._load (node:internal/modules/cjs/loader:807:14)
    at Module.require (node:internal/modules/cjs/loader:991:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/root/two/hidodie/node_modules/sqlite3/lib/sqlite3-binding.js',
    '/root/two/hidodie/node_modules/sqlite3/lib/sqlite3.js',
    '/root/two/hidodie/node_modules/@keyv/sqlite/src/index.js',
    '/root/two/hidodie/node_modules/keyv/src/index.js',
    '/root/two/hidodie/index.js'
  ]
}

I fixed this once before but I don't remember how.

lusty quest
#

but then got added again after they removed the copy righted stuff that where in the core for testing

quartz kindle
shy turret
#

no i used npm i

quartz kindle
#

did the npm i show any error?

shy turret
#

nope

#
up to date, audited 165 packages in 1s

4 vulnerabilities (2 moderate, 2 high)

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

just normal stuff

#

i should sudo

quartz kindle
#

try reinstalling it

#

npm i keyv

shy turret
#

same thing

#

i did try that and npm i @keyv/sqlite

#

i should try degrading to nodejs v12

#

v12.18.2

quartz kindle
#

try npm rebuild sqlite3

shy turret
#

alr started downgrading, i dont want to interrupt the process

#

done

#

yep rebuilding fixed it

#

thanks!

solemn leaf
#
    if (!whitelist.users.includes(message.author.id) || !message.member.roles.cache.has('753954073694175254') || !message.member.roles.cache.has('753953764779622430') || !message.member.roles.cache.has('753953699268657264')) {
        message.channel.send("You aren't allowed to announce!")
        return;
    }

why isnt this working if the user has the irole

boreal iron
#
if(!whitelist.users.includes(message.author.id) && !message.member.roles.cache.has('753954073694175254') && !message.member.roles.cache.has('753953764779622430') && !message.member.roles.cache.has('753953699268657264'))

because your logic is nonsense KEKW

solemn leaf
#

but && is and

#

|| is or?

boreal iron
#

correct

solemn leaf
#

so doing && would fix

boreal iron
#

nope

#

watch carefully

solemn leaf
#

im reading thou

boreal iron
#

ok in words :

#

if(USER_NOT_IN_WHITELIST && USER_NOT_IN_GROUP(x) && USER_NOT_IN_GROUP(y) && USER_NOT_IN_GROUP(z))

#

then return;

solemn leaf
#

so liek that

boreal iron
#

message.member.roles.cache.has('753954073694175254') returns true if he has the role

#

...(message.author.id) && >>>!<<< message.member.roles...

#

Check if the user DOES NOT have this role

wintry raptor
#

After all the stuff you guys told me i think i got more braindead ๐Ÿ˜›

boreal iron
#

@solemn leaf You got it?

solemn leaf
#

still

#

doesnt work

boreal iron
#

Did you copy the code above?

solemn leaf
#

no?

#
if (!whitelist.users.includes(message.author.id) || !message.member.roles.cache.has('753954073694175254') || !message.member.roles.cache.has('753953764779622430') || !message.member.roles.cache.has('753953699268657264')) { ... }
boreal iron
#

Still doesn't make sense

solemn leaf
#

do I need to do &&

boreal iron
#

if(!whitelist.users.includes(message.author.id) && !message.member.roles.cache.has('753954073694175254') && !message.member.roles.cache.has('753953764779622430') && !message.member.roles.cache.has('753953699268657264'))

solemn leaf
#

thanks

boreal iron
#

if ONE of your conditions is true, the statement is done

#

You need to check ALL conditions

#

Try to imagine your example in words compared to what I've sent.

naive kestrel
#

lots of people using discord.js

hard anchor
#

Hi, I want my bot to send memes, I use discord.js, I don't want reddit api

boreal iron
#

errr... fuck markdown

naive kestrel
#

@hard anchor try using random puppy

hard anchor
#

I already did, I just need code

boreal iron
#

guess you need to code it yourself...

hard anchor
#

I am relatively new to node.js

naive kestrel
#

spoon feeding

#

@hard anchor try a tutorial as they go into depth

#

Welcome to a new series where I, synopNode() [also William], show you how to code a Discord Bot using NodeJs with the Discord.JS API from scratch!
This episode, we make a meme command to post some JUICY MEMES on Discord!
Next Episode... FIND OUT WHEN I UPLOAD!! XD

โ–ฌโ–ฌโ–ฌโ–ฌ CONNECT WITH ME โ–ฌโ–ฌโ–ฌโ–ฌ
โ€ข Subscribe: http://bit.ly/officialspimy [Gaming Channe...

โ–ถ Play video
#

this uses random puppy

hard anchor
#

Thanks

earnest phoenix
#

Which should look cleaner and better

#
<Array of IDs>.every(r => !message.member.roles.cache.has(r))```
pure lion
#

in trying to get from the nekos.life api, nothing happens

earnest phoenix
#

Code?

pure lion
#
        let res = reqwest::get("https://nekos.life/api/v2/img/kiss").await?.json::<JSONres>().await?;
        println!("{:?}",res);
```nothing printed
#
#[derive(Deserialize, Debug)]
struct JSONres {
    origin: String 
}
```the JSONres struct
earnest phoenix
#

reqwest moment

pure lion
#

reqwest is pog

earnest phoenix
#

Not even errors?

sudden geyser
#

shouldn't it be url, not origin?

boreal iron
sudden geyser
#

I think your code is being propagated upwards due to the ? operator holding a Result with the Err variant.

pure lion
sudden geyser
#

Confused. The site returns a JSON body of: ```json
{ "url": "..." }

And there being no `url` field, I don't see how it being a placeholder could be correct.
pure lion
#

ah

#

makes sense

shy turret
#
server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;

    proxy_redirect           off;
     proxy_set_header         X-Real-IP $remote_addr;
    proxy_set_header         X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header         Host $http_host;

    location / {
        proxy_pass http://localhost:8000;
    }
}

^ worked perfectly (wasn't example.com)

server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;

    proxy_redirect           off;
     proxy_set_header         X-Real-IP $remote_addr;
    proxy_set_header         X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header         Host $http_host;

    upstream websocket {
         server localhost:8000;
     }

    location / {
        proxy_pass http://localhost:8000;
    }
}

^ but when I tried to add websocket support to the reverse proxy, it gave me an error when i tried to restart it

pure lion
#

that error being?

shy turret
#

is there a way to add websockets with reverse proxies?

pure lion
#

yes

#

upstream websocket

shy turret
#

^ error

pure lion
#

what happens on nginx -t

shy turret
#
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

pure lion
shy turret
#

wait opps

#

i removed the upstream websocket temp

#

so it didnt give an error

pure lion
#

lm

#

ok un-fix

shy turret
#

nginx: [emerg] "upstream" directive is not allowed here in /etc/nginx/sites-enabled/twostuff.conf:11
nginx: configuration file /etc/nginx/nginx.conf test failed

pure lion
#

you cant have a ws connection in a server block

shy turret
#

wait wha

#

so i need to ssl?

pure lion
#

not http im dum

shy turret
#

oh

pure lion
#

put it outside of the server block

shy turret
#
root@www:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

#

time to systemctl restart nginx

#

no errors but

#

oh

#

i think ik the problem

#

wait if i use cloudflare, will websockets automatically become wws?

#

i got a 200 error

#
server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;

    proxy_redirect           off;
     proxy_set_header         X-Real-IP $remote_addr;
    proxy_set_header         X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header         Host $http_host;

    location / {
        proxy_pass http://localhost:8000;
    }
}


upstream websocket {
    server localhost:8000;
}

^^ working (not example.com) but websockets still dont work

bronze bramble
#

need a tip

#

0

earnest phoenix
#

My bot wont start up someone help me man like it needs to be up 24/7 so it can get reviewed and im so worried now i need help ASAP

eager chasm
#

uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

old latch
#

you need a host server then right?

earnest phoenix
#

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

eager chasm
#

but like first of all what are u using for ur bot?

old latch
#

where do you host your bot now?

eager chasm
#

like what language are u coding in

#

yea

earnest phoenix
#

CSS and js

eager chasm
#

for js are u using nodejs and discord.js?

earnest phoenix
#

i forgot

eager chasm
#

._.

earnest phoenix
#

i have been worrying to much about it not being bloody up

old latch
#

how can you forget which lib you are using lol

eager chasm
#

lol

#

ikr

old latch
eager chasm
earnest phoenix
#

BECAUSE ITS BEEN || FUCKING|| FOREVER I HAVE BEEN WORRYING TO MUCH ON WHY ITS NOT WORKING

eager chasm
#

ok chill

old latch
#

send a screenshot of your package.json file so we can check

eager chasm
#

i swear if u dont have a package.json file ._.

shy turret
earnest phoenix
eager chasm
#

oh good

earnest phoenix
#

but its different my bot is under review and its offline

old latch
#

discord.js then

shy turret
#

the package name cant have caps or spaces im pretty sure

earnest phoenix
#

well it was working fine before

eager chasm
#

lemme check

shy turret
#

chang "Discord Market" to "discord_market"

#

well it isnt required

#

but recommended

eager chasm
#

are u getting an error in ur terminal when u try to turn ur bot on?

shy turret
#

npm init wont let u add spaces

eager chasm
#

or a general error in ur code?

earnest phoenix
old latch
#

anyways, back to your original question, you have to get a server for your bot then... @earnest phoenix

earnest phoenix
#

what do you meAN?????????????

eager chasm
#

wheres ur p

earnest phoenix
#

?

eager chasm
#

"packagae"

#

this is says "ackage"

earnest phoenix
#

HU????????????????????

#

WERE

eager chasm
#

._.

earnest phoenix
#

WHART

#

???????

#

???

#

?@?????

#

?@

@earnest phoenix @earnest phoenix @earnest phoenix

#

?

eager chasm
#

calm down

earnest phoenix
eager chasm
#

i meant in ur terminal bud

old latch
#

bro

eager chasm
#

u typed it wrong

old latch
#

calm down

earnest phoenix
#

I didnt type that

#

my god

eager chasm
#

ik

#

its an error

#

in ur code

earnest phoenix
#

were/????

eager chasm
#

somewhere when u tried to run it

#

idk

#

lemme check

#

cuz that shouldn't happen

earnest phoenix
#

ima smash my keyboard

old latch
#

that is just a money waste but ok

eager chasm
#

lol

old latch
#

and it won't help you

eager chasm
#

lol

old latch
#

you want your bot online 24/7 right?

earnest phoenix
#

man shush honestly ima bout to come round and smash the keyboard into your window

eager chasm
#

omigod

old latch
#

lol

eager chasm
#

lol

old latch
#

really you should calm down

eager chasm
#

yea its not gonna help

#

just relax

shy turret
#

yes i finally fixed my reverse proxy

eager chasm
#

we'll find a way to fix this

#

@shy turret noice

earnest phoenix
#

๐Ÿ˜ฆ

old latch
#

you want your bot online 24/7 right?

earnest phoenix
#

Yea

eager chasm
#

ok find a hosting program

old latch
#

good

#

yes exactly

#

do you know what that is?

eager chasm
#

its free!

#

lol

earnest phoenix
#

I Am already using the shitty thing

eager chasm
#

wut

old latch
#

??

earnest phoenix
#

there support is terrible

eager chasm
#

wut are u using?

earnest phoenix
#

they didnt help me

old latch
#

then what's your problem=

#

?*

#

and why do you need support?

eager chasm
#

tf are u using boi

earnest phoenix
#

WHAT DO YOU MEAN

#

FAM

old latch
#

hey listen we are just trying to help

earnest phoenix
#

how can i make my bot update the membercount when someone left or join ? (i refer the membercount of all guilds)

shy turret
shy turret
naive kestrel
#

@earnest phoenix member.guild.members.cache.filter(m => !m.user.bot).size is one way to get the member count excluding bots of one guild

#

let member = msg.mentions.members.first() || msg.member and you can easily define member such as something like this

bronze bramble
#

hey

naive kestrel
#

?

bronze bramble
#

how come the discrim isnt correct when i view the app in discord dev portal

#

3371 is not the discrim

quartz kindle
naive kestrel
#

^

#

intents

#

@bronze bramble how are you viewing the discrim in the dev portal?

#

oh

#

Im blind as fuck

#

never knew that was there

solemn leaf
#

@boreal iron

boreal iron
#

@solemn leaf

solemn leaf
#

why didnt he unicode work?

#

the*

boreal iron
#

probably need to be escaped

solemn leaf
#

escape markdown?

boreal iron
#

like all special chars

solemn leaf
#

?

boreal iron
#

I don't see any in your pic

solemn leaf
#

the \n is a new line

boreal iron
#

Escape the \n

#

With \n

#

oh

#

\\n

solemn leaf
#

wdym by escape

#

hold up

#

still nope

boreal iron
#

not while writing

#

in your code

solemn leaf
#

like find?

#

.match?

boreal iron
#

string.replace("\n", "\\n");

solemn leaf
#

can I just like

#

do it for all unicode

#

string.replace("", "");

#

like that?

boreal iron
#

As you can see Discord thinks you wanna escape something, too

solemn leaf
#

so no?

#
    let title = params[0].trim().replace("\n", "\\n");
    let desc = params[1].replace("\n", "\\n");
boreal iron
#

not sure but I guess it shouldn't cause issues

solemn leaf
#

so I can do that

boreal iron
#

don't know why not, test it, yes

solemn leaf
#

this is concusing

#

confusing

boreal iron
#

that doesn't make sense

#

replacing \\ with \\

earnest phoenix
#

what are you trying to do ๐Ÿค”

boreal iron
#

wut

solemn leaf
#

but it doesnt work

#

if the thing is there

#

normally

#

bcs it escapes the "

boreal iron
#

oh that's what you mean

#

of course it does

solemn leaf
#

so what solution

boreal iron
#

it's an escape char

solemn leaf
#

`'"??

#

` ' "

boreal iron
#

replace \n by \\n

#

you got it right above already

solemn leaf
#

still nope

boreal iron
#

just send the whole code snip

#

is this an embed background?

solemn leaf
#

yeah

boreal iron
#

First of all I'm not sure if the title can be a multiliner

solemn leaf
#

it can

boreal iron
#

gimme one sec

solemn leaf
earnest phoenix
#

what are you trying to do ๐Ÿค”

boreal iron
#

his embed.setTitle escapes any \n

earnest phoenix
#

but what are they trying to do

boreal iron
#

Guess writing \n to insert a new line

#

to the title as well as the description

earnest phoenix
#

but why lol

#

just do a newline in your message

#

instead of writing \n and then trying to convert it in your code

#

sending a message
like this

will get interpreted as sending a message\nlike this

boreal iron
#

Nah I remember he's doing an announce command using a d: param putting the text behind into the embed description

earnest phoenix
#

it wouldn't matter though

#

a newline is a unicode char like any other

#

the only thing special about is that it is rendered as a... new line

solemn leaf
#

laugh

earnest phoenix
#

what is your code right now

boreal iron
#

well you need to remove the code which replaces your \n

#

for both vars

#

a newline is a unicode char like any other

aye but any input the user does should be supported, even if he uses a one liner entering \n

earnest phoenix
#

that's the user's fault for being dumb ๐Ÿคทโ€โ™‚๏ธ

boreal iron
earnest phoenix
#

a normal user wouldn't even know what \n is

boreal iron
#

well good argument lmao

#

but talking like this I wouldn't expect the user neither knows to press SHIFT + ENTER

solemn leaf
#

but talking like this stop calling my friends idoits

boreal iron
solemn leaf
#
    let title = params[0].trim());
    let desc = params[1]);
    let channel = message.mentions.channels.first();

    const embed = new Discord.MessageEmbed()
        .setColor(embedconf.color)
        .setTitle(title)
        .setAuthor(message.member.displayName, message.author.displayAvatarURL({ dynamic: true }))
        .setDescription(desc)
        .setTimestamp()
        .setFooter(embedconf.author.text, embedconf.author.image);

@earnest phoenix

earnest phoenix
#

remove the part that replaces it

#

and it should work

solemn leaf
#

but I wanna use \n

earnest phoenix
#

but why

#

lol

solemn leaf
#

bcs

#

left to right embed

#

etc

#

lots of useful unicode out there

earnest phoenix
#

h-huh?

boreal iron
#

err may it's been escaped already...

#

then you need to replace \\n by \n

earnest phoenix
#

don't reinvent the wheel

#

^^^

boreal iron
#

didn't think of that in the first place

solemn leaf
#

nice

#

so I need to replace \ with \

boreal iron
#

hmm looks like the line break is escaped already

earnest phoenix
#

keep in mind

solemn leaf
#

does discord escape it?

earnest phoenix
#

\n does not actually look like \n, it's just a standard to insert a newline

boreal iron
#

test\nyes\nDiscord\ndoes

earnest phoenix
#

discord doesn't

solemn leaf
#

yes it does

stark abyss
#

I am not finding any good resources to connect my postgress with discord js bot Thinkeng

earnest phoenix
#

\n does not actually look like \n, it's just a standard to insert a newline

solemn leaf
#

okay

#

well what ever

boreal iron
#

lmao

earnest phoenix
#

if you type in \n in your message box right now and send it
the value of that message is going to be \\n and not \n

#

however, if you write

boreal iron
#

aye, escaped

earnest phoenix
#

a message

like this

#

it's going to look like this

a message\n\nlike this
stark abyss
#

yes Thinkeng

solemn leaf
#

let title = params[0].trim().replace("\n", "\n");
let desc = params[1].replace("\n", "\n");

earnest phoenix
#

that is effectively not doing anything

boreal iron
#

Use code tags or this discussion will never end

earnest phoenix
#

read what i said it's going to clear your confusion

solemn leaf
#

doesnt matter thou

#

bcs replace only does one lol

#

I need regex

earnest phoenix
#

so mark it as global with regex

solemn leaf
#

nah

#

regex weird

#

ill jsut do shift enter

boreal iron
#

wtf reges is weird? nah

solemn leaf
#

discord made me do shift enter when ever I want to do enter so

earnest phoenix
boreal iron
#

@solemn leaf replaceAll

solemn leaf
#

fr

boreal iron
#

oh

#

he's faster

solemn leaf
boreal iron
#

shame on me

solemn leaf
#

kill me

earnest phoenix
#

you're reinventing the wheel when you shouldn't need to ๐Ÿคทโ€โ™‚๏ธ

solemn leaf
#

bro

#

when

#

replaceAll

#

a thing

boreal iron
#

well if he likes to do pogey

solemn leaf
#

yeah

earnest phoenix
#

replaceAll is a new feature of the ecmascript 2021 spec doc i think

#

nevermind, ecmascript 2020

solemn leaf
#

the wheel should be a googolgon

#

whats a n-gon

bronze bramble
solemn leaf
#

๐Ÿ˜ƒ

#

@earnest phoenix

#

you lied

bronze bramble
#

odd

earnest phoenix
#

you're not using ecmascript 2020

#

๐Ÿคทโ€โ™‚๏ธ

boreal iron
#

I mean you can still use replace() using regex

solemn leaf
#

explain me regex

#

and how workie

earnest phoenix
#

you don't need to know regex

solemn leaf
#

yes I do

red coral
#
        Embed = new Discord.Message.Embed()
        .setColor('#f02016')
        .setTitle(`Expert bot Commands:`)
        .setDescription(`?robloxfind ,a invite bot link for unclaimed roblox group!`)
        .setDescription(`?hack , fake pretend hack!`)
        .setdescription(`?online ,see how many people that are online in this server`)
        .setdescription(`?say ,the bot says what whatever u put in after the cmd!`)
        .setdescription(`?server ,see how many members are in this server!`)
        .setdescription(`?youtube ,checkout my youtube channel!`)
        .setdescription(`?beg ,begs for money`)
        .setfooter('Create by Jeremy');
    message.channel.send(Embed);```
earnest phoenix
#

just incase your string with a global flag; /str/g

boreal iron
#

replace(/\\\\n/gi, "\n")

red coral
#

idk why it no work

#

any help?

solemn leaf
#

.addfeild?

#

ever heard of them?

red coral
#

yeah

solemn leaf
#

well first

boreal iron
solemn leaf
red coral
#

use .addfield ?

#

ok

earnest phoenix
#

good point

solemn leaf
#

3rd

#

wtf so many descriptions

boreal iron
#

you know he's doing weird things :D

earnest phoenix
#

setdescription does not exist

#

setDescription does

solemn leaf
#

fakje

red coral
#

o

solemn leaf
#

what about like

earnest phoenix
#

and everytime you call it, you overwrite what was set before

solemn leaf
#

nvm

#

good bue

boreal iron
solemn leaf
#

im not doing this more lol

boreal iron
#

wut?

red coral
#

its said ```message.channel.send(Embed);
^

ReferenceError: Embed is not defined```

boreal iron
#

Embed = new Discord.Message.Embed()

#

let _ cough_

red coral
#

i have this Embed = new Discord.Message.Embed()

boreal iron
#

you shouldn't copy and paste things without understanding the basics

#
let my_var = null;
this_is_not_a_var = error;
red coral
#

but this one works if (command === 'daily') Embed = new Discord.MessageEmbed() .setColor('#21eb67') .setTitle(`${message.author.username} recieved 1,000 JG coins`) .setDescription(`come back tomorrow to get your next 1,00 JG coins!`) .setFooter('Expert'); message.channel.send(Embed);

graceful dock
#

Message.Embed != MessageEmbed bruh

#

You really should look at the basics of js (objects) and read discord.js docs

boreal iron
#

guess he just had a typo in his message before

graceful dock
#

there's a lot of kiddos making bots without even knowing what is a language so I'm just guessing here

red coral
#

wait is it .setField or .setfield

boreal iron
#

I'm more worried about all those kids renting a server and have no clue how to administrate it. Watching the growing amount of bot servers and daily attacks

graceful dock
red coral
#

ok

broken sentinel
#

Somebody know how to host my bot from vps ?

#

i have vps but i dont know how to host my bot from it

stark abyss
#

it doesn't let me type my password, but before that it let me type. This is postgress, I am trying to connect through localhost

broken sentinel
#

it let you

#

but it dont show the text

stark abyss
#

oh

broken sentinel
#

its not that good

boreal iron
#

wrong channel

broken sentinel
#

@stark abyss just copy the password then paste it in the command ctrl+v and then enter

stark abyss
#

yeah ty

broken sentinel
#

np

#

@stark abyss you trying to host bot from vps ?

stark abyss
#

idek i am tryna use it through visual studio

boreal iron
#

install python or nodejs, whatever u wanna use

stark abyss
#

hm

broken sentinel
#

I have vps but i can not use it as host i dont know how

#

somebody help ?

boreal iron
#

wut?

earnest phoenix
#

I am using the code

@tasks.loop(hours=24)
async def my_loop(*args, **kwargs):
    now = datetime.datetime.now()
    next = now + datetime.timedelta(hours=24)
    # Do the normal tasks
    now = datetime.datetime.now()
    interval = next - now
    self.change_interval(hours=interval.hours, minutes=interval.minutes, seconds=interval.seconds)

@my_loop.before_loop
async def my_loop_before():
    now = datetime.datetime.now()
    next = datetime.datetime.now()
    next.replace(hour=start_hour, minute=start_minute, second=start_second)
    if next < now:
        next.replace(day=now.day + 1)
    await asyncio.sleep((next - now).total_seconds())

And i keep getting the error:

Unhandled exception in internal background task 'my_loop'.
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/ext/tasks/__init__.py", line 101, in _loop
    await self.coro(*args, **kwargs)
  File "/home/container/main.py", line 57, in my_loop
    self.change_interval(hours=interval.hours, minutes=interval.minutes, seconds=interval.seconds)
NameError: name 'self' is not defined

What should i replace self with to get it to work?

broken sentinel
#

Somebody help me with vps host ?

earnest phoenix
#

yeah

#

so what should i change it to?

#

i dont think this is defined as well

#

how about

#

my_loop.change_interval?

#

nvm i got it

#

module.exports = {
    name : 'slowmode',
    description : 'Limite de mandar mensagem em um determinado tempo ',
    async run(message,args) {

        let msgs = args[0];
        if(!message.member.hasPermission('MANAGE_CHANNLES')){
            let embed = new Discord.MessageEmbed()

            .setDescription('Vocรช รฉ fraco, falta lhe permissรฃo de `Gerรชnciar Canais` para usar este comando')
            .setColor('#9edb87')

            return message.channel.send(embed).then(msg => msg.delete({timeout: 5000}))
        }
        else if(!args[0]){
            let embed = new Discord.MessageEmbed()

            .setDescription('Poucos argumentos | `,slowmode <tempo>`')
            .setColor('#9edb87')

            return message.channel.send(embed).then(msg => msg.delete({timeout: 5000}))
        }
        else if(args[0] === 'none'){

            await message.channel.setRateLimitPerUser(0)

            let embed = new Discord.MessageEmbed()

            .setDescription('slowmode resetado a 0 segundos')
            .setColor('#9edb87')

            return message.channel.send(embed).then(msg => msg.delete({timeout: 5000}))
        }
        else if(isNaN(args[0])){

            let embed = new Discord.MessageEmbed()

            .setDescription('Insira um nรบmero')
            .setColor('#9edb87')

            return message.channel.send(embed).then(msg => msg.delete({timeout: 5000}))
        }

        const time  = Number(args[0]);
        if(time){
            
            await message.channel.setRateLimitPerUser(time)

            let embed = new Discord.MessageEmbed()

            .setDescription(`<a775482737766563850> |Slowmode ativo em ${time}`)
            .setColor('#9edb87')

            return message.channel.send(embed).then(msg => msg.delete({timeout: 5000}))
        }

    }
}```
#

my error is in permission

#

can i help me?

#

i need help finding a good bot hosting website anyone knows one?

#

Discloud

#

ok thx

graceful dock
#

if(!message.member.hasPermission('MANAGE_CHANNLES')){ this ?

#

you need to provide the permissionresolver

earnest phoenix
graceful dock
#

and you made a typo

#

MANAGE_CHANNELS

broken sentinel
#

Can somebody help me with vps host I have vps

bronze bramble
#

any clue yall?

graceful dock
bronze bramble
#

why is it sending two

earnest phoenix
#

and what to do then, if you do not have permission from adm or moderator, I don't know ... the user cannot use this command

bronze bramble
#

no, i dont have two pythons runnig afaik

graceful dock
bronze bramble
#

i see

broken sentinel
earnest phoenix
#

i dont understand

#

???

#

im soo confused

graceful dock
broken sentinel
#

Yes i think

earnest phoenix
boreal iron
#

OS = operation system

graceful dock
#

^ @earnest phoenix

earnest phoenix
#

tnks

broken sentinel
#

@graceful dock so do you know how to host it

graceful dock
#

I need to know what is the OS of your vps in order to help you

broken sentinel
#

Vps windows

graceful dock
#

do you have a graphical interface ?

broken sentinel
#

:/ no

hollow prawn
#

if I have a function in DJS code, would I need to pass down the parameters or the function would be able to access them when they're defined in a if statement?

graceful dock
#

mhh then I can't help you, I've never used windows on the shell as a vps

broken sentinel
#

ok

broken sentinel
#

i will se some tutorials in youtube

#

see*

boreal iron
#

They need to be passed anytime

earnest phoenix
graceful dock
#

you have a typo

#

replace MANAGE_CHANNLES by MANAGE_CHANNELS

boreal iron
earnest phoenix
#

yes

#

omg

#

but doesnt work

hollow prawn
# graceful dock can you reiterate

ok so, I have a mute command which would do some if statement checks before executing a function that is above the if statements, I would like to know as I havent fiddled with this, would I have to pass the parameters that would be let/const defined inside the if statements to the function before its called or would it be able to access them either way

graceful dock
#

You have to pass the parameters to the function every time you use it

hollow prawn
#

aight, gotcha

#

I had a feeling, just like needed to have it confirmed

boreal iron
#

Err declaring vars after the function you wanna use the as parameters doesnโ€™t work

#

They need to be defined before you can access them of course

graceful dock
#

basically, ```js
let yes = "ok";
myfunc(yes)

will not tell the function to retrieve the value of yes, it will pass it the value of yes directly
#

idk if you understand me there since its not very clear

#

and having the function defined before the variable doesnt change anything

boreal iron
#

It does it will result in an error

graceful dock
#

no?

hollow prawn
#

ok lemme see if I can type it in code

function myFunc() {
 // function code
};
if (check 1) {
let check 2 = something;
  if (check 2) {
   let check 3 = something;
    if (check 3) {
      myFunc();
    }
  }
}```
boreal iron
#

lmao thatโ€™s what you mean

hollow prawn
#

something like this I'm thinking of, most probably I would have to pass the parameters to the function

#

but not sure tbh

graceful dock
#
const ok = (arg) => {
  console.log(arg)
}

const lol = "yes";
ok(lol)
graceful dock
solemn latch
#

Pass in nothing

hollow prawn
#

it would take parameters, the thing is as I said I haven't really fiddled with this, so I gotta check before hand if I would need to actually pass them that are in the if statement or would I not

boreal iron
#
function myFunc(p1, p2) {
 if(p1 == x || p2 == y) etc.
};
if (check 1) {
let check 2 = something;
  if (check 2) {
   let check 3 = something;
    if (check 3) {
      let a = 0, b = 1;
      myFunc(a, b);
    }
  }
}
#

that's what u mean

hollow prawn
#

well i'd be passing the check2 and check 3

boreal iron
#

np

hollow prawn
#

so the function could set up a muterole's ID in the database for a server

#

if I have check 2 be a mentioned role, check 3 be whether to 'set' it or 'remove' it, i'd be passing those I presume

#

however I'm not sure if the position of the function does play a factor in a code

boreal iron
hollow prawn
#

hmm

boreal iron
#

but I guess we both missunderstood him

hollow prawn
#

yeh its a lil bit confusing

boreal iron
#

nope the position doesn't play a role

#

if you use this function one time only, creating this function is useless

hollow prawn
#

uhh i'll use it one time, however it'll be executed in different parts of the code

boreal iron
#

using it multiple times even outsite your statements you will have to create the function like in your example

#

(scopes)

hollow prawn
#

for exmaple I would like to allow server owners to set up a mute role by either mentioning it, or by role ID

#

so I'd have do check if its mentioned, or if its just an ID followed by the function being executed

boreal iron
#

Well just check the arguments of your command being a mention or a role ID

graceful dock
#

its just like using a variable before referencing it, doesnt make sense

boreal iron
#

If u donโ€™t use a command handler, just split your content by whitespaces (slice of your command) and check if the first argument is a mention or an ID

hollow prawn
#

i use command handler, as well as i will have the mute command be used to set up the mute role

#

and also for muting someone

boreal iron
hollow prawn
#

as well as updating channel/category perms

boreal iron
#

Ok your command handler splits your content already and provides you the arguments, right?

hollow prawn
#

yes it does, I will be doing check if its ID or mentioned role

boreal iron
#

Aye thatโ€™s what u need to do

desert hazel
#

what is wrong lads

hollow prawn
#

and when its a role ID, i need to fetch the role from the guild roles cache to check if its valid, if its mentioned role then i just carry on with the function

#

so thats one if statement split

desert hazel
#

okay

#

const member = message.mentions.members.first()|| message.guild.members.cache.get(args[0]) || message.member

This does members

boreal iron
#

What is your function supposed to do?

desert hazel
#

so if its mentioned | if its a ID | the message member

#

so if you change that to roles

#

youll get what you need

hollow prawn
#

would for example this work? JS function myFunc(param1, param2, param3) { //code } if (mentionedRole) { myFunc(param1 = mentionedRole, param2 = somethingElse, param3 = somethingElse); } else if (roleID) { myFunc(param1 = roleID, param2 = somethingElse, param3 = somethingElse); }

desert hazel
#

yes

#

i think

#

it should

#

try it?

carmine summit
hollow prawn
#

well so far I havent tested anythign, doing an update from DJS 11.6.4 to 12.5.0

boreal iron
#

Is mentioned role and role ID the same type def?

hollow prawn
#

one would be if a role is mentioned with a @ another one would be just the role's ID

#

so you dont have to mention the role

desert hazel
#

so

#

if you do

#

const member = message.mentions.members.first()|| message.guild.members.cache.get(args[0]) || message.member this kind of thing for it

#

but change it to roles

#

you can do

hollow prawn
#

what if they decide to give me channel ID or userID, cant attach that as muterole, it'll for sure cause crash for the bot

desert hazel
#

const member = message.mentions.members.first()|| message.guild.members.cache.get(args[0]) || message.member obv for roles

function myFunc(param1, param2, param3) {
//code
}
if (member {
myFunc(param1 = member, param2 = somethingElse, param3 = somethingElse);

#

that will not crash it

hollow prawn
#

so if its just a role ID i'd like to verify it being a valid role ID before carrying on with changing the muterole's ID in the database

boreal iron
#

Well you donโ€™t search the cache for members, you will have to search for roles

#

If somebody provides a channel ID for example a role with that ID canโ€™t be found

#

If so you return the user has used a wrong parameter

hollow prawn
#

oh it'll give it undefined

boreal iron
#

Yes

desert hazel
#

so basically, what i sent, goes

boreal iron
#

Of course you need to check the result if youโ€™ve fetched a role

desert hazel
#

so if it does give undefined, it would tell them its not a role

boreal iron
#

Not a role or not found which is the same result

desert hazel
#

yeye

#

so if they supply a role that isnt in the server

hollow prawn
#

mm then yeah what ghost suggested for roles would work without the last part

desert hazel
#

yes

hollow prawn
#

meaning at that point I could have everything under one if statement and not need the function at all

desert hazel
#

thats why i use it KEK

earnest phoenix
#

fish

desert hazel
#

you dont need a funtion really

hollow prawn
#

as the function's main idea was to save code lines rather than have same code copied over for 2 separate occasions

desert hazel
#

oh

#

its a good idea, but the way i said will get a role either way

#

with 1 line

boreal iron
#

You donโ€™t need multiple statements (if and else if) just one statement checking the results

#

Which is less code

hollow prawn
#

yeh imma head on do that

desert hazel
#

ok

#

fake, idk if you can help me with my code, lemme write out the problem

boreal iron
#

Imma not familiar with djs but as Ghost wrote, check if the argument is a mention or a role ID, then check itโ€™s valid and then execute whatever u wanna do

desert hazel
hollow prawn
#

yeh, its what i do rn, send out ur problem Ghost, might be able to help oout

desert hazel
#

so why is it not triggering line 26

boreal iron
#

Will be at PC in a minute

desert hazel
#

okay

stark abyss
#
const db = require('pg')
const dbClient = new db.Client({
    user: "postgress",
    password: "my pass here",
    port: 5432,
    server: "localhost",
    database: "discord test db"
})

dbClient.connect()
    .then(()=> console.log("Connected to Postgres!"))
    .catch(e => console.log(e))
    .finally(() => dbClient.end())

Error:
error: password authentication failed for user "postgress"
I am sure the password is correct

#

this is postgress

desert hazel
#

erm

#

mySQL npm has a issue with the secure password plugin on it

opal plank
#

usually the user is called postgres btw

#

not postgress

desert hazel
#

ah

#

ive never used it

stark abyss
#

shit I misspelled smh

opal plank
#

also avoid using space separated db's

stark abyss
#

Ok

opal plank
#

for consistency and some queries

hollow prawn
#

@desert hazel probably the first return of bal < depo is causing the code to cease there

#

have you tried to test it when that is false?

desert hazel
#

hmm

#

ill try changing the order

hollow prawn
#

cuz probs it gives it correct and it cuts it off there

desert hazel
#

that might make sense

#

one sec

hollow prawn
#

altho the thing is I havent seen such a issue as they're 2 separate IFs

stark abyss
#

Ah It finally worked yay

hollow prawn
#

so both should be executed

boreal iron
#

ouch eating ice cream too fast can hurt your brain lmao

desert hazel
#

see

#

test means its passed

#

the command has ran*

#

so its not been captured by line 26

hollow prawn
#

you changed the order of those two and still line 26 isnt being executed?

desert hazel
#

yep

#

the "not enough money" works

boreal iron
#

what's not working?

hollow prawn
#

then the if statement for finaldepo > banklevel doesnt return true

desert hazel
#

if(finaldepo > banklevel)return message.reply(`This will take you past your ${bank.level * 10000} limit, buy more with ,buy bank`)

hollow prawn
#

if changing the order doesn't execute it either way

desert hazel
#

but it should be

#

as i console log it all

#

and its coming out correctly

#

WAIT

#

hmm

#

NaN

hollow prawn
#

big brain time

#

letsgooooo

desert hazel
#

lets have a look at this now KEK

#

why NAN

#

HBSIFJNDMKFNDS

#

My nans dead D:

boreal iron
#

banklevel is NaN

desert hazel
#

Yea

boreal iron
#

regarding your log order, banklevel1 is

desert hazel
#

yeye

boreal iron
#

which means banklevel (parseInt()) fails

desert hazel
#

Hmm

#

it shouldnt be though

boreal iron
#

I wonder the amount of vars you use

desert hazel
#

1*10000 is 10000

#

hmm

#

maybe it is failing the parseInt

boreal iron
#

why *= and not level = bank.level * 10000

desert hazel
#

idk, i used + before and realised it adds the args after

boreal iron
#

cant u just copy the code, too lazy to write it again

desert hazel
#

wait one sec

boreal iron
#

WC brb

desert hazel
#

this is bugging me

boreal iron
#

one sec

#

typing

#

what's depo?

desert hazel
#

deposit

boreal iron
#

I know

#

lmao

#

I dont see where you've defined it

desert hazel
boreal iron
#

bank is an obj?

#

oh yeah, see your console logs, it is

#

still waiting for u to post the code

desert hazel
#

oh all of it?

boreal iron
#

not gonna rewrite all

desert hazel
#

one sec

boreal iron
#

alright

#

k gimme a sec now

desert hazel
#

thx

boreal iron
#

banklevel is always * 10000 ?

desert hazel
#

yes, so it goes up in 10k increments when you use a command, ,buy bank

#

you will get 20k limit

#

and so on

boreal iron
#

I wonder about banklevel1 = bank.level *= 10000

desert hazel
#

tbh i was trying shit

boreal iron
#

Your current bank.level fetched from the DB * 10000

desert hazel
#

yes

boreal iron
#

ok last question

desert hazel
#

ok

boreal iron
#

deposit

desert hazel
#

yes

boreal iron
#

been removed from your bank account

desert hazel
#

it removes it from bal

#

bal and bank different

boreal iron
#

err yeah meant to say that

#

what happend to it?

desert hazel
#

it goes out of bal

#

into bank

boreal iron
#

yeah

desert hazel
#

bank.bank

boreal iron
#

should have called it pay_in

#

got it

#

lmao

desert hazel
#

lol

earnest phoenix
#

I am using the code

@tasks.loop(hours=24)
async def my_loop(*args, **kwargs):
    now = datetime.datetime.now()
    next = now + datetime.timedelta(hours=24)
    # Do the normal tasks
    now = datetime.datetime.now()
    interval = next - now
    my_loop.change_interval(hours=interval.hours, minutes=interval.minutes, seconds=interval.seconds)

@my_loop.before_loop
async def my_loop_before():
    now = datetime.datetime.now()
    next = datetime.datetime.now()
    next.replace(hour=start_hour, minute=start_minute, second=start_second)
    if next < now:
        next.replace(day=now.day + 1)
    await asyncio.sleep((next - now).total_seconds())

And i keep getting the error:

Unhandled exception in internal background task 'my_loop'.
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/ext/tasks/__init__.py", line 101, in _loop
    await self.coro(*args, **kwargs)
  File "/home/container/main.py", line 57, in my_loop
    my_loop.change_interval(hours=interval.hours, minutes=interval.minutes, seconds=interval.seconds)
AttributeError: 'datetime.timedelta' object has no attribute 'hours'

doesnt it have hours as an attribute?

boreal iron
#

@desert hazel

module.exports.run = async (client, message, args) =>
{
  let deposit = parseInt(args[0]);
  
  if(Number.isNaN(deposit)) return message.reply("Provide a number, dumbass");

  let balance = await client.db.get(`money-${message.guild.id}-${message.member.id}`);
  
  if(deposit > balance) return message.reply("Not enough money in your pocket, dumbass");
  
  let account = await client.db.get(`bank-${message.guild.id}-${message.member.id}`, { level: 1, bank: 0 });
  
  let new_balance = (account.bank + deposit);
  let level = (account.level * 10000);
  
  if(new_balance > level) return message.reply(`This will take you past your ${level} limit, buy more with \`,buy bank\``);
    
  await client.db.set(`money-${message.guild.id}-${message.member.id}`, (balance - deposit));
  await client.db.set(`bank-${message.guild.id}-${message.author.id}`, { level: account.level, bank: new_balance });
}

tried to use understandable names

desert hazel
#

lets have a go

boreal iron
#

can't test but should do what u expect, if I understood right

desert hazel
#

yeye i understand it

boreal iron
#

still don't get what the account.level does, but okay KEKW

desert hazel
#

omd

#

my guy

#

thanks man

boreal iron
#

oh I forgot something lel

desert hazel
#

basically account.level will change if they buy it

#

it will change to 2

#

and so on

boreal iron
#

lmao one second, forgot something

desert hazel
#

oof ok

boreal iron
#

oh imma retarded

#

nvm

#

if(deposit > balance) return message.reply("Not enough money in your pocket, dumbass");

#

is in there already

desert hazel
#

loool

boreal iron
#

forgot I forgot that

#

wtf#

#

*thought

desert hazel
#

Thanks tho man

boreal iron
#

np

desert hazel
#

hmm

#

tomorrow at 00:00

#

nice

boreal iron
#

Hmm some users in the client list on the right have different names than in the chat

#

just hit CTRL + F5

desert hazel
#

wym

boreal iron
#

W T F is happening

desert hazel
#

whahaha

#

show show

boreal iron
#

I'm done I guess or Discord is

#

ok have a good one, need to sleep oof

boreal iron
#

If transaction is successful and the level should be increased by 1 then,

#

Replace

await client.db.set(`bank-${message.guild.id}-${message.author.id}`, { level: account.level, bank: new_balance });

by

await client.db.set(`bank-${message.guild.id}-${message.author.id}`, { level: (account.level + 1), bank: new_balance });
limber flume
#

Im using pillow to create this so i saw that it didnt show other languages and was just blank so i started using the unicode fonts, now it overlaps the screen even tho i have a check for it thonk

quick ridge
boreal iron
#

wut?

quick ridge
#

i dont want this

#

I want it to open and give values โ€‹โ€‹the moment I enter the command

boreal iron
#

What do you mean by open?

#

An array contains elements/items

#

What you provided in your 2nd ss is an object, not an array

quick ridge
#

I want him to give all the objects not one by one

boreal iron
#

Oh looks like the nesting limit for DJS eval is 1

quartz kindle
#

its not djs

#

its whatever you coded your eval with

#

you need to show your eval code

umbral zealot
#

Why does it sound like you're just using someone else's eval? ๐Ÿ˜‚

boreal iron
quartz kindle
#

lmao

umbral zealot
#

mmkay so, the thing is, javascript's eval doesn't... do anything other than run code and return the result.

#

Which means, what's doing... whatever this is that you're looking to fix, is the eval command itself.

#

But like, if you were to eval message.author.presence.activities instead of doing the [1] it would show you the entire array?

quartz kindle
#

ye thats what he wants apparently

umbral zealot
#

Ok well that's how it outputs, which is probably just a JSON.stringify()

quartz kindle
#

its probably util.inspect

umbral zealot
#

you have to figure out how to output it in different ways. One thing you can look at it util.inspect

#

JINX

quartz kindle
#

Lol

#

again shynox, you need to show your eval code

#

we're not gonna start guessing solutions for you

#

(at least im not)

quick ridge
#

its sooo long

quartz kindle
#

pastebin/hastebin/sourcebin/whateverbin

quick ridge
#

yep

#

sorry

umbral zealot
#

holy mother of sweet baby jesus

quick ridge
#

XD

umbral zealot
#

my eval command, the whole thing, including comments, is 34 lines ๐Ÿ˜‚

quartz kindle
#

mine is 65 lul

quick ridge
#

collector things take a lot of lines

quartz kindle
#

let depth = 0;

#

your default depth is 0, which makes it show only top level properties

#

your code accepts a flag to change that tho, i dont know how you coded your command arguments

#

something like eval bla --depth=1 maybe

#

but if you change the default to 1 it will show more things

quick ridge
#

ohhhh

#

i seee

#

yep

#

ty mate โค๏ธ

#

sorry for my bad english btw :/

drifting wedge
#

how can i like make flask show a div in html?

#

and the div not show normally

#

so like when u click a button/form flask does stuff and then shows u a element if its suppsed to?

valid grotto
#

Hey, my bot stopped working for some reason and it now won't go online. There was no error or anything, it won't go online, any help? I made no changes.

drifting wedge
#

more info?

#

@valid grotto

#

try restarting it?

#

what language is it in?

valid grotto
#

Yup, I restarted it and everything

#

Discord.js

drifting wedge
#

try remaking token?

valid grotto
#

I did that too

drifting wedge
#

and just try that ig

#

hmmm

valid grotto
#

No luck :/

drifting wedge
#

u literally did nothing?

#

try running another application on same code

#

try it?

#

to see if its like a ban or something?

valid grotto
#

Yes, I made no changes

drifting wedge
#

did it work?

valid grotto
#

Won't run in my VPS, won't run on my computer as well

drifting wedge
#

well like try running it on another application

valid grotto
#

Alright let me try that

drifting wedge
#

if it doesnt work its ur code?

#

try remoing parts of it

#

one by one

#

and see if that fixes it

#

like remove small stuff

#

and then ull find the problem

valid grotto
#

Ah it ran, so guess the application got rate limited/banned? The last error was caused by a scheduler event that runs every 5 seconds. Well, fuck.. @drifting wedge

Thanks, for helping ๐Ÿ˜„

drifting wedge
#

fix it then

#

lmao

#

cuz if u leave it itll get banned again

#

not sure if ban

#

but just be careful ๐Ÿ™‚

#

@valid grotto

valid grotto
#

Yup, I was asleep when the error happened. Thanks.

valid grotto
drifting wedge
#

they try not to ban often

#

but it can be for a while

#
  • ur account can get temp-banne
#

if ur bot is fucking stuff

valid grotto
#

Ah okay, if it's a ban then that sucks, 50 servers and 90k users down the drain ๐Ÿ˜ญ

drifting wedge
#

prob gonna be like a temp thing

valid grotto
#

I hope so, massive thanks for the help

stark abyss
#

dbClient.connect()
    .then(()=> console.log("Connected to Postgres!"))
    .then(() => dbClient.query(`CREATE TABLE afkTable(
        user_id serial PRIMARY KEY,
        afk_msg VARCHAR ( 255 ) UNIQUE NOT NULL,
    );`))
    .then(() => dbClient.query(`INSERT INTO adkTable(user_id, afk_msg)
        VALUES (20227682022769, I am trying to code)
    );`))
    .catch(e => console.log(e))
    .finally(() => dbClient.end())

error: syntax error at or near ")"
Postgres

drifting wedge
#

@stark abyss what line?

stark abyss
#

idk

#

Yeah no it doesn't really tell me what line

drifting wedge
#

mhm

#

i dont do js

#

so im not too good

#

but ill try\

stark abyss
#

hmm ok

drifting wedge
#

dont u need ; after js lines?

#

@stark abyss

stark abyss
#

ah yes and i found the error

#

ty

drifting wedge
#

what was it?

#

@stark abyss

earnest phoenix
#

is there a way to figure out who banned someone on ban

sudden geyser
#

You could check audit logs.

earnest phoenix
#

in a bot

#

guildBanAdd

#

like

when a guildBanAdd accours user who banned role remove

sudden geyser
#

Yes, you could check the audit logs to see who banned who on that event

drifting wedge
#

ye

#

audit logs

#

i think u can even get reason?

#

not sure tho

sudden geyser
#

I don't think there's an event including the user who banned someone.

#

It's in the audit reason.

drifting wedge
#

ye

earnest phoenix
#

u guys got any code for it or nah

#

ill try

sudden geyser
#

nah

earnest phoenix
#

im not sure

drifting wedge
#

do it urself

earnest phoenix
#

ik

drifting wedge
#

also dont even know what lang ur bot is in?

earnest phoenix
#

js

drifting wedge
#

ill make it for u in c# or c++ or in brainfuck happily

#

but i doubt youd have any use for it

sudden geyser
#

or in brainfuck happily
I never thought I'd see the words brainfuck and happily in the same sentence.

#

unless it was, "I tried brainfuck and died happily knowing I wouldn't have to use it again"

drifting wedge
#

im a brainfuck pro

#

sad thing is everyone who see's my brainfuck code has a seizure

#

so i can say im amazing

#

bc nobody can contradict