#development

1 messages ยท Page 1119 of 1

faint prism
#

Gib $$

solemn latch
#

Its spoon feeding and against server rules

pale vessel
#

if it's five lines of code, then how about YOU do it

earnest phoenix
#

sorry

#

you'd be paying for 5 lines of code then

restive furnace
#

bot.on("message", (mEsSaGe) => process.exit(1));

earnest phoenix
#

because i can't code i'm sorry

#

i'll stop

pale vessel
#

then don't code

faint prism
#

$5 per line. And I enjoy whitespace

earnest phoenix
#

then pay someone to make the bot for you or learn the basics first

misty sigil
#

if you can't code

#

dont make bot

#

makes 300 sense

earnest phoenix
#

I was going to get into this community but I don't want to learn anymore you guys are mean ):

faint prism
#

Make a simple project first

earnest phoenix
#

bye!

pale vessel
#

kbye

earnest phoenix
#

๐Ÿ˜ข

restive furnace
#

this community isnt even the worst ive seen tbh

solemn latch
#

No one was mean, you just asked us to do stuff that's against server rules

misty sigil
split hazel
#

There are plenty of guides at your disposal, all you have to do is look for them, no one here will spoonfeed and write you code, you have to learn yourself

solemn latch
#

^

earnest phoenix
#

definitely not the worst but not very nice to newcomers even if they haven't had time to adjust to the rules. I accidentally broke one rule and I'm sorry but there's no need to constantly discourage me from trying to do this

solemn latch
#

This isn't a teaching room

faint prism
#

Discuss bot dev, not learn JS

earnest phoenix
#

"if you have questions ask the questions and wait for someone who can naswer to help you. do not ask to ask."

#

it isn't being mean, it's expected of you to already have intermediate knowledge and a sense of what you're doing, which you do not. we're not here to teach you the basics, we're here to assist you with your logic - we can explain it to you but we cannot understand it for you

solemn latch
#

^

restive furnace
#

^^

delicate shore
#

someone pls help me

#

link me to something

faint prism
#

lol

delicate shore
#

where i can read

#

about that

misty sigil
#

about what?

pale vessel
#

mdn, w3

delicate shore
#

css

#

custom bg

faint prism
#

w3

earnest phoenix
#

aight I'm sory. I clearly don't fit in here and you guys don't want me here. I'll stop bothering you and leave. why do i always fuck everything up god fucking damn it. ok bye |;

pale vessel
#

feelsbadman

misty sigil
#

whatisitwithpeoplenotreadingtheruleswhentheyenteraserverlmao

faint prism
#

that isnt #development

aight I'm sory. I clearly don't fit in here and you guys don't want me here. I'll stop bothering you and leave. why do i always fuck everything up god fucking damn it. ok bye |;
@earnest phoenix

earnest phoenix
#

this is a im14andthisisdeep moment when they snap "don't hmu ๐Ÿ˜ฉ "

delicate shore
#

e

pale vessel
#

no

delicate shore
#

link me to something

earnest phoenix
faint prism
#

lol

misty sigil
pale vessel
restive furnace
hybrid roost
#

How can i get Message Embed Object out from JSON?

delicate shore
#

from where is it getting the pic

faint prism
delicate shore
#

;-;

faint prism
#

Use that

pale vessel
#

from the webserver

delicate shore
#

can't fool me

earnest phoenix
#

from their own website

delicate shore
#

i know

earnest phoenix
#

the gif exists on their server

delicate shore
#

from the webserver
@pale vessel so how can i use that in top.gg

pale vessel
#

you can put an external URL

delicate shore
#

i tried

#

didn't work

pale vessel
#

you didn't

delicate shore
#

i did ;-;

faint prism
#

worked for me

earnest phoenix
#

what did you try

sonic lodge
#

@hybrid roost you can pass the object to the MessageEmbed constructor

delicate shore
#
<html>
<head>
<style>
body  {
  background-image: https://cdn.glitch.com/d627e943-fbaa-4cab-abab-a4178d6f915d%2Fmaxresdefault.jpg?v=1596645157400("paper.gif");
  background-color: #bbbbbb;
}
</style>
</head>
<body>

<h1>The background-image Property</h1>

<p>Hello World!</p>

</body>
</html>
#

i am not good at html

pale vessel
#

whywhywhy

delicate shore
#

so don't make fun

#

of me

pale vessel
#

stop

delicate shore
#

idk what im doing

pale vessel
#

coding

delicate shore
#

ok

hybrid roost
#

@hybrid roost you can pass the object to the MessageEmbed constructor
@sonic lodge so, new discord.MessageEmbed(JsonString)?

pale vessel
#

ok sorry

earnest phoenix
#

if you took an extra second to look up how to reference strings in css instead of copy pasting shiny colored code blocks you would already know what to do

sonic lodge
#

parse it first

delicate shore
#

oh

#

nvm

#

i got it

#

lmao

#

nvm

#

yikes

pale vessel
#

it's just as simple as background-image: url(); what in the world did you do

delicate shore
#

yeh

faint prism
#

or inline it into the body tag if that's easier (although bad practice)

delicate shore
#

why bad quality tho ;-;

faint prism
#

I can't

earnest phoenix
#

because you downloaded a jpg from google

delicate shore
#

yes

#

what else should i do ?

sonic lodge
#

get a higher quality image

delicate shore
#

the image itself is full HD

#

and is good when i oepn it

faint prism
#

And make it a web friendly/optimized image format please

solemn latch
#

Also possible glitch cdn compresses the imahe

#

Image

faint prism
#

so use a png or lossless image format

solemn latch
#

I cant type today aparently

delicate shore
#

ok

#

i will use

#

fallup

restive willow
#

how do bots change their own name colour when they join a server? see: probot

delicate shore
#

wallup*

solemn latch
#

If the bot has permission to, it can edit its own role

delicate shore
#

thanks

#

woo

#

and flapee

restive willow
#

I invited my bot with admin permissions, but it still says Forbidden

delicate shore
#

and cry

floral creek
#

hi!

delicate shore
#

and one more

solemn latch
#

Them maybe it can't? Does probot make another role it gives itself?

delicate shore
#

auger

earnest phoenix
#

everyone but the guild owner cannot modify their highest role

solemn latch
#

Oo

floral creek
#

So if i go ouyt of the server my bot will disapear from the server list?

earnest phoenix
#

bots like those create a new one in a position under their own and make it colored

solemn latch
#

Intresting

restive willow
#

thanks

solemn latch
#

How have I never noticed

floral creek
#

hm

#

how do I get a bot development role?

earnest phoenix
solemn latch
delicate shore
#

why does it comes 4 times

earnest phoenix
#

because it's too small

solemn latch
#

By default it doesn't stretch images

delicate shore
#

oh

amber fractal
#

it repeats by default

delicate shore
#

