#development

1 messages ยท Page 1761 of 1

earnest phoenix
#

o-o

vivid fulcrum
#

make your characters variable a const since it doesn't need to ever change

earnest phoenix
#

Okay.

vivid fulcrum
#

yeah i mistype a lot

#

lol

earnest phoenix
#

What would I do after "characters"

#

Dear god spelling.

vivid fulcrum
#

the place where the three dots are at?

earnest phoenix
#

I have yet to ever use a loop.

vivid fulcrum
#

or?

earnest phoenix
vivid fulcrum
#

you place whatever you had there in your old snippet

#

oh also

#

here's docs for for

earnest phoenix
#
  mystr += characters['ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-='];
#

???

vivid fulcrum
earnest phoenix
vivid fulcrum
#

no ๐Ÿคฆ

earnest phoenix
#

I have not ever used this loop thing.

#

xD

#

kek < Me

vivid fulcrum
#

that's why i linked you the docs

earnest phoenix
#

Oh dear xD

#

Give me a few weeks

#

stealthy.exe has shutdown

#

@vivid fulcrum Yup, the docs were very useful......

#

I-

vivid fulcrum
#

that's because you skipped all of the useful text and went straight to the colorful code blocks

earnest phoenix
#

I read almost everything D2S_E_why

vivid fulcrum
#

in another words

#

whatever you have inside for is going to keep executing until the condition of the for loop becomes false

earnest phoenix
#

Ohhhh, okay.

#

Now that makes more sense.

#

xD, alright, welp, imma go try a few things.

lyric mountain
#

well, I said you has to use an inner div

#

but anyway

#

use the previous method

#

but fine tune it by using f12

lament stump
#

I am using an inner div lol

#

If you mean a container

lyric mountain
#

then you put stretch in the wrong place

#

do the same way you did here

#

but fine-tune with f12

lament stump
#

I did, it's working

#

but not for the titles

lyric mountain
#

how so?

lament stump
#

there, do you see the issue

#

not the out of bounds text

lyric mountain
#

use margin

lament stump
#

the fact that one box is higher

lyric mountain
#

use justify-content

lament stump
#

i am lol

lyric mountain
#

you're not

#

justify-content has an option to stretch

lament stump
#

justify-content: space-between;

#

that is what i am using

lament stump
#

i figured it out with min-height and max-height

shadow frigate
#

is logging command usage of a bot against discords terms of service?

umbral zealot
#

It's not, but having it public is a gray area.

shadow frigate
#

How about only allowing a bot support team to view the log channels?

#

Will I not have to specify that my bot logs commands to members?

umbral zealot
#

That's still "Private"

shadow frigate
#

Alright aha, thank you

drifting wedge
#

Hey @umbral zealot on that topic

#

Im allowed to log command errors?

#

And guild logs right?

#

For me to see

umbral zealot
#

Uhh yeah of course

drifting wedge
#

I am gonna eventually log literally everything

#

For the server staff to see

#

Like for example, messages per day

#

Etc etc

#

Nothing too private

#

But that's fine?

umbral zealot
#

I don't see why not

drifting wedge
#

Ok cool

umbral zealot
#

Error logs are common

drifting wedge
#

I mean like yeah

#

That's visible to me

#

But like imma have in depth logging

#

That is like LITERALLY EVERYTHING

#

like for example when a user sends a message etc

#

Not for me

#

But for the guild staff

#

Like would that be fine?

#

basically a discord analytics thing, but better

#

And with a poggers ui

umbral zealot
#

"user sends a message"???

#

Why does it have to be such a dumb ass example

#

If you mean a counter though... That's perfectly fine

#

Feels like you want a blanket statement, that's impossible to provide.

lyric mountain
drifting wedge
#

yeah

#

it will be like just that a message was sent in CHANNEL

#

not like who sent it

#

or what it contains

lyric mountain
#

also don't log channel name

drifting wedge
#

uhh

#

what if i hash it?

lyric mountain
#

let's say youre going into a very dangerous spot

#

the grayest area

solemn latch
#

is there any real reason you want to log "LITERALLY EVERYTHING"?
the point of logging is to have a purpose, logging for the purpose of logging makes no sense.

drifting wedge
#

yeah there is

#

so im making a analytics page for the server staff

lyric mountain
#

also remember every log you add will add more processing time to your bot

drifting wedge
#

uhh

#

ig so, but like its all async?

#

idk how do explain it

#

like for example

#

if a channel is created

#

the bot sends it in the log channel

#

but logs it after?

#

so it doesnt like slow that down?

drifting wedge
#

@lyric mountain @solemn latch

solemn latch
#

do you need to log anything then?

#

just a counter is plenty

drifting wedge
#

well yeah

#

id log the channel name though?

#

or the id

#

and just request the name when the person is looking at it

#

thats the idea?

#

what "logging" did u think i was thinking of?

solemn latch
#

๐Ÿ‘€

drifting wedge
#

oh

#

wait im confused

#

so for example

#

if i have a "log" of the messages this week

drifting wedge
#

itll store:

guild ID
channel ID {
how many messages this week
}

lyric mountain
#

they are anon

drifting wedge
#

yeah

#

so thats fine?

wheat mesa
drifting wedge
#

you cant visualize it

#

like for example

#

if you wanted to see

#

if u wanted to compare: members joined: to members left

#

you cant graph it easily

#

if u wanted to compare: members joined to members who joined and sent a message

#

etc

solemn latch
#

maybe just use a time series database?

drifting wedge
#

ill look into that

#

i gtg rn

#

but just logging numbers is fine right

#

channel names, not so much?

wheat mesa
#

Anyone know if it's against Youtube TOS to make a youtube to mp3 or mp4 converter?

solemn latch
solemn latch
wheat mesa
#

thought so

#

Couldn't be illegal though could it? I feel like ytdl-core would've been shot down very quickly if that were the case.

earnest phoenix
#

Hey, soooo, I am obv back again with yet AGAIN, another Question.

        welcome.composite(avatar, 40, 55).write('Welcome2.png')

