#development

1 messages · Page 1378 of 1

tardy dove
earnest phoenix
#

like an extension

solemn latch
#

I would think the nodejs dev team would handle that

earnest phoenix
#

actually exactly like an extension

#

how do you make extensions

#

ill look it up

#

@solemn latch could u help me with my time issue

solemn latch
#

lmk what you come up with. I currently dont think its possible

earnest phoenix
#

u said in a min

solemn latch
#

yeah was trying to get into a good position

#

hecking warthunder

sudden geyser
#

Cthulhu, I don't think you understand. Intents.default() does not enable presence or member data. You won't get it unless you enable it through your source code, not the toggleable buttons on the dashboard.

For example, discord.Intents(members=True) would enable member data.

earnest phoenix
#
msg.author.send(`\n> Byte Memory Usage: ${process.memoryUsage().heapUsed}\n> Bot Uptime:\n> Seconds: [${Math.floor(bot.uptime/1000)}]\n> Minutes: [${Math.floor(bot.uptime/1000/60)}]\n> Hours: [${Math.floor(bot.uptime/1000/60/60)}]\n> Days: [${Math.floor(bot.uptime/1000/60/60/24)}]`);```
#

alright so i got this

#

and I want the values to reset

#

after they reach the max

#

so seconds 60, minutes 60, hours 24, and days can go on

grizzled raven
#

@earnest phoenix how bad? cause i have no choice but to do that until i finish rewriting my bot

earnest phoenix
#

so instead of this

#

it might say like

sudden geyser
#

@earnest phoenix use the modulo operator

livid lichen
#

const MutedRole = msg.guild.roles.catch.get(MutedRole => MutedRole.Name === "Muted"); (node:7588) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined

earnest phoenix
#

what scale are you planning on using it on @grizzled raven

grizzled raven
#

wdym? i'm just gonna have 2 clusters meaning 2 connections

earnest phoenix
#

@sudden geyser how would i use it

livid lichen
#

Anyone know what I am doing wrong?

earnest phoenix
#

no no like, at what scale, how many guilds / queries a second (or a minute)

sudden geyser
#

Like, bot.uptime / 1000 / 60 % 60 would make it wrap around so it never goes above 60

#

If I have 53 and do 53 % 5, it wraps back to 3.

grizzled raven
#

yeah i've no idea

#

but i'm at 11k guilds

earnest phoenix
#

but i want it to reset if it gets > 60

#

ooooof

#

no sqlite can't handle that

grizzled raven
#

yeah i'm screwed

earnest phoenix
#

not just clamp

sudden geyser
#

and that's what the modulo operator will do? I don't understand

earnest phoenix
#

sqlite starts choking at around 150 guilds normally using the bot on exponential growth

grizzled raven
#

i think i'll just keep my bot offline for a few weeks

earnest phoenix
#

@sudden geyser ok ill look into it

grizzled raven
#

might just give up i don't even know tbh

earnest phoenix
#

i realized a long time ago that public bot development is not worth it lol

#

maybe only for the experience

grizzled raven
#

i like doing it

#

it's just i make stupid mistakes

solemn latch
#

if this was a movie someone would say "mistakes are what makes us human"

grizzled raven
#

i'm happy with what im making, although it's one of my first ever coding projects, hence why it's a mess

sudden geyser
#

const MutedRole = msg.guild.roles.catch.get(MutedRole => MutedRole.Name === "Muted"); (node:7588) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
@livid lichen there's no property called .catch on RoleManager: https://discord.js.org/#/docs/main/stable/class/RoleManager

To go along with that, .get (which will likely be used on a Collection) does not take a function. You're most likely looking for .find

To add even more fuel to the flames, .Name is not a property on a Role

earnest phoenix
#

granted, if you're out of education and are looking for a job, a big bot can be your entry to one

boreal iron
#

Mistakes? You mean happy little accidents :bob_ross_emoji_doesnt_exist_here:

earnest phoenix
#

i know a guy who mentioned statistics of his large bot on his CV and that got him the job KEKW

wicked pine
#

Abi guys solve the problem of the botuptime the right to slow orders

grizzled raven
#

lmao

#

well

#

i'll figure it out

livid lichen
#

@livid lichen there's no property called .catch on RoleManager: https://discord.js.org/#/docs/main/stable/class/RoleManager

To go along with that, .get (which will likely be used on a Collection) does not take a function. You're most likely looking for .find

To add even more fuel to the flames, .Name is not a property on a Role
@sudden geyser I used .find but it caused an error once again. Would you like me to say the error?

sudden geyser
#

did you fix the first one

livid lichen
#

Yeah, thanks.

drifting wedge
#

How would I get text from a text box and show it in live time in like a body tag html

sudden geyser
#

then swapping .get for .find should also work

cerulean mason
#

livid lichen
#

TypeError: msg.guild.roles.find is not a function @sudden geyser.

sudden geyser
#

You didn't fix the first issue. You just removed it.

.catch is not a property, and a manager does not hold the collection of data. On the docs, the .cache property has the actual data (a collection of roles).

livid lichen
#

@sudden geyser So I should include .catch in the roles part?

earnest phoenix
#

msg.author.send(`**${'\\*'.repeat(75)}**\n> Byte Memory Usage: ${process.memoryUsage().heapUsed}\n> Bot Uptime:\n> Seconds: [${Math.floor(bot.uptime/1000) % Math.floor(bot.uptime/1000)}]\n> Minutes: [${Math.floor(bot.uptime/1000/60) % Math.floor(bot.uptime/1000/60)}]\n> Hours: [${Math.floor(bot.uptime/1000/60/60)}]\n> Days: [${Math.floor(bot.uptime/1000/60/60/24)}]**${'\\*'.repeat(75)}**`);

sudden geyser
#

No, I said you should change it.

earnest phoenix
#

ok now after it gets to 60 it no longer displays anything

#

i wanted it to reset

livid lichen
#

No, I said you should change it.
@sudden geyser What should I change it to though?

earnest phoenix
#

@sudden geyser ur method didnt work

snow urchin
sudden geyser
#

@livid lichen like I said,

.catch is not a property, and a manager does not hold the collection of data. On the docs, the .cache property has the actual data (a collection of roles).

So, you should change it to .cache

#

@earnest phoenix because you didn't use it correctly. bot.uptime / 1000 % 60 would (hopefully) work in this situation.

livid lichen
#

Oh my. How stupid can I get for thinking .catch and .cache is the same thing. I thank you, but I am left with one final question; Should I put .cache before or after .roles?

sudden geyser
#

.roles is an instance of RoleManager, and .cache only exists on managers. So, no, you'd put .cache after .roles

It's easier to understand the order and how to access your properties and call your methods when you learn the principals of object-oriented programming.

livid lichen
#

Understood. I highly appreciate your help @sudden geyser.

static oyster
#

God wondering does anyone know how to fix arbitrary file overwrite for fstream and unzip packages, they're both fully up to date

earnest phoenix
#

when editing files using ActiveXObject()

#

wait

#

nvm

gaunt atlas
#

I am making a music vid. if u wanna porticipate pls DM me (u need roblox) more info later

solemn latch
#

not really development related but okay

snow urchin
#

why is user.send returning "The user aborted a request" error for me?

opal plank
#

multiple reasons

#

bad internet
being the most likley of them

#

or the script halting

#

for whatever reason

snow urchin
#

it happens locally and on a vps with 10 gig up down

opal plank
#

iirc its when something takes more than 15 seconds to finish

#

dont quote me on that though, i forgot the actual numbers

snow urchin
#

ye it usually happens after 15 seconds from running user.send

static oyster
#

God wondering does anyone know how to fix arbitrary file overwrite for fstream and unzip packages, they're both fully up to date

opal plank
#

do you get more than that though

#

you should be getting a proper stack trace

earnest phoenix
#

they're not printing it lol

#

they're swallowing the error

snow urchin
#
HTTPError [AbortError]: The user aborted a request.
    at RequestHandler.execute (/home/PreMiD/Discord-Bot/node_modules/discord.js/src/rest/RequestHandler.js:107:21)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 500,
  method: 'post',
  path: '/channels/745960754875727883/messages'
}
earnest phoenix
#

500 status code

#

discord's side

#

nothing you can do about it

snow urchin
#

...

earnest phoenix
#

5xx errors aren't your fault and you can't do anything about them, they're server side errors

snow urchin
#

Well.... discord can't just stop our bot from being able to send dms

quartz kindle
#

they can lol

opal plank
earnest phoenix
#

yes they can

#

it's their platform

#

lol

snow urchin
#

ok yes they can, but why LOL

earnest phoenix
#

no idea

#

it may just be an actual error

opal plank
#

99.9999% sure its only ur bot

#

bots should still be able to dm freely

earnest phoenix
#

ok i feel like it's discord having a stroke because did yall see the delay on that embed

opal plank
#

sweats in mass dm

quartz kindle
#

when is discord not having a stroke

snow urchin
opal plank
#

@quartz kindle i have the answer for that

snow urchin
#

Yes, PreMiD bot mass dms!111!!!!11!

opal plank
#

when its completely down mmulu

#

the 2 discord states

quartz kindle
#

having a stroke and dead from a stroke

opal plank
#

Full downage
Having Stroke

#

im fairly certain downage is a thing, even though it should be outage

snow urchin
#

maybe its the code because it doesnt work on our test bot too haha

blissful coral
#

What does a 502 Bad Gateway error usually come from in code

earnest phoenix
#

what does that question even mean

#

oh

blissful coral
#

Getting that when sending a webhook test

#

To my endpoint

earnest phoenix
#

you misconfigured your http server

livid lichen
#

TypeError: Cannot read property 'roles' of undefinedif (UserToMute.Member.roles.has(MutedRole.id)){

#

Didn't work.

earnest phoenix
#

code is case sensitive

#

Member is not the same as member

livid lichen
#

Crap.

#

Thanks.

#

Uh oh... it didn't work.

#

@earnest phoenix I got the same error.

earnest phoenix
#

is your UserToMute a user object

livid lichen
#

const UserToMute = msg.guild.member(msg.mentions.users.first()) || msg.guild.members.cache.get(Arguments[0]);

earnest phoenix
#

your object is already a member

#

read your code

livid lichen
#

My oh my. I have -10 brain cells :/

earnest phoenix
#

it happens to the best of us

livid lichen
#

Lol

#

@earnest phoenix Different error. TypeError: UserToMute.roles.has is not a function.

earnest phoenix
#

i'm guessing you're using djs v12

livid lichen
#

Yeah

#

I forgot to use cacht didn't i

earnest phoenix
#

yup

livid lichen
#

Frick

#

welp

#

TypeError: Cannot set property '687735736384225288' of undefined

quartz kindle
#

Bot.muted is undefined

livid lichen
#

Oh.

blissful coral
#

Listening to 8080 using express

earnest phoenix
#

what happens if you hit the endpoint manually

blissful coral
#

Ummm

#

Let's see

#
const app = express().use(bodyParser.json()); // creates http server

app.listen(8080, () => console.log('Listening'));
earnest phoenix
#
const fs = require('fs');

let jsonData = require('./list.json');

console.log(jsonData.id1); //{warnings: 1}

let id2 = {
    "warnings":1
};

let data = JSON.stringify(id2);
fs.writeFileSync('list.json', data);

console.log(jsonData.id1); //{warnings: 1}
console.log(jsonData.id2); //undefined```
#