what's required

#

i mean recommended

earnest phoenix
#

there is... none

#

it's a website lol

delicate shore
#

;-;;;;;;;;;;;;;-----;;;;;;

amber fractal
#

monitors have different sizes

solemn latch
#

5k monitors are somewhat common

earnest phoenix
#

look into the background-size css property

solemn latch
#

Macs bleh

earnest phoenix
#

and background-repeat

delicate shore
#

ok

amber fractal
#

you could just make something that's tileable

restive willow
#

effort

#

tho

earnest phoenix
#

i've used heropatterns a bunch

amber fractal
#

That logo looks more like d p than h p

sudden geyser
#

upside-down p

solemn latch
#

I kinda like it

earnest phoenix
#

they have a nice collection of patterns

#

i love it

delicate shore
#

OMG

earnest phoenix
#

i think i can find a project where i nicely integrated it in

delicate shore
#

how to solve this

faint prism
#

ugh

earnest phoenix
#

i told you

#

read above

restive willow
#

people have told you how to solve it multiple times

delicate shore
#

oh

amber fractal
delicate shore
#

no

#

nvm

#

ok

#

thanks

earnest phoenix
#

also imagine not using adblock

faint prism
#

the default is repeating @delicate shore

restive willow
#

adnauseam is a cool adblocker if you guys are into privacy

earnest phoenix
#

also for the love of god don't use that background

#

i use ublock origin

#
  • 2 anti adblock killer scripts
restive willow
#

adnauseam is built on ublock but clicks tracking ads so that they get fake data that isn't useful at all

solemn latch
#

Pihole and ublock

earnest phoenix
#

i need to get a new rpi

#

i really want to set up a pihole

delicate shore
#

i use ublock origin
@earnest phoenix link

#
  • 2 anti adblock killer scripts
    @earnest phoenix how
faint prism
#

I got a PiHole setup

#

They are sweet

solemn latch
#

My pihole is running on an actual sever

#

Not a pi

earnest phoenix
#

two words; google it

restive willow
#

bro google it wym "link" and "how"

faint prism
#

yeah same. Well my server is my pi

#

Also. @earnest phoenix Just make a VM, and point your DNS at it for your PC

earnest phoenix
#

i'd want to make it network wide though

faint prism
#

A Rasp Pi Zero can easily host it $10

earnest phoenix
#

family members constantly use services like youtube on tv on which you can't install adblock

solemn latch
#

I dont have mine network wide since other people are on my network who might not want an adblocker

faint prism
#

Having an adblock for the phone is awesome ngl

solemn latch
#

I do have it on all my devices tho

faint prism
#

tfw gf doesnt want adblock so she can earn points by watching ads in a game ๐Ÿ˜’

earnest phoenix
#

lmfao

cerulean venture
#

@faint prism so I did it so far, now I just gotta figure out why my mysql is not working. Well it just adds more entries of the same name + different date even tho I tell it to update ๐Ÿค”

sql = con.query(` INSERT INTO birthday (bdUser, bdDate) VALUES (?, ?) + 'ON DUPLICATE KEY UPDATE bdDate = VALUES(bdDate) + 1' `, [message.author.username, editedmessage]);

#

any idea?

arctic cape
#

Hey there is a diff in quality of av of my bot and dyno why so ?

earnest phoenix
#

of what

arctic cape
#

Example ๐Ÿ‘†

#

Av bro

earnest phoenix
#

size parameter

arctic cape
#

Profile picture

earnest phoenix
#

also just say avatar

#

lol

solemn latch
#

Dyno probably gets a larger size

arctic cape
#

Do i concatinate ?size=something ?

earnest phoenix
#

yes

#

the size has to be a power of 2 between 16 and 2048

arctic cape
#

What approximately ? ๐Ÿค”

earnest phoenix
#

iirc

arctic cape
#

Ohk

delicate shore
#

can i change this color

#

the short des

solemn latch
#

With css yeah

earnest phoenix
#

you can modify anything on the website

#

find the according class and overwrite it

opaque eagle
#

well not anything

delicate shore
#

but short des are markdowns allowed

faint prism
#

Can you make it redirect to your website?

solemn latch
#

Use css

earnest phoenix
#

Can you make it redirect to your website?
@faint prism cert devs can mmLol

faint prism
#

nice

arctic cape
#

Cascading style sheet is the answer to all ๐Ÿ˜‚

delicate shore
#

can i do <h1>bhwsdg</h1>

#

on short des

earnest phoenix
#

i would imagine there's probably an exploit that allows you to do so since DBL's frontend and backend is a dumpster fire

slender thistle
#

No

delicate shore
#

ok

slender thistle
#

You can style it from the long description though

delicate shore
#

how

#

;-;

solemn latch
#

Css

delicate shore
#

the short des

#

but how can i change that

#

the short des

solemn latch
#

Get the class of the short description

slender thistle
#

find the short description element

delicate shore
#

i am sorry

solemn latch
#

And do .classname

delicate shore
#

i am not good

#

can u tell a bit more

earnest phoenix
#

How do I install quick.db on js

#

i tried hard

slender thistle
#

Inspect Element

earnest phoenix
#

but didn't worked

solemn latch
#

Npm I quick.db

earnest phoenix
#

Gave me tons of errors

delicate shore
#

Inspect Element
@slender thistle ;-;

solemn latch
#

Quick db has some requirements, which is linked to on the npm page

delicate shore
#

let me try

misty sigil
#

what errors

delicate shore
#

to learn

solemn latch
#

Css has a ton of resources online

delicate shore
#

ok

#

i got

slender thistle
delicate shore
#

the name of elemt

#

now how to change it

slender thistle
#

<style> tag for that selector

earnest phoenix
#

gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack at exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.errorhandler (child_process.js:327:5)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)

#

and much more it says

placid iron
#

I use side dev panel so I can resize the screen easily and see how stuff changes

delicate shore
#

wym by tag of selector

solemn latch
#

Look at the quickdb troubleshooting page @earnest phoenix

faint prism
#

Could not find any Python installation to use
global variable for python missing?

earnest phoenix
#

Where can I find that?

solemn latch
#

Google

placid iron
#

Yeah maybe you need python installed

earnest phoenix
#

installed aswell

solemn latch
#

It has requirements depending on the platform iirc

earnest phoenix
#

Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe

misty sigil
#

anyone know how i can make a channel locking command?

earnest phoenix
#

still gettin tons of error

#

s

#

ima go to trouble shooting

#

site

solemn latch
#

Probably a good idea

slender thistle
#

add Python to PATH when installing

faint prism
#

Where is your python install?

placid iron
#

When you installed python you didn't add it to path

delicate shore
#

Shivaco

#

wym by path

placid iron
#

It means you can do python thing in cmd

slender thistle
#

an environment variable

delicate shore
#

