#development

1 messages · Page 1637 of 1

unique shore
#

basically heroku or any other paas style

lament rock
#

Your status says VSCode

unique shore
#

oh right, god I'm so tired lmao

lusty quest
#

pm2 can restart on file change, but last time ive used it it where quite whacky

unique shore
#

tells you suggested methods/properties and also gives you type info and comments made on the methods/properties. VSCode uses TypeScript internally
how? never seen that before

lusty quest
#

probably bcs of a sqlite database

autumn dust
#

when i start the bot it looks fine but if i dm him i get this error

PS C:\Users\justi\Downloads\modmailbot-master\modmailbot-master> node src/index.js
Starting Modmail v3.3.0 (1047528) on Node.js 14.15.4 (x64)
Loading configuration from config.ini...
Configuration ok!
Using an SQLite database:
  C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\db\data.sqlite
Preparing plugins...
Connecting to Discord...
Connected! Waiting for servers to become available...
Initializing...
Loading plugins...
Loaded 16 plugins (16 built-in plugins, 0 external plugins)

Done! Now listening to DMs.

Error 50001: DiscordRESTError [50001]: Missing Access
    at RequestHandler.request (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\node_modules\eris\lib\rest\RequestHandler.js:61:15)
    at Client.createMessage (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\node_modules\eris\lib\Client.js:550:36)
    at Thread._postToThreadChannel (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\data\Thread.js:101:25)
    at Thread.receiveUserReply (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\data\Thread.js:405:37)
    at async C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\main.js:168:9
    at async C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\queue.js:10:9
PS C:\Users\justi\Downloads\modmailbot-master\modmailbot-master> 
autumn dust
#

help me

autumn dust
lusty quest
#

then better ask in the github repo you got the bot from

unique shore
#

what if I just use github actions to get into my vps and just git pull -> restart app

lament rock
#

hovering over something usually tells you its type and other info.
In this screen shot, I was hovering over .cache

unique shore
#

oh, I never hover over things lmao, good to know

lament rock
#

when you're typing, a "window" will also pop up and give you suggestions

unique shore
#

I mean, I hate dealing with types tbh but for this project I'm willing to do it the right way I guess

slender thistle
#

In the long term types are very helpful

opal plank
#

i give up, i was on page 32 of dapi looking for that shit

#

simply cant find it

#

anyway

#

point being

#

there are blacklisted discriminators

#

that you cant get normall

lament rock
#

practically every other coding language is statically typed. JS is a weird exception. TypeScript is very helpful since static types lead to predictable and less flawed logic

unique shore
opal plank
#

should probably hit them with the TS in 100 seconds

unique shore
#

so far I've had 0 need for it, so vshrug

slender thistle
#

It really depends on who you ask

opal plank
#

not using types is shooting yourself in the foot

unique shore
opal plank
#

a good comparison is saying you should code in notepadd++ instead of vsc

#

types are there to help you catch bugs

unique shore
opal plank
#

if you dont use it, its on you

slender thistle
#

I'm fond of typehinting my code since it helps with autocompletion and my IDE yells at me whenever I get incompatible types. In small scripts, though, I don't bother

opal plank
#

autocompletion, catching bugs, intellisense, it all comes together

slender thistle
#

For the record, I'm a Python dev, so my typehints don't mean jack crap to the interpreter

opal plank
#

if you dont use it, like i said, its the same as using notepad++ to code instead of an IDE

#

its a helping tool

lament rock
#

Reading the docs and seeing that guild.members is a GuildMemberManager and that it has a property .cache which is a Collection<string, GuildMember> is helpful info.

The docs for any app is based on static types

opal plank
#

if you dont want it, its on you, but nobody can argue its not useful

slender thistle
#

It's helpful but when you're doing small stuff it's understandable if you're not gonna bother with types

unique shore
#

yeah I use js and python primarily, last time I used something like c# and c++ was before dropping out of college cause I found it awfully boring and tedious

opal plank
#

in small projects, like shiv said, its fine

#

the more you get, the more complicated it gets

#

thats why its there

#

to catch bugs FOR you

#

its a helping tool

lament rock
#

Just be thankful you're not trying to make a Minecraft Forge mod. There are no docs. They literally just tell you to use your IDE and look at the suggestions

opal plank
#

small investment upfront, big reap endgame

unique shore
#

idk, I've worked in big projects (not developed just by me) and I have yet to encounter typescript

#

I'm not saying it can't be useful

#

I know it is

#

I just never had the need for it

astral arrow
unique shore
#

when I do, I'll learn it

astral arrow
#

@opal plank

#

10 sec

#

Done

lament rock
#

People can use it independently of other project members

opal plank
#

whjat?

#

why the ping?

astral arrow
unique shore
#

dude, chillax

opal plank
#

the fuck is that related to either here or me?

unique shore
#

so, for the vps, do I just setup a github action that pulls the new code and restarts an app?

opal plank
unique shore
#

is there a good terminal manager thingy that I can use?

opal plank
#

you could just set a bash script

#

and use a command to trigger it

unique shore
#

like, if I just do npm start and close the vps connection the process stops right, so there are apps for that to run in the background or whatever, any recommendations?