im trying to learn how to do data stores

#

but id2 is "undefined" when called

#

why is that?

quartz kindle
#

jsonData is a variable containing list.json

#

then you overwrite list.json with data

#

this doesnt affect the jsonData variable

earnest phoenix
#

yeah i just realized

#

it created a new file

umbral zealot
#

oh god don`t use json as a database

#

for the love of all that is holy

blissful coral
#

plz

earnest phoenix
#

then what do i use

blissful coral
#

mysql

#

mongodb

quartz kindle
#

i mean

blissful coral
#

anything but json

quartz kindle
#

let him experiment

earnest phoenix
#

whats wrong with json

#

tell me whats wrong

umbral zealot
#

sqlite, nedb, kev

blissful coral
#

it is prone to corruption

unique nimbus
#

It corrupts

umbral zealot
#

Why shouldn’t I use a JSON file as a database?

A JSON file is not suitable for use as a database for several reasons.

Firstly, you will incur a major performance hit as you need to read from and write to the file on each query and modification. This brings a major performance impact especially when the amount of data increases.

Second, you cannot concurrently write to a JSON file - only one write can be performed at a time. This is part of what causes the performance impact, but perhaps more importantly may introduce unexpected results and even file corruption.

JSON files are also human readable and easily accessible by end users. This means that your database and application will be vulnerable to attacks, especially as database reads are rarely checked for malicious code (Which usually happens on write).

What should I use instead?

An actual database, to put it bluntly. SQL, NoSQL, whatever takes your fancy. Some SQL databases are SQLite, PostgreSQL and MariaDB, while NoSQL databases include things like MongoDB, RethinkDB, ArangoDB and many more. If you want the easy way out, check out Enmap.

What can I use a JSON file for?

JSON files are best used to store static data, in other words data that doesn’t need to change often or programmatically. In practice, this means configuration and other application data that needs to be defined by a human - which is what JSON excels at.
jsondb jsonisnotdb jsonisnotadb dbjson nojson

unique nimbus
#

@quartz kindle Please sir, why is my database corrupted, I use txt files

quartz kindle
#

it doesnt corrupt out of nowhere, it just doesnt have all the protections that regular databases have

unique nimbus
#

yea

quartz kindle
#

so it requires a lot of extra care to do it right

blissful coral
#
const app = express().use(bodyParser.json());

app.listen(8080, () => console.log('Listening'));
#

Anyone know?

umbral zealot
#

looks like there's nothing running on port 8080 on that machine

#

¯_(ツ)_/¯

blissful coral
#

hmmm

unique nimbus
#

is port 8080 open

umbral zealot
#

Is it on the same machine

blissful coral
#

No

unique nimbus
#

Are you the father?

#

I mean

umbral zealot
#

and not in some weird-ass docker setup?

blissful coral
#

using ngrok

#

Basically creates a domain and then sends whatever it gets to the localhost port you give it

umbral zealot
#

no I'm asking if ngrok is running on the same machine as the express server.

blissful coral
#

Yes

#

It is

umbral zealot
#

And neither of them are in any sort of VM or docker or anything?

blissful coral
#

No

umbral zealot
#

does it log listening in the console?

blissful coral
#

Yes

earnest phoenix
#
var con = mysql.createConnection({
  host: "localhost",
  user: "yourusername",
  password: "yourpassword",
  database: "mydb"
});```
blissful coral
earnest phoenix
#

