#development

1 messages · Page 1465 of 1

earnest phoenix
#

the best way to host any bot it's with a VPS

#

im under 18

#

barely any money either

mellow kelp
#

calls my parents

quartz kindle
#

Glitch and heroku give you 500mb afaik

mellow kelp
#

DAD I NEED THE CREDIT CARD

quartz kindle
#

So google givds you slightly more

#

But google is a full vps

mellow kelp
#

so it has more features and stuff?

quartz kindle
#

You have full admin/root access

earnest phoenix
#

Repl gives me 512 MB which is more than enough

mellow kelp
#

poggers

earnest phoenix
#

And I don't plan on making a big bot

mellow kelp
#

im gonna try google cloud then

quartz kindle
#

Can even install windows on it

sand walrus
#

static

mellow kelp
#

hope i make it before i run out of dynos

earnest phoenix
#

GOOGLE LITERALLY LETS ME RENT A COMPUTER

mellow kelp
quartz kindle
#

Thata what a vps is

earnest phoenix
#

???

crimson vapor
earnest phoenix
#

DA FUCK

crimson vapor
#

virtual private server

river peak
#

we are developing

#

right

#

because we're in the development channel

earnest phoenix
#

Computers are expensive they can't give a free forever computer each to millions of users

#

(that's probably why credit card)

mellow kelp
#

apparently its to verify that im not a bot

quartz kindle
#

Google charges you for bandwidth tho, they only give you 1gb free per month

earnest phoenix
#

reCAPTCHA is hard to bypass but it's possible

sand walrus
#

i have a downloaded image created with photoshop and i create the command where compare the image

earnest phoenix
#

bypassing credit card is impossible and illegap

#

illegal

quartz kindle
#

Still, my bot was paying like 50 cents per month on 1k servers

mellow kelp
#

dang

#

thats pretty good

earnest phoenix
#

I'm barely even released yet

#

Two servers, ones my normal one and the other is for testing

#

Wait I just realized I haven't put my server on DSL

crimson vapor
earnest phoenix
#

how does google expect heavy resource usage from a d.js-light dev

quartz kindle
#

That was before djslight

#

My bot was using 300-400mb ram and crashing due to out of memory

#

Thats why i moved out of google

earnest phoenix
#

my bot uses a maximum of 70mb ram

#

recommends us to use google

tells his story of moving out of google

quartz kindle
#

Yes

earnest phoenix
#

my bot's is hosted in a VPS

#

🤔

quartz kindle
#

Because paid vps > google >>> glitch/heroku/replit

earnest phoenix
#

do you guys remember that story about how a single recursive function racked up $75000 for the GCP project of a company few days before launch

Google was kind enough to forgive them for it. ALL OF IT. ALL SEVENTY FIVE FUCKING THOUSANDS OF DOLLARS OF IT

quartz kindle
#

Lmfao

vague imp
#

code gone wrong

earnest phoenix
quartz kindle
#

Lmao

hollow sedge
#

That's why you set a budget

quartz kindle
#

google is not better than private vps providers

earnest phoenix
#

They did set a budget and they got an email and nothing else happened

quartz kindle
#

Not in terms of price value

earnest phoenix
#

google has firebase tho

hollow sedge
#

Oh lol

crimson vapor
#

contabo is pretty good

chilly bison
#

aws is good

hollow sedge
#

What is contabo

#

Haven't heard of that

vague imp
#

true

#

private vps is better than google

crimson vapor
#

its a cheap company

earnest phoenix
#

successfully started vps war time to close discord and go code

crimson vapor
#

like 10usd for a decent vps

vague imp
#

especially in terms of pricing

quartz kindle
#

aws is like google, both are stupidly expensive compared to private vps providers who offer the same features

chilly bison
#

only $70 per month for a 1-core 5MB RAM compute instance with 20KB port

vague imp
#

lol

hollow sedge
earnest phoenix
#

y e s but actually n o

mellow kelp
hollow sedge
#

So you can beat all of us with your discord bot 🤯

mellow kelp
#

confusion

earnest phoenix
#

HAHA I MADE YOU GUYS BATTLE IN VPS WAR WHILE I COPY PASTE YOUR CODE AND MAKE MY BOTUM DA BEST HAHAHAHA

hollow sedge
#

..he's saying it's not as good as a private vps

#

NOOOOO

mellow kelp
#

well k

#

imma choose google

earnest phoenix
#

YESSSS

crimson vapor
#

I like ovh

#

but its not free

#

3.5 usd for cheapest one

hollow sedge
#

Some people just like to see the world burn

crimson vapor
#

and you have to do some big brain things to get to it

earnest phoenix
#

y e s

#

WAIT YOU'RE MAKING ME STAY ON DISCORD LONGER

hollow sedge
#

What weird thing do you have to do

#

LOL

quartz kindle
#

Im paying like 2.77

#

On galaxygate

earnest phoenix
#

I HAVE OFFICIALLY GOT AN UNO REVERSAL SLAMMED ON MY FACE

hollow sedge
#

Ez game gg

crimson vapor
#

Tim usd?

earnest phoenix
#

capslock.on();

hollow sedge
#

no

#

capslock = true

quartz kindle
crimson vapor
#

wow

earnest phoenix
#

"A".repeat(100);

crimson vapor
#

I pay 11.5

hollow sedge
#

No

#

repeat("A", 100)

crimson vapor
#

why

hollow sedge
#

Why not

crimson vapor
#

his name is literally code

hollow sedge
#

are you assuming their gender

crimson vapor
#

yes

#

im sorry

#

force of habbit

hollow sedge
#

force of hobbit

crimson vapor
#

@quartz kindle how do you like ts?

quartz kindle
#

ew

crimson vapor
#

agreed

#

at least you can autogen typings

south sinew
#

somewhat off topic, but does anyone know how to make fail2ban send webhooks to a discord channel?

crimson vapor
#

which is poggers

quartz kindle
#

Can fail2ban even send webhooks?

south sinew
#

ive seen someone do it

#

there is also a plugin for slack, so its definitely possible

hollow sedge
#

What is fail2ban

earnest phoenix
# earnest phoenix `"A".repeat(100);`

Finally flazepineapple's aeon listened to me and ran this command and let me fuckign copy the nonembed text on mobile

I present to you

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

hollow sedge
#

..congrats?

south sinew
hollow sedge
#

Does anyone know what you're talking about

earnest phoenix
#

cloudfox is now on my bonk list beware of a giant wooden softbody coming at thy face

quartz kindle
#

Look into fail2ban actions and curl

hollow sedge
#

:o oh no I'm on someone's bonk list

earnest phoenix
#

hope you're not british

#

code are you on an lsd trip

#

just asking

#

yes

south sinew
#

hmmm, looking at the slack plugin it literally looks like they are parsing the fail2ban logs with a bash script

pale vessel
earnest phoenix
#

i a m

#

always has been

south sinew
#

oop found a way, its via a file in /etc/fail2ban/action.d/

#

that makes things easy

earnest phoenix
#

whats up with that file extension

south sinew
#

action.d is a directory

#

so like i'm making the file /etc/fail2ban/action.d/discord-webhook.conf

#

just gonna ignore this

earnest phoenix
#

@oak cliff uhh

south sinew
#

smh

#

these are the type of people that buy discord badges lmao

#

oop

earnest phoenix
#

mommy beaned them

south sinew
#

<3

earnest phoenix
mellow kelp
#

The body must be in json

#

so

#
fetch('url', { body: JSON.stringify({ grant_type: 'client_credentials' }) })
earnest phoenix
#

im trying

hollow sedge
#

Formatting 😩

mellow kelp
#

bruh yes

hollow sedge
#

Will that even work

mellow kelp
#

its just a quick reference

hollow sedge
#

I don't understand how that would work

mellow kelp
#

it also hurts my eyes KEKW

earnest phoenix
#

i am getting a 415 status code error.

hollow sedge
#

Why do you need to stringify only the grant_type

mellow kelp
#

yea true

earnest phoenix
hollow sedge
#

If you had to convert it to JSON, wouldn't you have to do it for the entire body?

#

I mean I could see this either way actually

#

Yeah, you're right

#

I just checked

earnest phoenix
#

The request body data's method of transmission IS JSON not for individual properties

#

how the hell are you gonna be sending an object over the air

hollow sedge
#

You know what

quartz kindle
#

The docs are not asking for json

hollow sedge
#

You're supposed to be coding rn

#

Ok?

earnest phoenix
#

Ik

#

But no

#

Coding on mobile sucks especially on replit

hollow sedge
#

then don't

earnest phoenix
#

And I cant sit on my pc

hollow sedge
#

Connect a keyboard to your phone

#

Ez

earnest phoenix
#

tf

#

how

hollow sedge
#

Idk, there's probably a way

earnest phoenix
#

i have the micro usb or whatever it's called port for my phone

#
await fetch("https://accounts.spotify.com/api/token", {
        method: "post",
        grant_type: "client_credentials",
        headers: {
            "Authorization": "Basic ....."
        }
    })
    .then(
        function(response, body) {
            if (response.status !== 200) {
                console.log(body)
                console.log(response.status)
                return;
            }

            response.text().then(function(data) {
                console.log(data);
            });
        }
    )
    .catch(function(err) {
        console.log(err);
    });

i'm getting a 400 error. what's wrong

#

you know that the end of the usb that connects to the computer is big

hollow sedge
#

Where's the body?

earnest phoenix
#

@earnest phoenix is that an actual URL

#

when i tried i got error 415.

quartz kindle
#

Its not json

#

Youre not supposdd to send them json

#

They want urlencoded

earnest phoenix
#

Time to go play agar.io bye people who are on my bonk list

snow urchin
#

Why do I get this error when running guild.members.fetch()? The server has 5 members

sudden geyser
#

do you have intents enabled

snow urchin
#

u dont need intents unless u get 75+ servers?

sudden geyser
#

You still need to enable it.

earnest phoenix
#

oh boy

#

how do people still have misconceptions about intents

quartz kindle
#

You need the server members intent to be able to request all guild members

#

You dont need it to request only one member

snow urchin
#

well, what if I need the member count of a server 😄

quartz kindle
#

You use guild.memberCount

snow urchin
#

i- forgot that existed

#

i hate life 😄

earnest phoenix
#

i'm literally at the point where i need to use node 15 cause of proper native abort controller support but so many packages break with node 15 so i have to fork them, adjust them for node 15 and then install from the repo

quartz kindle
#

Lul

earnest phoenix
#

this is fine, totally fine

quartz kindle
#

The problem is not node

#

Its npm v7

#

Its breaking lots of installs

earnest phoenix
#

process.stdin?

quartz kindle
#

Abort controller

#

Its a signal you can send into a function or promise to cancel it from the outside

tired panther
#

Have a problem:
Same code, but two differenes:
1.Win 10 pc
2.Linux server on debian
And the second one is not working, its outputting a error in a db fetch, which the win 10 pc do not do.

earnest phoenix
earnest phoenix
earnest phoenix
tired panther
tired panther
earnest phoenix
#

sure it will

earnest phoenix
#

the error is the key to everything, you telling me your os is the less important thing here

#

That's actually possible iirc

tired panther
earnest phoenix
#

vm

tired panther
#

but this error does not happen , when I do it on my win 10 pc

earnest phoenix
#

@tired panther code plz

#

I should make logs for my errors ngl

#

you need to properly handle your errors

#

don't log to discord

#

and print out the full stacktrace

#

...why the fuck would i log on discord

#

i was referring to meister

tired panther
earnest phoenix
#

fs.createWriteStream("log file path")
then keep writing data to it, should i?

tired panther
earnest phoenix
#

take a guess

tired panther
#

I can not look every second in the server

earnest phoenix
#

you don't have to?

#

just ssh into it whenever you see something isn't working correctly

earnest phoenix
#

you should look into sentry, meister

tired panther
earnest phoenix
#

whaaaaaat?? when program no worky people complain to developer??? no way!!

tired panther
#

1 error happens every day xD, all other are handeld successfully

earnest phoenix
#

my internet is having a stroke

tired panther
#

So do you had a kind of same problem?

#
let dm = await count.fetchUser(bumpedby)
                        
                        if(dm.status === "beta"){
#

happeing here

earnest phoenix
#

so your fetchUser method returned null

#

find out why

earnest phoenix
#

if you're using a local-based database, the database you have on your pc and the one you have on your vps will not have the same data

#

so if i send a 100 Kb chunk then a 10 byte chunk the 100 KB one would finish writing first THEN the 10 byte chunk

#

amirite?

earnest phoenix
#

including promise rejections

#

never say never

#

it doesn't have to be your app that crashes

#

it can be your vps provider

#

and what's wrong with not being able to log one error

tired panther
#
static async fetchUser(userids) {
  
    if (!userids) throw new TypeError("A user was not provided.");

    const user = await count.findOne({userid: userids });
    if (!user) return false;

    
    console.log("user id and other fetched");
    return user;
  }
``` what is here the problem?
earnest phoenix
#

it's your code

#

you tell us

tired panther
#

nothing its work on my pc, same command

#

but not on the linux server

tired panther
#

It works on heroku .... everywhere, but not on the linux server

earnest phoenix
#

you using mongodb atlas or local

tired panther
earnest phoenix
#

well how is it causing problems

#

the db is hosted on atlas so it should be the same everywhere

tired panther
#

yes

#

thats way my head is 🤯

earnest phoenix
#

by the code you shared, fetchUser will never return null

#

the error says fetchUser returned null

#

you most likely don't have the same code on both machines

tired panther
#

user.status returns null xD

restive furnace
#

he prob means undefined

#

null is just shorter to write

earnest phoenix
#

im confused how that is relevant though

#

they don't use that anywhere

#

unless they couldn't read their stacktrace properly

noble trail
young ember
#

I am using the DBLPy module

#

And it says i need to define get_user_vote

hollow sedge
#

you need to call it from the client

#

its a method

#

@young ember

young ember
#

@hollow sedge how do i do that?

hollow sedge
#

show me all the code

young ember
#

@hollow sedge

#

Soz, im on mobile lok

#

Lol*

hollow sedge
#

where are you creating the dblpy client..?

#

@young ember

young ember
#

Hold up. I forgot abt that

#

@hollow sedge hold up, the docs got me confused, how do i make it?

hollow sedge
#

look at the docs

young ember
#

@hollow sedge this?

#

If yes, i dont understand the bot bit

limber edge
#

What code could I use in My Math Bot? I Forgot the code ;-;

hollow sedge
#

You should probably just connect it to an API

earnest phoenix
#

Someone who knows how to deal with moment knows how to tell me how to leave it in the format, for example: 1 month, 5 days and 3 hours (discord.js)

quartz kindle
#

moment.duration(amount of time).humanize()

earnest phoenix
#

ok! I go try

lyric mountain
#

ig you need to split it before

#

ah, wait

#

you're doing it wrong

#

you need to get the difference between current time and message creation time

earnest phoenix
#

message.createdTimestamp - message.member.joinedAt @lyric mountain

lyric mountain
#

no

earnest phoenix
#

like this?

#

oh

lyric mountain
#

get current time, not join time

earnest phoenix
#

date.now()?

lyric mountain
#

ig

#

or new Date() idk

#

not a JS dev, but the logic behind it is the same

#

current date - target date = interval

earnest phoenix
#

ya

#

i put this

quartz kindle
#

Date.now()

clever agate
#

at Object.<anonymous> (/rbd/pnpm-volume/dfba60fc-72a3-4d95-9c08-ac1aa82d8721/node_modules/.registry.npmjs.org/better-sqlite3/7.1.1/node_modules/better-sqlite3/lib/index.js:2:18)

#

at bindings (/rbd/pnpm-volume/dfba60fc-72a3-4d95-9c08-ac1aa82d8721/node_modules/.registry.npmjs.org/bindings/1.5.0/node_modules/bindings/bindings.js:126:9)
at Object.<anonymous> (/rbd/pnpm-volume/dfba60fc-72a3-4d95-9c08-ac1aa82d8721/node_modules/.registry.npmjs.org/better-sqlite3/7.1.1/node_modules/better-sqlite3/lib/database.js:9:24)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)

earnest phoenix
#

"Invalid date"

quartz kindle
#

there's no member.createdTimestamp

prime glacier
#

SyntaxError: Error parsing /home/ubuntu/secret/package.json: Unexpected token < in JSON at position 1104

earnest phoenix
#

ok

#

I'll try anyway, if I can't, can I mention you?

opal plank
#

fucking finally

#

bruh writing docs in markdown is such a shitshow

crimson vapor
#

I agree

opal plank
#

at least theres a sense of accomplishment once its done

earnest phoenix
#

@quartz kindle It worked :D

crimson vapor
#

the same as there is when you finally fix that bug

opal plank
#

bugs im more used to, its just that doc writing is just plain walls of text without logic

earnest phoenix
opal plank
#

leave it like what?

earnest phoenix
#

I don't know how that word is in English

opal plank
#

say it in portuguese then

earnest phoenix
#

I think it's like putting

opal plank
#

if its a word or two its fine, we just cant chat in another language in this channel

#

whats the word in your language?

earnest phoenix
#

deixar

opal plank
#

yeah, how do you put it like this

#

you mean embed?

#

like that box?

earnest phoenix
#

ya

opal plank
#

which library are you using?

#

discord.js?

earnest phoenix
#

discord.js

opal plank
#

try this

earnest phoenix
opal plank
#

message.channel.send({
embed: {
description: user
}
})

#

send() can take an object

earnest phoenix
#

wait

opal plank
#

which you can specify what its int

#

Loritta uses Fields

#

the way im sending you is with description

earnest phoenix
#

I think I got confused, I'm referring to time

opal plank
#

you already got time, no?

#

5 meses

earnest phoenix
#

I wanted it to stay in that format

opal plank
#

it will stay in that format though

earnest phoenix
#

"5 months 4 days 6 hours"

opal plank
#

isnt that how it is already?

#

im fairly certain humanize() does it for you

#

unless humanize has some custom params

earnest phoenix
#

If I put only that expression that I sent the photo, it only shows the months

#

So, what can I do?

opal plank
#

try somebody else

#

it does have thresholds

earnest phoenix
#

okok

opal plank
#

i think the proper method isnt humanitze()

#

its fromNow

earnest phoenix
#

Could you give me an example? I'm still very confused

opal plank
#

trying to see

#

but aparently humanize() only brings the biggest threshold rounded

#

which is odd

earnest phoenix
#

hmm

opal plank
#

theres an issue for it

#

take a look at that

earnest phoenix
#

What if I make a file?

#

okok

crimson vapor
#

Erwin

#

I have a question of preference for you

opal plank
#

they are either a)
using one of the solutions in that
b) using a different lib
c) they got their own humanize() method

crimson vapor
#

expressjs server do I make my code into one big class or nah?

opal plank
#

depends, i personally only use classes for constructors

#

i dislike classes

crimson vapor
#

ok

#

alright ty

steep chasm
#

can i ask here about apis ?

crimson vapor
#

you can

opal plank
#

np

steep chasm
#

What is the best Covid API w/ json format and last update time

opal plank
#

yeah

#

scraping from bing prob best bet

steep chasm
#

link ?

opal plank
#

though im sure theres tons of covid apis

#

i dont have a link for it

steep chasm
#

what is the best one u know ?

opal plank
#

bing has some private real time updates

#

bing

opal plank
#

though, while it comes with VERY accurate results in real time, its a REALLY hard api to deal with since they dont want people to be scraping their shit @steep chasm

crimson vapor
#

config.json or env? which should I use?

steep chasm
#

bruh

opal plank
#

preference

#

i use json

crimson vapor
#

whats yours and why?

opal plank
#

though evn has its use cases

#

json is easier when dealing with tons of configurations, which i do

#

i think leviathan has over 80 configs

#

my genshin has over 50 configs

crimson vapor
#

wow

opal plank
#

highly customizable behaviour

crimson vapor
#

alright json it is, but mostly because my config needs to include an array and a few objects

mellow kelp
#

pog

#

i only use .env for tokens and stuff like that

#

for other things i use a config.json

crimson vapor
#

json inside or outside of the src/?

mellow kelp
#

i put it inside because typescript

crimson vapor
#

hmm

#

am using js

mellow kelp
#

then i guess you can put it wherever you want

crimson vapor
#

should I even use src?

opal plank
#

lemme update my eval and show you rq

#

actually

analog tinsel
#

How can I use 2 colors in one line?

#

this eval command from some bot

opal plank
#

this is just the local configs, it fetches more from the database(for global configs)

analog tinsel
crimson vapor
#

he uses json response I think

opal plank
#

million, i wouldnt worry about half of the stuff you asking me tbh

#

it all boils down to preference and use cases

#

just blindly copying does no good tbh

crimson vapor
#

yea ik but idk why to do one or the other and ill just end up rolling a dice or somethng

opal plank
#

they have their pro's and con's

crimson vapor
#

which is why I ask for your reasons more than anything

opal plank
#

its not about rolling a dice, its about understanding it

crimson vapor
#

exactly

opal plank
#

ENV gets attached onto process and is accessible everywhere

#

json is easy to handle and manipulate, but you need to throw it around like a dirty sock to access it where you want(unless you make it global too or attach on process)

#

ENV is used in a couple cases, if you already got ENV being used, no need for config

mellow kelp
#

what about both tho

opal plank
#

hardly use for it

mellow kelp
#

i got lots of options

#

and tokens too

opal plank
#

unless you REALLY wanna stick to json but some application needs an ENV token

#

then i might see using both

mellow kelp
#

yeah i guess thats me

#

i got many configurations that would be really hard in env

#

but also some tokens

opal plank
#

but for an ACTUAL use, i cant think of many reasons

#

they are alternatives to eachother tbh

mellow kelp
#

well k

opal plank
#

its like using mongodb and postgres

#

why? dunno either

eternal osprey
#

hey i have recently made a music bot. If i type: !play pop smoke invincible, it doesn't play automatically. It requires the person to type a 1 before it plays (it is because it has a list where you can choose from).

#

how can i let it be played immediately?

#

i am using discord player npm pkg

fierce ether
#
const GuildConfigSchema = new mongoose.Schema({
    guildID: { type: String, required: true}, // GUILD ID
    guildName: { type: String, required: true}, 
    prefix: { type: String, default: 's!'},
    embedcolor: { type: String, defualt: "#7489d8"},
    errorembedcolor: { type: String, defualt: "#f53939"},
    commands: { type: Array, default: [] }, // Array of disabled commands (labels)
    modrole: { type: String},
    autorole: { type: String},
    adminrole:{ type: String},
    muterole:{ type: String},
    verificationchannel:  { type: String},
    verificationmessage:  { type: String},
    welcomechannel: { type: String},
    welcomemessage: { type: String},
    mutecase: { type: Number, defualt: 0},
    bancase: { type: Number, defualt: 0},
    kickcase: { type: Number, defualt: 0},
} );``` am i doing something wrong? not working at all?
opal plank
#

the fact that you typed defualt wrong 12 times really triggers me

regal locust
#

How do you make it so when someone invites your bot afterwards they are redirected to the bot's website

slender wagon
#
prize: args.slice(`${host}`).join(" "),

this thing is not able to slice host as it is a mention.
Is there a way i can get through this

opal plank
#

slice() takes indexes

#

if you wish to return an array without that specific argument, run a filter method@slender wagon

young flame
regal locust
#

lol

fallen roost
#

y'all coding bots frm scratch?

earnest phoenix
#

who wouldn't

hollow sedge
#

depends on what you mean by scratch

crimson vapor
#

on scratch? nah none yet

#

sadly

twilit geode
#

my bot!

#

is verified on discord!!!!!!

#

happy

crimson vapor
#

same

wide wharf
#

PLS HELP! HOW TO DOWNLOAD/IDK MODULES??
(I didn't program for a while sorry... Thanks in advance btw)
Console error:

2020-12-18T21:36:18: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
2020-12-18T21:36:18: PM2 log: App [index:0] starting in -fork mode-
2020-12-18T21:36:18: PM2 log: App [index:0] online
Error: Cannot find module 'ffmpeg'
Require stack:
- /home/container/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/home/container/index.js:16:10)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
    at Module._compile (node:internal/modules/cjs/loader:1108:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/container/index.js' ]
}

(Will reply tmrw, I guess... It's night here.. soo gtg Bye)

earnest phoenix
#

type npm i (module)

opal plank
#

cuz im fairly certain they are running on lower staff rn cuz of holidays

#

i've been waiting for mine its been 3 weeks now, which is annoying, they asked me what provider im using 10 days ago and still havent gotten back to me

#

what a nice way to kill my hype train

#

ty discord

earnest phoenix
#

lmao

fading warren
twilit geode
opal plank
#

at this point they'll just see me as the impatient skid

twilit geode
opal plank
#

though its odd that they asked for a reference and halted the verification process for it

fading warren
#

Just ask on there

opal plank
#

meh, fine

fading warren
#

^

twilit geode
#

you probably didnt fill out your verification form very well

opal plank
#

i did the same for my other bots

twilit geode
#

I put like examples and videos and all the shit

opal plank
#

its not about that

#

i did

#

i still hold a copy of my submission

fading warren
#

Yeah I spent around 2 hours on my application

#

Making sure everything was ok

opal plank
#

i've got other applications verified, its just this one thats taking awfully long

fading warren
#

And got accepted in 4 business days

twilit geode
#

sorry erwin

#

just get unlucky sometimes

fading warren
#

Yeah

earnest phoenix
#

how can i do custopm css on my bot page

crimson vapor
fading warren
#

They are normally quite helpful on the discord developers server though

earnest phoenix
#

does someone have an example

twilit geode
#

they ask for your host?

twilit geode
earnest phoenix
#

like this

twilit geode
#

hold on

#

actually you dont want to see mine

earnest phoenix
#

show it

opal plank
crimson vapor
#

yea

#

I would email them asking status or go to discord developers server

#

is there any way for me to say that an object in js has x and y properties?

quartz kindle
#

say where?

crimson vapor
#

anywhere

#

I just want intellisense for it

quartz kindle
#

ah so jsdoc or typings?

crimson vapor
#

hmm

#

its a json tho

umbral zealot
#

Then no.

crimson vapor
#

rip

quartz kindle
#

you want to type a json file?

crimson vapor
#

LOL

#

when you put it that way

umbral zealot
#

Unless you have a plugin in vscode or something.

manic cairn
#

When people use json but say Johnson

quartz kindle
#

you would type the code that loads the json file

#

for example make an interface and assign it to the return object from a json require

#

or a readFile

crimson vapor
#

seems like a lot of work for a config.json

#

ill just live with no intellisense

quartz kindle
#

the json file is not a code itself, is more like an input

#

so you have to treat it as such

#

type your code to expect ZYX properties as input in a certain function

crimson vapor
#

hmm

quartz kindle
#

and then give it the json object from the file as input

crimson vapor
#

yeah ima just open up the json in the side view and live like that

earnest phoenix
#

@inland pulsar

#

can you accept me

#

or friend me

#

velt told me to dm

#

you

inland pulsar
#

alright

crimson vapor
#

im so confused atm

#

why do you need to talk to Toxic Mushroom?

opal plank
#

@twilit geode @fading warren ty for the recommendation, it was an error indeed

crimson vapor
#

are they verifing?

opal plank
#

yup

crimson vapor
crimson vapor
#

honestly im thinking about just coding in ts

#

see how far I get

twilit geode
opal plank
twilit geode
#

hahaha

crimson vapor
#

Rabbit is a real person

twilit geode
#

poggers

crimson vapor
#

I thought it was a code name

opal plank
#

legit verified it 2 minutes after i asked them

crimson vapor
#

wow

twilit geode
#

gg

opal plank
#

i knew there was something off with it, no matter though, its been done

crimson vapor
#

my code is 30 lines and I just finished typing the default options

twilit geode
#

how does one go about making a new role

#

and giving it permisions

crimson vapor
#

language?

untold scroll
#

Help

twilit geode
twilit geode
crimson vapor
#

check the docs lmao they are easy

#

you search in the top right roles and go to roleManager

#

then there should be a roleManager.create or something

#

it it shows what it takes

#

and what it returns

twilit geode
#

ahh

#

i was trying to do it through guild

#

big brain

crimson vapor
#

its guild.roles.create iirc

#

im not sure

twilit geode
crimson vapor
#

ok one sec

#

guild.roles.create is the function

#

guild.roles is a roleManager and a roleManager has a create method

#

so strange that it isnt working

twilit geode
#

i had

guild.roles.create({
            data: {
                name: 'Super Cool People',
                color: 'BLUE',
            },
            reason: 'we needed a role for Super Cool People',
            
        })
crimson vapor
#

what was it returning?

twilit geode
#

hold on

#

it says guild is not defined...

#

i might be dumb

crimson vapor
#

message.guild probably lol

twilit geode
#

but why wouldnt it be defined

#

OH

#

hold on

#

yeah that works

#

Im just big stupid

oak cliff
#

in discord.js, does anyone know if, when a guildCreate or guildDelete event is fired, if i pull the memberCount property- does it include the bot thats being added to the guild or does it give the memberCount before the bot, and vice versa for guildDelete (does it give memberCount with the bot or after the bot is removed)

hollow sedge
#

cant you just test that

oak cliff
#

i can but i wanted to see if anyone knew off the top of their head sure2

hollow sedge
#

oh ok

oak cliff
#

why do the work when someone else might have done it already

hollow sedge
#

true

odd stratus
oak cliff
#

nyaaThumbsup thanks

odd stratus
#

stormzThumbsup Np, pretty sure on a guildDelete it removes the bots membercount as far as I've seen

#

Actually nvm it doesn't seem to do that on the delete event, it still counts the bots

hasty mulch
#

https://pastebin.com/EpH3EFmg

Unhandled exception in internal background task 'weatherembed_loop'.
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 101, in _loop
    await self.coro(*args, **kwargs)
TypeError: weatherembed_loop() missing 1 required positional argument: 'ctx'
#

I am confusion

hollow sedge
#

@hasty mulch you need to have the ctx argument

hasty mulch
#

Did you read the code?

hollow sedge
#

You never posted it

hollow sedge
#

Yes

#

The bottom error

#

Read that

hasty mulch
#

The link is the code, smh

sudden geyser
#

It's not going to receive a ctx parameter because there's not going to be context for the subject

hasty mulch
#

It was fine before I had to use self to get icon_url working

sudden geyser
#

If you want to send a message in a certain channel, you should rely on the bot field you receive in your initializer (assuming you're using cogs)

hollow sedge
#

Lite is right

#

It's not a command, there is no context

sudden geyser
#

You can't get info about the guild LIPD because there's no context to refer to. It's a loop that's called on a set interval.

hasty mulch
#

I want to get the icon_url

#

It looks cleaner

sudden geyser
#

You'd need to reference the guild somehow. If, for example, your users could enable that loop feature and you stored the guild IDs persistently, you could fetch the IDs and for each one send a message. You need to know the guild or channel in order to send a message in the first place.

hasty mulch
#

Alright, I’ll try referencing it outside the loop

trim saddle
#

@quartz kindle so, i don't get any errors from discord ws

distant cobalt
#

I tried installing quick.db but it got a ton of errors. I downloaded it by npm i quick.db is that right?

sudden geyser
#

what are the errors

distant cobalt
sudden geyser
#

so it couldn't find python

distant cobalt
#

?

#

how do i fix that?

sudden geyser
#

You see the message printed after the last screenshot you shared correct

#

It should tell you how to install it.

distant cobalt
sudden geyser
#

I know.

distant cobalt
#

erm

sudden geyser
#

To build quick.db (which relies on better-sqlite) it needs Python.

distant cobalt
#

oh

#

how do i do it? I looked on the last screenshot, can't find it

quartz kindle
#

you need the whole build tools, not just python

distant cobalt
#

how many is that?

quartz kindle
#

npm install -g windows-build-tools from an administrator cmd or powershell

distant cobalt
#

ok

quartz kindle
#

do what it says

distant cobalt
#

I did

#

i went to cmd prompt

quartz kindle
#

thats not what it says to do

distant cobalt
#

Erm

quartz kindle
#

click the windows button
type "powershell"
right click
run as administrator

distant cobalt
#

oop

#

found ti

wild mist
#

run as administrator

distant cobalt
#

erm

quartz kindle
#

you dont need to change directories

#

npm install -g means its a global install

distant cobalt
#

okay

wind vault
#

"inconsistent use of tabs and spaces in indentation (<unknown>,line 155 pylint(syntax-error) [155, 121])"

#

How do mean this?

#

Hello, I have a problem, When I do all the embed to the skin of the letter, There is one or another that makes me a problem because of the error that I just sent and I review and run it in another embed and it gives me perfectly, someone knows the solution ? +

distant cobalt
#

does anyone here have some time to teach me something?

mellow kelp
#

don't ask to ask KEKW

#

but whats your problem

crimson vapor
#

teaching is my favorite thing that people ask for

#

because it shows that they want to understand, not just for it to work

mellow kelp
#

yea true

#

"teach", the chad of coding questions

earnest phoenix
#

and then they ask you how to program a self driving car from scratch

crimson vapor
#

from scratch or in scratch?

lyric mountain
#
car.getMotor().setThrottle(100);
while (car.isOn()) {
	car.getSteering().setAngle(Math.random() * 360);
} 
#

Here, a self driving car

crimson vapor
#

thats some poggers code

#

gotta add a disclaimer in the fine text when you buy it

lyric mountain
#

Gotta make the fine text really fine

mellow kelp
#

yeah

#

like

#

font-weight: 1

hollow sedge
#

Wait I didn't see the random thing

earnest phoenix
#

My bot's database registers a user using a message event, but apparently if you are new and spam in the chat, it registers more than once

#

Can I settle for a settimeout?

hollow sedge
#

I think it would use radians rather than an angle

earnest phoenix
#

mongodb

crimson vapor
#

oh shit

#

you're gonna cause errors with that code

hollow sedge
#

True

crimson vapor
mellow kelp
#

shouldn't you check if a user is alreay registered first

hollow sedge
#

Gj million

#

You did it

mellow kelp
#

whoa there

earnest phoenix
mellow kelp
#

future elon musk

earnest phoenix
#

i make this

crimson vapor
#

no more errors PoggersRowPoggersRow

hollow sedge
#

YAY

earnest phoenix
#

Prefixo = prefix

hollow sedge
#

You shouldnt do it on message

#

You should do it when they use a command

earnest phoenix
#

makes sense

#

thank you bro

hollow sedge
#

That's not a fix tho

earnest phoenix
#

my bot has smart cooldown, I think it should solve

crimson vapor
#

because code uses radians

hollow sedge
#

You can do an insert if not exists

#

Yeah

crimson vapor
#

if we use degrees it will be so funky

hollow sedge
#

JS canvas uses radians

crimson vapor
#

most shit does

#

it makes more sense

hollow sedge
#

Yeah

lyric mountain
#

It is so hard to get used to radians tho

hollow sedge
#

It gets better when you learn about it in math

#

If you haven't yet

earnest phoenix
#

ok sir

mellow kelp
#

yea probably

#

whats are radians used for?

hollow sedge
#

Same as angles

#

But numerical form I think

lyric mountain
#

Nope, didn't expand on math side, I went to system hell college

hollow sedge
#

Woah

#

That sucks

lyric mountain
#

Tons of uml and paper

earnest phoenix
#

I use discord.js

lyric mountain
#

With some flavor of development

earnest phoenix
#

oh

#

okok

crimson vapor
#

I prefer radians

hollow sedge
#

It makes more sense

crimson vapor
#

I agree

#

since realistically we could make a circle 400 degrees instead of 360 and nothing would change

hollow sedge
#

Yeah

carmine summit
#

Is there something like:

let letter = "a";
letter++
//b
hollow sedge
#

Huh

crimson vapor
#

umm

hollow sedge
#

Oh I see

crimson vapor
#

kinda?

carmine summit
#

wait

hollow sedge
#

Why would you want to do that though

crimson vapor
#

you can get the charCode

#

increase it

hollow sedge
#

I don't see why someone would need this tho

carmine summit
hollow sedge
#

Ohh

lyric mountain
#

Js is weird

lyric mountain
#

Some combinations merge

carmine summit
#

hmm?

hollow sedge
#

Fr?

#

Why

lyric mountain
#

Like, I some dude showed that here

#

They become the flag iirc

hollow sedge
#

Weird

carmine summit
#
i = `:regional_indicator_${x}:i`
)```
#

hmm?

lyric mountain
#

🇫

hollow sedge
#

Don't you need {i}

lyric mountain
#

With 🇷

hollow sedge
#

Not just i

lyric mountain
#

🇫🇷

hollow sedge
#

Uh

#

Didn't work

carmine summit
#

uh

lyric mountain
#

Space

#

Can't have space

hollow sedge
#

Woah

lyric mountain
#

Try it urself

#

Use F and R

hollow sedge
#

Ok so thats why it's called regional indicator

lyric mountain
#

Without space

hollow sedge
#

That's actually really cool

lyric mountain
#

Yeah, turns out it indeed is a regional indicator lul

mellow kelp
#

🇧

hollow sedge
#

🇺🇸🇦

#

Cool

lyric mountain
#

Always thought why it was called regional_indicator instead of alphabet

mellow kelp
#

Rush 🅱️

hollow sedge
#

Lol

carmine summit
#

hmm

#

so how do I do this?

crimson vapor
#

because discorb™️

mellow kelp
#

ah yes

hollow sedge
#

Btw

#

Don't use forEach

mellow kelp
#

if you make a spelling error, trademark it

hollow sedge
#

It's slower

mellow kelp
#

maybe it depends

hollow sedge
#

usually

mellow kelp
#

i made some tests and foreach was somewhat faster than for of

lyric mountain
#

forEach has more memory usage because of the overhead

mellow kelp
#

but of course for(let i =0;... is always faster

carmine summit
#

now we're changing topic

mellow kelp
#

but u g l y

carmine summit
#

bruh

lyric mountain
#

Anyway

hollow sedge
#

What was your question anyway

#

I thought it was answered

lyric mountain
#

Cast the string to integer

hollow sedge
#

I sent you a link

lyric mountain
#

It'll get u the unicode

carmine summit
lyric mountain
#

Answer is neymar

crimson vapor
#

messy > slow

hollow sedge
#

Sometimes the first answer isn't the best one

#

Keep looking through them

crimson vapor
#

if it were up to me I would get from charCode

lyric mountain
#

Also look at the comments

crimson vapor
#
  • 1
#

turn back to string

lyric mountain
#

Sometimes comments contain gems

hollow sedge
#

Yeah that's what the answer is

#

Truee

lyric mountain
#

Stack's answer block is silly

carmine summit
#

so uhh

#

A = 65

#

interesting

#

and a = 97

#

tf?

lyric mountain
#

Yep

hollow sedge
lyric mountain
#

A isn't equal to a

hollow sedge
#

heres a cool reference

#

it also shows why the char codes are what they are

carmine summit
#

ok then back to work :DD

lyric mountain
#

a is 0100 0001

carmine summit
#

and, im just gonna use for

lyric mountain
#

And A is 0101 0001

hollow sedge
#

in what?

lyric mountain
#

Binary

hollow sedge
#

oh

lyric mountain
#

Like, that extra 1 in the first 4 numbers is what defines if it's uppercase or not

hollow sedge
#

yeah i see

lyric mountain
#

Btw, for regional indicators you could simply use unicode notation

hollow sedge
#

^ you can just paste the emoji

carmine summit
#

With an array?

lyric mountain
#

Regional A is \u1F1E6

carmine summit
#

that has random length?

lyric mountain
#

Just increase the last numbers and you'll get the sequence

#

F1E7 is B

#

F1E8 is C

carmine summit
#

now that I got that sorted, how do I decode it?

lyric mountain
#

You don't need, emojis are already stored like that

hollow sedge
carmine summit
#

cool

carmine summit
lyric mountain
#

When you paste any emoji in most IDEs they'll parse to unicode notation

hollow sedge
#

i know, i was just saying its an alternative to using unicode notation

carmine summit
lyric mountain
#

Unicode is the fastest and easiest way

hollow sedge
#

i like the visualization

hollow sedge
lyric mountain
#

Because it has an extra byte

hollow sedge
#

arrays can have any length

lyric mountain
#

Just a sec

carmine summit
lyric mountain
#

\uD83C\uDDE6

carmine summit
#

ah yes

lyric mountain
#

Here

#

That'll parse to a single emote

carmine summit
#

what's that?

hollow sedge
#

why do you know so much about emojis lol

lyric mountain
carmine summit
#
  for (i = 0; i < randomized.length; i++) {
    let j = i + 6;
    let base = "\u1F1E" + j;
    randomized[i] = base + decodeURIComponent(randomized[i]);
  }
```uhhh
lyric mountain
hollow sedge
#

oh

lyric mountain
#

You can't do it like that

#

Use the surrogate pairs

lyric mountain
carmine summit
#

wdym?

lyric mountain
#

Increase the last 2 numbers

#

In this case, E6

carmine summit
#

last 2?

lyric mountain
#

Yeah, you could increase everything, but you'll not get regionals anymore

#

Like, you'll increase at most 26 times

hollow sedge
#

wait why not just use .push

#

with an array

lyric mountain
#

Yeah, there's that too

carmine summit
#

wont let me :/

hollow sedge
#

isnt it \\

#

maybe not

#

yeah probably not

lyric mountain
#
for (int i = 0; i < options.length(); i++)				eb.addField(new String(new char[]{"\uD83C\uDDE6".toCharArray()[0], (char) ("\uD83C\uDDE6".toCharArray()[1] + i)}) + " | " + options.getString(i), Helper.VOID, true);
#

Here's how I do it

#

Sorry, it's a long line

#

Ig showing the actual code would be easier to read wouldn't it?

tardy pecan
#

Hey, I have a newbie question, is there a specific way to make a web page to configure a bot like for example the Tatsumaki bot?

lyric mountain
#

But basically, split that unicode in a char array

#

Then increase the second char by the number u want

#

Add 1 and it'll become B

carmine summit
#

wha?

lyric mountain
#

Add 2 and it'll become C

carmine summit
#

whaaa??

hollow sedge
#

its quite involved

lyric mountain
#

Here, line 127

lyric mountain
#

Reading with actual highlight is easier

hollow sedge
#

its not something that can be answered here though

carmine summit
#

IS THAT JAVA?!?!

lyric mountain
#

Yep

hollow sedge
#

you need to know about web apps and a ton of other stuff

lyric mountain
#

But look at the logic, not the actual syntax or stuff

carmine summit
#

oh, that's why

#

uhh

lyric mountain
#

Regardless of the lang, u can do tbe same thing

hollow sedge
#

is it just me or does java require a ton of imports

#

like theres 20 imports

lyric mountain
hollow sedge
#

same for python but i dont see this happening

lyric mountain
#

Also, I use a lot of references in that file

hollow sedge
#

perhaps its because of all the java util imports

lyric mountain
#

Just glance at my helper file lul

hollow sedge
#

importing a List 😆

lyric mountain
#

It's at utils folder

lyric mountain
#

I could do utils.*

#

But it's better to use individual imports

hollow sedge
#

you did do that lol

#
import java.util.List;
import java.util.*;
#

does the bottom one include the top

lyric mountain
#

Hm

#

Idk then, intellij is who manages most imports

hollow sedge
#

oh i see

#

it just imports as you use them?

lyric mountain
#

Yep

#

There's an option to disable that

hollow sedge
#

thats cool

lyric mountain
#

Also works for node in ultimate edition

#

And python

#

Idk about lua

hollow sedge
#

ha

lyric mountain
#

But anyway, back to topic

hollow sedge
#

who even uses that

carmine summit
#

hey

#

found this