#development

1 messages · Page 1121 of 1

delicate shore
#

ok

wanton anvil
#

How to create a channel in a pre built category

#

using dpy

pine aspen
#

How could I make a function that repeats itself 10 times after another function is made.

#

First run -> Run the Function -> wait for user input -> Second run

restive furnace
#

like what?

#

while (otherFunctionrunning && timesran !=> 10)
{
// your stuff
}

earnest phoenix
#

use a for loop over a while

austere robin
#

Hi

#

Im Wondering on how to make logging stuff

#

so mod commands get logged in (channel)

lusty quest
#

store the channelid somewhere (json file works too) then just make sure on bot Startup the channel is cached. Then just add in your Moderator Commands a function that sends a message into the stored channel

radiant kraken
#

Im Wondering on how to make logging stuff
@austere robin use events provided by your library

#

and send it to some channel you preferred (or store it on database)

austere robin
#

wdym? im new to coding. started making bot first time yesterday

#

lol

radiant kraken
#

what language do you use?

austere robin
#

discord.js

lusty quest
#

its simple

austere robin
#

@radiant kraken wait so, would i need to make a new json file?

#

i mean brain

lusty quest
#

did you have a json file where you store your configuration?

radiant kraken
#

like config.json

austere robin
#

nope

#

lol

#

i feel like im trash xd

lusty quest
#

did you use a Database?

austere robin
#

nope

#

ive only used 1 file for all the code so far

radiant kraken
#

oh.

lusty quest
#

wtf man. did you Hardcoded everything in to your bot (prefix as example)

austere robin
#

lol wdym? hardcode?

lusty quest
#

its nothing bad the json file makes it just easy to change the channel if it changes

radiant kraken
#

try learning editing json files in javascript, there are a lot of tutorials out there

lusty quest
#

you dont need it its just a qol feature

austere robin
#

wait, im using a json file.....

lusty quest
#

then just make a new key where you store your ChannelID

austere robin
#

bruh, explain more

#

lol, i only started yesterday

lusty quest
#

you have something like this : ```json
{
prefix: "!"
}

austere robin
#

ehhh

misty sigil
#
{
// other stuff here
"channel":"channelid"
}```
austere robin
#

no....

radiant kraken
#
{
    "serverid": "channelid"
}```
austere robin
#

do u want me to make that

#

no

#

i do not have it

lusty quest
#

did you got a config.json?

austere robin
#

no

lusty quest
#

or is it a package.json?

austere robin
#

i got a package.json

radiant kraken
#

where did you code your bot? @austere robin

lusty quest
#

ok dont touch this file

austere robin
#

@radiant kraken server.js

#

Dont mind the warns and servers and economy and ranks stuff

#

nothing in there -_-

misty sigil
#

you're using json as a db?

earnest phoenix
#

yikes

austere robin
#

whats so bad

#

lol

earnest phoenix
#

everything

misty sigil
#

yikeeess

radiant kraken
#

that's ok if your bot is small though

misty sigil
#

everything literally everything

austere robin
#

Which type is better for a db?

misty sigil
#

mongo or sql

radiant kraken
#

SQLite

livid saffron
#

Sql better

austere robin
#

k

misty sigil
#

quick.db does sqlite easily

#

look into it

earnest phoenix
austere robin
#

lol

radiant kraken
#

my friend had a bot with 500+ servers and still uses json as a db

misty sigil
#

yikes blobyikes

austere robin
#

uve been here for 1 year+

#

Dude, i only started yesterday

#

lol

livid saffron
#

Mega yikes

austere robin
#

-_-

livid saffron
#

500+ server and json as db?

austere robin
#

Wait, so sql?

livid saffron
#

Yeah

austere robin
#

config.sql

earnest phoenix
#

yikes

#

sql is a language

austere robin
#

bruh

#

how would i know that

livid saffron
#

First try learn xampp will be usefull

radiant kraken
#

try learn using mongoose/mongodb

austere robin
#

bruh, alright

ocean violet
#

MongoDB 100% better

radiant kraken
#

it's beginner friendly imo

earnest phoenix
#

for a config json is fine, for ephemeral storage with data that changes often look into using a proper database

ocean violet
#

Just make sure you secured the dB instance

austere robin
#

so do i need to re code everything?

#

ive done 545 lines so far

#

;(

livid saffron
#

545 means nothing since

earnest phoenix
#

lines do not matter in the slightest

mild steppe
#

If u use separate files for each guild will it be fine?

livid saffron
#

You can make it smaller

golden condor
#

you fucking donkey full of yanky danky doodle shite

livid saffron
#

And better

austere robin
#

lmfao @golden condor

ocean violet
#

Mongodb is user friendly especially with mongoose

golden condor
#

Just doing what cry has told us to do

#

lol

austere robin
#

Wait so, im confused af

#

so do i use js?

earnest phoenix
#

i suggest you do research on what a database is, what sql is and what sql databases are

#

you need to grasp a better understanding of this

#

lmfao

austere robin
#

Lol, so Databases are stuff in which data is held

livid saffron
#

Databases is where you store things simple

#

And needs be secured

#

Aswell

radiant kraken
#

database is where you store data so that if your bot goes offline all of the data doesn't disappear

austere robin
#

Yeah ik

#

But the code

#

is different

#

right?

earnest phoenix
#

i can easily explain everything to you right now but you won't understand it, i cant understand it for you ergo you have to do your own research on this

austere robin
#

Lol explain everything right now

#

i'll try and understand

earnest phoenix
#

do the research, im on phone it hurts to type

golden condor
#

Should i...

austere robin
#

yes

earnest phoenix
#

but anyways, there are many layers to a database - from encryption to storage to what type it even is, sql is a querying language meant to work with sql based databases

#

they're built to sustain huge amounts of requests

golden condor
earnest phoenix
#

hence database

#

lmfaoo

austere robin
#

@golden condor -_-

golden condor
#

¯_(ツ)_/¯

earnest phoenix
#

once again

#

do your own research

austere robin
#

Yes fine

golden condor
#

and once again...

austere robin
#

lol how long would that take

radiant kraken
#

try watching yt tutorials

austere robin
#

@golden condor bruh dont

#

lol

earnest phoenix
#

no

golden condor
#

lmao

#

i'll stop now

pine aspen
#

How could I make a function that repeats itself 10 times after another function is made.
First run -> Run the Function -> wait for user input -> Second run

earnest phoenix
#

stop suggesting youtube tutorials because you damn well know they'll end up on a how to and end up copypasting

golden condor
#

use a while or a for loop

#

e.g

pine aspen
#

Callum I am.

earnest phoenix
#

@austere robin there is no set "how long will that take", once you get it you'll get it

austere robin
#

alr

pine aspen
#

It's just causing my bot to crash.

golden condor
#
for (let i = 0; 10 > i; i++){
//do something
}```
pine aspen
#