So I have that coded., how would I make it so it goes into the .setImage() portion of a embed?

solemn latch
solemn latch
earnest phoenix
#

FacePalm I thought of that xD

#

I never tried it lmao

wheat mesa
solemn latch
#

it might be more work, theres a weird quirk with discord image embeds, but cant remember what it is.

earnest phoenix
#

@solemn latch

solemn latch
earnest phoenix
#

Would it just happen to be that^?

#

It flooded my console XD

#

My google froze FacePalm

solemn latch
earnest phoenix
#

Thanks for the docs link xD

#

Can you elaborate on "attach the image"?

#

ohhh

#

.attachFiles()

#

Gotcha.

#

Wait, this is constructing a image.

#

It is not in assets.

wheat mesa
solemn latch
drifting wedge
#

and have the guild id separate

#

and then preform some sort of algorithm with the guild id to find the data?

solemn latch
#

I would probably store all of it by channel id, then get the relevant channels.
if you wanted all the channels of a guild, you would have that mapped in another database, or just use the discord api.

drifting wedge
#

ok so for example

#

if i have a guild database

#

can i or not have like just one document with like guild id, guild name, etc etc

#

?

solemn latch
#

realistically, you wouldnt keep all data from a time series data in a single document.

drifting wedge
#

ok but im asking more like is it allowed?

#

like is it bad safety practice?

#

i get that its bad code practice

#

but im trying to understand the safety side of things

solemn latch
#

safety wise, you are storing more data than you strictly need, which is always bad.

drifting wedge
#

gotcha

#

im making an api to fix all that

#

but like for example the analytical time data

#

that i cant request

#

bc like its from the past

#

like for example if i need the guild name from the id, ill use the api

#

but if i need to get the data from a month ago

solemn latch
#

thats one of the very few times it would be okay, with guild owner consent.

umbral zealot
#

Analytical data is fine. Discord doesn't really care if you count messages, even messages from a user

drifting wedge
#

ill delete the data every month btw

umbral zealot
#

However, logging content is a completely different beast

drifting wedge
#

yeah

#

but like for example

umbral zealot
#

So. Logging numbers : no problem. Logging text: super bad idea.

drifting wedge
#

loging analytical data based off the channel id

#

thats fine

#

like basically

umbral zealot
#

yes

drifting wedge
#

ok cool

umbral zealot
#

ID isn't user data

drifting wedge
#

thats it then

#

the name is right

umbral zealot
#

You're not allowed to log things people typed or people uploaded or people sent without their constent, and when you have it, it has to be secured, encrypted, deleted on demand, etc etc.

drifting wedge
#

ok

umbral zealot
#

But stats? Discord don't care at all. It's not personal, it's not identifiable, that's fine.

drifting wedge
#

what about bot stuff?

#

like currency balance

#

for example

umbral zealot
#

that's your data so.... yeah it's fine

drifting wedge
#

ok poggers

umbral zealot
#

Mee6 and its points and levels is annoying but absolutely not a problem

drifting wedge
#

tysm woo and evie

#

also just wondering

#

is that fine

#

ik its not like in the data bla bla bla

#

but does it matter?

solemn leaf
#

is not erwin still here

solemn latch
umbral zealot
#

putting tokens in the url is bad practice
Tell that to Discord Webhooks

drifting wedge
#

the api would be basically

#

from inside the machine

umbral zealot
#

why do it through http then

#

just use IPC instead

drifting wedge
#

its like localhost:blablabla/request thingy

#

yeah ive tried

#

didnt work as i wanted

solemn leaf
#

why did you do blabla bla

#

it can only be numbers

#

: is stating which port

drifting wedge
#

i know

#

@umbral zealot ipc didnt work as i wanted for many reasons

#

i had to switch frameworks to use ipc

#

if bot or webserver restarted it broke

umbral zealot
drifting wedge
#

flask doesnt have a discord ipc

umbral zealot
#

I mean sure, ok.

drifting wedge
#

quart does

umbral zealot
#

but if it's localhost

#

why the token

drifting wedge
#

oh

#

uhh idk lmao

#

it wont hurt?

umbral zealot
#

put it on a port that's blocked from the web

#

problem solved, no one can reach it

solemn leaf
#

bruh localhost

drifting wedge
#

google did this

solemn leaf
#

no body should be able to see it

#

actually

drifting wedge
#

and it didnt work

solemn leaf
#

unless you forward it

drifting wedge
#

:p

solemn leaf
#

tot he web

drifting wedge
#

basically

#

even if i did that

#

eventually, one day in the future

solemn leaf
#

just comment it out

drifting wedge
#

idk how to explain it

#

i know what u mena

#

ty tho

pale vessel
#

no problem I guess

wheat mesa
#

Currently attempting to write scuffed HTML and js to keep the height and width values in an input box in a 16:9 ratio... html <label for="widthRes">Width</label> <input type="number" id="widthRes" min="1" oninput="calcSize(); AspectRatioWidth(true)" placeholder="Insert number here"><br><br> <label for="heightRes">Height</label> <input type="number" id="heightRes" min="1" oninput="calcSize(); AspectRatioWidth(false)" placeholder="Insert number here"><br><br> for some reason my second function AspectRatioWidth() does not seem to get called. Is there any reason for this?