opal plank
#
import {exec} 
exec.run('git pull $branch pass')
exec.run('node ./index.js')
await message.send('restarting bot')
process.exit(0)
``` this simple
unique shore
#

will that not kill the app once I close the connection?

opal plank
#

isnt the point to restart the app with a pull to update the code?

unique shore
#

I swear I love the dev community but all the contradictory info makes me go crazy

opal plank
#

vps runs regardless

#

its its own VM/machine

river panther
#

anyone needs js help?

opal plank
#

if you cut the connection from you to the vps it doesnt matter at all

#

unless the vps goes into statis without a connection, which would be absolutely idiotic

#

imagine exec as a terminal

unique shore
#

wtf so why people say that you need some process manager like pm2 or others

opal plank
#

you're simply running commands

#

in truth

#

cuz most people dont know jackshit about coding and want stuff pre-made at their leasure convenience

unique shore
#

I hate the dev community

#

jk I don't

#

but ffs

opal plank
#

wait till you look at the npm directory

unique shore
#

ok so I put the code you sent into a file and then...run it with a gh action?

opal plank
#

you'd be using git

#

this

#

6300 people on a weekly basis download, this

unique shore
#

hahahaha

lament rock
#

not efficient memory management

opal plank
#

welcome to js community

lament rock
#

input === void 0; would be better

unique shore
#

my memory is being overflowed rn thanks

lament rock
#

@returns Boolean class
gross typings

opal plank
#

now

#

here

#

here

#

watch this

#

500k WEEKLY

unique shore
opal plank
#

half a million

#

users

#

per week

#

download this

unique shore
opal plank
#

i shit you not

#

500k people per week

#

all this code is trahs

#

return (n % 2) === 1;

#

this

#

this is what 500k people are downloading weekly

#

its disgusting

slender thistle
#

Just goes to show how much of a lost cause some people are

river panther
#

case*

unique shore
lament rock
#

Yes. Memory efficient

opal plank
#

but back to where we were

#

i assume you know what a terminal is

unique shore
tired panther
#

then you require ("modules/shema/log.js")

unique shore
opal plank
#

and i assume you've been using terminals before too

river panther
unique shore
#

go on

opal plank
#

@river panther if you arent going to contribute to this channel, i kindly ask you to either lurk or do something else

river panther
#

ok ok

opal plank
#

so

#
import {exec} 
exec.run('git pull $branch pass')
exec.run('node ./index.js')
await message.send('restarting bot')
process.exit(0)```
#

this is not valid code btw

#

intentionally

#

this is just to give a quick gimplse or what im suggesting

opal plank
#

you're opening a terminall

#

and running that command basically

#

git pull will pull from a repo

#

which you'd be pushing your updates to

#

the second will run after the first one has been finished, so give it a couple seconds before continuing

#

aka, node ./index.js

#

or wherever your entry point is at

unique shore
#

right

opal plank
#

that'll start a second instance

#

then a simple console.log or message to let you know the bot is restarting

#

and then closing the initial process

#

now you have the old process terminated, and a new one opening with the new code updated

#

simple as that

unique shore
#

I see

#

and this is better than setting up gh actions to do this?

opal plank
#

how you trigger that is up to you, webhooks, commands, panels, dashboard, nodemon, anything you want

unique shore
#

oh okok

opal plank
#

i havent used gh actions, so i cant firmly say

#

but this would be as simple

unique shore
#

I've used them before so that's why I know I can use them, but also when I learned to use gh actions to do "continuous deployment" they used pm2 to start the app

#

in the tutorial I mean

opal plank
#

the usual gist is:
if it works, dont touch it unless you plan on scaling it

#

if what you got works flawlessly, there isnt much need to update it

#

what im suggesting would be lighter since it wouldnt require pm2 as a dependency

#

unless you using it as a monitor

#

in which case you might wanna consider it

unique shore
#

yeah, I mean all of this I'm doing it for private servers so there's no "scaling" that needs to happen

opal plank
#

then there shouldnt be much need to change it

unique shore
#

my shitty first bot is still on heroku doing fine

opal plank
#

go with the
ItJustWorks™️

unique shore
#

yeh

#

oh you said you're using Forever right? @opal plank

opal plank
signal night
#

anyone know how to make discord login in website like top.gg

opal plank
#

oauth2

lament rock
#

Look at Discord's Oauth2 docs

opal plank
#

with redirects

signal night
#

yup

#

anyone can help

near stratus
signal night
unique shore
lethal trout
opal plank
#

though the length of the command is quite big

#

since im using forever on startup

near stratus
opal plank
#

welp, time to head off

#

good luck

tired panther
lethal trout
#

it does not need to have it

#

if not it would say cant find module

tired panther
opal plank
#

require() resolves on modules

#

you dont need to have .js in the require

#

only in the file

lethal trout
#

yea

opal plank
#

im saying you're wrong firedragon

#

you're saying they need .js

#

they dont

tired panther
opal plank
#

oh, my bad

#

it was meister

#

anyway, the point still there

#

it doesnt need it for .js

#

nor .mjs iirc

tired panther
#

thats his code

lament rock
#

NodeRequire is weird

tired panther
#

@lethal trout Can I see the schema?

lethal trout
#
const { Schema, model } = require("mongoose");
module.exports = model(
    "logging",
    new Schema({
        req: {
            required: true,
            type: Boolean,
            default: false
        },
        channelID: {
            type: String
        },
        guildID: {
            type: String
        },
        MessageUpdate: {
            required: true,
            type: Boolean,
            default: false
        },
        MessageDelete: {
            required: true,
            type: Boolean,
            default: false
        }
    })
);```
#

@tired panther

tired panther
tired panther
lethal trout
#

ill show

tired panther
#

finding them?

lethal trout
#
const client = require('../index')
const Discord = require('discord.js')
const logs = require('../models/logs')

client.on("messageUpdate", async (oldMessage, newMessage) => {
const channel = oldMessage.channel
    if (oldMessage.content === newMessage.content) return;
    const data = await logs.findOne({
        guildID: newMessage.guild.id,
        channelID: newMessage.channel.id,
        MessageUpdate: true
    });
console.log(data)
    if (data) {
//const targetchannel = client.channels.fetch(data.channelID)
//console.log(targetchannel)
        const embed = new Discord.MessageEmbed()
            .setAuthor('A message has been edited!')
            .setThumbnail(oldMessage.author.displayAvatarURL({ dynamic: true }))
            .setColor('#FF0000')
            .addField("Edited by:", oldMessage.author.tag)
            .addField("Edited in:", oldMessage.channel)
            .addField("Edited at:", oldMessage.createdAt)
            .addField("Before:", oldMessage.content)
            .addField("After:", newMessage.content)
            .addField("URL:", `[Click Me](${oldMessage.url})`)
            .setTitle('Message Edited!')
            .setTimestamp()
        client.channels.fetch(data.channelID).then(c=>c.send(embed))
    } else {
        return
    }
})```