@golden condor will that allow a function to be fully run

golden condor
#

yes

pine aspen
#
        while (qNumber <= 9) {
            await startGame();
        } 
#

I've been doing this for now

golden condor
#

That will run whatever code you put in there 10 times

pine aspen
#

will it wait

#

Until the functuon is over

austere robin
#

just a question, how long have u all been coding

pine aspen
#

then run it again

golden condor
#

if you use await then yes

pine aspen
#

ok

golden condor
#

like u did above

#

but you can do this instead

pine aspen
#

hmm?

misty sigil
#

just a question, how long have u all been coding
@austere robin 2 months now

golden condor
#
for ( 10 > qNumber; qNumber++){
//do something
}```
earnest phoenix
#

time wise im a senior full stack dev by this point but still in high school lol

misty sigil
#

i mean longer but 2 month bot dev

pine aspen
#

ok.

austere robin
#

@earnest phoenix haha, what grade?

pine aspen
#

for ( 10 > qNumber; qNumber++;) {

#

you mean this?

golden condor
#

I have been coding properly for 6 months

pine aspen
#

for ( 10 > qNumber; qNumber++) {

misty sigil
#

i've worked on some backend before

pine aspen
#

is an error

misty sigil
#

backend is fun

golden condor
#

yes

pine aspen
#

Yes

misty sigil
#

better than frontend

pine aspen
#

frontend = annoying

earnest phoenix
#

junior @austere robin

golden condor
#

Not if you use vue

misty sigil
#

my frontend looks shite

golden condor
#

Vue is good

austere robin
#

@earnest phoenix bruh, ur fking smart then

radiant kraken
#

i suck at UI design

austere robin
#

lol

misty sigil
#

lmao same @radiant kraken

golden condor
#

American grades are confusing

austere robin
#

im in AUS

#

Year 10

golden condor
#

I'm in Year 8

misty sigil
#

aus is australia right

austere robin
#

yeah

pine aspen
#

Callum, only?

austere robin
#

@golden condor ur in AUS??

golden condor
#

no

#

UK

misty sigil
#

i have an aunt in australia

austere robin
#

alr

golden condor
#

how old would I be lol

pine aspen
#

I'm in year 10 but leant coding myself because teachers are pointless.

misty sigil
#

lmao

pine aspen
#

I know more JavaScript then them.

austere robin
#

lol

pine aspen
#

I sometimes have to teach the class.

austere robin
#

i just want the bot dev badge

#

-_-

floral creek
#

I am in year 9 same

misty sigil
#

don't make a bot just for the badge

austere robin
#

@misty sigil Lmfao, i'll continue it

radiant kraken
#

you need to work hard to get the badge

austere robin
#

@radiant kraken ik

misty sigil
#

also you need to have ID

#

that you are willing to verify with

pine aspen
#

Yeah.

#

It's not working.

#

can someone tell me a simple fix.

golden condor
#

Eris

pine aspen
#

Oi.

golden condor
#

Respect

pine aspen
#

Ey.

#

Usually people are like. Ewww.

golden condor
#

Let me just refine your code a bit

#

This might help

pine aspen
#

Alright.

#

I've never worked with something like this become.

#

It has become a challenge.

golden condor
#

Give me a sec

#

Discord is taking ages to load on my pc

pine aspen
#

Nw

silk wadi
#

how to be bot dev

#

role

golden condor
#

Make a bot

#

Submit it

#

And get accepyed

silk wadi
#

so i just wait for them to accept?

#

ok thanks

golden condor
#

Yes

lusty quest
#

any suggestions how to get the userid of every user that reacted with x emote?

pine aspen
#

Yes.

golden condor
#

Yeah

#

What lib

pine aspen
#

Emoji Reactor.

lusty quest
#

js

golden condor
#

Djs?

lusty quest
#

@pine aspen doesnt work

pine aspen
#

Probs discord.js

lusty quest
#

yes

pine aspen
#

lies

golden condor
#

I think uh

pine aspen
#

I'll send code.

lusty quest
#

im already in a event

golden condor
#

hold on

lusty quest
#

messageReactionAdd event. i want to prevent users from adding mutiple reactions to a message

pine aspen
#

m.forEach(m => m.userid)

#

filter?

golden condor
#

You could loop through all reactions

pine aspen
#

that too.

golden condor
#

See if they have added another one

#

And remove one of them

lusty quest
#

yea just got a idea

pine aspen
#

👍

golden condor
#

Alr

#

Pc is being very slow

#

AAAA

pine aspen
#

lol

#

It's fine.

#

Idm

#

Is like discord no loading?

golden condor
#

I'm on my phone rn

#

Yes

pine aspen
#

If so go to task manager

#

look for all discord processes.

#

end them

golden condor
#

I am tryna use web

pine aspen
#

then reopen discord

#

ok

#

web

#

nvm then

golden condor
#

I just wrote it out on my phone lol

pine aspen
#

Lol

#

So this should work?

faint prism
#

Ngl I thought this was the website's tagline

Please, help
Trying to get a full thing done with the user input. Doesn't work and just skips.

pine aspen
#

I'll check and compare my code.

golden condor
#

Oh wait nvm gonna fix it

#

I just saw a bug

pine aspen
#

Ok.

#
0|index  | SyntaxError: Unexpected token ';'
0|index  |     at wrapSafe (internal/modules/cjs/loader.js:1054:16)
0|index  |     at Module._compile (internal/modules/cjs/loader.js:1102:27)
0|index  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
0|index  |     at Module.load (internal/modules/cjs/loader.js:986:32)
0|index  |     at Function.Module._load (internal/modules/cjs/loader.js:879:14)
0|index  |     at Module.require (internal/modules/cjs/loader.js:1026:19)
0|index  |     at Module.Hook._require.Module.require (/root/.nvm/versions/node/v12.18.1/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:80:39)
0|index  |     at require (internal/modules/cjs/helpers.js:72:18)
0|index  |     at Object.module.exports.run (/root/ModCord/commands/developer/reload.js:16:22)
0|index  |     at runMicrotasks (<anonymous>)
0|index  |     at processTicksAndRejections (internal/process/task_queues.js:97:5)
#

btw

golden condor
#

...as soon as Firefox loads

pine aspen
#

lol

#

fixed

#

maybe

golden condor
#

At the end

#

You said

#

if(qNumber = 10) change that to if (qNumber === 10)

pine aspen
#

ok

faint prism
#

Oof, assignment rather than comparison

pine aspen
#

Yeah that was a pretty terrific error.

golden condor
#

Yep

earnest phoenix
#

Hi

pine aspen
#

hmm

#

no

#

Callum didn't fix it.

faint prism
earnest phoenix
#

I'm from Brazil

remote silo
#

Not sure if this is the correct channel, but, where do you recommend me to host a music bot?

#

and what specs would you recommend? and internet speed maybe?

faint prism
remote silo
#

Let's say a 1000 servers

earnest phoenix
#

How can I add a bot to my server?

remote silo
#

what specs would you recommend

faint prism
#

Invite one via a link @earnest phoenix

#

Depends on the calculations a command performs @remote silo
Bot's are typically pretty lightweight

#

Mine is running on a rasp pi 4's specs if that gives you an idea

remote silo
#

Music bots are not that lightweight

#

ah

#

how much ram?

earnest phoenix
#

Invite one via a link @earnest phoenix
@faint prism Thank you

faint prism
#

Really depends on the data you hold in memory, man. I can't do a profiling of your bot's overhead. Open TaskManager and see how expensive it is to run

earnest phoenix
#

Besides me, are there other Brazilians around here?

faint prism
#

Np

opal plank
#

Bad idea to use task manager to check memory

#

se process.memoryUsage

#

check for rss

faint prism
#

I typically do a profiling in VS, but I wasn't sure how JS devs do it

finite bough
#

process.memoryUsage()

#

just like that

#

lmao

opal plank
#

i dont even use vs for memory profiling

#

its good for cpu profiling, but i use chrome for memory

pine aspen
opal plank
#

await message with a filter

pine aspen
#

Check the code.

opal plank
#

assuming its d.jsd

pine aspen
#

I linked it.

#

No it's eris.

#

But I found a way.

opal plank
#

it seems rather bad to be doing those regexes like you are tbh

misty sigil
#

like <:name:id> or just ID?

opal plank
#

emoji name is just the name iirc

quartz kindle
#

its either name or id

pine aspen
#

Erwin any idea how I could fix it then?

#

Stuck I am ;p.

opal plank
#

since i dont know eris, no, but regexing the mesages doesnt seem like a very good idea

pine aspen
#

Ok.

opal plank
#

specially cuz you arent lowercasing them

quartz kindle
#

i wouldnt use collectors for that

#

it makes everything needlesly complicated

#

are you using eris additions or whatever that package name is?

pine aspen
#

Yes.

#

No

#

Wait

quartz kindle
#

do you have access to a helper function like awaitMessages?

pine aspen
#

No.

#

I could find an addition for it though.

quartz kindle
#

you could make your own too, its a wrapper around the collector

#

that returns a promise that resolves once its conditions are met

earnest phoenix
#

Slc maluco é bilíngue

quartz kindle
#

makes it much easier to use in this specific scenario

pine aspen
#

let responses = await message.channel.awaitMessages(m => m.content === "yes", { time: 10000, maxMatches: 1 });

#

oh

#

ok

#

I can do that

quartz kindle
#

👍

opal plank
#

@earnest phoenix english only here, no hue hue hue

faint prism
earnest phoenix
#

I'll be back to Brazil's servers, bye

digital ibex
pure lion
#

Heyo

#

So

#

It's still not working and idk what to do

digital ibex
#

whats not working?

#

i've not been coding or anything dev related for the past few days soooo might not be much help

pure lion
#

It's the fucking poo mug peerjs server

earnest phoenix
#

i dont understand the Spotify API

#

the Docs is bullshit

pure lion
#

Of course you don't understand you easy bake oven

faint prism
#

Doesn't it have sample get/post requests?

earnest phoenix
#

Nope

digital ibex
#

why would they show u how to make an api request?

#

what do u need tho

misty sigil
#

<reaction>.emoji should return emoji stuff right

digital ibex
#

have u tried it?

misty sigil
#

yes

digital ibex
#

what is <reaction> ?

misty sigil
#

its the reaction object from messageReactionAdd

digital ibex
#

because im- oh 1 sec

#

yeah, it does

misty sigil
#

weird

digital ibex
#

?

misty sigil
#

its returning undefined for me

digital ibex
#

how are u doing it?

misty sigil
#

just reaction.emoji

digital ibex
#

send ur code the client.on('messageReactionAdd.... bit

pure lion
#

Would it return a reaction obj or a reaction obj and a message obj?

misty sigil
#
client.on('messageReactionAdd', (messageReaction, user) => {
    console.log(messageReaction, user);
});```
pure lion
#