i dont understand how you use these parameters

#

like

#

is it just whatever i want

#

or does it want my ip

#

or something

blissful coral
#
const mysql = require("mysql");

const pool = mysql.createPool({
    host: 'localhost',
    user: 'root',
    password: 'yourpassword',
    database: 'yourdatabase',
    charset: 'utf8mb4'
})

module.exports = pool
#

Make a external file

#

and make a pool instead

quartz kindle
#

mysql is a fully featured database server, you need to install and run mysql separately. that code is only for connecting to a mysql server

#

@earnest phoenix

blissful coral
#

Then just call that file with a constant and go from there

#

@umbral zealot Whatcha thinking?

earnest phoenix
#

so then how do i make a mysql server

blissful coral
#

Does ngrok.exe have to run in the same file directory as the bot?

umbral zealot
#

my question is

earnest phoenix
#

i already got it installed

umbral zealot
#

Because that particular log indicates the express server is started.

blissful coral
#

I changed it from listening to that.

umbral zealot
#

hmm

blissful coral
umbral zealot
#

Ok let's try something, can you try running wget http://localhost:8080/ on your vps?

earnest phoenix
#

me?

blissful coral
#

sure

#

no

#

Connection refused

earnest phoenix
#

ok so

#

someone told me to make a file pool

#

what type of file do i make it

umbral zealot
#

then it's not running on that machine.

earnest phoenix
#

and how do i edit that pool

blissful coral
#

It may be file directory then

#

Let's see

earnest phoenix
#

is there any easier solutions to mysql

#

it makes no sense

blissful coral
#

sqllite is easy to learn

umbral zealot
#

@earnest phoenix if you want the dead-simple solution, https://enmap.evie.dev/ is what you want

earnest phoenix
#

something that u do in js itself

blissful coral
#

ah yes enmap

#

You do it in js

#

lol

umbral zealot
#

Enmap is bae, it's what you want.

earnest phoenix
#

is it reliable

blissful coral
#

Alright we gon try this evie

umbral zealot
#

Disclaimer: I wrote it, I'm biased, but 1.3 million downloads don't lie.

blissful coral
#

Moving ngrok to my bot directory

umbral zealot
#

No I don't think this is a directory problem

blissful coral
#

Only thing it can be

umbral zealot
#

I think the server is either not running on that port or it's shutting down right away

blissful coral
#

ngrok is in my bin of the VPS and the bot is in the root

#

Is there a listener for when it shuts down

umbral zealot
#

yeah but this isn't to do with ngrok

#

you literally just did a localhost ping and it fails

#

Nothing is running on that machine on port 8080

blissful coral
#

hmm

#

But is there a way to log when it stops

earnest phoenix
#

does this mean its downloaded

#

or downloading

umbral zealot
#

I'm not sure, I've never had an express server needing to dhut down

blissful coral
#

Something to do with the vps because when I do it locally on my pc it works fine

umbral zealot
#

you missed the entire first part of this.

earnest phoenix
#

npm i -g --add-python-to-path --vs2015 --production windows-build-tools

#

im not using python

#

im using js

umbral zealot
#

you are

earnest phoenix
#

im using js

umbral zealot
#

just... follow the damn instructions

blissful coral
#

Dude

#

It uses python

umbral zealot
#

python is necessary to build the better-sqlite3 binaries.

earnest phoenix
#

but what do i put there?

blissful coral
#

For JS

earnest phoenix
#

im not using python

umbral zealot
#

Literally. READ. THE. INSTRUCTIONS

blissful coral
#

You do not understand how making these works

umbral zealot
#

why is it so goddamn hard.

blissful coral
#

Not every js lib is made in JS

#

They are made in python, ts, js, c# and a lot of others

earnest phoenix
#

bruh this is hard to understand ill just learn sql

umbral zealot
#

python is necessary to build the better-sqlite3 binaries.

blissful coral
#

This one uses python

earnest phoenix
#

atleast sql can be downloaded in 1 line and i dont need to install 10000 things

umbral zealot
#

mysql will require you to install and configure a mysql server.

blissful coral
#

Ima leave now

#

LMAO

earnest phoenix
#

ok then ill do sql lite

umbral zealot
#

SQLite will require you to build the binaries. With python and the C++ build tools

solemn latch
#

databases are work

earnest phoenix
#

then ill just use json

blissful coral
#

Just let him learn

#

LMAO

earnest phoenix
#

if json is unreliable then why is it literally built into discord.js

umbral zealot
#

Then you'll lose data, like a moron. Fine, have fun with it, I'm not going to help you load the shotgun you're going to shoot yourself in the foot with.

#

It's not.

solemn latch
#

a decent json storage is more complex than any proper database.

blissful coral
#

@umbral zealot HOW DO I RESTORE MY JSON DATABASE IT CORRUPTED!!!

umbral zealot
#

discord.js does not save data in json files

earnest phoenix
#

looks like json to me

blissful coral
#

Oh my god

umbral zealot
#

first, that's not discord.js, that's nodejs doing it

blissful coral
#

You do know that package json files are not discord js?

solemn latch
#

package files are not dynamic storage.

earnest phoenix
#

even better

blissful coral
umbral zealot
#

second, it's not a database, it's literally a package configuration file

earnest phoenix
#