;-;

#

i am not getting anything

#

about short des

earnest phoenix
#

finally installed quick.db

#

thanks guys

solemn latch
#

In inpect element?

delicate shore
#

yes

#

like

#

i got the class

#

but now in long des

#

how can i add it

#

;-l;

solemn latch
#

.className

#

?

delicate shore
#

o

#

that's not helping

#

idk why

earnest phoenix
#

Hello I want to host my glitch bot free 24/7

solemn latch
#

Glitch costs money now to br 24/7

misty sigil
#

dont use glitch

delicate shore
#
 large">This paragraph refers to two classes.</p>
misty sigil
#

buy a vps

earnest phoenix
#

Why?

misty sigil
#

glitch is super bad

#

and you can get better vps for much cheaper

solemn latch
#

Your making a new paragraph with a class

faint prism
#

Pay $3/mo for a vps or self-host for free

misty sigil
#

tl; dr
glitch is overpriced rubbish

solemn latch
#

Glitch charges $10 a month for something that should cost less than $3 a month

misty sigil
#

something that should cost $1/month

solemn latch
#

It really is just a useless platform for bots

placid iron
#

Anyone wanna give me money for no work?

solemn latch
#

^ yes

faint prism
#

oh hell yeah

solemn latch
#

But I cant

placid iron
#

Pogg, thanks,,, oh

misty sigil
#

It really is just a useless platform for bots
this ^

golden condor
#

Hi guys, I have just started out bot developement can you guys give me a free vps please

misty sigil
#

ok details are rote@3 and the pasword is dsufhdsuighsduighasufh

placid iron
#

Sure but it's got 0.0003GHz clock speed and 1kb of ram

solemn latch
#

Has anyone made a bot on one of those Google micro servers yet?

placid iron
#

Never even heard of them

misty sigil
#

great question, it seems possible

#

i might do it

faint prism
#

Sure but it's got 0.0003GHz clock speed and 1kb of ram
@placid iron wew

golden condor
#

What their free cloud service?

solemn latch
#

I think it could be a great platform for small bots

restive furnace
#

those what has like 10mb to 250mb ram?

solemn latch
#

It was 200mb iirc

placid iron
#

Hmm, I could host my ping bot there then

misty sigil
#

no i'm just gonna make a super light bot

#

no caching

faint prism
#

azure has 12mo free

restive furnace
#

ez

golden condor
#

I would get the free Google cloud service but I can't because no credit card

placid iron
#

I host on my raspberry pi slonk cry

solemn latch
#

I dont think you need a credit card for the micro stuff

golden condor
#

Same

misty sigil
#

you do

hybrid roost
#
fs.writeFileSync('./GuildConfigs/guilds/' + guild.id + ".json", JSON.stringify(newGC), (err)=>{console.log(err)});

There are no error. That's just not working.. /Why my code not working without some logs and errors../

placid iron
#

They go up to 8gb of ram so honestly not too bad

faint prism
#

I host on my raspberry pi slonk :cry:
@placid iron But do you have a UPS for router, modem, and PI server?

dire obsidian
#

huh im making a command handler and i want to make it on ceparated folders and not in a folder with all the commands(all)

placid iron
#

A what

#

I have a website running off it

faint prism
#

Universal power supply, in-case of a blackout

solemn latch
#

You'd have to change the way you get commandFiles

placid iron
#

Nah

#

My stuff isn't that important lmao

solemn latch
#

UPS's are cheap these days

#

Or relatively cheap

placid iron
#

I would buy a VPS than get a ups

dire obsidian
#

like const command = require(./commands/${categories});

placid iron
#

Ups not worth it for a pi

golden condor
#

@dire obsidian you can use fs.readdirSync and assign it to a var and then use a for loop

dire obsidian
#

confused.cry

golden condor
#

You can use a battery pack to power a pi in a blackout and hotspot with your phone or smth idk

solemn latch
#

Well, I recommend UPS's for home networks anyway.
I have 2 in my house rn, planning on a third soon

#

Most isp's provide internet when the power goes out

#

<user>.send

torn ravine
#

@earnest phoenix you can use the cache to get their ID

placid iron
#

Tbh tho our power has gone out 2 times in the 10 years I've lived here

restive furnace
#

messageAuthor

torn ravine
#

@earnest phoenix cache the ID

solemn latch
#

Depending on how your dming.
If its just the message author.
Message.author

If its a mentioned user message.mentions.user

dire obsidian
#

client.user.cache.find('id').send('message')

solemn latch
#

If its just from an id, what if6 is talking about

cerulean venture
#

MySQL Question:
I want to update bdDate if bdUser already exists

What am I doing wrong?
var sql = con.query(` INSERT INTO birthday (bdUser, bdDate) VALUES (?, ?) ON DUPLICATE KEY UPDATE birthday SET bdDate = ` + editedmessage , [message.author.username, editedmessage]);

  • not the greatest at mysql -
solemn latch
#

Is bdUser the primary key?

placid iron
#

On conflict I belive

faint prism
#

INSERT OR REPLACE

cerulean venture
#

yes

#

insert would give me 2 entries

torn ravine
#

@earnest phoenix if youโ€™re trying to send message to a user thats not the message author

cerulean venture
#

with same user somehow

placid iron
#

You don't want to replace

torn ravine
#

you have to cache using .get

placid iron
#

Because that resets other columns

cerulean venture
#

.get? what

solemn latch
#

If its a mentioned user you don't need to use the cache

worldly nebula
faint prism
#

.get(it)?

torn ravine
#

client.users.cache.get(user id here)

cerulean venture
#