function AspectRatio(toggleHeight) {
    const getCheckboxState = document.getElementById("scalarValue");
    document.getElementById("test").innerHTML = "Works";
    if(getCheckboxState.checked == true) {
        const width = parseInt(document.getElementById("widthRes").value);
        const height = parseInt(document.getElementById("heightRes").value);
        if(toggleHeight) {
            document.getElementById("widthRes").value = height*(16/9);
        } else {
            document.getElementById("heightRes").value = width*(9/16);
        }
    }
}
``` method for reference ^
#

I fixed it by just calling AspectRatioWidth() in my calcSize function instead. Not a great solution, but hey, it works.

lyric mountain
#

Why are you multiplying width by 9/16?

wheat mesa
#

^

#

1920*(9/16) = 1080

#

keeping 16:9 aspect ratio

drifting shell
#

Apparently I've a syntax error in my sql query but I have no clue where it is onesieKEKW

#

worked fine on my local db also running the same version iirc

#
alter table discord_user_premium add column applied_api_id varchar(191) default discord_api_id after discord_api_id;
old cliff
#

what is an efficient way to delete more than 100 messages in one go?
Loop? or what?
coz I don't want to get ratelimited

drifting shell
#

deleteMessagesByIds

#

bulk delete

keen wedge
#

I hate SQL errors, it says there's an error but doesn't say where, fucking hell

#

it just says "check your manual" or some shit like that

rocky hearth
#

hey guyz, in css, how can I clip a inline span to its parent div. Just like a background-clip: text is for text. But I want to do the inlined span instead.

floral rune
floral rune
rocky hearth
#

I want to make 20 vertical bars (spans), gradient to right in red-yellow-green.

floral rune
#

as a background?

rocky hearth
#

some thing like this, but separated with some spacing

floral rune
#

if it wont have anything in front of it maybe try a flexbox parent div with 20 children each colored with the gradient pattern
for the spacing you can just add a margin to the children

rocky hearth
#
  backgroundImage: 
    repeating-linear-gradient(to right, transparent 0, transparent 6px, white 6px, white 10px), 
    repeating-linear-gradient(to right, red 0%, yellow 50%, green 100%);

floral rune
#

ah i wasnt aware you were ok with a smooth gradient

#

that works then

light pumice
#

Regarding VPS's, what are the recommended locations to bring your bot ping super low?

#

I'm using digitalocean so anything specifically relating to that would be great. In general as well is useful shibaheart

#

I've heard San Francisco area is good but I could be wrong.

grave kestrel
rapid wharf
#

Python Vs Javascript which is better for bot dev in long time???

quartz kindle
earnest phoenix
#

How much time?

quartz kindle
#

time for what

earnest phoenix
#

How much time will it take to add my bot in top.gg??

quartz kindle
#

if youre waiting for approval it takes 1-3 weeks

earnest phoenix
#

Sed

signal grotto
#

Some one know an application or a website to create a cool bot website?

woeful pike
#

vscode

earnest phoenix
signal grotto
#

a simple application ๐Ÿ˜‚

woeful pike
#

oh sorry

#

notepad++

earnest phoenix
#

Did it got full or not started

light pumice
quartz kindle
#

last i heard the api gateway is there

#

i have a vps in new york, gets me 25 ws ping

#

but try it from san fransisco and see how much you get

woeful pike
#

why would you go for SF? discord doesn't host their servers in their headquarters lol

quartz kindle
#

imagine if they did

#

home server :^)

neat crater
#

Hmm so for the verification there is a question asking about data collection
Do server member ids count as data being collected?

quartz kindle
#

yes, just explain that you collect them for x y z reasons

#

for example for storing user configuration

neat crater
#

Thanks

#

now what do I write here?
How the bot is hosted and all that stuffs?

quartz kindle
#

ye

near stratus
earnest phoenix
#

i have IP open to all

exotic lotus
#

How do i change new Date()'s UTC timezone according to the server's region?
Like if server's region is US East nd time is May 5, 2029 16:39 in utc nd bot will convert it to timezone of US East which is GMT-5:00 ig

lusty quest
exotic lotus
copper cradle
#

you can call toLocaleDateString on a date object, and then pass in the locale

earnest phoenix
near stratus
near stratus
#

np

earnest phoenix
#

How do i change repository?

umbral zealot
#

That is a great question that I don't know and can't find the answer to, so you should probably ask on their discord
https://repl.it/discord

opal plank
#

now THIS is a first

#

token in config.js

umbral zealot
#

is it now?

#

we do that in guidebot because our config also has code to check for perm levels

south sinew
#

Currently, I'm rewriting my bot in TypeScript, and I'm currently contemplating how I want to build it. I could just use tsc, but I'm considering using a tsickle + closure setup with either webpack or bazel, as that's what I use for compiling frontend web applications. Not sure if it makes sense or if it's good practice, so figured I'd ask here

willow mirage
#
(node:7680) UnhandledPromiseRejectionWarning: TypeError: body used already for: https://discord.com/api/v8/users/SOMEID

what does this mean?

umbral zealot
#

Yeah but the point Erwin is making is that it's usually .JSON not .JS

opal plank
#

either .json or .env, but yeah

#

i'd personally go against using .js/.ts for tokens

#

mainly cuz we are all dumb and we'll likely forget to .gitnore it or end up commiting the changes and accidently leaking it

quartz kindle
#

why do people keep using .env tho

#

instead of using the actual env

opal plank
#

what

quartz kindle
#

the .env package and the .env file

#

why use it

#

just use the actual system env

#

or node env

#

or whatever

#

you could simply do MYENV=123 node file.js

#

or if you're using pm2, you can put everything in a pm2 ecosystem file

opal plank
#

i only use stuff like that as argsv

#

for a token, its fine, but isnt it consuming to have to add another line on your command to run node everytime?

quartz kindle
#

usually you have something that runs node for you

#

like pm2 or a startup script to run it in the background

#

so you just add it there

opal plank
#

but at the end of the day it'd be the same, you either have to edit the script, or edit the .env

quartz kindle
#

ye but i mean

#

the entire env functionality already exists

#

the .env package is not needed

#

its just another useless dep

opal plank
#

guess u have a point

south sinew
# quartz kindle the .env package is not needed

I think it's biggest use case is having it .gitignored and throwing tokens and keys or whatever that you don't want public into it as opposed to having to edit package.json or pm2 config or whatever is being used to start the process

#

And for example, I have a .env with an array of YouTube authorization headers, that'd be quite ugly to have a 400 character long line in a startup command

quartz kindle
#

i use the pm2 ecosystem file

#

all pm2 processes are managed from a single file

south sinew
#

Yeah, same case, you'd be having to be careful to not comnit tokens, but I suppose you could just use a config.js and import it and gitignore it

quartz kindle
#

the ecosystem file is in the system root

#

outside of the working dir

south sinew
#

ah I see what you mean now

#

I was thinking of smthn else

#

yeah that makes sense

#

problem is a lot of people don't use that system, so I think that's where dotenv is applicable

quartz kindle
#

you could also do ENV_VAR=value pm2 start app.js

#

and pm2 will remember it through restarts

south sinew
#

Yep

#

But again, some people don't use pm2 ๐Ÿ˜›

umbral zealot
south sinew
#

Prefix should be in like a config file

umbral zealot
#

Depends.

south sinew
#

Only stuff that should be in a .emv realistically is sensitive configuration, that being tokens or whatever

umbral zealot
#

It's always a case by case basis

#

We use .env files for development, or because places like repl.it require it.

quartz kindle
#

repl.it doesnt even use env files anymore

#

besides, at that point whats the difference between an .env file to anything else like .config .ini .json etc?

#

i like using env the way it was made to be used

#

if i want anything stored in a file i'll just use a json file or something and gitignore that instead, no need for another dependency to read a file

eternal osprey
#
    message.guild.roles.create({ data: { name: 'Verified', permissions: ['VIEW_CHANNELS', 'READ_MESSAGES'] } });
    message.guild.roles.create({ data: { name: 'Non-verified', permissions: [0] } });``` is this a valid way of giving one of the roles reading and viewing permissions and the other none