um..
there is a id in the db and i need to get the channel id
but i always get null
that means nothing
but there is smth
https://media.discordapp.net/attachments/272764566411149314/818343159196418088/unknown.png
https://media.discordapp.net/attachments/272764566411149314/818343832588124160/unknown.png
wow
no wonder
i did `console.log(data.guildID)` and it sent `cannot read property of guilfID of null`
how to fix it?
#

look

#

this

#

for some reason it is not able to get the channel id

#

because it is not even able to get the guild

#

smh me and my bot

tired panther
lusty quest
#

are you still on ths?

#

i would say your mongodb query is making the issues

#

did you want to have mutiple documents per guild?

tired panther
lusty quest
#

i know

#

but i want to know if he plans to use more than one document per guild

tired panther
lusty quest
#

i just want to know if he does or not

#

bcs then there could be an issue or two

tired panther
#

let us see if it can fetch from db

lethal trout
#

see first i need the get the guild id then from that guild i need the msg id so it can send the msg in that channel of that guild only

lusty quest
#

he probably wont find anything bcs of his filter

lethal trout
lusty quest
#

like i said did you have mutiple documents per guild?

tired panther
lethal trout
#

k

quartz kindle
#

Tfw you get a dm saying your bot is not working, you check logs and everything is fine, you ask them to show you what theyre doing, and theyre just using the command wrong and ignoring the part where the error message shows exactly how to use the command

lusty quest
#

like i said, expect the enduser to be a donkey

tired panther
opal plank
#

@quartz kindle and thats why you never trust users

#

ever

#

also good night tim

quartz kindle
#

Guess where the user is from

opal plank
#

huehue land

quartz kindle
#

Nop

opal plank
#

kebab land?

lusty quest
quartz kindle
#

Yup

opal plank
#

lul

lethal trout
tired panther
lethal trout
#

put channelid above?

tired panther
opal plank
#

tim help me spread the word of our glorious god, detritus

lusty quest
#

answer the question ive asked now 4 times in the past 15 minutes

opal plank
#

listen here u lil

lusty quest
quartz kindle
#

All hail discord.js for better or worse :^)

opal plank
#

burn the sinner!

#

the only thing detritus doesnt have(yet) is reaction collectors

lethal trout
#

so how do i fix my issuse?

opal plank
#

for that, i'll give d.js a break

#

had to implement my own reaction collector

quartz kindle
#

Lul

opal plank
#

which wasnt hard at all

quartz kindle
#

If i ever make a lib it wont have them either

lethal trout
tired panther
opal plank
#

we're talking about code

opal plank
lethal trout
#

but i need help soo yea..

opal plank
#

well this channel isnt ehre to solely help you

#

sorry

lethal trout
#

oof 😦

opal plank
#

Channel for chatting about development. If you have questions, ask the questions and wait for someone who can answer to help you

quartz kindle
lethal trout
earnest phoenix
#

Is there away to use discord AUTH and checking if the member has admin perms in the guild without client login?

quartz kindle
#

Likely yes

opal plank
#

not something that would bother you much i assume

quartz kindle
#

I like being niche

opal plank
#

join detritus dev team

earnest phoenix
tired panther
quartz kindle
#

I always find the small things that dont exist and do them, even if nobody will use

lusty quest
# earnest phoenix yes

iirc you can request the guilds from the user and there are permissions as bitwise present

opal plank
#

i swear i havent been paid to advertise their shit lol

lethal trout
#

@quartz kindle could u help me fix my code?

quartz kindle
lusty quest
#

i use it to check if a user got the manage guild permission to invite my bot (over my maybe working dashboard in the future)

earnest phoenix
earnest phoenix
lusty quest
#

i use oauth for it, i dont have directly a bot running

lethal trout
# quartz kindle What is the problen
const client = require('../index')
const Discord = require('discord.js')
const logs = require('../models/logs')