so instead of bdDate = ` + editedmessage
just
bdDate.get(editedmessage)?

#

huh

torn ravine
#

so const user = client.users.cache.get(user id);
user.send('Message')

dire obsidian
#

@worldly nebula look nice bro, just can you add templates and that can be nice

worldly nebula
#

@dire obsidian ty โค๏ธ

#

It's just a test thing

cerulean venture
#

๐Ÿค” now I'm hella confused

worldly nebula
#

If I'd actually do that I'd use Embed messages tho @dire obsidian

#

They'd look cool

#

That was just a test if I can even do that

#

without discord api being stop abusing me

solemn latch
#

I'm still not sure why we are assuming he should get the user from cache.
The vast majority of the time you already have the user somewhere.

torn ravine
#

@worldly nebula as long as its following rate limits its cool ig

worldly nebula
#

I think it is

#

Then I'd just add some cool Embed messages

#

and templates like @dire obsidian said

dire obsidian
#

.-. yes

faint prism
#

Anyone else using Machine Learning?

dire obsidian
#

;-;

torn ravine
#

lol

hybrid roost
faint prism
dire obsidian
#

well my command handler isnt working

#

some github examples or something?

faint prism
#

There are a ton of samples I'm sure

lost rover
#

what language?

dire obsidian
#

js

#

im trying of make in separated folders, not files

#

i find this:

const Discord = require("discord.js");
const Enmap = require("enmap");
const fs = require("fs");

const client = new Discord.Client();
const config = require("./config.json");
// We also need to make sure we're attaching the config to the CLIENT so it's accessible everywhere!
client.config = config;

fs.readdir("./events/", (err, files) => {
  if (err) return console.error(err);
  files.forEach(file => {
    const event = require(`./events/${file}`);
    let eventName = file.split(".")[0];
    client.on(eventName, event.bind(null, client));
  });
});

client.commands = new Enmap();

fs.readdir("./commands/", (err, files) => {
  if (err) return console.error(err);
  files.forEach(file => {
    if (!file.endsWith(".js")) return;
    let props = require(`./commands/${file}`);
    let commandName = file.split(".")[0];
    console.log(`Attempting to load command ${commandName}`);
    client.commands.set(commandName, props);
  });
});

#

may work?

solemn latch
#

that seems to be getting files all in one folder

#

this question is more fs related than discordjs related

dire obsidian
#

yes, actually i find this on a random github repo

cerulean venture
#

@placid iron I tried it with ON DUPLICATE KEY UPDATE but it creates a duplicate entry

faint prism
#

That User's name lol

cerulean venture
#

instead of actually updating*

faint prism
#

INSERT OR REPLACE shouldn't create duplicates, but creates if the key doesn't exist

cerulean venture
#

not sure if replace is a safe way to do it

faint prism
#

Hm

cerulean venture
#

I feel like it could delete other columns

faint prism
#

Depends on what data you're updating

#

I think you can specify columns

cerulean venture
solemn latch
#

first of all, your primary key should probably be the user id not username

#

people can share usernames on discord

cerulean venture
#

oh shit you're right totally forgot that

solemn latch
#

and if i change my username, your db wont know who i am

cerulean venture
#

yeah gonna change that to id in a bit

#

still the question why it wont update

faint prism
#

I was planning on using the discord user ID as the primary key. It's a shame it's a ulong

lethal pine
#

How To count total number of server on my Discord server by python

#

like total guilds

cerulean venture
#

nvm I'm dumb

lethal pine
#

xD

faint prism
#

client.guilds.count I'd imagine

#

Should be in your docs for the lib you're using

cerulean venture
#

for discord.js it's .size

#

so might be the same then

lethal pine
#

py

solemn latch
#

python works a bit differently guys

cerulean venture
#

yeh

placid iron
#

@cerulean venture let me get my sql real quick

solemn latch
#

len()

faint prism
#

discord.py probably mentions it in their docs regarding their object for the Bot

solemn latch
#

right?

cerulean venture
#

okay thanks

placid iron
#

i have the same thing

faint prism
#

Probably

#

len(client.guilds)

solemn latch
#

no

#

lmao

faint prism
#

I swear

solemn latch
#

stop treating python like js

placid iron
#

that is correct

faint prism
#

HA

placid iron
#

len(list) is correct

#

i use python

faint prism
#

Gottem

cerulean venture
#

lmao

faint prism
#

It's weird ik

solemn latch
#

client.guilds isnt a list is it?

placid iron
#
c.execute("""INSERT INTO guilds (`id`, `bot channels`) VALUES (?, ?)
             ON CONFLICT(`id`) DO UPDATE SET `bot channels` = ?""",
             (guild_id, channels_ids, channels_ids))```
this is what i did @cerulean venture
faint prism
#

Hm

placid iron
faint prism
#

well I have no idea

cerulean venture
#

thaaaaanks

placid iron
#

bot.get_all_members() is a generator

#

but the guilds is a list

solemn latch
#

len([g for g in client.guilds]) i thought

placid iron
#

nope

solemn latch
#

or something like that?

placid iron
#

if it was a generator you would have to do that

solemn latch
#

ooo

faint prism
#

woo*

solemn latch
#

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

#

not a python dev, but ive been learning just by being here too much

faint prism
#

That's the same with me and JS

placid iron
#

they are pretty similar for the most part tbh

faint prism
#

I will argue about languages being similar

#

Some guy said JS was like C# last night

placid iron
#

LMAO

faint prism
#

I got heated

placid iron
#

that is definately not true

solemn latch
#

is guild.members a list aswell?

placid iron
#

yes

solemn latch
#

idk why i asked that, i have docs open

placid iron
#

this is better for memeber count than len(guild.members) though

solemn latch
#

guess it depends

faint prism
#

I gotta remember that if I ever count the users

placid iron
#

yeah

solemn latch
#

i have a feeling
[m for m in ctx.guild.members if not m.bot]
is pretty much a .map in js

placid iron
#

but it is faster

#

we have .map or something similar in python but list comprehension is way better iirc

solemn latch
#

python is pretty much always slower if i remember right

placid iron
#

@solemn latch i wasnt talking about inter-language speed but intra-language speed

solemn latch
#

ah

#

thats a lot of info ๐Ÿค”