node js is a larger software

#

and clearly they trust it

blissful coral
#

Dude please learn exactly what you are talking about before you attempt to argue with the ones who know what they are doing

solemn latch
#

they dont handle thousands of changes an hour

umbral zealot
#

Alright dude, you're clearly stubborn and arrogant and know better, I bow down to your Dunning Krueger god, Have Fun.

earnest phoenix
#

yo discord.js does use it

umbral zealot
#

Not like I've been working with javascript for 20 years.

blissful coral
#

Dude

#

And look inside that package

solemn latch
#

static json files are not the same as dynamically editing them

earnest phoenix
#

ur not 30+

blissful coral
#

Wanna know what is in it?

#

Info about discord.js and its dependencies

#

and nor are you

earnest phoenix
#

never said i was

#

or implied it

umbral zealot
#

I'm almost 40 years old, I've been doing javascript longer than you've been alive, and I'm telling you do not use json as a database

blissful coral
#

Then don't make a comment you can't even live up to

#

Can confirm

umbral zealot
#

Don't be a little pest and listen when the adults tell you to do something.

earnest phoenix
#

ok so if someone said "i jumped in a volcano and lived" i cant argue with that

#

because i havent done it myself

#

got it

umbral zealot
#

It takes all of 5 minutes to run the commands required to use sqlite.

#

You are literally given the exact step by step instructions to make it work

#

It's not hard, at this point you don't even need to think about it you just need to follow instructions.

earnest phoenix
#

what do i replace add python to path too

umbral zealot
#

in an admin command prompt or powershell

#

you do'nt replace anything

earnest phoenix
#

ok ill run that

umbral zealot
#

you literaly just follow, to the letter

blissful coral
#

Your working on installing a database while we are the ones making the databases and creating the stuff that makes the stuff you use work.

#

We are the ones who keep guides up to date and make sure there are no errors in them

#

No need to try and argue with us

earnest phoenix
#

bruh u didnt make enmap

umbral zealot
#

I did.

earnest phoenix
#

no u didnt

blissful coral
#

Sorry did I say I did?

#

Yes he did

earnest phoenix
#

yes you did

#

We are the ones who keep guides up to date and make sure there are no errors in them
@blissful coral

umbral zealot
#

I am literally, the author of enmap

earnest phoenix
#

we*

#

wait really

blissful coral
#

Never said I made enmap

earnest phoenix
#

you said we

blissful coral
#

I am making another database rn

earnest phoenix
#

which explicitly implies it

blissful coral
#

we as in developers that are making databases

#

Never said the same one

umbral zealot
#

What they said is that we are the ones with the knowledge, you're not, and you should really learn to listen to people that are more knowledgeable.

blissful coral
#

Jesus why do people argue with us when we know what we are talking about evie

#

I don't get it sometimes

umbral zealot
#

especially when they're actually asking for help and we're working hard to help them

#

it's infuriating.

#

I rarely lose my cool these days, but Tylers... man, they're the exception.

earnest phoenix
#

oh crap you did make it

#

nice job man

blissful coral
#

...

#

I give up

earnest phoenix
#

i found that discord on da website

#

so

umbral zealot
#

Man I ain't sus, aight? 😂

blissful coral
#

Also, evie I figured out the problem for some reason when I put it into the bin it was not actually turning into a command so it was making me do it through a file in the root that wasn't the bot file which was making it not run on the bot for some reason and was not recognizing it

#

I do not know why it did that at all I am gonna reach out to ngrok and galaxygate about it

earnest phoenix
#

ok ill try to download the thing

blissful coral
#

Prob should go with a dockerfile tbh

umbral zealot
#

"put it in the bin"... Thonk

solemn latch
#

its kinda nice knowing the people who make libs.

umbral zealot
#

sounds like you have a complex setup there

blissful coral
#

src/bin

#

Idk

#

I don't even know what I did wrong

quartz kindle
#

recycle bin

blissful coral
#

lulw

#

I fixed it tho so

#

¯_(ツ)_/¯

opal plank
#

am i the only one who doesnt use docker even though i know how to use it?

quartz kindle
#

why do you need ngrok tho? trying to hide your ip?

blissful coral
#

I never understand why it doesn't work and I never understand why it starts working

solemn latch
#

i dont know how to docker

blissful coral
#

@quartz kindle until I get a domain

#

I am currently testing so haven't set any of that up yet

quartz kindle
#

ye but you can just use your ip

opal plank
#

just use localhost mmulu hiding ip 101

blissful coral
#

Ah true

#

Then I don't have to go through ngrok being a BITCH

quartz kindle
#

xD

blissful coral
#

Fuckin annoying as hell

#

Docs aren't helping cuz they are outdated to the version

opal plank
#

@sly wing report to a mod, not here

blissful coral
#

Dm a mod

#

Whoever sent that

#

LMAO

opal plank
#

i think they got kicked

blissful coral
#

They still here for em

#

me

opal plank
#

nope, they simply left

earnest phoenix
#

@umbral zealot i can only find c++ for visual studio 2017

blissful coral
#

Alright now that I switch to my IP IT WORKS

earnest phoenix
#

not vsc

opal plank
#

oh they back

blissful coral
#

Holy

earnest phoenix
#

whos back

blissful coral
#

Guys...

earnest phoenix
#

what

#

i never left

blissful coral
#

Whos gonna tell him...

opal plank
#

wasnt talking about you

earnest phoenix
#

i thought u said u gave up

#

go bother another js beginner trying to learn how to do a database

blissful coral
#

sometimes I change my mind ¯_(ツ)_/¯

#

not really bugging anyone

earnest phoenix
#

you're bugging me

opal plank
#

dude can you just chill the f out?

blissful coral
#

You should know though that installing a lib isnt installing something to vsc tho

opal plank
#

from everything ive seen in chat you've been nothing but toxic this whole time

umbral zealot
#

you don't need to find anything you just need to run the commands as indicated

earnest phoenix
#

Visual Studio C++ Build Tools

blissful coral
#

^

earnest phoenix
#

his installation literally says visual studio

sly wing
#

im gay

earnest phoenix
#

c++

blissful coral
#

@sly wing Nice

quartz kindle
#

@earnest phoenix you just need build tools

umbral zealot
#

Yes, it needs the build tools and python which are installed globally with the commands indicated.

quartz kindle
#

you can install them using npm

#

are you on windows or linux?

earnest phoenix
#

from everything ive seen in chat you've been nothing but toxic this whole time
@opal plank im being toxic because i started out just asking how to make a data base then they started being an asshole by being ignorant to the fact im new to js and i probably dont know how to do a database

umbral zealot
earnest phoenix
#

windows

#

i did

blissful coral
#

Doesn't mean you get toxic.