Oh

#

Fair

misty sigil
#

i've logged the reaction.emoji bit too

digital ibex
#

console.log(messageReaction.me);

#

should return a boolean

misty sigil
#

it does

#

false

quartz kindle
#

so messageReaction logs, but has no .emoji?

digital ibex
#

console.log(messageReaction.emoji.name)

misty sigil
#

yea

quartz kindle
#

seems to work for me

mossy sundial
#

Can i ask what channel i should use if i want to report something

digital ibex
#

i think u dm a mod

#

i think

misty sigil
#

emoji is undefined

digital ibex
#

what discord.js version are you on?

misty sigil
#

latest

mossy sundial
#

Discord.js?

#

How can i find it

misty sigil
#

not you

digital ibex
mossy sundial
#

Ohm mb

quartz kindle
#

lmao

misty sigil
#

lol

digital ibex
#

are u using discord.js-light?

misty sigil
#

nope

digital ibex
#

cuz i believe it recently got updated

#

oh

#

what does messageReaction respond with?

#

like if u just log it

#

doesn't say it would be undefined in any case so

misty sigil
#

wot

#

i think i done something

wanton anvil
#

how to create a channel in specific category using dpy

misty sigil
#

ye fixed it

digital ibex
#

ook

delicate shore
#
          if(msg.auhtor == member) return msg.reply("Boomer, You wanna ban yourself?")```
#

this does not work

#

person can still ban himself

nimble kiln
#

auhtor - typo

delicate shore
#

;-;

nimble kiln
#

idk if msg.author == member works tho, just try 😄

delicate shore
#

oo

quartz kindle
#

auhtor lmao

solemn latch
#

Is member a user object or a member?
User == Member would never be true right?

quartz kindle
#

depends on what kind of type coercion it does

delicate shore
#

not

#

working

quartz kindle
#

but the correct thing would be to compare ids directly

delicate shore
#

i tried

#

it said cannot read property id

opal plank
#

^^

wanton anvil
#

who is member here

quartz kindle
#

its a getter

opal plank
#

is it?

wanton anvil
#

member means bot??

opal plank
#

member means member

#

guild member

solemn latch
#

Member means guildMember

#

Typically

opal plank
#

bot means bot

golden condor
#

Author means User

opal plank
#

var means bad

wanton anvil
#

if message.auhtor == member: do something

#

hahaha

#

😆

golden condor
#

You have to check if there is the member variable first and if there is an object inside of it or if it's just undefined

digital ibex
#

he using javascript

opal plank
#

or use conditional chaining

golden condor
#

Also what is wrong with var

solemn latch
#

Global

golden condor
#

And... Is that an issue? What if you want global

opal plank
#

no reason to use var over let/const, just causes hard to catch bugs down the line

#

if you DO want, use it

solemn latch
#

Then var is usable for that

opal plank
#

but most of the times there isnt reason for it

solemn latch
#

If you can use let, use let

opal plank
#

it does have its uses for sure, but mostly can be replaced by let

golden condor
#

I just switch between the two all the time tbh

wanton anvil
#

what is difference between a category and categoryChannel

solemn latch
#

Thats generally a bad idea

golden condor
#

Nothing wrong with it

#

Sometimes I need to use var because of the global thing

lusty quest
#

yay. cant check something i have coded already in a other bot bcs my NAS is having a stroke again

solemn latch
#

Oh feels bad man

golden condor
#

Sometimes I just instinctively do it

lusty quest
#

i have a brainfart rn. want to remove only 1 reaction from a message not all reactions by this one user

wanton anvil
#

somebody answer my question

what is difference between a category and categoryChannel
@wanton anvil

solemn latch
#

Don't know if there is one

digital ibex
#

i think categoryChannel is the channels in the category, and category is a category object or something idk

wanton anvil
#

no @digital ibex

#

I've checked it's not

delicate shore
#

it worke

#

d

digital ibex
#

i literally said "i think" and "idk" "or something"

delicate shore
#

thanknknknks

#

guyyys

wanton anvil
#

@digital ibex I appericiate it thanks anyways

golden condor
#

Category Channel is a category

wanton anvil
#

no difference?? @golden condor

golden condor
#

No difference

#

If you have a channel

surreal notch
#

hEY

golden condor
#

That is a category

#

It will give you the values of the CategoryChannel class

wanton anvil
#

how can I build a Category class without bot

golden condor
#

A category is an instance of CategoryChannel basically

wanton anvil
#

in py

#

ok

golden condor
#

Idk

#

I don't use discordpy

wanton anvil
#

got it thanks @golden condor you gave me a idea

#

isinstance()

earnest phoenix
#
RangeError: Source is too large
at Uint16Array.set (<anonymous>)
at OpusScript.encode (/root/bot/node_modules/opusscript/index.js:67:16);

Keep getting this when the bot is hosted on a vps but never when i host it on my own pcs

golden condor
#

Yeah that's what I thought

#

But I wasn't sure what it is in py

wanton anvil
#

haha

solemn latch
#

Didn't we help you with this issue already

digital ibex
#

tim already said that the file, or something, ur trying to play is too large

#

something like that idk

earnest phoenix
#

but it only happens on my vps

solemn latch
digital ibex
#

maybe ur vps cant handle it

earnest phoenix
#

it has 80gb ssd space

digital ibex
#

whats the cpu?

#

compared to ur pcs one

solemn latch
#

Ssd space? Your source is from your ssd?

earnest phoenix
#

it's a digitalocean vps

#

the one thats 20 a month

delicate shore
#

Hey

#

I wanna make my bot see

#

If the person he is trying to van

#

Ban

#

Has higher role then him

#

Like I do s!ban @mod

earnest phoenix
#

compare highest role

delicate shore
#

How;-;

#

That's my question ;-

earnest phoenix
#

members have a role property if im not mistaking

delicate shore
#

O

solemn latch
#

Docs explain how quite well

delicate shore
#

:o

solemn latch
digital ibex
#

im having a small issueee if anyone knows

delicate shore
#

So

digital ibex
#

im trying to send "oof" to my api, any ideas how i can do this?

delicate shore
#

So

solemn latch
#

Is this form data?

digital ibex
#

yeah

delicate shore
#

if (msg.author.highestrole < member.user.highestrole) return

solemn latch
#

Then just a post request with all the form data

digital ibex
#

i've got that bit

delicate shore
#

if (msg.author.highestrole < member.user.highestrole) return
It this how u do it

digital ibex
#

but i dont know how to send "oof" to it

#

like, for each server, its going to be different

delicate shore
#

if (msg.author.highestrole < member.user.highestrole) return
@delicate shore

earnest phoenix
#

a user doesnt have a role

digital ibex
#

users dont have-

delicate shore
#

He

earnest phoenix
#

only guildMembers have that property

#

read the docs pls

delicate shore
#

Ok

solemn latch
#

You know the docs literally explain this if you follow the role chain

delicate shore
#

member.highestrole

#

Ok

solemn latch
#

Theres already a method that tells you the order of two roles.
Reading the docs is an amazing thing

pure lion
#

@digital ibex

digital ibex
#

hi

pure lion
#

Are you setting the value to oof?

digital ibex
#

?

#

oh im not

#

thats just the servers roles

pure lion
#

Yeah you gotta do that and send it in post

#

Oh it's dynamic

#

How are you templating?

digital ibex
#

i know dis bit

pure lion
#

Den just post the value

lusty quest
#

i have a blockade rn. I want to remove a reactions of a User if there is already one reaction from him on the message. any suggestions?

digital ibex
#

but i just need to somehow send the option element to the backend

#

wdym

pure lion
#

Set the value to oof and post unless that's what you're doing already

solemn latch
digital ibex
#

wdym set the value?

pure lion
#

<input value="oof">

digital ibex
#

lemme show u what im doing 1 sec

pure lion
#

Alright

digital ibex
#
<form action="/guilds/<%- id %>/moderation" method="post">
   <div class="select">
      <select>
        <option>Select the muted role</option>
        <% roles.forEach((role) => { %>
            <option><%- role.name %></option> <!-- trying to send the value of "option" which the user clicked -->
        <% }) %>
      </select>
    </div>
   <%- include('../imports/save') %> 
</form>```
pure lion
#