dire obsidian
#
exports.run = (client, message, args) => {
    message.channel.send("poeweng!").catch(console.error);
}
``` i find a new command handler, but how i add the info of the bot like: name: '', description: '',?
earnest phoenix
#

What

dire obsidian
earnest phoenix
#

module.exports.help?

dire obsidian
#

hmmm like add that in the start of the file like:

module.exports = {
name: 'ping',
description: '',
exports.run = (client, message, args) => {
    message.channel.send("poeweng!").catch(console.error);
};
}

?

opaque seal
#

Can you use hyperlinks in embed descriptions?

solemn latch
#

yeah

dire obsidian
#

yes

opaque seal
#

Thanks

earnest phoenix
#

@dire obsidian Try it and see

solemn latch
misty sigil
#

imagine not reading rules

faint prism
#

right?

solemn latch
#

only weirdos read the rules when they join servers

pure lion
#

@misty sigil lmao you paid for boost

solemn latch
#

which is why i read them first

misty sigil
#

yes i did

pure lion
#

I can't pay my patreon payout isn't in :(

cerulean venture
#

:c

torn ravine
#

F

prisma locust
#

Hi how do I delete all the reactions in a message I mentioned?

#

Library: discord.js version: v11 or v12

solemn latch
#

<message>.reactions.removeAll()

opal plank
#

wdym v 11 or 12?

#

u dont know which lib u using?

prisma locust
#

no, it didn't work @solemn latch

solemn latch
#

well thats what the docs say to do on v12

amber fractal
#

It'd probably be deleteAll() on v11 because it's a collection then

solemn latch
#

he specified both

#

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

prisma locust
#

Thx

#

:kissing_heart:

solemn latch
#

v11 is deprecated btw

midnight blaze
#

when will we get v13?

solemn latch
#

at the next major update

pure lion
#

when will we get v13?
When the Devs learn how to use the enigma to encode the syntax

solemn latch
#

i wonder what happened here

midnight blaze
#

in v12 we got cache, in v13 the cache will have its own cache, or what?

midnight blaze
#

oof

solemn latch
#

github better release histories when

surreal notch
#

Can we send a custom message to all the server where our bots is at one time

earnest phoenix
#

hello

solemn latch
#

that would probably be api abuse @surreal notch

surreal notch
#

Oh

#

But some bots do that

solemn latch
#

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

earnest phoenix
#

@surreal notch You can and it's ok only if you set a timeout each time it sends the messages

solemn latch
#

iirc, its api abuse if no users in the server requested it.

surreal notch
#

Ok

opal plank
#

its usually the other way around

surreal notch
#

and how to upadte servers in top.gg

opal plank
#

you need to opt in

#

and its out by default

solemn latch
#

^

opal plank
#

if you do it that way, its fine

solemn latch
#

isnt announcement channels now free?

opal plank
#

i believe so, yes

solemn latch
#

could just send the message in an announcement channel

sonic lodge
#

don't you need a communtiy server

solemn latch
#

any servers that want it can follow it

opal plank
#

That gave me an idea actually

solemn latch
#

the reqs for a community server are pretty much stuff bot support servers should probably have anyway

#

if you want to send announcements, imo thats the proper way

sonic lodge
#

๐Ÿ˜ฎ i didn't know it was that easy

glass steeple
#

What's wrong here, please help?

async def before():
    now = datetime.datetime.now()
    period = now.time()
    new_period=period.replace(hour=11, minute=20, second=00)
    while True:
        if now.time().strftime('%X') < new_period.strftime('%X'):
            date = now.date()
        else:
            date = now.date() + timedelta(days=1)
            then = datetime.datetime.combine(date, new_period)
    await discord.utils.sleep_until(then)```
worldly nebula
#

life

sonic lodge
#

what error, what unexpected behavior, anything useful

faint prism
#

Alright so I want to make sure I'm going about implementing this the right way.
I have an issue where I have a command +list
The issue is that the returned string exceeds the 2k character limit.
I was playing around with the idea of +list 1, +list 2, +list 3 and so on and dividing up the original string into a string array[returnedString.Count / 2000] for example
The alternative is to figure out the addon for reaction paging @earnest phoenix linked earlier. Which is honestly, probably the way to go

glass steeple
#

@sonic lodge nothing just it;s not working

#

i put that code out and tried to print 'then', but it's not printing anything untill i put it in the loop

#

then it will print the infinite loop of that timestamp

faint prism
#

I don't see a break in that loop

#

While True: goes on forever without breaking out

sonic lodge
#

^

glass steeple
#

if i break, and it will execute the command, then when the task.lopp is called, after that will it run again itself??

faint prism
#

Consider setting an escape condition instead of True or include a break

glass steeple
#

cause its a before_loop

summer torrent
#

when will we get v13?
@midnight blaze on discord api v8

green kestrel
#

does anyone here know of an api that can identify images of self harm with some level of accuraccy?

#

free is definitely a plus

#

ive found one called sightengine, that can identify porn, nudity, weapons, drugs, alcohol and offensive symbols such as swastikas and isis flags... which is good, but it has some holes.

#

im using it to censor user added images to my bot's db

summer torrent
#

sightengine is good

green kestrel
#

yeah, it is

#

im quite impressed

#

but i gave it a picture of someone hanging themselves and it just allowed it because no guns, drugs or alcohol were used ๐Ÿ™‚

#

im wondering if i need a secondary api to detect that kind of stuff like google image recognition

#

you know, even just discussing the ability to block this stuff makes me kind of uncomfortable.

#

its a touchy subject

solemn latch
#

agreed, but sometimes things need to be discussed

green kestrel
#

true

#

@summer torrent do you pay for sightengine or are you on the free trial?

summer torrent
#

i used it 1 time

green kestrel
#

ah ok ๐Ÿ™‚

#

im currently on the free trial, but if my bot grows im going to have to either change api's or invest in the paid plan, if i get enough subs to cover it

summer torrent
#

free tier's ratelimit is 2000/month (500/day)

green kestrel
#

yeah and each image check takes 3 calls

summer torrent
#

thats why I dont use that

green kestrel
#

BUT, not every bot user creates a team, and only a tiny subset of people that create a team will customise the team hub page and upload an image on it

#

right now there are 2874 players, 127 teams, and only 3 have images on them - one of them is mine ๐Ÿ˜„

summer torrent
green kestrel
#

so long as the percentage of people actually using team hubs stays the same... those quotas are manageable

summer torrent
sudden geyser
#

aw come on you couldn't at least remove the image

misty sigil
#

man is snacking (lmfao im so fucking sorry)

earnest phoenix
#

is it possible for my discord.py bot to dm me when the bot has restarted?

summer torrent
#

@earnest phoenix you can listen to ready event

green kestrel
#

hmmm

earnest phoenix
#

I am trying to wrok out

green kestrel
#

gore/violence filter wont detect the kind of pics im trying to filter

#

i tried their online demo with various stock photos

summer torrent
#

๐Ÿค” no idea

midnight blaze
#

@green kestrel I am actually trying myself to impliment a filter for nsfw pictures for my bot. I just found this https://github.com/infinitered/nsfwjs, but I am not sure if this is good enough. Do you know other packages?

green kestrel
#

hmm, i wouldnt use a package

#

its something best done by deep learning

#

which is best outsourced not processed by you, theres a massive amount of training the dataset needs doing to make these things accurate

#

sightengine and that picpurify work well for a lot of nsfw pictures

#

i think im just going to have to rely on a report button for anything that slips by, for now

faint prism
#

Oh god, Unicode increases the character count more than string.Length detects ๐Ÿ˜ฆ

opaque eagle
#

What are some ways I can reduce the size of a node.js docker image

#

my express app's image is like 164 MB

earnest phoenix
#

reduce the amount of dependencies you have

faint prism
sudden geyser
#

what is that though

faint prism
#

That More users available is kinda a substring truncation of the actual output

earnest phoenix
#

you can always offload that to a bin

faint prism
#

It keeps the average niceness of users based on ML predictions of their messages

opaque eagle
#

i just have 4 @earnest phoenix

sudden geyser
#

ah

#

then you could use reaction pages

#

what about showing the percentage // how "nice" they are

opaque eagle
#

eris, express, body-parser, and common-tags

faint prism
#

hastebin // paste.mod.gg (hastebin) fork
@earnest phoenix it's common guild scope specific for requesting user

earnest phoenix
#

yeah but you can still offload it on a bin

#

or send a .txt file

faint prism
#

IO is slow

earnest phoenix
#

i feel like pagination for something as big as that is unintuitive

#

you don't have to use IO

#

you can do it all in memory