earnest phoenix
drifting wedge
#

ok so i have a delete button

#

and i want the entire div to disappear

#

when u click it

#

but idk how

crimson vapor
drifting wedge
#

yes, but i need to get the big div element

#

like it doesnt have an id

#

and if it did, it wont work well

quartz kindle
quartz kindle
drifting wedge
#

lemem try

silent hornet
#

hey anyone know how to fix : bot crash when join in a stage channel?

earnest phoenix
#

discord js version?

umbral zealot
#

my thought exactly

silent hornet
#

12.3.1

umbral zealot
#

that's not possible

#

discord.js is at 12.5.3

silent hornet
#

sry

#

AHHA

umbral zealot
#

Update.

earnest phoenix
#

try updating discord js

silent hornet
#

only need to update xD

#

ok

earnest phoenix
#

yup

#

v11 dont even recoginize stage channel ids

umbral zealot
#

indeed

quartz kindle
#

v11 crashes on stage channels

umbral zealot
#

I keep telling people "hey yeah you had a full year to update, so that's on you"

earnest phoenix
#

^^

quartz kindle
#

on the other hand, there's the saying "if it works dont fix it"

#

:^)

crimson vapor
#

if it works, don't fix it. unless its deprecated

silent hornet
#

now doesnt crash

umbral zealot
#

"If it ain't broke don't fix it" works for physical machines, not for programming code on external systems ๐Ÿ˜›

silent hornet
#

but leave istant the channel (nothing in console)

drifting wedge
#

but deletes everything

#

like so 1 .parentNode leaves the bot

#

box

#

but removes content

#

then 2 of them

#

deletes all the boxes

silent hornet
earnest phoenix
#

updated?

silent hornet
#

yes

#

now dont crash

earnest phoenix
#

well,

#

no idea

silent hornet
#

but dont stay in vc

#

left istant

#

๐Ÿ˜ฆ

drifting wedge
#

i see the issue

#

all good

silent hornet
#

there are some documentations about stage channels?

drifting wedge
#

pog ty

umbral zealot
quartz kindle
#

you need to use the master branch

silent hornet
#

is a music bot

umbral zealot
#

code?

silent hornet
#

js

quartz kindle
#

discord.js v12 treats stage channels as "unknown" so it doesnt register them in the cache

silent hornet
#

but groovy can play song in stage channels

umbral zealot
#

groovy isn't using discord.js is it

silent hornet
#

oh okay

quartz kindle
#

if you want support for stage channels you have to use the master version

#

which is v13 thats in development and not officially released yet

silent hornet
#

so I can't make that the bot play in s.c. if I use discord.js v12

slender thistle
rocky hearth
#

in html, y do buttons have, default type of submit. Like y the f??

eternal osprey
#
const filter = (m) => m.author.id === newMember.id
newMember.dmChannel.awaitMessages(filter)
  .then((collected) => console.log(collected.first().content))```
why is this giving me: cannot read awaitmessages of undefined?
#

newMember is the property i have passed in the guildmemberadd function

quartz kindle
rocky hearth
#

then what should we use in general?

quartz kindle
#

whatever you want

#

you can use anything as a button these days

rocky hearth
#

would it be good, for screen readers? Can they detect it

#

if div is used as a button

lavish bramble
#

How can I do the args only in number

#

If its not a number then it sends message

rocky hearth
quartz kindle
# rocky hearth would it be good, for screen readers? Can they detect it

The button role should be used for clickable elements that trigger a response when activated by the user. Adding role="button" will make an element appearย as a button control to a screen reader. This role can be used in combination with theย aria-pressedย attribute to create toggle buttons.The button role should be used for clickable elements that...

rocky hearth
tribal siren
#

yo everyone

#

i got a problem with my leveling system

#

so first lemme show the code then lemme show the bug

#

and this is the bug

#

i don't understand what causes the bug and i request your help

rocky hearth
#

what's the bug?? Does it always show level 3?

tribal siren
#

no it just loops the level 3 for one user

#

it also loops level 6 for me

#

and other dude with some other level

lavish bramble
#
const user = message.mentions.users.first
if(!user) return message.channel.send("Please mention a user to give money")
		
		const money = args[1]
		if(!money) return message.channel.send("Lamo you are not giving anything to that user!")
		if(!isNan(money)) return message.channel.send("Money should be in numbers")

When I type only
--give them it sends me money error not user error

tribal siren
#

const user = message.mentions.members.first()

#

if(isNaN(money))

#

that's it

pale vessel
#

if you're not using an editor like notepad then your editor should scream at you already

rocky hearth
tribal siren
#

= is a Number

tribal siren
#

idk typescript so no im not able to

rocky hearth
tribal siren
#

yes

rocky hearth
south sinew
#

For building in dev I'd be using something simple

earnest phoenix
#

There is a deno port of discord.js on deno.land

south sinew
#

I don't use djs

earnest phoenix
#

what

#

then what do you use

south sinew
#

discord-rose

earnest phoenix
#

import the module in deno with import stuff from "https://esm.sh/discord-rose" if it's on npm

south sinew
#

berry brainwashed me

earnest phoenix
#

and deno is 30% smaller than nodejs because it doesn't have npm as it imports stuff from url

stiff lynx
#

internal/fs/utils.js:269
throw err;
^

Error: ENOENT: no such file or directory, open '/home/runner/novabot30/index.js'
at Object.openSync (fs.js:462:3)
at Object.readFileSync (fs.js:364:35)
at Object.<anonymous> (/run_dir/interp.js:195:19)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/home/runner/novabot30/index.js'
}

#

I'm tryign to host on replit from heroku

#

and I dont know what is going on

earnest phoenix
#

how... are you hosting a project on replit from heroku

stiff lynx
#

I've uploaded the file from my computer to replit

umbral zealot
#

well the error is saying you don`t have a file called index.js here