V a l u e

digital ibex
#

lemme see

#

ree pc no load

pure lion
#

Reeree

#

But basically

digital ibex
#

oh

#

i c

#

it loads, lemme see if that works rq

pure lion
#

<option value="titties"> will post titties when submitted

digital ibex
#

hm

#

so, would i need to put the value as the role id?

pure lion
#

Whatever you wanna post

#

That makes the most sense tho

#

Yeah that makes sense if you're setting a muted role

digital ibex
#

so... i click oof and press save changes

#

and req.body is an empty object... still

pure lion
#

Oh

solemn latch
#

Iirc, they need to be in a form

digital ibex
#

i've got this as my middleware app.use(express.urlencoded({ extended: true })); so no idea why its not working

pure lion
#

You gotta set the name

digital ibex
#

its in the form

pure lion
#

Weh

digital ibex
#

name?

pure lion
#

Yeah

digital ibex
#

wdym?

pure lion
#

<option name="Donald trump">

#

Oh nice

#

I'm retar btw

#

Wait I gotta go to my site a sec

digital ibex
#

AH HA

#

THANKSSS

#

WOOO

#

i had to set the select name to something

solemn latch
#

It was all woo

digital ibex
#

and it works :)

#

lmao

solemn latch
#

The benefits of the name woo, taking credit for everything