client.on("messageUpdate", async (oldMessage, newMessage) => {
const channel = oldMessage.channel
    if (oldMessage.content === newMessage.content) return;
    const data = await logs.findOne({
        guildID: newMessage.guild.id,
        channelID: newMessage.channel.id,
        MessageUpdate: true
    });
console.log(data)
    if (data) {
//const targetchannel = client.channels.fetch(data.channelID)
//console.log(targetchannel)
        const embed = new Discord.MessageEmbed()
            .setAuthor('A message has been edited!')
            .setThumbnail(oldMessage.author.displayAvatarURL({ dynamic: true }))
            .setColor('#FF0000')
            .addField("Edited by:", oldMessage.author.tag)
            .addField("Edited in:", oldMessage.channel)
            .addField("Edited at:", oldMessage.createdAt)
            .addField("Before:", oldMessage.content)
            .addField("After:", newMessage.content)
            .addField("URL:", `[Click Me](${oldMessage.url})`)
            .setTitle('Message Edited!')
            .setTimestamp()
        client.channels.fetch(data.channelID).then(c=>c.send(embed))
    } else {
        return
    }
})```

um..
there is a id in the db and i need to get the channel id
but i always get null
that means nothing
but there is smth
https://media.discordapp.net/attachments/272764566411149314/818343159196418088/unknown.png
https://media.discordapp.net/attachments/272764566411149314/818343832588124160/unknown.png
wow
no wonder
i did `console.log(data.guildID)` and it sent `cannot read property of guilfID of null`
how to fix it?
lusty quest
#

@quartz kindle he got issues getting the data from his mongodb, but he doesnt listen ffs

lethal trout
#

just that i am very bad a db

lusty quest
opal plank
#

i also suggested a lot of stuff thats wrong with that command

lethal trout
#

ill tell

opal plank
#

completely ignored

opal plank
#

beyond this point i gave you a lot of feedback, seems like you didnt fix a SINGLE thing

lethal trout
#

come on guys forgive me

opal plank
#

my internal tsundere dislikes you for that

lethal trout
opal plank
#

read after that

#

dont lose yourself on the first message

drowsy epoch
opal plank
#

me and shiv went back and fourth with info about how you can improve it

lethal trout
# drowsy epoch what u need help with
const client = require('../index')
const Discord = require('discord.js')
const logs = require('../models/logs')

client.on("messageUpdate", async (oldMessage, newMessage) => {
const channel = oldMessage.channel
    if (oldMessage.content === newMessage.content) return;
    const data = await logs.findOne({
        guildID: newMessage.guild.id,
        channelID: newMessage.channel.id,
        MessageUpdate: true
    });
console.log(data)
    if (data) {
//const targetchannel = client.channels.fetch(data.channelID)
//console.log(targetchannel)
        const embed = new Discord.MessageEmbed()
            .setAuthor('A message has been edited!')
            .setThumbnail(oldMessage.author.displayAvatarURL({ dynamic: true }))
            .setColor('#FF0000')
            .addField("Edited by:", oldMessage.author.tag)
            .addField("Edited in:", oldMessage.channel)
            .addField("Edited at:", oldMessage.createdAt)
            .addField("Before:", oldMessage.content)
            .addField("After:", newMessage.content)
            .addField("URL:", `[Click Me](${oldMessage.url})`)
            .setTitle('Message Edited!')
            .setTimestamp()
        client.channels.fetch(data.channelID).then(c=>c.send(embed))
    } else {
        return
    }
})```

um..
there is a id in the db and i need to get the channel id
but i always get null
that means nothing
but there is smth
https://media.discordapp.net/attachments/272764566411149314/818343159196418088/unknown.png
https://media.discordapp.net/attachments/272764566411149314/818343832588124160/unknown.png
wow
no wonder
i did `console.log(data.guildID)` and it sent `cannot read property of guilfID of null`
how to fix it?
drowsy epoch
#

have u read what they said?

lusty quest
#

probably not

opal plank
#

definitively not

tired panther
lethal trout
#

i did but totoally did not understand a single thing cause i am very bad at understanding anything

opal plank
lethal trout
#

so its my mistake

lusty quest
#

then you might want to learn a bit more how mongodb works

opal plank
#

you're checking for an object

#

that object might be empty

#

like i mentioned, you arent checking anything inside

lethal trout
drowsy epoch
#

tbh its been given to u

#

spoonfed tbh

opal plank
drowsy epoch
#

thats the right emote

lethal trout
#

😭

tired panther
opal plank
#

start from what you understood then

drowsy epoch
#

Read carefuly what has been aid

#

*said

opal plank
#

if you say you didnt understand a SINGLE thing from all the things i mentioned, you need to learn js before making a bot

#

and i'll slap you with the docs if thats the case

#

hard

drowsy epoch
#

its like in 300+servers

opal plank
#

the words js will be stamped on ur cheeks

pale vessel
tired panther
#

lol

opal plank
#

oh wow

#

okay thats too much

lusty quest
#

tbh i expected this

quartz kindle
#

I mean

#

If the database is returning null

opal plank
#

i meant this

quartz kindle
#

And you are 100 sure there is data in it

opal plank
#

administrator AND all the perms

quartz kindle
#

Then you might be using tbe database wrong

opal plank
#

my dude legit went and clicked on every permission

quartz kindle
#

Check the database documentation again

quartz kindle
opal plank
#

big bots usually can backup the need for it tho

#

and not many do

#

Rythm for example is just administrator

tired panther
opal plank
#

not EVERY permission

drowsy epoch
#

same with mine

lusty quest
#

just do bare minumum to work, and you never need Administrator,

opal plank
#

^^

#

no sketchy perms, just what it needs

#

its good practice to just put what your bot needs

quartz kindle
#

Thats why, big bots have commands fof everything lul

opal plank
quartz kindle
#

Lmao

opal plank
river panther
#

wait, i have turned everything for my bot, like the permission, so is my bot big now 0.0

opal plank
#

wtf my dude?

lusty quest
opal plank
#

^^

#

unecessary

marble juniper
#

his brain is messed up ngl

opal plank
#

shows no effort whatsoever

river panther
#

but it needs everything

marble juniper
lusty quest
opal plank
#

it doesnt

#

i DOUBT you'll hit every single permission

tired panther
#

it needs a new ddev

opal plank
#

ABSOLUTELY doubt

quartz kindle
#

It wants everything

#

:^)

marble juniper
#

but sure if you think it does leave it like that and then ask yourself again why your bot got declined

lusty quest
#

when a meme bot requires Ban, Kick and Administrator permissions for fetching memes From Reddit and then sending them into a channel

quartz kindle
#

Ecks dee

river panther
near stratus
#

Be like me
When I applied I made top.gg make an invite for me with no permission

opal plank
#

bot with a ping command and an avatar permission asking for ADMINISTRATOR

lusty quest
#

this is probably why most bots get denied

river panther
#

how solve this?

marble juniper
quartz kindle
#

Unknown interaction

river panther
#

=|

quartz kindle
#

Check your send function

river panther
#

see, i have named it changemymind same as the file name

river panther
opal plank
#

i smell anger issues

river panther
#

breh

quartz kindle
#

Ah yes

marble juniper
#

juuuuuuust some small anger issues

opal plank
#

lmao

marble juniper
#

nothing much

lusty quest
#

did you try to use replys?

#

(with d.js)

river panther
#

i mean, there are more but ok

marble juniper
#

I don't think thats appropiate

opal plank
marble juniper
#

that moment when you want to help people in development but then you see this

opal plank
#

forever saved