earnest phoenix
#

it gave me errors

umbral zealot
#

ok so what errors is it giving you

quartz kindle
#

what errors

blissful coral
#

Then show the error stack

earnest phoenix
quartz kindle
#

if something gives you errors, it doesnt mean you should give up, it means you should solve the errors lol

opal plank
#

replying toxicity with toxicity doesnt lead anywhere, be the better person and be courteous pls @earnest phoenix

quartz kindle
blissful coral
#

Read the 4th line from the bottom

#

You are not in a admin shell

quartz kindle
blissful coral
#

Like the site says

earnest phoenix
#

powershell vs admin shell

umbral zealot
earnest phoenix
#

whats the difference

#

oh u meant command prompt

blissful coral
#

The difference is obvious, one doesn't work the other does

opal plank
#

or powershell

umbral zealot
#

Yes. Command Prompt or PowerShell

opal plank
#

they're both terminals

blissful coral
#

Please read what it says fully and trust me, it will work.

umbral zealot
#

those are 2 different things and they do the same in the end for this purpose

blissful coral
#

Kind of how they work

quartz kindle
#

doesnt matter which one you use, as long as its in administrator mode

opal plank
#

^^

blissful coral
#

If it doesn't have admin it is useless in this case

opal plank
#

though im a powershell supremacist too

blissful coral
umbral zealot
#

At this point I even use the Terminal app

blissful coral
#

LOL

#

Question

#

What SSH clients do you guys use?

quartz kindle
#

i just use shift+rightclick open cmd here

opal plank
#

putty

quartz kindle
#

terminus

opal plank
#

or openssh

blissful coral
#

ok

#

currently using putty

earnest phoenix
#

ive been duing lua for 2 years and it is nothing like js so alot of these concepts i am 100% new too

blissful coral
#

Been lookin for a better option

quartz kindle
#

ever tried luvit? @earnest phoenix

earnest phoenix
#

i did

umbral zealot
#

I just connect to my VPS directly from vscode lol

quartz kindle
#

node.js is very similar to luvit

opal plank
#

^^

#

I just connect to my VPS directly from vscode lol
@umbral zealot this

blissful coral
#

I should try that ngl

earnest phoenix
#

i would rather learn from js

blissful coral
#

Never tried it

earnest phoenix
quartz kindle
#

@umbral zealot this
@opal plank this when saving/uploading files

earnest phoenix
#

@umbral zealot does this mean it finished or its still downloading

blissful coral
#

read the end of it...

opal plank
#

bruh using remote vsc ssh is a bliss

umbral zealot
#

just wait until it ends and goes back to the normal prompt

#

it may take a few minutes

blissful coral
#

Just like any npm package being installed

#

lol

earnest phoenix
#

usually u get a stack end message when the download is done @blissful coral

blissful coral
#

Yeah you right

opal plank
#

never again will i have to edit local configs with fucking Nano again in that crap @quartz kindle

quartz kindle
#

who uses nano

opal plank
#

i have wet dreams just thinking about not having to use nano anymore

blissful coral
#

LMAO

earnest phoenix
#

does notepad corrupt

blissful coral
#

??

earnest phoenix
#

txt files

blissful coral
#

.txt??

earnest phoenix
#

yes

blissful coral
quartz kindle
#

nothing corrupts by itself

#

they corrupt if you use them wrong

earnest phoenix
#

apparently json does

opal plank
#

notepad is an editor

quartz kindle
#

only if you use it wrong

blissful coral
#

Are you attempting to use .txt as a database

opal plank
#

json is the actual file

earnest phoenix
#

maybe

hushed axle
#

huhu how do I connect to ubuntu vps

blissful coral
#

yeah not really a good idea

umbral zealot
#

No, the point of JSON's corruption is when you do a lot of reading and writing, it's got nothing to do with editing it once

blissful coral
#

@hushed axle A SSH client

opal plank
#

i'd highly recommend using an ACTUAL database

blissful coral
#

please

hushed axle
#

Can you show me how huhu

opal plank
#

not a txt or json file

earnest phoenix
#

this download is slowing down my houses wifi everyone is mad at me lol

quartz kindle
#

my bot used to have a json database until like 1500 servers

umbral zealot
#

It's also not limited to JSON files - it can happen with any file that you try to read and write a lot to.

opal plank
#

unless you doing it for experience, dont fuck with that crap

hushed axle
#

It my first time using the ubuntuhuhu

blissful coral
#

Just install PuTTy @hushed axle

opal plank
#

it aint that simple

#

putty is just the client

#

you need to register ssh keys in the host too

blissful coral
#

Yea

#

Depends on your host

opal plank
#

which requires a fair bit of linux knownledge

hushed axle
#

Howhuhu

blissful coral
#

As to how

#

Who is your provider

opal plank
#

trust me, ask your provider

quartz kindle
#

trust me, im an engineer

opal plank
#

teaching someone how to setup ssh keys is NOT an easy task

blissful coral
#

trust me, I am smart

faint prism
#

yeah not really a good idea
@blissful coral SSH

blissful coral
opal plank
#

specially with 0 knowledge beforehand

hushed axle
#

huhu I buy in Vultr

faint prism
#

Whoops wrong quote

blissful coral
#

lulw

quartz kindle
#

many vps providers have options to setup SSH keys in their control panels

opal plank
#

you need to generate a token and then add it locally

earnest phoenix
#

my wifi download is 10 mbps would a rasberry pi 3 hog the internet?

quartz kindle
#

depends on what it does

faint prism
#

my wifi is 10 mbps would a rasberry pi 3 hog the internet?
@earnest phoenix depends on what you're doing with it

earnest phoenix
#

hosting a bot

#

thats like 15 mb

faint prism
#

Depends on the bot

quartz kindle
#

likely not

#

especially if you use intents

opal plank
quartz kindle
#

my bot hogs about 5kbps on average

#

at 5k servers

tired nimbus
blissful coral
#

My bot kills my vps lmao

#

at 15k guilds

opal plank
#

no one laughed at my joke, feels bad

blissful coral
#

it was chillin when discord had a message problem

faint prism
#

I don't get it

umbral zealot
#

@tired nimbus is your package perhaps in a namespace like @thing/packagename ?

quartz kindle
#

i had to hover over it and check the file name @opal plank lmfao

opal plank
#

what is that pic auger?

quartz kindle
#

hen tie

opal plank
#

^^

faint prism
#

Oooh

tired nimbus
#

yes I already navigated to the directory

umbral zealot
#

That doesn't answer my question

#

what's the package name you're trying to publish?

tired nimbus
#

no its not

umbral zealot
#

as in the name property in your package.json

#

what is it

tired nimbus
#

loomdatasimulator

opal plank
#