digital ibex
#

lmfao

misty sigil
#

lol

pure lion
#

*cries*

#

Well you're forbidden

#

How's your page set up?

#

Server wise

faint prism
#

Can you access that url from Postman?

#

Or if it's a GET request, a browser?

earnest phoenix
#

Hi

#

Some one can help with website

#

I need js script what redirect from domain.com to www.domain.com

#

Thx

faint prism
#

js has a redirect

earnest phoenix
#

But wait

#

It just redirect

#

It's will redirect you every time

faint prism
#

if !url.startswith("www.") redirect

#

But why do that at all?

#

I don't think you need www. for a url lol

digital ibex
#

you need to contact ur website hosting serverice thingy for www as a subdomain for website.com to redirect u to www.domain.com

#

www is ugly tho, i dont have it as any of my subdomains because yuck

faint prism
#

It's actually not necessary to use WWW in URLs. It exists for just one purpose – to identify the address as a website.
So unless you're using the url for another service than website hosting

earnest phoenix
#

you need to contact ur website hosting serverice thingy for www as a subdomain for website.com to redirect u to www.domain.com
@digital ibex I Aleready have www subdomain

digital ibex
#

what domain provider thingy u using?

delicate zephyr
#

@grave jay do you use cloudflare?

opaque eagle
#