stiff lynx
#

ok i did it

earnest phoenix
stiff lynx
#

what happen if I host the same bot on 2 clients?

umbral zealot
#

it`ll probably answer twice to commands

stiff lynx
#

But it is really better replit than heroku? I ask because I wanted to do a test. I'm using the same commands with same code but from different bots and the heroku one answer faster

umbral zealot
#

Neither is better unless you pay for them.

stiff lynx
#

novabot with logo Is on Heroku

umbral zealot
#

So why do you want to move away, then?

stiff lynx
#

idk, I've Heard that Heroku Is Better

latent heron
#

whoever you heard that from doesn't sound very smart, no offence

stiff lynx
#

sorry

#

replit Is Better

umbral zealot
#

Both free services are going to be crap

#

There are no good free hosting services. Period.

latent heron
#

It costs money in the real world for good stuff

charred nest
#

^^^

latent heron
#

You could be like me though

charred nest
#

i recommended digitalocean myself, itโ€™s safe & secure and you only pay for what you need

latent heron
#

run the bot on your own computer and never turn the computer off

stiff lynx
latent heron
#

you only need good wifi

earnest phoenix
#

only

charred nest
#

โ€œonlyโ€

latent heron
#

with a bot running either in JS or Python? yeah

earnest phoenix
latent heron
#

both are very well optimized languages

stiff lynx
#

this Is my wifi

earnest phoenix
#

decent

latent heron
#

or well, if you have good standing code, you should only need wifi to begin with

#

284 mbps is more than decent, that's very good

#

anything above 20 mbps honestly is good enough lmao

earnest phoenix
#

where on earth are you living then

charred nest
#

mcdonalds

earnest phoenix
#

284 is not even close to decent for me

#

that's when it's a shit day of internet

latent heron
#

that sounds more like a standard you've set for yourself lol

earnest phoenix
#

if not, reallyyyyy shit

latent heron
#

the lowest i get is 70 mbps but highest i've gotten was 350 mbps

earnest phoenix
latent heron
#

lol what

earnest phoenix
#

๐Ÿค

latent heron
#

ok and

#

i pay for the internet bill myself kek

earnest phoenix
#

cool

latent heron
#

i'll choose what plan works best for me

#

judging people for wifi speed anything over even 10 mbps is dumb

charred nest
#

some people just genuinely canโ€™t get that

latent heron
#

which is why it's considered rude

charred nest
#

highly populated areas/rural areas/etc, canโ€™t control what they canโ€™t

earnest phoenix
#

not judging people if you would read

stiff lynx
earnest phoenix
#

i am judging the speed

latent heron
#

alright so you're also indirectly judging the plans people choose with their ISPs

earnest phoenix
#

I am indirectly judging the guy

latent heron
#

you don't need to explicitly call it out in order to be judgemental of it

earnest phoenix
#

i am indirectly judging his family

#

i am indirectly judging his grand parents

#

I am indirectly judging his country

#

i am indirectly judging earth

#

so i am indirectly judging everyone

#

4head

latent heron
#

your argument makes no sense

stiff lynx
#

everyone Is trash

#

lol

pale vessel
#

no u

latent heron
#

arguing semantics of a word to justify a point

earnest phoenix
#

you started saying i am indirectly judging

#

then i just said who or what i am indirectly judging

#

so now you can say i am rude to everyone on earth

latent heron
#

no you're honestly just a smartass trying to play it off cool and that's also annoying as hell

earnest phoenix
charred nest
#

alright, i think this conversation is just going to go in circles & isnโ€™t relevant to development anymore, letโ€™s move off of this yesnodyes

crimson vapor
#

what the fuck is this conversation?

#

how is 280mbps slow????

earnest phoenix
#

What even is going on here

#

@MILLION#1321 familiar with discord-rose?

crimson vapor
#

yes

#

90% of the time people use less than 10mbps im pretty sure

earnest phoenix
# crimson vapor yes

nice
what is
client.channels.cache.find(x=>x.name==="channelname")
in discord-rose
worker ??????

south sinew
earnest phoenix
#

yeah i will disable some props

south sinew
#

I'd recommend looking at the wiki and docs

earnest phoenix
#

already saw it but did not find out where it get saves as worker.channels.cache or without.I will have to try it ig

crimson vapor
pale vessel
#

where are you getting that cache from

south sinew
#

^

pale vessel
#

it's not discord.js

earnest phoenix
crimson vapor
#

uhh

#

I think so?

south sinew
#

Id have to test that

crimson vapor
#

well

#

just enable it

south sinew
#

Experiment kek

crimson vapor
#

I mean I use everything enabled but without intents

earnest phoenix
#

I want to just use discord-rose bc custom caching

south sinew
#

Also million I have a PR berry is waiting for your approval on

south sinew
crimson vapor
#

ik ik

south sinew
#

Command handler is also bussin

crimson vapor
#

my internet went out yesterday

south sinew
#

Rip

crimson vapor
#

I couldn't do anything for a few hours

#

ill look at it today

south sinew
#

same happened to me late at night lol

#

I was talking to berry in vc then I just left

crimson vapor
#

it was like 2 pm to like 12 or something

south sinew
#

rip

earnest phoenix
south sinew
#

Nice thing is the library is quite small as opposed to the likes of eris and djs so if you need to figure out how something works you can just look at source

crimson vapor
#

I mean like

#

yeah but no

earnest phoenix
#

yeah okay,btw are there internal shards?

crimson vapor
#

yes

south sinew
#

Sharding config is mainly set through BotOptions

earnest phoenix
#

okay gd

south sinew
#

It's just, "how many shards total do you want" and "how many shards should a cluster have"

wicked pivot
#
bot.guilds.cache.get('846512453658738720').channels.create('๐Ÿ“ Chat ' + Channel, {
                            type: 'text'
                        }).then(async(chan) => {
                            await chan.setParent('846512454103859222')
                            await chan.overwritePermissions([
                                {
                                    id: 846512453658738721,
                                    deny: ['VIEW_CHANNEL']
                                },
                                {
                                    id: 846512453658738720,
                                    deny: ['VIEW_CHANNEL']
                                },
                                {
                                    id: user.id,
                                    allow: ['VIEW_CHANNEL']
                                }
                            ])
                        })```