works fine

lavish flint
#

lol

blissful coral
#

that tbh

umbral zealot
#

and you've run npm login to get your proper npm username and password setup?

tired nimbus
#

yes

paper perch
#

Anyone want to play among us

umbral zealot
#

@paper perch wrong channel, darling

earnest phoenix
#

YO

#

its been like 10 minutes

#

does it normally take that long

solemn latch
#

🤔

quartz kindle
#

you have to wait until it says ALL DONE

umbral zealot
#

I've seen it take over 25 minutes

solemn latch
#

i need more redists

umbral zealot
#

so yeah be patient

tired nimbus
#

oh it could be because I used my alt email

solemn latch
#

missing 2011

umbral zealot
#

@earnest phoenix take that time to read the rest of the enmap docs, it'll be helpful real soon 🙂

quartz kindle
#

is there even a 2011 redist?

solemn latch
#

no idea

quartz kindle
#

you're missing 2007 and 2005

#

lmao

tired nimbus
#

yes now it has installed thank you

solemn latch
#

lol

#

guessing they mostly came from games

quartz kindle
#

@umbral zealot ever tried replacing discord.js collections with enmaps? xD

umbral zealot
#

That would be possible only if I added back a couple features that I've removed

#

like sort() and first()

quartz kindle
#

i was thinking about it a while ago

#

it would need a lot of prototype hacking

blissful coral
#

As you said your internet is like 10mbps

#

so

#

May take a bit

umbral zealot
#

Actualy it wouldn't, tim, if I just added those features back lol

earnest phoenix
#

@umbral zealot so did u write the bot in c++ or python

quartz kindle
#

no i mean

earnest phoenix
#

Not bot

umbral zealot
#

@earnest phoenix no, I didn't write in either of those. I'm using better-sqlite which was

earnest phoenix
#

I meant module

#

Oh

hushed axle
#

teridynono how do I put my password in the putty it doesn't let me write on it

umbral zealot
#

enmap doesn't use the build tools, it just uses something that does.

blissful coral
#

lul

pale vessel
#

:teridynono: how do I put my password in the putty it doesn't let me write on it
@hushed axle lmao

hushed axle
#

sorry it my first time using this 😦

quartz kindle
#

djs collections hold classes with specific prototypes, one would need to detect the class that it holds, and parse it correctly so it only saves the actual data to disk, and rebuilds the class when getting the data from the disk

pale vessel
#

wait what are you being serious

opal plank
#

:teridynono: how do I put my password in the putty it doesn't let me write on it
@hushed axle you only put password on the putty agent

hushed axle
#

who :/ ? me?

pale vessel
#

yes

hushed axle
#

yes 😦

opal plank
#

dont put password on putty

quartz kindle
#

SSH clients dont show the password when you type it, but it does work

opal plank
#

just add the key on puttyagent

umbral zealot
#

@quartz kindle what about just overwriting the import since d.js collections are now a separate library?

pale vessel
#

what tim said

umbral zealot
#

ezpz

opal plank
quartz kindle
#

@umbral zealot i mean, replacing djs's internal caches

#

so when you do client.guilds.cache.get(id) it gets from disk, nor from memory

umbral zealot
#

yeah I know, but d.js internal caches are @discordjs/collection so replacing them would be fairly easy

quartz kindle
#

yes, but they hold classes

umbral zealot
#

so does enmap

quartz kindle
#

you need to parse them and rebuild them

umbral zealot
#

Enmap has a serializer/deserializer feature

agile shuttle
#

how i make a embed

#

message

umbral zealot
#

I've saved "discord.js classes" like that, by simply serializing it as an ID

agile shuttle
#

somebbody can help me

quartz kindle
#

does it also serialize functions and methods?

#

and getters