I'm having trouble configuring postgres on my VPS
I installed it, added a user, added a database with that new user as the owner, edited pg_hba.conf, and allowed ufw firewall on port 5432
but when I try to connect, my connection times out

delicate zephyr
#

@opaque eagle make sure the service your running it listening on 0.0.0.0 and not 127.0.0.1

opaque eagle
wanton anvil
#

how can I send timed messages using dpy

faint prism
#

127.0. 0.1 is the loopback address (also known as localhost). 0.0. 0.0 is a non-routable meta-address used to designate an invalid, unknown, or non-applicable target (a 'no particular address' place holder)

earnest phoenix
#

what domain provider thingy u using?
@digital ibex

delicate zephyr
#

to 0.0.0.0

#

if that doesnt help idk

opaque eagle
#

ohh

delicate zephyr
#

judging by the ipv4 connections

#

im guessing thats the one

faint prism
#

Careful changing localhost to non-specific ip addrs, could break a connection between services

earnest phoenix
misty sigil
#

what is /64 ipv6 network

faint prism
#

A range basically

wanton anvil
#

how can I send timed messages using dpy
@wanton anvil help please

faint prism
#

IP addresses are assigned to networks in different sized 'blocks'. The size of the 'block' assigned is written after an oblique (/), which shows the number of IP addresses contained in that block. For example, if an Internet Service Provider (ISP) is assigned a “/16”, they receive around 64,000 IPv4 addresses
@misty sigil

digital ibex
#

show the panel where u add the subdomain @earnest phoenix

earnest phoenix
#

1@digital ibex

#

Dm pls?

digital ibex
#

u can send it here

opaque eagle
#

still nothing

misty sigil
#

woah so 64000 different ipv6 ip addresses for /16 network

digital ibex
#

;....

#

ok

lusty quest
#

funny enought if it wont work the normal way try it with Docker. had some issues getting MongoDB working in a Replicaset with the Normal Installation. with docker it took 5 minutes

opaque eagle
#

yeah I'm used to using docker

#

but I don't want to spin up entirely new instances of postgres for each new project

#

@lusty quest

lusty quest
#

you dont need to?

opaque eagle
#

wdym

lusty quest
#

you can just run a Container with Postgres and connect with mutiple projects to it

opaque eagle
#

if i include a postgres db in my docker-compose file then it can only be used by other containers in that project right

worldly nebula
#

Should I actually make this to a good command?
Current things I may add:
Embed Messages.
Templates for diffirent desings.

lusty quest
#

lol thats overkill

opaque eagle
#

wait i get what u mean

#

just a one-off container with postgres inside

lusty quest
#

yea

opaque eagle
#

ok ok lemme try that

digital ibex
#

AHH

#

EMOJI ON CHANNEL

#

🔪

lusty quest
#

just make sure to add a volume

#

otherwise it can be annoying AF

opaque eagle
#

yeah

tepid gate
#

If I'm posting data for stats should I put that in the ready?

opaque eagle
#

wouldn't it bad for my VPS's memory tho

lusty quest
#

why?

opaque eagle
#

it would be more efficient to just run postgres natively

#

because it's inside a docker container

solid falcon
#

Is discord bot delaying send message every sending 5 message?

lusty quest
#

i was running MongoDB on 3 VPS (each 1GB Ram) and each used maybe 12% Ram (together with OS, Docker)

#

Docker has a small overhead

digital ibex
#

tfff

#

3gb ram just for ur db???

lusty quest
#

Digital Ocean doesnt offer VPS with lower Specs

#

but i switched to a paid Plan from MongoDB Atlas. Gives me some nice stuff and i need to care less about it

digital ibex
#

eh

solid falcon
#

Try Azure, Vultr, Linode, Conoha, etc..

digital ibex
#

i see no reason to use atlas unless you're working with other developers on ur project

lusty quest
#

what i have RN is pretty decent

#

get a Replicaset at Atlas for a decent price

#

since i dont need to pay for 3 Individual Instances im fine with it

wanton anvil
#

how can I add timeouts in python which library is best??????

digital ibex
#

when u forget to commit changes before taking a break

delicate shore
#

Anyone good in API's?

digital ibex
#

what do u need?

delicate shore
pale vessel
#

o

digital ibex
#

thats not you ACTUALLY interacting with the api itself, u are, but its an api wrapper

fickle arch
#

I putted new Discord.Collection() in my code but it's said Discord is not defined but I'm putting const Discord at the start of the code.

digital ibex
#

show ur code

fickle arch
digital ibex
#

where is it erroring?

fickle arch
#

it's said Discord not defined

digital ibex
#

ik

#

but where is it erroring

fickle arch
#

wait hold up, I think I'm stuttering for a while.

digital ibex
#

you're literally not helping urself or me help u

#

send the whole code

faint prism
amber fractal
#

That wouldnt be the cause

#

you can put that on 4 new lines if you want

faint prism
#

Just wanted to make sure since the syntax highlight color is diff