#

that's all permissions except the user

umbral zealot
#

use quotes around all IDs in your code.

lavish bramble
#
const client = new discord.Client({ disableMentions: 'everyone' });

What is disableMentions

earnest phoenix
#

or use String()

umbral zealot
#

It disables... mentions.

south sinew
#

For clarity an id is this

`${bigInt}`
lavish bramble
#

Is there is any other event then disableMentions

earnest phoenix
#

disableMentions: 'everyone'

wicked pivot
#

thx

crimson vapor
#

when typed, yes @south sinew

umbral zealot
south sinew
#

๐Ÿคฏ

crimson vapor
#

but most people don't care about it

umbral zealot
umbral zealot
latent heron
#

doesn't JS also do bit rounding or smth?

pale vessel
#

you forgot n

south sinew
pale vessel
#

or BigInt(number)

south sinew
#

it's greater than whatever the stupid for it is

umbral zealot
#

yeah ok but discord.js treats them all as strings

south sinew
#

2e52 I think

umbral zealot
#

so trying to use bigint is completely pointless

crimson vapor
#

no one uses bigints

#

they are just typed using literals

south sinew
#

I'm just saying when it's typed that's what it is

crimson vapor
#

its the same thing

south sinew
#

^

umbral zealot
#

Ok but guys this isn't useful to a user that just wants to use discord.js

crimson vapor
#

I agree

south sinew
#

I suppose

umbral zealot
#

It's great to flex that you know what a bigint is, but it's not useful to anyone in this context.

south sinew
#

In like 4 contexts it is kek

#

I'm not trying to flex information I'm just saying it to be helpful

umbral zealot
#

It's not broken

crimson vapor
#

its not wrong?

south sinew
#

Sheesh

crimson vapor
#

its just the way its output

umbral zealot
#

It's 100% working correctly

crimson vapor
#

there is no reason to output the "" for a string

umbral zealot
#

Now do the same thing with 683630053686378498 which is the context in which we're in right now

#

Show the result of String(683630053686378498) and tell me again how my eval is broken.

#

not the typeof

#

the result

#

I know it's a string, you noob

crimson vapor
#

why are you doing string on a number

#

its not even a bigint

tulip ledge
#

Hey I wanna learn react with electronjs to make dekstop apps with JS but when I run my start command: "electron-react": "concurrently \"BROWSER=none npm start\" \"wait-on http://localhost:3000 && electron .\"" I gain this error:

crimson vapor
#

just keep ids as strings and move on

#

why does it even matter

#

its not

#

thats how mine does it

#

I don't see what you are on about

umbral zealot
#

Sorry, I'm getting agitated. I just can't stand people flexing ridiculous knowledge thinking they can one-up my 20 years of experience, when all I want to do is fix an issue for one user that doesn't understand any of this shit.

#

@earnest phoenix eval String(683630053686378498) please.

#

Go ahead. Humor me.

crimson vapor
#

its not getting output as a number

latent heron
#

its almost as if

#

its not outputted as an int

umbral zealot
#

Look HERE

#

this is why what you're saying isn't useful to anyone.

latent heron
umbral zealot
#

Do you see how this number is not the same?

crimson vapor
#

would you mind doing 'O' + "w" + 'O' and tell me if the quotes are output in the eval

latent heron
#

have you tried

#

type checking

#

it

umbral zealot
#

Nobody gives a shit it's a string, jesus christ

#

It's the wrong string

crimson vapor
#

they won't be

#

Evie's output was not changing it to a number

umbral zealot
#

It's not the ID that this person is trying to give to permission overrides, because it's no longer the same ID

crimson vapor
#

it was just joining the two strings

latent heron
#

if you're doing permission checks you should be checking the mutated ID, so the ID after the change

#

why are you checking the old one

#

it's literally the wrong string even as such

#

the whole point is you're trying to perform a logical operation to check if the comparison of both are equal and they're literally not

#

you're going to genuinely give people brain aneurysms RAKE lmao

umbral zealot
#

The worst here is that the person that asked the question was answered and helped like 15 minutes ago and y'all are still flexing how you think you understand JS integers.

#

So pointless.

real vine
#

Anyone knows speak Arabic here

umbral zealot
#

This channel is english only

crimson vapor
#

I honestly don't see anyone really trying to flex, just a miscommunication trying to prove another person wrong

latent heron
#

no

crimson vapor
#

no

latent heron
#

it is a flex

crimson vapor
#

@earnest phoenix you cannot use integers

umbral zealot
#

It would not

#

Literally would not

#

And I've proven this to you

#

you've proven it to yourself

#

It won't

crimson vapor
#

@earnest phoenix integers don't have the precision that IDs use, you need to keep it as a string

latent heron
#

and it clearly doesn't

umbral zealot
#

are you blind or being stupid right now?

latent heron
#

it's literally been proven to you

#