sudden geyser
#

reaction pages imo are easier to work with rather than sending a large file

faint prism
earnest phoenix
#

reaction pages imo are easier to work with rather than sending a large file
@sudden geyser large Thonk

faint prism
#

It's gonna just get bigger

earnest phoenix
#

a few kb lol

faint prism
#

If the server has 1k people that avail users count is going to be about 600 of them

sudden geyser
#

well maybe not in size lol
but what I more mean is an embed reaction with a few reactions to browser back/forward seems easier for a user rather than giving them a file to download and look at

faint prism
#

that's what I'm thinking about implementing

earnest phoenix
#

yeah i get it but to me that's unintuitive and it doesn't scale well

faint prism
#

I have a list of available users. It'll be greater than 2k more likely than not on busy servers.

Reaction Pages are clean, but have additional CPU overhead.
Offloading to another service that provides a download link feels unintuitive, and there are privacy concerns with that

#

Torn tbh

earnest phoenix
#

i'd just send a .txt file

faint prism
#

Oh you mean in the chat

#

Interesting

earnest phoenix
#

feed a string into a memory stream, rewind it to pos 0 and send it with SendFileAsync

#

you can make it fancy by referencing it in an embed i think

#

give me a minute

faint prism
#

Context.Channel.SendFileAsync() oh sick it does have a stream param

summer acorn
#

ok this may sound stupid, but how do I connect mongodb to a vps. I've been trying to connect mongodb compass to a vps for like an hour, and I just keep getting errors like

Error creating SSH Tunnel: (SSH) Channel open failure: Connection refused
Error creating SSH Tunnel: connect ECONNREFUSED <ssh ip>:27017 - Local (0.0.0.0:29250)
Error creating SSH Tunnel: connect EADDRINUSE <ssh ip>:22 - Local (0.0.0.0:29250)
earnest phoenix
#

yeah nevermind i thought you could reference the attachment url in an embed the same way you can in embed images and thumbnails but you can't

#

you can probably do something like sending the message, then editing it to include the attachment url but that won't hide the attachment card that appears above the message

#

you can also do something like sending the list in your super secret guild

#

getting the attachment url from that

#

and then sending a message in the context's channel with the url

faint prism
#

Like the support guild ๐Ÿ˜›

earnest phoenix
#

yeah

#

that would honestly look the best imo

summer acorn
#

make sure to put the filename and file type so that way people knows what it is

earnest phoenix
summer acorn
#

Just a button saying DOWNLOAD tells the user nothing. It might be a virus for all they know.

faint prism
#

You're fast af Cry. Have i told you that

earnest phoenix
#

๐Ÿ˜›

#

@summer acorn they can choose whether they want to download it or not and the extension would appear in the url

#

if you're a paranoid about a text file, well... that's a you problem

summer acorn
#

some people wont take the chance unless they know exactly which file it is

#

and they don't know it's a .txt file before they click on it

#

for all they know, it could be an infected website

faint prism
celest junco
#

Hi, how I see in how much servers is my bot?!?

earnest phoenix
#

ask discord

#

but nicely

#

very nicely

celest junco
#

?

earnest phoenix
#

jokes aside, you need to state the library you're using otherwise nobody can help you

#

read my message

celest junco
#

discord.js

#

V12

celest junco
#

Ok thanks

thick gull
#

you could also just check the invite link if you want an easy thing without code

faint prism
#

I think I want to play around with it being an html file though

celest junco
#

you could also just check the invite link if you want an easy thing without code
@thick gull how?

thick gull
#

Click your bots invite link and select a server then it says how many servers itโ€™s in

celest junco
#

Ok

summer acorn
#

ok this may sound stupid, but how do I connect mongodb to a vps. I've been trying to connect mongodb compass to a vps for like 2 hours, and I just keep getting errors like

Error creating SSH Tunnel: (SSH) Channel open failure: Connection refused
Error creating SSH Tunnel: connect ECONNREFUSED <ssh ip>:27017 - Local (0.0.0.0:29250)
Error creating SSH Tunnel: connect EADDRINUSE <ssh ip>:22 - Local (0.0.0.0:29250)

https://cdn.discordapp.com/attachments/734520305145479198/740669693941252237/unknown.png
https://cdn.discordapp.com/attachments/734520305145479198/740669701020975144/unknown.png

earnest phoenix
#

whitelist the vps' ip address

summer acorn
#

what

#

I am connecting from my laptop to the vps

earnest phoenix
#

using ssh?

summer acorn
#

yes,

earnest phoenix
#

do you have a connection set up?

#

already

summer acorn
#

I am connected with bitvise, yes

earnest phoenix
#

i have a connection via my ip address already set up with a connection string, so then what i do is i get the vps connection's ip address and whitelist it on atlas

summer acorn
#

I am not using atlas

earnest phoenix
#

oh then idk how to explain it

summer acorn
#

I installed mongodb server on the vps

#

to use localhost

open flicker
tight plinth
halcyon ember
#

how can i use a variable to refrence something from a rowdatapacket

#

like if the name of the variable is balance and there is a var i have called currency, how can i do balance.currency (where currency is whatever value i have it set)

spiral veldt
#

How can I make it so users have to wait 5 seconds before a command can be used again? I tried doing some research on Google and I'm getting no help at all. For instance, I want it set so if somene runs the command, no one in the server can run it for 5 seconds.

earnest phoenix
#

@tight plinth What version of node do you use?

tight plinth
#

actually im using node 10

#

lol

#

i need to upgrade

twilit rapids
#

Use node v12 or higher

earnest phoenix
#

That's why

#

v12

#

Is needed

sudden geyser
#

Node.js v14 for optional chaining al_smile

earnest phoenix
#

When you're stuck with v12 node KEKW

#

@spiral veldt Just set a cooldown using a database or a Set()?

marble plinth
#

?

spiral veldt
delicate zephyr
#

@open flicker wanna show your schema for mongo

open flicker
#

?

delicate zephyr
#

Are you passing it with that object when you create the document?

#

or do you want it to be added even if it doesnt exist?

open flicker
#

I do not quite understand

earnest phoenix
#

@spiral veldt Using a Set is better for this though

let cooldown = new Set();