fickle arch
faint prism
#

Oh guess not

earnest phoenix
#

where can I promote my bot

faint prism
#

Not here

#

Try reddit

digital ibex
#

here but not here

misty sigil
#

lmao thats

#

about right

digital ibex
#

whats the full error?

earnest phoenix
#

which channel

fickle arch
#

discord not define.

digital ibex
faint prism
#

No channel for that, bud

#

Look up another server for adverting
Ask in #support for any more questions not development related please
@earnest phoenix

digital ibex
#

whats the full error?

fickle arch
#

mmmm let me try something.

digital ibex
#

thats not the full error

fickle arch
#

Sorry for that, it's fixed.

thick gull
#

still not an error

#

smh

digital ibex
#

?

thick gull
#

no ignore me

earnest phoenix
#

I did all my bot and the economy is working but how can I add a command to control the credits etc.

tight plinth
#

do you know what youre even doing

earnest phoenix
tight plinth
#

@earnest phoenix not here

#

did you write that code

#

coz its a very bad code

#

and it doesnt work

lusty quest
#

i would make it completely different

tight plinth
#

obviously

#

no

#

it not

#

learn js, make a bot yourself and come back

#

k thx

lusty quest
#

i can recomend using the captcha bot from top.gg

#

easy to setup

#

and works fine

tight plinth
#

you cant fix it if you dont know what each line of your code exactly does

radiant kraken
#

Bruh

faint prism
#

Where is this "code" being referenced

radiant kraken
#

It's deleted

faint prism
#

Can't help someone who does that

lusty quest
#

there are mutiple mistakes

radiant kraken
#

why is the captcha the same text and not random?

lusty quest
#
  1. Never Nest Events into each other
faint prism
#
  1. The entire architecture of that costs a lot of technical debt
lusty quest
#

and why always the same text? then the verification is defeated by the first smart person who knows how to make selfbots

cobalt spruce
#

@lusty quest u still in this chat do u live here lol

#

long time bro

lusty quest
#

?

faint prism
#

Real devs live here

#

🏘️

cobalt spruce
#

@faint prism ur new here dont joke with me lol

#

ive been here for to damn long

radiant kraken
#
  1. Pretty much 90% of the syntax is embeds
faint prism
#

I am, fairly new tbh lol

lusty quest
#

just use a Random String Generator and send it to the user. its already better than sending the same image to everyone

radiant kraken
#

Especially if the bot is public

lusty quest
#

if you need a idea for a Random string i can recommend looking into the crypto package (makes it easy to get a random string) otherwise you can easy make one in plain js

faint prism
#

My approach for that was get some random int within ascii's letter range, cast to a char, then add append to a string

#
            string randomStr = string.Empty;
            Random rng = new Random();
            for (int i = 0; i <= 15; i++)
            {
                randomStr += (char)rng.Next(65, 123);
            }```
#

``zg^McmLGPD_eRGx`
Quick and dirty example

slender thistle
#

huh

radiant kraken
#

tbh in js you don't need that at the declaration, you can use let/const

slender thistle
#

does (char)rng.Next return a character under returned code?

golden condor
#

I can give a simple example for it

dire obsidian
golden condor
#

But I cba to type it on mobile

faint prism
#

Every char has an int for it's ascii (or whatever encoding) position. This allows the cast

slender thistle
#

yeah, that just didn't look very intuitive to me as a Python dev

faint prism
#

What, what I sent?

slender thistle
#

yeah, the (char)rng.Next(65, 123); part

faint prism
earnest phoenix
#

Filthy Python dev @slender thistle

slender thistle
#

In Python you'd do chr(random.randint(65, 124)) catshrug

faint prism
#

In Python you'd do chr(random.randint(65, 124)) :catshrug:
@slender thistleIn C# that's equivalent to this, assuming char cast works the same

slender thistle
#

Actually, I don't know why I expected that to return a character when the returned random integer is at least two numbers long

faint prism
#

What do you mean? I am having a bit of trouble reading that message, lol.
It should return a char as long as the int is within the encoding's char value range

#

assuming char cast works the same

slender thistle
#

(char)65 wouldn't make sense to return 65 as char type
and that's essentially what I expected it to do, for some reason

faint prism
#

65 as a char is 'A' in ASCII

slender thistle
#

yeah, makes sense

faint prism
#

I think you can also do byte conversions in a similar way. Characters have hex values as well

#

0x41 for example is 'A'

slender thistle
#

So like (char)0x41?

sonic lodge
#

while we're talking about this, could i do (int)('A') and get 65

faint prism
#

Well it'd just be \x41 I think .Let me check

#

yeah

#

(int)'A'

sonic lodge
#

👌

slender thistle
#

Huh, that's neat

faint prism
#

Console.WriteLine('\x41');
returns A

#

Since the hexcode/byte representation is essentially the char itself

golden condor
#

What Lang is that

faint prism
#

In memory that's what it actually is

#

C#

golden condor
#

Ah ok

quartz kindle
#

you can do that in js as well

digital ibex
#

ha lol

golden condor
#

I'm looking to get into better web development, I have started learning vue, is that a good choice or is there better things?

faint prism
barren sand
#

Can I ask something

#

I am a new developer

faint prism
#

-ask2ask

#

Vue.JS is known for implementing the best of aspects of Angular and React
@golden condor

barren sand
#

Well it'd just be \x41 I think .Let me check
@faint prism how to write that

digital ibex
#

vue is simple, you dont really learn much if u understand the basics of es6 and just js in general, its really lightweight too with its cool features

barren sand
#

Black background

golden condor
#

I like vue

faint prism
#