blissful coral
#
const embed = new Discord.MessageEmbed()
.setTitle(`Hi`)
message.channel.send(embed)```
agile shuttle
#

that only??

earnest phoenix
#

I’m making a warnings system, a data base wold be appropriate right?

hushed axle
#

so when I open the putty I but the IP addres right?

umbral zealot
#

Doesn't need to, since all you need is to serialize as data => data.id and deserialize as data => client.<thing>.cache.get(data)

agile shuttle
#

how i make a embed
@agile shuttle how??

quartz kindle
#

not sure we're not the same page here lmao

blissful coral
#

I just sent you a code snippet

#

LMAO

quartz kindle
#

or at least im not following

agile shuttle
#

yes

blissful coral
#

wait

#

in what lang tho

#

and lib

umbral zealot
agile shuttle
#

but inly that

#

ahh thks

earnest phoenix
#

bro yall need to understand not everyone will learn and understand something the same way you do

#

Just sayin

blissful coral
#

Well we can't really explain it any better

#

Sorry

#

We don't speak beginner

umbral zealot
blissful coral
#

We give you what to learn and what we know

#

If you need more info look it up on MDN

umbral zealot
earnest phoenix
#

We don't speak beginner
@blissful coral that’s the problem. You think someone who’s just learning embeds is going to understand you’re way of talking?

umbral zealot
#

It's perfectly viable to replace a discord.js collection

blissful coral
#

I mean it was pretty simple

#

I give him the const to use

#

which is embed

#

as a example

#

I then show him to start a constructor with new

umbral zealot
#

@earnest phoenix dude you've already shown you're a hard, toxic client to please, don't start trying to whine about how we help others, it's not useful to your cause.

blissful coral
#

and then tell him to use the Discord lib and call the MessageEmbed constructor

#

Please do not tell us how to help other people

#

We aren't new to helping we know the best ways to help others

#

And it isn't by feeding them every single damn thing

umbral zealot
#

We have no manager, Karen, so we don't have to please you or anyone. We do our best to help. So just shush and let us do what we can.

#

goddamn tylers.

earnest phoenix
#

I don’t normally get this “toxic” as u call it. It’s just that you need to learn I’m new, and you shouldn’t be mocking my ideas because of it, it makes me annoyed

umbral zealot
#

You and ten thousand other "new" developers

#

You're not the first tyler we've had to deal with, you won't be the last.

blissful coral
#

You and the other 100s that are into coding due to covid or other reasons

earnest phoenix
#

Not true

blissful coral
#

or other reasons

earnest phoenix
#

Ive been doing lua for 3 years

#

2*

#

Not 3

umbral zealot
#

lol Covid has nothign to do with it, plenty of teens wanting to just learn JS or just shoveling code because they "just want a bot"

earnest phoenix
#

Way before COVID

#

and no

#

It’s because I would like to learn JavaScript

#

So I figured why not learn it an interactive way

solemn latch
#

one thing i think you have to understand is its really frustrating to try and teach concepts when people dont know the words for the concepts needed to know these other concepts.

blissful coral
#

And you are learning it for other reasons then

earnest phoenix
#

By making a bot

solemn latch
#

all code is interactive.

umbral zealot
#

@earnest phoenix point is buddy, you're coming through as very arrogant and entitled. You might have to re-adjust your behaviour when trying to receive help from others

blissful coral
#

You learn by doing

#

Also I suggest taking the time to learn all the basic concepts of js because we are using those along with our js knowledge to help you

earnest phoenix
#

You’re the one mocking my methods because I don’t know any better, if anyone you’re acting entitled

hushed axle
#

😦 can anyone help me how to connect to putty I am so confuse what to do

umbral zealot
#

I didn't mock your methods, I told you using JSON was wrong

earnest phoenix
#

Not you

#

The Pokémon guy

umbral zealot
#

You might feel like he's being mocking but he's tryign to help you and you're not making it easy

earnest phoenix
#

By responding with “LMAO” to every wrong thing I do

#

Yeah not mocking

umbral zealot
#

we're all humans and falliable, and when you piss people off, they are probably going to get pissed, y'know, as humans do.

blissful coral
#

lmao because we laugh?

#

We can chuckle at things lol

earnest phoenix
#

which is mocking, you’re laughing at an idea I had

umbral zealot
#

Which we're allowed to.

earnest phoenix
#

Yes, but don’t be like “lol why u so toxic” when you’ve been doing this the entire time

umbral zealot
#

@hushed axle it would probably be best to ask your VPS provider for instructions on how to connect to their service.

hushed axle
#

They give me a linkhuhu I read it and I still can not connect

umbral zealot
#

@earnest phoenix the reason we called you toxic is that you went full dunning-kruger and went "But this uses JSON so it must be good! waaaaaaaaah " when we were trying to explain something, and it made us annoyed and a little bit angry. Again, we are human beings, not machines, and we're not paid to do this, so you don't get to tell us how to act or how to deal with you.

earnest phoenix
#

that was sarcasm, I was trying to be annoying to show how y’all have been acting

blissful coral
#

Why would you try to be annoying

#

That doesn't really motivate us to help you at all

umbral zealot
#

Except we hadn't been acting like you had. We were giving you information that you needed to hear.

#

You're in the wrong, deal with it.

earnest phoenix
#

Yeah I think i learned that after you sent like 30 paragraphs about how json databases are for idiots

umbral zealot
#

Adjust your behaviour and learn from it rather than try to police our actions and thoughts.

#

It was information

#

it never once used the word "idiots"

earnest phoenix
#

implied

umbral zealot
#

no, you implied that all on your own.

blissful coral
#

No, it was not

#

Stop this conversation'

umbral zealot
#

That's your own personal issue, not ours.

earnest phoenix
#

Maybe u didn’t but I know Vibin did

solemn latch
#

i mean, tim has used json databases 🤷‍♂️

blissful coral
#

No I actually didn't

earnest phoenix
#

He used the word morons

#

yes you did

#

Here I’ll try to find it

umbral zealot
#

He didn't.

blissful coral
#

I did?

solemn latch
#

is this argument even worth it 🤔

blissful coral
#

Honestly

earnest phoenix
#

Bruh you just deleted it didn’t you

blissful coral
#

Just stop

solemn latch
#

honestly getting to the point you should take it to dms or drop it

blissful coral
#

Alright fine let's ask a mod to check server logs then

#

This isn't even development anymore

#

Just stop

earnest phoenix
#

@umbral zealot

umbral zealot
#

What

earnest phoenix
#

Wait it was evie

#

What I quoted something

#

Why did it just ping

blissful coral
#

What?

earnest phoenix
umbral zealot
#

lol

earnest phoenix
#

Then you'll lose data, like a moron. Fine, have fun with it, I'm not going to help you load the shotgun you're going to shoot yourself in the foot with.
@umbral zealot

#

there we go

umbral zealot
#

Like I said, I got angry when you started acting like a pre-teen entitled blob of toxic goo, so yeah, I said that

blissful coral
#

like

#

I love veld's commentary rn

#

LMAO

humble gyro
solemn latch
humble gyro
#

what's the issue

umbral zealot
#

Want some popcorn, Veld?

solemn latch
#

2v1 scrub fight or something

humble gyro
#

npm i sqlite

#

here's ur solution

umbral zealot
#

Nothing just trying to explain to this guy that we're trying to help him and he's not being a good customer

#

Conversation was pretty done until he started telling us how to help someone else I guess

earnest phoenix
#

their definition of helping is mocking every bad practice

#

Ad misericordium or some shit

umbral zealot
#

oh look at the fancy big words.

earnest phoenix
#

it’s a fallacy

#

Appeal to pity

solemn latch
#

thesaurus war GO

umbral zealot
#

We started off trying to help you but clearly, you don't like that. Alright.

earnest phoenix
#

yeah and you got all offensive because I didn’t understand sql

blissful coral
#

No buddy

#

You get defensive and pissed off

umbral zealot
#

It's alright let 's just block and move on

blissful coral
#

Because you couldn't download a package

solemn latch
#

lol

blissful coral
#

After we told you exactly what to do

umbral zealot
#

problem solved. he doesn't want our type of help

blissful coral
#

Exactly

quartz kindle
#

@umbral zealot yeah thats not what i meant

blissful coral
#

Conversation over

earnest phoenix
#

I asked for help with downloading it and u were like “lol ur so dumb stupid!!!11”

blissful coral
#

Conversation over
@blissful coral

earnest phoenix
#

ah alright

#

Was more of an argument than a conversation

umbral zealot
#

@quartz kindle then I'm curious because I'm pretty sure replacing djs with enmap along with a very simple serializer/deserializer would be just fine

blissful coral
#

A argument is still a conversation. conversation is 2 people conversing on a topic

#

Which we were doing

#

Have a good day/night

earnest phoenix
umbral zealot
#

I might actually just prove it to be sure of what I'm saying 😂

blissful coral
#

and I’m the toxic one apparently
@earnest phoenix indeed

quartz kindle
#

what i mean is, completely replacing djs caches with a database. the advantage of better-sqlite3 being synchronous, one can completely replace djs's in-memory caches with a fully disk cache, meaning all your 200k cached members are stored in a better-sqlite3 instead of a colleciton in memory, and then designing a seamless interface to interact with it, likely using js proxies for example, that intercept djs managers and make them get the data from disk and rebuild it on the fly

umbral zealot
#

yeah I know, that's why enmap would do fine because it's a wrapper on sqlite but it's like 90% identical to discord.js collections

earnest phoenix
#

didn’t need to end on that smart ass response

mint thicket
#

its done now

#

so we all can drop it

umbral zealot
#

Or rather it has 90% of the discord.js collection methods, and they're easily re-added.

solemn latch
#

Outof curiosity what would be the benefit of doing something like that?

#

no need to request users/members/stuff

umbral zealot
#

Well, with the new Intents update, not everyone gets to fetch every member

#

so they mentioned keeping a local cache

#

Of course there's cache invalidation but you can definitely just fetch with certain conditions or something

#

¯_(ツ)_/¯

earnest phoenix
#

@umbral zealot does ur thing need 2015 c++ build tools?

#

wait

#

he blocked me i think

#

can someone else ask

solemn latch
#

I would bet the npm page says

quartz kindle
#

windows-build-tools contains everything you need to install it

earnest phoenix
#

wait wtf

#

i dont remember installing this

spark oracle
#

I have a question.
Can my bot be verified without getting 75 servers??

quartz kindle
#

its part of the package, you dont need it tho

umbral zealot
#

@spark oracle no.

quartz kindle
#

did windows-build-tools finish installing?

#

did it say ALL DONE? like this

earnest phoenix
#

idk

#

how doi install it

quartz kindle
spark oracle
#

Using windows 7

earnest phoenix
#

his thing downloaded

#

with no errors

#

so i would guess i already have it installed ?

umbral zealot
#

Now keep following the instructions on the page

#

which is CLOSE THAT WINDOW

#

and any open prompt you may have

worthy pine
#

how to i have a local cache

umbral zealot
#

and open a NORMAL command prompt in your project folder

worthy pine
#

do

earnest phoenix
#

so run it here?

#

this is the bot im gonna use this for

umbral zealot
#

yes, the next command, the npm i enmap command - like the page says

earnest phoenix
#

yeah ik, i just didnt know if i installed it on my user or on the bot's cd itself

#

that took like 10 seconds what

umbral zealot
#

Enmap is smol

blissful coral
#

Something take's 10 seconds when it is small

#

something takes 30 minutes when it is big

earnest phoenix
#

ok so if im understanding this correctly

#

if i want to add something into the database, such as a user id and a warnings integer, i would do warningsEnmap.set(User.Id,2) // this user has 2 warnings

blissful coral
#

Is that from the guide

umbral zealot
#

You'd understand this correctly if you took the time to read the docs I painstakingly wrote over the course of the last 3 years

#

kthx

pale vessel
#

him: no

blissful coral
hushed axle
#

what should I put for this :< I write my password right and then they appear this

umbral zealot
#

Congratulations! You've successfully connected to your VPS

#

You're in!

hushed axle
#

it doesn't appear anything :<

blissful coral
#

Because it doesn't...

#

Run a command

#

lol

umbral zealot
#

It does, that's.. your terminal.

#

it's just like the command prompt, but it's on another machine completely

blissful coral
#

It doesn't appear a giant screen saying poof I am here!

hushed axle
#

😦 wait what I confuse

blissful coral
#

time in node -v

#

For example

#

type

umbral zealot
#

you know what the command prompt is, right?

#

like the thing you go into to run your bot

hushed axle
#

yes :<

umbral zealot
#

So this is the same thing

#

but... on your VPS

#

I mean, not exactly, but it's the same concept

#

This is where you'll do pretty much everything related to your hosting.

#

it's your lifeline to the service you're getting

hushed axle
#

wait what sad

umbral zealot
#

We've gotten you through your first question, "how do I connect" . you're connected now.

hushed axle
#

in my own computer?

blissful coral
#

The SSH that you are using is connecting you remotely to your server.

#

That SSH is a command prompt

#

So you are then running commands on that machine from your machine

hushed axle
#

it not like window server right 😦

hollow sedge
#

If you're not comfortable with the terminal, you could use filezilla

#

It has a GUI

hushed axle
#

catsad I download the filezilla it say connect to server lost

vocal sluice
#

is there a rate limit on how fast a bot can delete channels?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sudden geyser
#

is there a rate limit on how fast a bot can delete channels?
@vocal sluice rate limits are dynamic, so no matter what number I give you, there's no guarantee it'll change sooner or later. I recommend you set it to something reasonable in your use case.

vocal sluice
#

would a reasonable number say like 1 or 2 channels a second?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

hasty mulch
#

How do I do a perm check in an if statement in Python?

sudden geyser
#

A permission check for what though? A user? A role? A user's permission in a channel?

hasty mulch
#

User in general @sudden geyser

#

Ie, Manage Guild

sudden geyser
hasty mulch
sudden geyser
#

No.

#

Member should be an instance of the Member class. If you have a context object, you could do ctx.author to get the member (it's a User or Member instance so make sure you check with isinstance(...)).

guild_permissions is a class. I sent you the link because the documentation explains how to use the class. There are properties on the class to check for if some property equals another.

hasty mulch
#

I still don’t get how that would be an if statement

sudden geyser
#

In its raw form, it's not. You use the class data (in this case, checking permissions) and can use it like one.

For example: py if isinstance(ctx.author, discord.Member) and ctx.author.guild_permissions.kick_members: pass

hasty mulch
#

Ah, ok

earnest phoenix
#

How can you obfusicate? discord.js

pale vessel
#

it's not specifically discord.js

earnest phoenix
#

will any js obfusicator work?

pale vessel
#

ye

earnest phoenix
#

ok

pale vessel
#

but why

#

obfuscation is annoying

earnest phoenix
#

is there a way to defusicate

#

that would defeat the whole point of obfusication

#

yeah idk

#

how do developers typically find out what their code is when its obfusicated?

#

backup file?

lusty furnace
#

bc i need help with a reaction role command i made

#

basically it works well and all

#

but when the bot restarts it doesnt work anymore and doesnt give u the role when u react

#

heres my code:

#

@client.event
async def on_raw_reaction_add(payload):
  for role, msg, emoji in client.reaction_roles:
    if msg.id == payload.message_id and emoji == payload.emoji.name:
      await payload.member.add_roles(role)

@client.command()
async def set_reaction(ctx, role: discord.Role=None, msg: discord.Message=None, emoji=None):
  if role != None and msg != None and emoji != None:
    await msg.add_reaction(emoji)
    client.reaction_roles.append((role, msg, emoji))

  else:
    await ctx.send("Invalid arguements.")```
slender thistle
#

Because your reaction roles get lost as a result of solely relying on cache

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender thistle
#

There's no persistent data storage that you are performing, which would be using a database

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

is that necessary for discord bot code

#

can bot source be accessed from a client without being distributed by someone else?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender thistle
#

Your code doesn't get exposed from mere connections to the Discord API and/or operating

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

ok also one more thing

#

is it possible to have client only message

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

for instance a bot message that only appears for 1 client

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

like

sage bobcat
#

One message removed from a suspended account.