and you're being stubbornly ignorant

crimson vapor
#

@ripe prairie

latent heron
#

@ripe prairie

#

ugh

crimson vapor
#

too slow

umbral zealot
#

It's RIGHT HERE that it doesn't work, right in your face, my friend.

ripe prairie
#

-b @inland yarrow racism

gilded plankBOT
#

dblMod Banned Raiz#7046 (@inland yarrow)

crimson vapor
#

ty

ripe prairie
#

me: checks other server for one second
top.gg: PING IPNG

#

thanks guys

crimson vapor
#

LOL

umbral zealot
#

Our pleasure, Neko! ๐Ÿ˜„

earnest phoenix
visual goblet
#

hello so whats a bufsize in python?

#

File "C:\Users\Cameron\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 778, in init
raise TypeError("bufsize must be an integer")
TypeError: bufsize must be an integer

umbral zealot
#

Once again I have disabused someone of an erroneous notion. ayy

earnest phoenix
#

but what is the function for String() then? when it is still a number

umbral zealot
#

It converts a number type into a string type

ripe prairie
umbral zealot
#

It's not "still a number". It's a string containing a number.

ripe prairie
#

send full error/code

visual goblet
#

i dont even know where the error is it doesnt say

umbral zealot
#

"12345" is not the same as 12345, @earnest phoenix

visual goblet
#

OHHHHHH

#

nvm got it sorry

ripe prairie
#

๐Ÿค”

visual goblet
#

i was testing this janky ass way of running a javascript file with my python code

#

and it didnt like it

ripe prairie
#

well theres your first problem

#

using js

visual goblet
#

LMAO

umbral zealot
earnest phoenix
#

so how would you convert a number to a string then?

crimson vapor
#

ok

#

basically

#

IDs are never numbers

#

they should NEVER be treated as numbers

umbral zealot
#

They are technically numbers, but js cannot process them as such.

crimson vapor
#

using a number means you lose precision

summer torrent
#

snowflakes

crimson vapor
#

don't confuse him please

#

thank you

#

what we learned from this conversation

#

IDs are strings

#

treat them as such

umbral zealot
#

The problem here, isn't converting a number to a string. It's processing/reading numbers that are larger than JS's MAX_SAFE_INTEGER. That number is 9007199254740991 , anything bigger than that cannot be processed this way.

crimson vapor
#

I actually used numbers for my first database

crimson vapor
#

every ID ended with 00

#

learned my lesson

slender thistle
#

I'm confused why you would run JS along with Python

crimson vapor
#

you wouldn't

earnest phoenix
crimson vapor
#

djs utils does a lot of work to get it correct

#

I yoinked a function that seems to work when I needed it

slender thistle
#

How do you generate snowflakes in languages that don't support int64 is my question

umbral zealot
#

I'm guessing you wouldn't be able to.

slender thistle
#

Do you literally take right-most character from last ID, increment it, then put it back

tulip ledge
#

how do I fix this?

earnest phoenix
umbral zealot
#

yes?

quartz kindle
stiff lynx
#

What I have to do for hosting 24/7 on replit?

slender thistle
#

Use uptimerobot

earnest phoenix
stoic thorn
#

$tu

stiff lynx
tulip ledge
#

can someone please explain how tofix my issue?

quartz kindle
#

timestamp.toString() + instance.toString() + sequence.toString()

#

you will need a bit of padding tho

slender thistle
#

You will have a repl.co URL. That will be the URL to send your requests to

stiff lynx
umbral zealot
quartz kindle
#

timestamp doesnt need padding since its the front of the sequence

stiff lynx
umbral zealot
#

what does it say at the bottom

quartz kindle
#

but the instance and sequence bits need to be padded to 4 characters if they output a number smaller than 1000

umbral zealot
#

It tells you how to keep the bot awake

#

and it gives you 2 things to do

#

Do both.

tulip ledge
earnest phoenix
tulip ledge
#

how?

earnest phoenix
#

linux windows?

tulip ledge
#

windows

earnest phoenix
#

I need more info do you run it on a local machine or remote device with public ip?

tulip ledge
#

local machine

earnest phoenix
#

did you set the port?

tulip ledge
#

wdym set the port? I'm new to react and electron

stiff lynx
tulip ledge
#

win.loadURL('http://localhost:3000') this?

umbral zealot
#

well look at the error message you probably did something incorrect

earnest phoenix
#

okay i see go to package.json

tulip ledge
#

yup

earnest phoenix
#

scripts .start

tulip ledge
#
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "electron-react": "concurrently \"SET BROWSER=none && npm start\" \"wait-on http://localhost:3000 && electron .\""
  },
earnest phoenix
#

and change it too "set PORT=3000 && react-scripts start"

#

I want to align items like this with flexbox:

/--------\           /----------\
| [left] |  [space]  | [center] |
\--------/           \----------/

how do i do that?

tulip ledge
#

same error

umbral zealot
#

"permission denied" sounds like, y'know, a permission issue

#

as if you weren't, like, admin.

tulip ledge
#

well I don't know how to fix

#

I'm admin on my pc tho

umbral zealot
#

clearly this isn't running under that account then

earnest phoenix
#

i tried removing the flexbox and setting align items to center and putting the first element on position absolute

#

still doesnt work

tulip ledge
#

how do I make it run under my account then?

earnest phoenix
#

why does it search a port in 0.0.0.0 and not in locahost

umbral zealot
#

I'm not sure

#

try running this under an admin command prompt

#

see if it changes anything

tulip ledge
#

The issue is that it's on my D drive and I don't know how to access my D drive through my cmd prompt

stiff lynx
#

It's replit really 24/7?

earnest phoenix
#

the free plan, not so much

umbral zealot
earnest phoenix
#

and uptimerobot doesnt guarantee 24/7

tulip ledge
#

yeah that didn't work, I had to do cd /d D:

stiff lynx
tulip ledge
#

but that doesn't fix it either

earnest phoenix
#

yeah

umbral zealot
#

really? wat

tulip ledge
#

same error

stiff lynx
earnest phoenix
#