lusty quest
#

lol how tf did this post with the star instantly went into the starboard

tired panther
#

"small voice of calm" 3551_haha_laugh_sign_bean

quartz kindle
#

And reason

river panther
#

i was banned for 3 months from that server because of the NSFW roasts which continued that

marble juniper
#

I wonder if you will be next in this server

#

who knows

lusty quest
#

ive made a bot that could help you improving you attitude

river panther
#

no no, thank you 👍

near stratus
tired panther
#

lul

opal plank
#

just make an AFK arena bot where you simply spam a single reaction on the bot to get coins. ezpz

marble juniper
#

kekw

lusty quest
marble juniper
#

let me guess

near stratus
marble juniper
#

it uses perspective ai

river panther
opal plank
#

that has to be the most idiotic idea i've had today

opal plank
#

or any afk game

tired panther
#

lul

opal plank
#

simply spam on the reaction to get points

lusty quest
opal plank
#

you spam dsicord, the bot, the channel, everywhere

marble juniper
opal plank
#

its a win-win situation

tired panther
river panther
#

is it a hall of fame?

opal plank
marble juniper
#

since that dude on youtube made that video with his bot I have seen like 50 clones off it on top.gg

opal plank
#

yeha, you posted something so stupid people thought it was worthy

tired panther
marble juniper
#

lol

near stratus
marble juniper
#

famen't

opal plank
#

!fame

quartz kindle
#

That should give you a better and more informative error

near stratus
river panther
#

oh no, i forgot to take a shower today, brb 👍

marble juniper
#

you should always catch errors anyways

near stratus
quartz kindle
#

Who cares about showering, code is more important

opal plank
#

errors? what errors?