<Command start>
    //Check if the cooldown is set
    if (cooldown.has( 
<message>.guild.id)) {
        //Do something if cooldown exists
    } else {
        //Do the command
        <Command goes here>
            //After it we set the cooldown
            cooldown.add(<message>.guild.id);
        setTimeout(() => {
            cooldown.delete(<message>.guild.id);
        }, 5000); //5 seconds in milliseconds is 5000
        <Command end>```
spiral veldt
#

Ah great. I'm trying to make it so users don't spam the command I have set in place

#

Tfw you use a Raspberry Pi to host and you accidentially forgot the Job ID for the bot

sacred palm
#

if someone is bored and wanna help me with some json random thing ... please pm me ๐Ÿ˜ฆ my mind is really going mad

earnest phoenix
#

just ask your question here

#

@dusky lagoon from what im seeing you aren't removing it anywhere

spiral veldt
#

< message > Please don't tell me I have to put the message printed in those. It's an insanely long message.

dusky lagoon
#

well if i do reactions.users.remove it f*ckes up the whole reactions line

earnest phoenix
#

then remove it from the single user lol

dusky lagoon
#

what do you mean??

earnest phoenix
#

@spiral veldt No

#

you can remove reactions from individuals

#

you don't have to clear them

spiral veldt
#

Okay good.

earnest phoenix
#

or are you thinking a line in code

dusky lagoon
#

already fixed it

sacred palm
#
 {
 "imgMemes": {
"aggressive": "https://media3.giphy.com/media/3o7WTOv81ONBE7413O/giphy.gif",
"banana": "https://thumbs.gfycat.com/ImpressiveSomeFieldmouse-size_restricted.gif",
"bear": "https://media1.giphy.com/media/PaiePPzQ8AtCU/giphy.gif",
"best": "https://i0.wp.com/media2.giphy.com/media/9Xh1CGm4Hzo4g/giphy.gif",
"bird": "https://64.media.tumblr.com/064bea4abbfb10531ef60c5226c4c6e3/tumblr_inline_pat02nBUoV1vu12yv_500.gif",
"birthday": "https://media1.tenor.com/images/bac81fca76a33e709530cafa60a6a75b/tenor.gif?itemid=5476259",
"bite": "https://media1.tenor.com/images/c91f7e6ca3f5c157c5e6f6e4ea2e364c/tenor.gif?itemid=7748718",
"blush": "https://thumbs.gfycat.com/PossibleNextGoshawk-size_restricted.gif",
"boom": "https://media2.giphy.com/media/laUY2MuoktHPy/200.gif"
}
}

So... this is a part of my memes.json that sends a gif image for every keyword. Is there any chance that i may transform to select random from multiple images for same keyword ?

earnest phoenix
#

make imgMemes an array of objects instead of an object

#

although that should be hardcoded anyways

#

i dont get the point of using json for that

#

using require caches the file so there's no point, and reading the file manually on every command is so unperformant it hurts my soul

#

Yea but json support arrays so you can put an array and put your links in there and get a random one instead of just one link as you put there

sacred palm
#

me 0 - 3 python ... that s why json

earnest phoenix
#

oh

#

py

#

make it a dict

#

in code

#

there's no point in using json

sacred palm
#

the entire bot is on discord.js, i started from a github base bot of discord.js

earnest phoenix
#

what

#

you just-

#

you just said python

sacred palm
#

i said that s why i choosed json

earnest phoenix
#

huh??????????

#

What

sacred palm
#

what ?

earnest phoenix
summer acorn
#

ok this may sound stupid, but how do I connect mongodb to a vps. I've been trying to connect mongodb compass to a vps for like 3 hours, and I just keep getting errors like

Error creating SSH Tunnel: (SSH) Channel open failure: Connection refused
Error creating SSH Tunnel: connect ECONNREFUSED <ssh ip>:27017 - Local (0.0.0.0:29250)
Error creating SSH Tunnel: connect EADDRINUSE <ssh ip>:22 - Local (0.0.0.0:29250)

https://cdn.discordapp.com/attachments/734520305145479198/740669693941252237/unknown.png
https://cdn.discordapp.com/attachments/734520305145479198/740669701020975144/unknown.png
third time I ask. I've been having this issue for ages. I've tried when connected through SSH with bitvise, and when not. I just can't figure out why it is like this. The error I am mainly getting is EADDRINUSE

sacred palm
delicate zephyr
#

make sure its listening on 0.0.0.0 aprixia

#

@summer acorn ^

summer acorn
#

uh, I don't know how to do that

delicate zephyr
#

edit the config file

#

and check

#

its located at

#

/etc/mongo/ i cant remember the exact file name

#

hold on

#

ngl

#

@summer acorn /etc/mongod.conf is the file you wanna edit

summer acorn
#

alright, thank you ^^

delicate zephyr
#

this is what you wanna edit

summer acorn
#

oh

delicate zephyr
#

uh

#

uh

solemn latch
#

only a few syntax errors

delicate zephyr
#

use nano

#

or vim

#

pls

summer acorn
#

ok I didn't know what to use

delicate zephyr
#

do

#

sudo nano /etc/mongod.conf

summer acorn
#

ok there, now it was without errors

spiral veldt
delicate zephyr
#

ok there, now it was without errors
@summer acorn listening on 0.0.0.0 right

opal plank
#

oh god

#

i hate it

solemn latch
#

what is this font

finite bough
#

<message> is not s thing

opal plank
#

idk what the f that background , font, colors and opacity is

solemn latch
#

is this = or == or ===

opal plank
#

but i hate it

summer acorn
spiral veldt
#

It's whatever Kali Linux comes with

solemn latch
#

i cant even read whats going on

summer acorn
#

and yes, 0.0.0.0

delicate zephyr
#

now

#

sudo systemctl mongod restart

finite bough
#

@spiral veldt remove <>

#

in message

spiral veldt
#

Is that all I need to do?

summer acorn
opal plank
#

@spiral veldt would be nice if you posted an error or something rather then 'this nu work, pliz fix'

delicate zephyr
#

@summer acorn sudo service mongo restart

opal plank
#

what are you expecting to occur? whats happening?

finite bough
#

it might be all but let's go step by step

spiral veldt
#

Okay no errors now. Let's hope this works

summer acorn
delicate zephyr
#

aprixia

#

I changed the command entirely

summer acorn
#

oh

delicate zephyr
#

replace systemctl with service

summer acorn
#

I didn't see

delicate zephyr
#

its cool

spiral veldt
#

Okay so that didn't do a cooldown at all.

summer acorn
delicate zephyr
#

now try mongod

#

xD

summer acorn
#

lmfao

delicate zephyr
#

i forget if its mongo or mongod

#

i use docker

#

so

summer acorn
#

ok no output now, I think that is good

#

I am like entirely new to vps

delicate zephyr
#

fair

summer acorn
#

all I know is just how to start, stop, restart, upload, and code a bot

#

I don't know any terminal stuff

opaque seal
#

Does someone have an example of an event handler?

summer acorn
#

heyyy I was finally able to connect now

#

Thank you, Luke! ^^

delicate zephyr
#

No problem

#

feel free to shoot me a dm if you need more help

#

i'll happily explain / show you how commands work

summer acorn
#

Sure will ^^
I will definitely need a lot of help in the future with using a VPS properly ^^

tight plinth
#

@quartz kindle So i want to do logs wth my disord.js-light v2 bot, and i have a problem with the messageDelete event: 95% of the properties of the message that the event returns is undefined (I can't get channel name, author is just an empty object and worst of all, the message content is undefined). Any idea of what i can do against it? the GUILD_MESSAGES intent is enabled

#

and ofc i cant fetch a deleted message

quartz kindle
#

there is no way to get deleted messages if you dont cache them beforehand

#

if you want to make a logging bot, i suggest you use a database to store messages

tight plinth
#

hm

#

ok

slender wagon
#

Or simply make a discord channel to store the logs

tight plinth
#

gonna store them in a temporary map i guess

#

yep it works that way

#

ty

quartz kindle
#

you can do that, but rip your ram

misty sigil
#

uses d.js-light

#

proceeds to use more ram

quartz kindle
#

well, its still gonna be less ram than djs

#

xD

misty sigil
faint prism
#

So this might be a bit dumb, but I'm struggling to find the correct object that implements ISocketMessageChannel.
await context.Channel.SendFileAsync(stream, fileName, embed: embed);
This will send on the channel the command was recieved from, but I was to specify the channel. I see the GetChannel(ulong id), but it doesn't have the SendFile.. I might just be missing something obvious @earnest phoenix

earnest phoenix
#

cast

faint prism
#

lmao

#

i got it

quartz kindle
#

cast a spell

faint prism
#

I never use this as that

#

context.Client.GetChannel(id) as IMessageChannel

earnest phoenix
#

yup, that's correct

faint prism
#

I need to look more into that keyword

#

It does some magic

earnest phoenix
#

you can also cast to socket variants safely, cached channels are always going to be a Socket variant

faint prism
#

It seems like it just specifies which interface you're targeting that was inherited

pure lion
#

Sup

opaque seal
#

I've got this code to store my events, how do I make them run now?

// Events
const events = new Discord.Collection();

fs.readdir('./events/', (err, files) => {
    if (err) return console.error(err);
    files.forEach(file => {
        if(file.endsWith('.js')){
            const event = require(`./events/${file}`);
            events.set(event.name, event);
        }
    });
});```
quartz kindle
#

you dont need to store then, you need to bind them

opaque seal
#

oh

faint prism
#

Woah that looks badly formatted

pure lion
#

So I keep getting "SSL protocol error" on my peerjs app even though I'm passing in the cert and key

opaque seal
#

client.on(name, event.bind(null, client)); like that?

tight plinth
#

you can do that, but rip your ram
@quartz kindle i mean, there is no way to me to not use ram (and storing messages in a real db is a big nono)

quartz kindle
#

something like that yes

#

@tight plinth this is what dbs are designed for

#

storing things that you dont need to access in real time

tight plinth
#

i mean

#

i'll not store them forever

quartz kindle
#

ofc not

tight plinth
#

and im too lazy to write a script to delete messages from the db if they are 30+ days old

quartz kindle
#

but since you're not using them most of the time, you're just storing them for a specific rare occasion, a db is much better for it

tight plinth
#

ram usage by storing them into a temporary map or cpu usage by doing a lot of db calls, my choice is quick

quartz kindle
#

well, considering my bot uses 1% cpu and 10% ram, not a hard choice for me either

tight plinth
#

1% cpu but it can still lag a lot for no reason

quartz kindle
#

thats on discord

#

not us

opaque seal
#

Should this work?

// Events
// Get all the events file
const events = requireAll({
    dirname: './events',
    filter: /^(?!-)(.+)\.js$/,
});
// Prevent duplicate listeners
client.removeAllListeners();

for (const name in events) {
    const event = events[name];
    client.on(name, event.bind(null, client));
}```
faint prism
#

Alright. Now to find the link that the SendFileAsync() posts

quartz kindle
#

also, there are several databases that are designed for that purpose, like time series dbs

#

fast and efficient permanent writing, and even automatic delete on expiration

pure lion
#
const peer = new Peer({
    port: 9000,
    path: '/'
});
// client side
let key = fs.readFileSync('/etc/letsencrypt/live/ale-bot.xyz/privkey.pem')
let cert =  fs.readFileSync('/etc/letsencrypt/live/ale-bot.xyz/cert.pem')

const peerServer = PeerServer({
    port: 9000,
    ssl: {
        cert: String(cert),
        key: String(key)
    },
    proxied: true
})
// server side

idk what im doing wrong here

quartz kindle
#

the kind of databases actual logging systems use

tight plinth
#

i mean, i can do what i want soo

quartz kindle
#

sure

#

just responding to your response to my suggestion :3

#

@pure lion ssl is terminated in nginx

#

you dont need ssl in node

pure lion
#

oh

#

so get rid?

quartz kindle
#

yes

#

your setup should be like this

#

internet <-https-> nginx <-http-> node

amber fractal
#

why is d.js's collection clone a shallow copy mmLol

#

I had so many issues with editing the clone and it editing the old one I was so confused

quartz kindle
#

object cloning is a mess

pure lion
#

tim, now getting timed out err

quartz kindle
#

is the port correct? in nginx as well?

amber fractal
#

I just ended up making a new collection, looping over the old one and setting the collection stuff. I was working with permissions and I didnt want to make multiple api calls to update the permissions

pure lion
#

is the port correct? in nginx as well?
its port 9000 at client and server (how do i enable through nginx uwu)

quartz kindle
#

if all else fails, you can always JSON.parse(JSON.stringify()) :^)

amber fractal
#

I tried that

#

it gave me undefined => undefined

faint prism
pure lion
#

what

#

oh nice

faint prism
#

The link however isn't correct... I need add some logic for getting the link it just posted.
Any suggestions? If this command executes a lot, I don't want it to grab the wrong link. Maybe a Guild ID in the message in the hosting channel?

pure lion
#

push the channel ID/a timestamp or something to a map and as the key and the value as the link, then get when needed?

quartz kindle
pure lion
#

oh

#

can i just do /

quartz kindle
#

then you access https://ale-bot/peer

pure lion
#

because is a dynamic URI element

quartz kindle
#

and it will link to your node port 9000

#

with ssl and everything

pure lion
#

which file is this again

quartz kindle
#

your wbesite.conf file

pure lion
#

also the url looks like this

#

so whats the paaaaaath

quartz kindle
#

is that like a uniqueid url?

#

that peerjs generates?

pure lion
#

yeah

quartz kindle
#

does it accept a path prefix?

pure lion
#

um

quartz kindle
pure lion
#

yep

quartz kindle
#

so for example

#

you set the path to /peer

pure lion
#

nginx: [emerg] "proxy_pass" directive is duplicate in /etc/nginx/sites-enabled/ale-bot.xyz.conf:26

#

ran test

quartz kindle
#

are you running other things on this node.js server?

pure lion
#

nope

quartz kindle
#

are you gonna run other things on your website?

pure lion
#

not at the moment