5$ a month

#

a vps is the same price but better

#

try with SET HOST=localhost && react-scripts start

tulip ledge
#

I got this

#

but the weird part is that I looked into my ports and 3000 wasn't in use

stiff lynx
earnest phoenix
#

got to task manager

tulip ledge
#

yup

stiff lynx
#

Evie or a guide?

earnest phoenix
#

and check running node procees

tulip ledge
earnest phoenix
# tulip ledge this?

If you don't have any important process running at background terminate them all

tulip ledge
#

didn't fix it

#

same error and no node processes

earnest phoenix
#

did you kill all proccess?

tulip ledge
#

all node processes yes

earnest phoenix
#

then use an another port maybe 3005

stiff lynx
earnest phoenix
#

doing what

umbral zealot
#

VPN is not a VPS, those are 2 different things

earnest phoenix
tulip ledge
#

ok so this is weird

#

I just changed it all to 3005

earnest phoenix
#

remove set host=localhost

tulip ledge
#

"electron-react": "concurrently \"SET BROWSER=none && npm start\" \"wait-on http://localhost:3005 && electron .\""

win.loadURL('http://localhost:3005')

#

Oh that's not gonna work, I tried using a different port before

stiff lynx
#

Evie you have a Guidor for VPS?

earnest phoenix
#

help needed
I want to align items like this with flexbox:

/--------\           /----------\
| [left] |  [space]  | [center] |
\--------/           \----------/

how do i do that?

stiff lynx
#

this for example?

jagged plank
umbral zealot
earnest phoenix
#

nope

#

time to try it and see

tulip ledge
#

so I guess I'm not learning electron and react then

stiff lynx
#

OS system of the VPS?

earnest phoenix
restive furnace
#

anything you'd like

earnest phoenix
#

ubuntu is just popular

stiff lynx
earnest phoenix
#

since the code is compatible with every os

stiff lynx
#

I've found a guide for Digital Ocean. Anyone that knows It?

earnest phoenix
#

we dont memorize guide names

#

we memorize anime

umbral zealot
#

inb4 we're expected to index the entirety of google in our brains

#

Johnny Mnemonic gang.

boreal iron
#

To know anything Google knows

#

makes sense?

dense spire
#

is there a way to get the aliases of a certain command?

#

python

umbral zealot
#

That entirely depends on how you build your command handler

dense spire
#

using @bot.command(name="", aliases=[])

severe cedar
#

So my question is quite long so should I wate for you all to finish?

#

woops

#

sent that twice

umbral zealot
#

no, you shouldn't wait

#

just go right ahead and type your question and send it

severe cedar
#

So I am trying to make a command for my friend and I's rpg bot. Its meant to choose the elemen tyou will use on your journey but for some reason when I run it i get an error. Any idea what's going on?

Code:

    @commands.command()
    async def start(self, ctx):
        embed = discord.Embed(
            title = "Welcome to Discordia!",
            description = "To get started please choose a element you wish to use below.\n`โ—Warning this can't be changed laterโ—`",
            colour = discord.Colour.blue()
        )
        embed.set_footer(text=self.bot.user, icon_url=self.bot.user.avatar_url)
        embed.add_field(name='Elements', value="\n๐Ÿ”ฅ for Fire\n๐ŸŒŠ for Water\n๐Ÿ’จ for Air", inline=True)
        
        msg = await ctx.send(embed=embed) 
        reactionFire = await bot.wait_for_reaction('๐Ÿ”ฅ')
        
        await msg.add_reaction("๐Ÿ”ฅ")
        await msg.add_reaction("๐ŸŒŠ")
        await msg.add_reaction("๐Ÿ’จ")
        
        
        def check(self, reaction):
            return user == ctx.author and str(reaction.emoji) == "๐Ÿ”ฅ"
            #return user == msg.author and str(reaction.emoji) == "๐ŸŒŠ"
            #return user == msg.author and str(reaction.emoji) == "๐Ÿ’จ"
        
        try:
            reaction, user = await self.bot.wait_for("reaction_add", timeout=10.0, check=check)
        except asyncio.TimeoutError:
            await ctx.send("Timed out.")
            return
        if str(msg.reaction.emoji) == "๐Ÿ”ฅ":
            await ctx.send("You choose **Fire**!")
        if str(msg.reaction.emoji) == "๐ŸŒŠ":
            await ctx.send("You choose **Water**!")
        if str(msg.reaction.emoji) == "๐Ÿ’จ":
            await ctx.send("You choose **Air**!")```

Error:
```  File "/home/container/cogs/start.py", line 22, in start
    reactionFire = await bot.wait_for_reaction('๐Ÿ”ฅ')
NameError: name 'bot' is not defined```
#

I had it on copy and paste

umbral zealot
#

would it not be self.bot

#

as with 3 lines above

#

@dense spire

severe cedar
#

this is line 22: reactionFire = await bot.wait_for_reaction('๐Ÿ”ฅ')

umbral zealot
#

self.bot ?

#

seems useful

topaz echo
#

from main import * hah

severe cedar
umbral zealot
#

ooof

#

internal sharded bot. ok.

#

then I have no clue.

slender thistle
#

WAIT_FOR

umbral zealot
#

I don't even code in python. lol.

slender thistle
#

RTFD

#

PLZ

severe cedar
severe cedar
slender thistle
#

BROOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

severe cedar
#

calm down i can't understand what you mean

severe cedar
#

no dude explain

last geyser
#

rtfd = read the f*cking docs

umbral zealot
#

oh I didn't even see that.

severe cedar
#

I'm only editing the code

slender thistle
#

Use wait_for. wait_for_reaction is a legacy method

severe cedar
#

OH

slender thistle
#

And as you can tell, it doesn't exist

severe cedar
#

thats what my friend put

#

guess she was wrong when she put that

slender thistle
#

Yell at your friend

umbral zealot
#

Maybe she wasn't wrong back in the day when she put it

#

ยฏ_(ใƒ„)_/ยฏ

#

since it used to be correct

last geyser
#

wf_reaction/message was removed in 1.0.0

#

so