process.on('unhandledException', () => {})```
i see no errors?
marble juniper
opal plank
marble juniper
#

woah

delicate zephyr
#

Lmfao tim

quartz kindle
#

xDDDD

marble juniper
#

lmao tim

delicate zephyr
#

How are you Tim

marble juniper
#

this is the most offensive thing I have ever heard you say tim

quartz kindle
#

Am fine

delicate zephyr
#

Gud gud

opal plank
#

look, its not my fault node 15 legit crashes on any hidrance
and im too lazy to go get the flag to prevent crash.
I blame tim for not coding the bot for me

quartz kindle
#

Lmao

marble juniper
#

is there anything new in discord.js-light? dogkek

delicate zephyr
#

Lmfao

quartz kindle
#

Not yet

marble juniper
#

anything planned maybe

opal plank
#

tim adding random catgirls to commands

river panther
marble juniper
tired panther
quartz kindle
#

Working on the session refresh thing, but it doesnt work with the sharding manager without heavy mods

opal plank
#

see tim? listen to your public

marble juniper
opal plank
#

catgirls to be added on discord.js-light

quartz kindle
#

Yes catgirls

tired panther
delicate zephyr
opal plank
#

indeed

quartz kindle
#

And raid shadow legends

river panther
marble juniper
opal plank
#

when you create client it automatically adds the command to client.commands

marble juniper
quartz kindle
delicate zephyr
#

Nopw

#

Been open for well over a year and half and it's still an issue

quartz kindle
#

It should fixed in v13 i think

marble juniper
#

do it tim
you are the magician

quartz kindle
#

When they move to gateway v8

river panther
#

/

#

we should make a timism

#

whoever follows tim should be a timist

quartz kindle
#

Optimist

marble juniper
opal plank
marble juniper
#

kekw

quartz kindle
#

Catfemboys

opal plank
#

OR

#

better yet

marble juniper
#

I use discord.js-commando-light

opal plank
#

when you create client, it sends a catgirl pic to every user cached

marble juniper
#

my custom lib

#

kekw

#

not really custom lib

tired panther
marble juniper
#

my modified package

opal plank
#

commando trash

#

just saying

marble juniper
#

people may hate it

#

but I like it

opal plank
#

check detritus commandClient link

tired panther
marble juniper
#

check the docs

opal plank
#

its basically a half assed attempt to make a more advanced command handler

marble juniper
#

commando is basically a "command framework"

#

as they call it

#

lol

#

has stuff like args prompting and so on

quartz kindle
#

Raw commands ftw

marble juniper
#

and built in commands

tired panther
opal plank
#

good luck beating that commando

tired panther
quartz kindle
#

I dont even use http routers i use raw requests on my webserver

opal plank
tired panther
opal plank
#

detritus > d.js

#

by a mile

marble juniper
delicate zephyr
#

Eris is the Inbetweener of the two tbh Erwin

marble juniper
#

I think those are all

tired panther
marble juniper
#

oh and also eval

opal plank
delicate zephyr
#

Imo

#

More like 60 20 20

opal plank
#

i havent touched eris, but since its compared so often to d.j i would assume its on the same level with minor differences

delicate zephyr
#

Idk, eris's ram usage Vs d.js

#

Is hilarious

opal plank
#

let me post this again

#

cuz i sent that to tim

#

SAME bot

#

not a SINGLE difference

delicate zephyr
#

You sent that here too

#

It's not worth rewriting my backend tho tbh

#

Considering I already know it can handle 120k~ with 6GB if ram

quartz kindle
#

Too much caching... must... disable... all... caches...

delicate zephyr
#

Shiro has all the caching

#

And only uses 2.2GB~

opal plank
#

imagine having built in caching options

#

imagine needing for someone to work on your lib to make cache optional

tired panther
delicate zephyr
#

Imagine not needing cache

#

And not having both intents

opal plank
#

could

quartz kindle
#

#designgoals

opal plank
#

but i need the intents

#

my bot relies on presences

delicate zephyr
#

Same

opal plank
#

but i dont need it cached

delicate zephyr
#

I mean fair

quartz kindle
#

I have a critique about detritus in that regard

#

They use async zlib

opal plank
#

is that bad?

quartz kindle
#

Yup

tired panther
opal plank
#

hmmm

quartz kindle
#

xd

restive furnace
#

fast-zlib gang

opal plank
#

tim go advertise ur lib to them

tired panther
#

shame on them xD

opal plank
#

wink wink

tired panther
opal plank
#

say erwin sent you

quartz kindle
#

I havent actually tested the difference in a discord environment

opal plank
#

frick

quartz kindle
#

I mean

#

Considering async zlib still handles tens of thousands of packets per second

#

There wont be much difference

#

But making sync could lower the cpu a bit

slender thistle
quartz kindle
#

Good

#

:^)

slender thistle
river panther
#

exdi

opal plank
#

computers are all gates

#

NOR XOR AND

#

and binary

#

thats basically it

#

thats the basic of a processor

restive furnace
river panther
#

ig its only NAND

quartz kindle
#

xD

#

Tbh ive grown tired of OOP

#

At least excessive OOP

river panther
#

idk what is OOP

opal plank
#

object oriented programming

river panther
#

ik breh

#

sarcasm

opal plank
#

then why u ask

quartz kindle
#

Sarcosi

river panther
#

:/

opal plank
#

imagine thinking people will get sarcasm

#

over messages

#

cringe

quartz kindle
#

The reason why djs is so bad is excessive oop

river panther
#

yes

opal plank
#

tim

#

you wrong

#

d.js is not excessive OOP, its execive POOP

quartz kindle
#

You cant have many things without having the previous thing

#

Which fjcks it up

opal plank
#

just port d.js to jsfuck

quartz kindle
#

Cant have messages without channels

#

Cant have permissions without roles

opal plank
#

and they tried patching that with partials, and from the looks of it failed miserably

river panther
#

can were do electton.js

#

electric

earnest phoenix
#

How do i modules.exports in typescript

river panther
#

electron

opal plank
quartz kindle
opal plank
#

but preferabnly use EXPORT

#

its es6 syntax

#

technically

earnest phoenix
#

export =?

opal plank
#

yes and no

quartz kindle
#

export function abc

opal plank
#

export default
would be the equivalent of modeule.exports

#

module.exports.thing
would be
export thing =

earnest phoenix
#

Ah gotcha thanks

opal plank
#

no preblomo

quartz kindle
#

You dont need the = do you

opal plank
#

depends on what you do, but yeah

#

export default () => {}

river panther
opal plank
#

export default const a = 1

#

export default = {}

#

it varies with what you're doing

quartz kindle
#

Ye

opal plank
#

scratch is the ultimate lang btw

earnest phoenix
opal plank
#

dont you dare talk shit about it

quartz kindle
#

export thing =
Could be confused witb
export abc = function() {}

opal plank
#

yeah

#

you could do that tho

quartz kindle
#

But its better to do export function abc() {}

#

or function abc() {}
export abc

opal plank
#

default has some quirks with it

quartz kindle
#

I still havent finished that jsdoc thing

#

Too much work

near plover
#

anyone by chance have a good suggestion for a GitHub action to maintain versioning?

opal plank
#

huh?

#

use default git versioning

quartz kindle
#

Idk ive never used github actions

opal plank
#

me neither

#

commit to repo

#

pull version

#

thats it?

near plover
#

tbh after the long days I have programming i'm slowly trying to move away from manual releases and automate things

quartz kindle
#

You probably dont wanna automate releases

opal plank
#

i was actually scolding tim cuz of versioning not too long ago

#

cuz he was hardcoding it

quartz kindle
#

Higher chance of accidentally releasing broken code

opal plank
quartz kindle
opal plank
#

you were hardcoding your changelog

#

prob still are

quartz kindle
#

I still do

#

Lmao

opal plank
#

use github u dork

near plover
#

lmao yeah my main issue I face atm though is the extra steps required with the current repo, sometimes bumping our version doesn't actually update the version to the registry lol

quartz kindle
#

What i wanna show in the changelog is not the same as github commits

opal plank
#

commit with the message

#

thats it

#

when someone uses the bot just pull from your history

quartz kindle
#

I often need several commits and testing

opal plank
#

rather than having to update it everytime

quartz kindle
#

Before releasing a feature

opal plank
#

you can always fetch full on releases too from github

quartz kindle
#

And the repo is private

#

Cba setting up keys for it

opal plank
#

was about to say that

#

wouldnt matter

#

lul

quartz kindle
#

Lul

opal plank
#

tim

#

im coming for ur booty

#

3k servers

#

growing 500 per week

quartz kindle
#

Be my guest lul

opal plank
#

u at 9k no?

quartz kindle
#

8k

opal plank
#

hmmm

#

might take a bit longer than i was expecting

quartz kindle
#

I only grow when im featured in the certified section

opal plank
#

speaking of which

quartz kindle
#

Other than that i hardly grow

opal plank
#

i need to go bribe someone to get me in there

quartz kindle
#

Yes

opal plank
#

i dont think my bot has ever reached any frontpage

#

be certified, trending, anything

#

probably blow up if it did

#

and all my attempts at auctions failed

quartz kindle
#

Most likely

opal plank
#

cuz last second outbid

quartz kindle
#

People blindly add featured bots for no reason

opal plank
#

i've noticed

quartz kindle
#

Without understanding what they do

opal plank
#

quite a few people added my bot for roleplay purposes

#

3 months of development

#

and they add it to roleplay

quartz kindle
#

xD

#

3 years of development

#

and they add it, dont understand shit then remove it

#

:^)

opal plank
#

mine hasnt had much join/leaves

#

the retention is quite high

#

though theres quite the discrepancy between commands

#

looks balanced

quartz kindle
#

I dont measure that xd

opal plank
#

isnt that how we measure whose pp is bigger? 002_think

quartz kindle
#

I dont measure my pp

#

:^)

opal plank
#

F

dark crest
#

Hi i running my bot on vps and i created website for him not on the vps someone know how can i post the sever.length on his website without using the token out of the vps?

quartz kindle
#

Put a webserver in your bot and make a small rest api

#

Then from your website just make a request to your bot

autumn dust
#

when i run the same code on vscode i get no errors but if i run the code on heroku i get this error

2021-03-08T08:18:51.564303+00:0 heroku[worker.1]: Starting process with command `node index.js`
2021-03-08T08:18:52.213286+00:0 heroku[worker.1]: State changed from starting to up
2021-03-08T08:18:54.096664+00:0 heroku[worker.1]: Process exited with status 1
2021-03-08T08:18:54.160668+00:0 heroku[worker.1]: State changed from up to crashed
2021-03-08T08:18:54.040965+00:0 app[worker.1]: internal/fs/utils.js:307
2021-03-08T08:18:54.040987+00:0 app[worker.1]:     throw err;
2021-03-08T08:18:54.040987+00:0 app[worker.1]:     ^
2021-03-08T08:18:54.040987+00:0 app[worker.1]: 
2021-03-08T08:18:54.040988+00:00 app[worker.1]: Error: ENOENT: no such file or directory, scandir './commands'
2021-03-08T08:18:54.040989+00:00 app[worker.1]:     at Object.readdirSync (fs.js:1021:3)
2021-03-08T08:18:54.040989+00:00 app[worker.1]:     at Object.<anonymous> (/app/index.js:20:25)
2021-03-08T08:18:54.040990+00:00 app[worker.1]:     at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-03-08T08:18:54.040990+00:00 app[worker.1]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-03-08T08:18:54.040990+00:00 app[worker.1]:     at Module.load (internal/modules/cjs/loader.js:928:32)
2021-03-08T08:18:54.040991+00:00 app[worker.1]:     at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-03-08T08:18:54.040991+00:00 app[worker.1]:     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
2021-03-08T08:18:54.040992+00:00 app[worker.1]:     at internal/main/run_main_module.js:17:47 {
2021-03-08T08:18:54.040992+00:00 app[worker.1]:   errno: -2,
2021-03-08T08:18:54.040992+00:00 app[worker.1]:   syscall: 'scandir',
2021-03-08T08:18:54.040993+00:00 app[worker.1]:   code: 'ENOENT',
2021-03-08T08:18:54.040993+00:00 app[worker.1]:   path: './commands'
2021-03-08T08:18:54.040994+00:00 app[worker.1]: }
autumn dust
#

yes

drowsy epoch
#

that has worked set to node mainfilename

quartz kindle
#

The folder commands was not found

drowsy epoch
#

did u push it

dark crest
#

:/

quartz kindle
#

Whats your bot coded in?

dark crest
#

js

quartz kindle
#

Check out express.js

dark crest
#

what to do with that?

drowsy epoch
earnest phoenix
#

New guild joined: Top.gg Verification Center (id: 333949691962195969). This guild has 99 members!

#

lol

#

😂

drowsy epoch
earnest phoenix
#

ik

dark crest
drowsy epoch
#

wait u can do this

dark crest
#

do what?

#

install express?

drowsy epoch
#

yes

#

npm i express.js

near stratus
drowsy epoch
#

both woek

#

*work

zenith terrace
#

express has .js at the end?

#

I dont remember that

drowsy epoch
near stratus
zenith terrace
#

oh it does

near stratus
#

the module npm would install for express.js is made by someone whom I don't think is affiliated with actual express

drowsy epoch
near stratus
drowsy epoch
#

ok

quartz kindle
#

The actual official name is express.js

#

But you install it as express

near stratus
#

yea

zenith terrace
#

oh that makes more sense

quartz kindle
#

Many libs are like that

near stratus
#

imagine trying npm i discord

drowsy epoch
near stratus
drowsy epoch
#

ik

quartz kindle
#

What happens if you try it

drowsy epoch
#

prob some sketchy thing

quartz kindle
#

error or fake lib?

near stratus
quartz kindle
#

Lmao wut

near stratus
#

it actually exists lol

drowsy epoch
#

9yrs ago

quartz kindle
#

Lol 9 years ago

drowsy epoch
#

so many idiots doing npm i discord

#

expecting ot install discord.js

#

*to

quartz kindle
#

Npm is not allowing this anymore btw

#

You cant publish a package with a similar name to an existing one

near stratus
quartz kindle
#

I mean

near stratus
#

... ?

quartz kindle
#

If discord exists

#

You cant publish discord.js anymore

#

And vice versa

drowsy epoch
#

discord.ts i think is on there

near stratus
quartz kindle
#

Ye but you cant do that anymore

#

Packages with similar/confusing names are no longer allowed

#

I tried publishing a package called stringbase and it didnt let me

#

Because stringbase.js exists

zenith terrace
#

h

long crow
#

I

quartz kindle
#

Actually it wasnt stringbase.js

#

It was string-base

#

There is a lib on npm to check if a given name is available on npm

#

The lib downloads the entire npm list

#

150mb

#

Lmao

#

You didnt template it in the link

#

Ejs variables only exist inside templates, inside <% %>

#

You might need to use <%=

#

Check the ejs docs

#

They have special tags for running code with and without output

#

Check the ejs docs

#

I dont remember the exact tags

river panther
quartz kindle
#

See the %=

river panther
#

no no, it is npm install discord.js

#

you know why does verified devs have </> because whoever programmed bot's </life> and </happiness>

quartz kindle
#

If discord.js changed your life, you need to evaluate your priorities

#

And sanity

river panther
#

breh, how?

#

discord.js is good, at least better than java

quartz kindle
#

Flame from jda users incoming

river panther
#

i was waiting for that

opal plank
drowsy epoch
#

lmao

earnest phoenix
#

command bot @pliant gorge please

river panther
#

wait, can you program a bot with java too?

opal plank
#

of course

#

thats what jda is for

earnest phoenix
#

command bot @pliant gorge please

opal plank
#

this channel is for development

earnest phoenix
#

ok

river panther
#

imagine programming a bot in java

opal plank
#

imagine using d.js

#

shit lib

#

8spit*

river panther
#

what do you use?

opal plank
#

detritus

river panther
opal plank
#

you'll never ever touch d.js again if you get at it

river panther
#

is it banned in india?

opal plank
dusky harness
#

const Discord = require('discord.js');

module.exports.run = async (bot, message, args) => {
message.delete();
if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send( "Üyeleri At yetkisine sahip değilsin!");
let kUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!kUser) return message.channel.send('Kullanıcı giriniz.')
if(kUser.id === bot.user.id) return message.channel.send('Botu Atamazsın!');
let kReason = args.join(" ").slice(22);
if(!kReason) return message.channel.send('Sebep giriniz...')
if(kUser.hasPermission("BAN_MEMBERS")) return message.channel.send("Atmak istediğin kişi Üyeleri At yetkisine sahip Atamam...");

let kickEmbed = new Discord.RichEmbed()
.setDescription("Atma")
.setColor("#bc0000")
.addField("Atılan Kişi", `${kUser} ID'si ${kUser.id}`)
.addField("Yetkili", `<@${message.author.id}> ID'si ${message.author.id}`)
.addField("Sebep", kReason);