` ` The grave character @barren sand

golden condor
#

But react looks quite good too

#

But I'm a bit lost with the components

barren sand
#

Ok

digital ibex
#

its source code is in ts so its better for ts if ur using it

golden condor
#

ok

digital ibex
#

wdym?

faint prism
#

Vue.js lets you add it on top of an existing html page by just referencing it's script. Pretty neat imo

golden condor
#

It's components are a bit confusing and it's tutorial on their docs is weird because it's a game

#

Vue.js lets you add it on top of an existing html page by just referencing it's script. Pretty neat imo
@faint prism yeah I like it because of that, I made a basic cookie clicker with it

digital ibex
#

traversy media uploaded a crash course on it around a year ago, he explains vue in detail

golden condor
#

I mean react

#

Vue is quite simple and the docs are well presented too

#

So that's why I like it

#

But if any of you could link a good website and/or video for react I'd appreciate it :+1:

faint prism
#

I'm not a webdev sorry. More of a backend C# dev

golden condor
#

Alr

digital ibex
#

i've not watched it, but traversy media uploaded a react crash course too

faint prism
#

vue.js has video tutorials on their website

golden condor
#

Moving from ejs to Vue has been easy tbh, can you use it with express's render function if you set the view engine?

digital ibex
#

er

#

possibly if u use the cdn (not sure)

#

but u cant if u install the cli then defo no

barren sand
#

Actually i am a new developer so i want to how and where to code

#

Anyone help me out

slender thistle
#

-faq 3

gilded plankBOT
golden condor
#

@digital ibex I think there is a Vue npm pkg

#

Also can you link the Vue crash course?

solemn latch
digital ibex
#

yeah

golden condor
#

Thanks :+1:

digital ibex
#

@vue/cli

golden condor
digital ibex
#

yeah

barren sand
digital ibex
#

traversy media is really good

solemn latch
slender thistle
digital ibex
#

rp creator ^^

merry ivy
#

U know if the bot invitemanager is up ?

#

I can't config him on my discord

solemn latch
#

Its had some issues with some shards

#

For like the past few weeks

#

Invite manager has a support server, should ask there for more info

merry ivy
#

Where please ?

solemn latch
#

🤷 this isnt the invite manager server, so idk what their link is.
You can find it on their top.gg page

merry ivy
#

Ok thank's i found it

#

good day

barren sand
#

Nothing is coming

#

Plz help me

jolly wave
#

maybe

#

idk

slender thistle
#

Restart your client

barren sand
#

What is client?

#

I don't know

jolly wave
#

...

barren sand
#

I am new

jolly wave
#

ah

solemn latch
faint prism
#

Good thing it was just dotnet publish not overwriting the config file. EZ fix

#
      <None Update="config.json">
          <CopyToOutputDirectory>Always</CopyToOutputDirectory>
          <CopyToPublishDirectory>Always</CopyToPublishDirectory>
          <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
      </None>```

Which is weird because it always should..
quartz kindle
#

real programmers test in prod

opaque eagle
#

lol

jolly wave
#

why when i try to make commands in the commands folder they never work

faint prism
#

It worked in Test. I just forgot to update the config.json in prod

lusty quest
#

@jolly wave did you got a command handler?

jolly wave
#

yes i did

#

i did like in the discord.js guide

solemn latch
#

Command handlers also expect a format. If you dont follow that format it won't load the command properly

faint prism
#

I really need to finish my bot's devops pipeline...
Doing a manual update is tedious:
alias update-discordbot='sudo echo Starting as admin && cd /home/ubuntu/{BOTNAME}; git pull && sudo systemctl stop discordbot.service && dotnet publish -c Release -o release; sudo systemctl restart discordbot.service'

solemn latch
#

Format of the exports

#

Location of the files

#

Etc etc

opaque eagle
#

are you handling them properly

jolly wave
#

let me rewatch teh guide xd

opaque eagle
#

like storing them in a collection/map and using them in the message create event

#

watch?

#

discordjs.guide isn't a video guide

#

oh you said discord.js guide

#

others suck

thick gull
#

you don’t watch website pages?

jolly wave
#

e ok

solemn latch
opaque eagle
#

I like watching discord

solemn latch
#

You can watch discord

jolly wave
#

oh wait

#

discordjs.guide is what i use

solemn latch
#

Two people arguing is a great thing to watch

opaque eagle
#

I still haven't fixed my postgres error

#

but I've gotten better

#

I went from a "connection timeout" to a "connection refused"

#

can i post my wall of screenshots

jolly wave
#

ping.js don't work when i try it

solemn latch
#

Id go back and make sure you did everything outlined in the guide properly

lusty quest
#

did you run it now in docker?

opaque eagle
#

No

lusty quest
#

refused is good, this means something wont let it connect

opaque eagle
#

I'd just like to run it natively

#

yeah

lusty quest
#

firewall is allowed? or is it local?

opaque eagle
lusty quest
#

did you allow connections?

opaque eagle
#

pg_hba.conf?

lusty quest
#

yes

jolly wave
#

time to retry ping.js

opaque eagle
#

last line

jolly wave
#

i can't save index.js anymore why

lusty quest
#

i think you have there an error.

opaque eagle
#

where

lusty quest
#

not sure if you are allowed to have localhost and any host at the same time

solemn latch
#

You can't save a file?

jolly wave
#

yes

solemn latch
#

🤔

opaque eagle
#

oh

#

lemme try with just any host

solemn latch
#

Don't have permission to?

#

Or what

jolly wave
#

idk

lusty quest
#

where did you want to save your file? if it is a NAS or external Drive is it still reachable?