let incidentchannel = message.guild.channels.find(`name`, "mod-log");
if(!incidentchannel) return message.channel.send("`mod-log` kanalını bulamıyorum.");

message.guild.member(kUser).kick(kReason);
incidentchannel.send(kickEmbed);

};

exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: 0
};

exports.help = {
name: 'kick',
description: 'İstediğiniz kişiyi atar.',
usage: 'kick [kullanıcı] [sebep]'
};

I wonder what the code of this is, I could not understand

opal plank
#

i had that problem too, but its related to your ports

river panther
#

the fuck is this code

river panther
opal plank
#

i was running ssh tunneling which was fucking with it

#

easy fix:
open from mobile

#

hard fix: restart or stop app that might be using some special prots

river panther
#

oh, okok

quartz kindle
#

Things inside <% are server side, things outside are client side

river panther
#

tim what do you use?

opal plank
#

tim has his own lib lolo

river panther
#

tim.js

opal plank
#

dscord.js-light

river panther
#

is it better?

dusky harness
#

I wonder what the code of this is, I could not understand,

quartz kindle
opal plank
#

its d.js but it wont gurgle ram like i drink vodka

river panther
#

oh nice

opal plank
#

i'll let tim advertise it

#

heheh

quartz kindle
#

Drinking challenge, djs ram vs erwin vodka

opal plank
#

im already advertising detritus

#

hmmmmmm

#

every gb is 1 liter?

#

not sure i'd be able to keep up

#

by the end of the day i might be at 6 or 7 liters of pure vodka

quartz kindle
#

You cant compare them directly

river panther
quartz kindle
#

You can put stuff on the client, and then compare it

#

For example

river panther
#

oh mhm

#

nice

quartz kindle
#

let varFromServer = <%= guilds %>
// use varFromServer on the client side

dusky harness
quartz kindle
opal plank
#

bad code, bad permissions, hierarchy

opal plank
river panther
dusky harness
river panther
#

```js
//code
```

opal plank
#

wheres the rest of the stack?

#

the error

#

error stack

#

or trace

quartz kindle
#

console.log guildSettings

#

On the server side

opal plank
#

lmao

#

im gonna pretend i didnt see that

#

5th time is the charm

quartz kindle
#

Lmao

river panther
#

ping

#

who pinged?

opal plank
quartz kindle
#

The voices in your head

river panther
#

breh i really got a ping

dusky harness
# river panther \`\`\`js //code \`\`\`

const Discord = require('discord.js');


module.exports.run = async (bot, message, args) => {
message.delete();
    if(!message.member.hasPermission("KICK_MEMBERS")) return 
message.channel.send( "**Üyeleri At** yetkisine sahip değilsin!");
    let kUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
    if(!kUser) return message.channel.send('Kullanıcı giriniz.')
    if(kUser.id === bot.user.id) return message.channel.send('Botu **Atamazsın!**');
    let kReason = args.join(" ").slice(22);
    if(!kReason) return message.channel.send('Sebep giriniz...')
    if(kUser.hasPermission("BAN_MEMBERS")) return message.channel.send("Atmak istediğin kişi **Üyeleri At** yetkisine sahip **Atamam...**");

    let kickEmbed = new Discord.RichEmbed()
    .setDescription("Atma")
    .setColor("#bc0000")
    .addField("Atılan Kişi", `${kUser} ID'si ${kUser.id}`)
    .addField("Yetkili", `<@${message.author.id}> ID'si ${message.author.id}`)
    .addField("Sebep", kReason);

 
 
 
 
    let incidentchannel = message.guild.channels.find(`name`, "mod-log");
    if(!incidentchannel) return message.channel.send("`mod-log` kanalını bulamıyorum.");

    message.guild.member(kUser).kick(kReason);
    incidentchannel.send(kickEmbed);
};

exports.conf = {
  enabled: true,
  guildOnly: true,
  aliases: [],
  permLevel: 0
};

exports.help = {
  name: 'kick',
  description: 'İstediğiniz kişiyi atar.',
  usage: 'kick [kullanıcı] [sebep]'
};
//code
river panther
#

oh god oh fuck

opal plank
#

//code

river panther
#

exdi

quartz kindle
#

Congrats, you did it

river panther
#

man you deleted the message

#

genius

opal plank
#

maybe 6th is the charm

quartz kindle
#

Now what is the problem?

opal plank
#

cant kick member aparently

#

no error

#

maybe

#

they didnt mention an error

#

just that it didnt work

river panther
#

he deleted the message before even taking details out of it

quartz kindle
#

discord.js v11

#

Lul

dusky harness
opal plank
#

perhaps the command you having the issue with