#development

1 messages · Page 1898 of 1

tardy hornet
#

i even tried with the ()

#

same result

earnest phoenix
#

rapsberry pi

tardy hornet
#

LOL

earnest phoenix
#

lol

tardy hornet
#

anyways

tardy hornet
lyric mountain
#

console.log(user_money.toLocaleString())

rose warren
#

Oops I was busy with something else!

lyric mountain
#

please do typeof user_money

flat copper
#

help

lyric mountain
#

try SERVER_MANAGE

tardy hornet
tardy hornet
#

if v13 it wont work

flat copper
flat copper
lyric mountain
tardy hornet
lyric mountain
#

I mean, u can but it won't work as expected

flat copper
lyric mountain
#

convert to int first

tardy hornet
#

after the FLAG.

#

type the type of perms

tardy hornet
lyric mountain
flat copper
#

how?

tardy hornet
#

idk

lyric mountain
#

...you don't know how to parse to int?

tardy hornet
lyric mountain
#

oh ok

earnest phoenix
#

how do i disable eslint in a file

#

because it thinks useEsbuildLoader is a hook in next.config.js

quartz kindle
#

its MANAGE_GUILD not MANAGE_SERVER

cinder patio
flat copper
cinder patio
earnest phoenix
#

copied nextjs config cannot be wrong

earnest phoenix
#

and add next.config.js in it?

cinder patio
#

yup

earnest phoenix
#

still says it's wrong

#

I can just ignore the error

cinder patio
#

then do that

#

.eslintingore should do the job tho

dapper jasper
#

help

quartz kindle
whole surge
#

my bot is stucked on Ready Its is not turning on? it is offline

wheat mesa
#

That's very little information to work with

cinder zenith
#
internal/modules/cjs/loader.js:613
    throw err;
    ^
Error: Cannot find module 'discord.js'
Require stack:
- /app/bot.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
    at Function.Module._load (internal/modules/cjs/loader.js:526:27)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/app/bot.js:1:17)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:826:10)

Although "Discord.js" is defined in the main file of my bot, it gives this error, I deleted and reinstalled it and it still remained the same. It Says "Discord.js" Not Found But It Is In The Main File, Can You Help?

lyric mountain
#

npm i discord.js

cinder zenith
quartz kindle
#

where is your bot hosted?

cinder zenith
#

I was using Glitch to try something short term

quartz kindle
#

install it using glitch's add package button

cinder zenith
#

My Bot version v12.5.3 Currently. I haven't installed v13 yet. I Upgraded To V13 Maybe That's The Problem But The Result Was Still The Same

quartz kindle
#

whats your node.js version?

#

you can see it in your package.json under engines

earnest phoenix
#

Can anyone tell me where that $17 went actually?
I never added payment options

quartz kindle
lyric mountain
#

they probably gone to ur top.gg wallet

cinder zenith
earnest phoenix
quartz kindle
#

you cant use discord.js v13 with node.js v12

lyric mountain
cinder zenith
#

normally there was no such problem, it happened to me today

earnest phoenix
#

Yes. I did. But it says unknows user

quartz kindle
#

show your package.json

lyric mountain
#

then auctions

cinder zenith
# quartz kindle show your package.json
{
  "main": "bot.js",
  "license": "MIT",
  "scripts": {
    "start": "node bot.js"
  },
  "dependencies": {
    "captcha-plus": "^2.5.2",
    "chalk": "^4.1.2",
    "db": "^3.3.1",
    "discord-buttons": "^4.0.0",
    "discord.js": "^12.5.3",
    "express": "^4.17.1",
    "ffmpeg-static": "^4.4.0",
    "fs": "^0.0.2",
    "humanize-duration": "^3.27.0",
    "moment": "^2.29.1",
    "moment-duration-format": "^2.3.2",
    "node-fetch": "^3.0.0",
    "opusscript": "^0.0.8",
    "orio.db": "^2.1.4",
    "quick.db": "^7.1.3",
    "wio.db": "^4.0.21",
    "common-tags": "^1.8.0",
    "node-superfetch": "^0.2.3",
    "snekfetch": "^4.0.4",
    "ytdl-core": "^4.9.1",
    "discord-xp": "^1.1.16",
    "discord-canvas": "^1.3.2",
    "discord-backup": "^3.0.1",
    "twemoji-parser": "^13.1.0",
    "weather-js": "^2.0.0",
    "croxydb": "^0.0.7",
    "ms": "^2.1.3",
    "discord-button-pages": "^1.1.9",
    "dblapi.js": "^2.4.1",
    "node.js": "^0.0.0"
  },
  "engines": {
    "node": "12.x"
  },
  "name": "app",
  "version": "1.0.0",
  "devDependencies": {},
  "keywords": [],
  "author": "",
  "description": ""
}
spark flint
#

its just broken and says its been claimed

wheat mesa
#

oh my package dependency hell

quartz kindle
#

also, uninstall node.js and fs

#

they are not real packages

cinder zenith
#

ok

#

i try now

lyric mountain
#

node as dependency lul

quartz kindle
#

also, uninstall anything you're not using. you have a bunch of stuff that does the same thing for some reason, like croxydb wio.db quick.db orio.db and db

earnest phoenix
quartz kindle
#

node-fetch superfetch and snakefetch also all do the same thing

#

just use one

cinder zenith
royal portal
dense flame
cinder zenith
#
node:internal/modules/cjs/loader:936
  throw err;
  ^
Error: Cannot find module 'discord.js'
Require stack:
- /app/bot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
at Object.<anonymous> (/app/bot.js:1:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) {
  code: 'MODULE_NOT_FOUND',
requireStack: [ '/app/bot.js' ]
}

Now It's Giving This Error, I Think It's Still Not Solved

quartz kindle
#

its not an npm package

royal portal
cinder zenith
lyric mountain
#

I mean, node would not even be able to read package.json if fs was a lib

craggy pine
#

For a Discord.js Message Collector what would be a proper way of checking if any user is not a bot. I'm being a smoothbrain right now.
const filter = m => whatever check here

lyric mountain
#

m.user.bot

craggy pine
#

ty

lyric mountain
#

hi miyu

craggy pine
#

also hi ku

quartz kindle
lyric mountain
craggy pine
#
                const filter = m => {}
                const collector = new Discord.MessageCollector(message.channel, filter, { time: 86400000 });

Anyone can just type message and it throws it into a message. Everything works, except I just want it to ignore bot messages and let everyone respond who isn't a bot. Also ignore the long time, its a full day in ms KEKW

lyric mountain
craggy pine
#

Originally I did this m.author.id === message.author.id && !m.bot

#

But that only allowed the user who typed the command to input and it ignores everyone else

#

I only want it to ignore boots

lyric mountain
quartz kindle
#

m is not a user

#

m is a message

#

therefore m.bot is not a thing

lyric mountain
#

ah

quartz kindle
#

there is no message.bot

craggy pine
#

facts

lyric mountain
#

then m.author.bot

#

I thought it was member

craggy pine
#

Makes sense I'm a smoothbrain ty tim and ku

boreal iron
#

Don’t blame those Brazil guys freerealestate

#

It’s hard enough for him already

terse bone
#

What about Brazil?

cinder zenith
#

I wonder if the node.js Version is not compatible with the discord.js version I'm using? if so what node version would you recommend for 12.5.3?

lyric mountain
terse bone
earnest phoenix
#

people still use v12

#

sad

terse bone
#

Yes

#

I started my bot in v12 and they released v13 right after so I was like naaaah

spark flint
#

i've asked before and I still can't work out how but

#

is there a feature in express.js which works like render_template in flask?

boreal iron
quartz kindle
#

discord.js v12 requires node.js v12+

#

so you're fine

#

discord.js v13 requires node.js v16.6+

cinder zenith
#
internal/modules/cjs/loader.js:613
    throw err;
    ^
Error: Cannot find module 'orio.db'
Require stack:
- /app/bot.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
    at Function.Module._load (internal/modules/cjs/loader.js:526:27)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/app/bot.js:5:12)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:826:10)

Now it cannot find module "orio.db". but it is present in my "package.json" file and main file, still same as discord.js error just before.

lyric mountain
#

npm i orio.db

cinder zenith
quartz kindle
#

try enable-pnpm again

#

show what happens when you run enable-pnpm

cinder zenith
#

this time it's back to the beginning, it gives discord.js error, although it's still defined.

wheat mesa
#

defining it has nothing to do with your error, it's failing to find the npm package named discord.js

cinder zenith
grim aspen
#

aren't you supposed to do npm install discordjs@12.5.3?

quartz kindle
#

show the output of running enable-pnpm

cinder zenith
#

stuck on

quartz kindle
#

run pnpm i

cinder zenith
earnest phoenix
#

dose anyone have a heartbeat code for buttons?

modest maple
#

what?

spark flint
#

@rustic nova scam deleted

quartz kindle
cinder zenith
quartz kindle
#

👍

lyric mountain
modest maple
#

oh

#

yikes

earnest phoenix
#

dose anyone have a heartbeat code for buttons?

quartz kindle
#

what does that even mean

earnest phoenix
#

a animation for a button that make it beat

quartz kindle
earnest phoenix
#

ty

lyric mountain
#

"I don't code in css"

boreal iron
# earnest phoenix a animation for a button that make it beat
<style>
      @keyframes blinking {
        0% {
          background-color: #06c3d1;
        }
        50% {
          background-color: #ff0000;
        }
        100% {
          background-color: #270da6;
        }
      }
      #blink {
        width: 200px;
        height: 200px;
        animation: blinking 0.33s infinite;
      }
</style>

<div id="blink"></div>
earnest phoenix
#

ty

lyric mountain
#

that's not a heartbeat, that's a cancer

boreal iron
#

well than increase the speed and use opacity

subtle kiln
#

Hi! I've some interactions that end up with DiscordAPIError: Unknown interaction.

By taking a deeper look into it, I found out that the time between the creation of these interactions and the time that they arrive to my bot client is over 3 seconds. So when they arrive, they're already invalid and I can't do anything with them.

That's really strange because 91.2% of the interactions are less than 250ms old when they arrive. But a small 3.6% of them are about 3 seconds and up to 7 seconds old!

Did you experienced something similar?

lyric mountain
#

errrr

#

HOW is the interaction arriving over 3 seconds after u create it?

#

like, it's 3s after if reaches discord

subtle kiln
#

Idk, I got those stats in prod

#

can't recreate in dev

quartz kindle
#

where is your bot hosted?

earnest phoenix
subtle kiln
quartz kindle
#

it could be network issues

subtle kiln
#

That seems like to be it indeed. I just wanted to check if it was a known issue

boreal iron
#

If it sometimes takes a few second, use deferReply()

#

Your bot will show up Bot is thinking... and then send the message

subtle kiln
quartz kindle
#

you can try monitoring your network ping at the same time and see if there are any fluctiations

boreal iron
#

oh lol

woeful pike
earnest phoenix
#

@boreal iron in ur code how can i make like a cooldown before it starts

snow urchin
earnest phoenix
#

So I am in the process of making a platform that allows people to upload stuff to the site and display it on their profiles and such. Regarding the storage how should I go about storing the peoples images/videos or whatever properly or does it not matter how I store it as long as I save the info of that post in the db? (With that info I would have a link to the specified image of that post)

spark flint
#

make sure that you can ensure that there are no data leaks

#

i wouldn't personally want to upload files to a site where you can't ensure that databreaches or malware could be

earnest phoenix
#

Well ofc not

#

I haven't told em how much I wanna use as of right now

#

But he owns a good bit of em

spark flint
#

fair enough

#

does he own the rack space?

earnest phoenix
#

Yea

spark flint
#

and is it in a datacenter or in his house etc

earnest phoenix
#

No idea where its located

#

I just know he made a deal with a hosting service and split the bill with them when they were buying storage racks

#

so he owns like half of em

spark flint
#

ideally you would want it in a datacenter

earnest phoenix
#

Yea fair point

spark flint
#

so it has the fastest possible connection

#

and you would want 1gbps speeds

earnest phoenix
#

I am honestly not too experienced with content delivery so this is an entire new relm to me

spark flint
#

if you need help, i'm more than happy to try

earnest phoenix
#

Well, I have a fair idea how to actually serve the images its just storing them properly

#

So it isn't just a jumble of mess

spark flint
#

yah

#

somehing like that

earnest phoenix
#

Mmm

#

nginx never used it before

spark flint
#

i have a spare vps so i'm gonna try install that now and see if it works

spark flint
earnest phoenix
#

Alrighty

stray seal
#

If I am making commands for a later update on my bot, How do i keep the file on the bot but make it hidden so no one can use it?

earnest phoenix
#

Like on github?

vivid fulcrum
#

don't test in prod

stray seal
earnest phoenix
#

oh well just split your bot into prod and dev versions

spark flint
earnest phoenix
#

keep your prod alive on the host and test your development code on your machine

stray seal
#

I am trying to make not useable Lyrics, so people cannot use the command since that is next update

earnest phoenix
#

again make a dev version of the bot

#

so only the dev bot has the updated code

stray seal
native walrus
#

normally the thing you're asking for is done with feature flags but I don't think you're quite there yet

earnest phoenix
#

I am not even at the point of needing to handle posts yet

#

I just wanted to do some research beforehand

spark flint
#

alr

stray seal
slow ibex
#

uh.. dumb question i know.. uuuh... how can i get the folder where the index.js is executed?

#

I need to scan a directory in that Script path but i constantly get "no such file or directory"

native walrus
#

process.cwd() should give you the current working directory

#

which is where package.json is 99% of the time

#

unless you're doing some monorepo stuff

slow ibex
#

urgh.

#

Not really.. but cwd seems to be the Folder where i call the script from

#

Like /root

solemn latch
slow ibex
#

Found it! Its __dirname

#

Found it! Its __dirname

native walrus
#

ah yeah that's relative to the directory of the file you're running. Didn't think that's what you wanted

slow ibex
lyric mountain
#

is the port open?

slow ibex
#

Locally?

lyric mountain
#

ye

#

idk if it does matter, but it's good to try

slow ibex
#

I guess the ports are open, another port "8080" is reachable externally.. but i try to connect to the localhost.. so normally that shouldnt matter

lyric mountain
#

econnrefused errors are normally linked to firewall

slow ibex
#

I enabled ufw just to allow the port. Nothing changed

#

Just saying. The connection never leaves the server

lyric mountain
#

hm, idk then

#

do u have nginx/apache?

slow ibex
#

Nope

#

i already changed ports

#

nothing changed

lyric mountain
#

we'll need tim

slow ibex
lyric mountain
#

2333 is not there

slow ibex
#

Now 30333

#

But yes. its not there

lyric mountain
#

did u start the server process?

slow ibex
#

Yes

lyric mountain
#

then it's not even attaching to port

#

try running with sudo

slow ibex
lyric mountain
#

it's 8080

#

try connecting to it

slow ibex
#

8080 is something different

lyric mountain
#

ohhh wait

#

just noticed this

slow ibex
#

Thats also something different

#

I ran a port scan

lyric mountain
#

then I'm clueless

#

u sure it ain't 8080?

#

cuz the process attached to it

quartz kindle
#

what do you have in your application.yml?

slow ibex
#

application.yml

#

I used this Password as a test

quartz kindle
#

you keep changing ports lol, so now its port 30333?

slow ibex
#

Its still the port

#

So.. i managed to connect to it..

#

I changed in the application.yml the address to localhost (127.0.0.1)

#

again

#

And then Sudo opened a screen for the lavalink-server

#

If i use my Start script i get this error

#
screen -dmS musicbot sudo node musicbot/newBot/bot/index.js
screen -dmS lavalink-server sudo java -jar musicbot/newBot/server/Lavalink.jar
quartz kindle
#

what error

slow ibex
#

The connection thingy

quartz kindle
slow ibex
quartz kindle
#

well

#

you are starting the bot first

#

you should start lavalink first lol

slow ibex
#

Welp

#

fck

#

Buuuut.. even after that... the bot doesnt start

quartz kindle
#

you might want to add a delay as well, if those commands are too fast

#

not sure how long lavalink needs to become online

slow ibex
#

So the server is almost 2 Minutes online

#

Still cant connect to it if i manually start the script

quartz kindle
#

remove lavalink from the start script

#

run it manually

#

then run only the bot with the script

slow ibex
#

Okay.. started it manually...
screen sudo java -jar musicbot/newBot/server/Lavalink.jar

#

After i confirmed that i was fully started i ran the script... you know.. this thingy.. sudo node musicbot/newBot/bot/index.js

#

Still no connection

#

i think it has something to do where i start it

#

lol

#

If i start the Lavalink Server inside of its folder.. the script connects

stray seal
#

What is a good Color Scheme for Blue? (i asked here since it is for my Discord Bot...)

lyric mountain
#

what tone?

#

there are like, at least 510 tones of blue

earnest phoenix
#
message.guild.users.cache.get()
``` is a valid function?
proven lantern
pale vessel
#

No, cache is a collection

#

guild.users doesn't exist doe

lyric mountain
#

So much that discord itself doesn't use that tone for switches in settings screens

proven lantern
#

i am the only one using it

lyric mountain
#

too bright yet lacks any meaningful combo

proven lantern
#

it reminds me of christmas

lyric mountain
#

try #469a60

#

this is the one from discord switches

proven lantern
#

perhaps

dapper jasper
#

i give up. i do:

client.on('messageCreate', message => {
console.log(message);
});

and then nothing will happen the bot refuses to work when I send a message.

boreal iron
#

Is the client logged in?

#

Are you on v13?

dapper jasper
#

Yes and yes

earnest phoenix
earnest phoenix
#

It’ll fix your issue

boreal iron
#

No it doesn’t fix your issue

boreal iron
#

Try log the ready event please to see if your bot gets ready.

dapper jasper
boreal iron
#

And make sure it has the permissions to read messages (and the message history)

dapper jasper
boreal iron
#

Ah ok

dapper jasper
# boreal iron Ah ok

I've even tried logging something else in there to see if the action is ever triggered and it's not

#

I've also tried running it on Linux

#

Cuz I'm using Windows

boreal iron
#

Do you share at least one guild with the bot?

dapper jasper
boreal iron
#

OS doesn’t matter

dapper jasper
#

And yes I'm on a nodejs 16

boreal iron
#

I mean do you share at least one guild with your bot?

lament rock
#

I just use 36393F

boreal iron
#

Are you and your bot are in the same guild at least one?

dapper jasper
boreal iron
#

This whole server is a guild

dapper jasper
#

I've tried messaging in a server for the bot

boreal iron
#

Send a message in a server the bot and you are in

#

Check if that one logs

dapper jasper
#

I did

#

I've Already done that

#

I tried that before the DMs

dapper jasper
boreal iron
#

And the bot has the required permissions in the server?

dapper jasper
#

It is admin

boreal iron
#

On which OS are you atm?

dapper jasper
boreal iron
#

Hmm I’m out of ideas then

lament rock
#

36393F is Discord's dark theme background color

dapper jasper
boreal iron
#

You can test creating a new app

#

That might help

#

As well as TEMPORARILY disabling your server firewall to make sure incoming requests aren’t blocked

#

But i don’t think that’s the case

#

Oh I forgot one thing

lament rock
#

You never bothered to ask if the bot has the GUILD_MESSAGES intent enabled

boreal iron
#

Did you set the right intent?

#

Yes yes

#

There we go…

#

Always forget you need to specify them yourself in v13

#

@dapper jasper

dapper jasper
#

But completely remaking the application is what fixed it

boreal iron
#

Hmm weird but okay

dapper jasper
boreal iron
#

Np embarrassing enough I didn’t ask for intents in the first place

quartz kindle
#

i read somewhere that i should run openssl speed to test which ciphers are faster on my machine

#

this thing's been running for 40+ minutes now

#

@_@

boreal iron
#

read somewhere

#

What can go wrong freerealestate

lyric mountain
boreal iron
#

lmao

errant flax
#

is there a way to know where the request is coming from using the req params in express?

solemn latch
#

"coming from"?

#

as in ip? location?

errant flax
#

nvm

but how do i make it secure that my website can only request from the backend?

solemn latch
#

authorization headers

#

or if its the same server, firewall

errant flax
#

firewall?

#

wym by firewall

solemn latch
#

preventing any outside connection from accessing the server on that port

errant flax
#

also the thing is the browser is requesting from the backend so the user can just see the code and see the authentication code

quartz kindle
#

you cant hide authentication from the client

#

so dont put it there

#

what are you using this authentication for?

errant flax
#

to request stuff to the backend?

#

like with database stuff

errant flax
#

what do i do then

solemn latch
#

🤔 I dont think giving users access to your database is a good way to do things.

errant flax
#

no like updating things from the backend

#

like when a user click a button the js code request something to the backend and the backend updates ir

#

it*

#

the only problem is idk how to make the request secure for other ppl to just make some request

quartz kindle
#

button sends a request without authentication to the backend, then backend completes the requiest with authentication

errant flax
#

i don't under the second part

#

understand*

solemn latch
#

I think we need more context, what is this for?
like a bot dashboard?

errant flax
#

ye its a bot dashboard

quartz kindle
#

example:

// browser
fetch("website.com/backend", { method: POST, body: "something" })

// backend
app.post("/backend", (req, res) => {
  if(req.body === "something") {
    database.set("a", "b");
    res.send("done")
  }
})
#

(pseudo-code)

errant flax
#

but how do i hide it from the user checking out the browser's code sadge

quartz kindle
#

you cant

#

what do you have in there that needs hiding?

solemn latch
#

just to clarify, you are talking about trying to authorize users and are unsure about that?

#

or the database

quartz kindle
#

or are you trying to prevent the user from sending a request outside of the browser?

quartz kindle
#

there is no 100% reliable way of doing that

#

the closest you can get is using session cookies

errant flax
#

thx for the suggestion tho monkaHmm

quartz kindle
#

no matter what you do, anyone can see exactly what the browser is sending to your server if they dig hard enough

#

and nothing stops them from sending the exact same thing outside of the browser

errant flax
#

one more thing is it possible to delete a cookie in native js

timid widget
#
client.on("messageReactionAdd", function(messageReaction) {
    let data = JSON.parse(fs.readFileSync("./config/reactions.json", "utf8"));
    var good = parseInt(data.good)
    var bad = parseInt(data.bad)

    if (messageReaction == '✅') {
        good++
    } else if (messageReaction == '❌') {
        bad++
    }

    var newData = {
        good: good,
        bad: bad,
    }

    fs.writeFile("./config/reactions.json", JSON.stringify(newData), err => {
        if (err) console.log("Error writing file:", err);
    });
});

my issue is that it just shows in the json file as null

quartz kindle
austere thicket
#

hello

#

is there any way we can check if the a indivual user has voted for the server with the same method how we can check for bot

#

excpet of webhooks

#

like via the get method

lyric mountain
#

Ye, the only way to actually check for a specific user is by using the GET method

#

Webhooks are one-way

austere thicket
#

pls anyone?

earnest phoenix
#

servers dont have api

austere thicket
errant flax
#

im using oauth2 for this

how do i filter a user's joined servers which the user has manage server perms and the bot is in that server?

next crown
#

How do I put emojies in my code (I am on laptop)

sage prairie
#

search up emoji

#

and then paste it

#

bruh

#

💩

#

haha

#

bruh

#

just search up poo emoji

#

copy paste

#

\💩

earnest phoenix
#

So I am trying to figure out which would be easier, making a table relation between users and posts or just making them separate but having posts store the user id.

#

I am unsure which would be easier in practicality since I have never actually tried making a table relation without using an orm of any sort.

split hazel
#

I mean it doesn't matter all that much its just with sql relations you get extra features such as joining tables and updating relating rows automatically without another query

#

you should make a relationship between post user id and user id since it also acts like a bug catching mechanism if you're not going to be joining much

sage prairie
#

hi

sage prairie
#

nah

hollow depot
stiff lynx
#

how do I check for permissions in v13?

next crown
hollow depot
#

wait did u do win + or win .

next crown
#

Windows +

hollow depot
#

i said “win” key + “.” key lol

#

so win .

stiff lynx
#

Idk why I can see every slash command of my bot twice

#

any clue?

earnest phoenix
earnest phoenix
#

you can have a guild and a global command with the same name

earnest phoenix
drifting coral
#

How can I Import commands from file to another in python ??ping me and reply :))

next crown
#

I will try that

#

When I get home

errant flax
#

its this

woeful pike
#

it's so painful watching him I can't. It's a good video but my god

#

Why would you want to write header guards manually... why would you want to have to try to compile your program, then realize you forgot to import stdlib.h and import it manually when an IDE could do it for you automatically as you type calloc 🙄 just use an IDE dawg ugh

vivid fulcrum
#

"i'm an indie dev" starter pack:

#

because re-implementing features of an IDE instead of using one in the first place

#

serves as a distraction from doing your actual project

tame kestrel
#

Based and bigoted pure text editor programmers

earnest phoenix
#

css hard

vivid fulcrum
#

witchery

#

i just use https://animista.net/ to generate out of the box animations because i want to keep the little sanity i have

earnest phoenix
#

the discord logo is 27px wider than tall

#

so I end up with a wide putin discord logo because the img is 64 x 64

#

why tf is uncalled function being executed

#

its never called

#

its not even same directory

#

nvm i got it

small tangle
#

Im getting this error at one of my image attachment in an embed and the image isnt loading. But when i run the exact same command again, everything works fine peepoThink what could be the cause for that?

#
 @Override
    public void execute(SlashCommandEvent event, DBUser user) {
        try {
            final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
            ImageIO.write(createImage(user), "png", bytes);

            final EmbedBuilder embed = new EmbedBuilder();
            embed.setTitle(user.getAlpaca().getNickname())
                 .setDescription("_Have a llamazing day!_")
                 .addField("Work", checkCooldown(user.getCooldown().getWork()), true)
                 .addField("Sleep", checkCooldown(user.getCooldown().getSleep()), true)
                 .setThumbnail(event.getUser().getAvatarUrl())
                 .setFooter("Created by SirTimme", "https://cdn.discordapp.com/avatars/483012399893577729/ba3996b7728a950565a79bd4b550b8dd.png")
                 .setTimestamp(Instant.now())
                 .setImage("attachment://alpagotchi.png");

            event.replyEmbeds(embed.build())
                 .addFile(bytes.toByteArray(), "alpagotchi.png")
                 .queue();
        } catch (IOException error) {
            LOGGER.error(error.getMessage());
        }
    }

thats the command

earnest phoenix
#

@boreal iron remeber the code that u gave me? yeah how do i make a cooldown before it starts

#
 let user = message.mentions.users.first() || message.author
  let coin = await db.get(`coin_${user.id}`)
``` coin = 0
#

the coin is 5000 for me and 500 for my friend

#

it gives 5000 for me but for my friend gives 0

earnest phoenix
stray seal
#

How do you make "premium" commands? Where only paied people can use....

quartz kindle
#

have a database of users, with something in it that says if the user is premium or not

#

when the command is run, check if the user has premium

boreal iron
#

animation-delay: 3s

#

To the element you need

hollow depot
#

hi, i'm trying to send a text message to whoever visits the ip:port of my vps
this is my code:

const port = 3000
app.get('/', (req, res) => {
    res.send('Hello World!')
})
app.listen(port, () => {
    console.log(`App startred on ${port} port`)
})```
when i start this on my local machine it works just fine, but when i start it on my VPS using the public IP and the port 3000 it does not work, any advice?
#

in case that matters, the VPS is on a linux machine

earnest phoenix
#

does your vps have its 3000 port open

boreal iron
#

Does the port 3000 accept TCP requests?

hollow depot
#

well didnt think of those two

#

as you can see i'm new to express lol, also, how could i check those options?

boreal iron
#

OS?

#

Show me your input policy please
sudo iptables - -list -v

#

Yeah my phone doesn’t allow two - behind each other

#

Great

#

No space between - and -list

hollow depot
#

i got this:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination```
boreal iron
#

That’s not your issue then since the input policy is on ACCEPT by default

midnight swallow
#

Hey, I'm trying to deploy next js to vercel but I keep getting this error
"Eslint has unmet dependencies"
It works fine on my local machine tho..
This is my build log

boreal iron
hollow depot
#

could be

#

imma check

boreal iron
#

If so you would need to allow port 3000 INBOUND TCP

fair axle
#

How can we get that result from a json on Node.js?

(like json.items() in python)

json = {"a": 1, "b": 2}

Expected Result:
[["a", 1], ["b", 2]]
sacred aurora
#
Object.entries(json)
fair axle
#

Thanks

earnest phoenix
#

how do i make this show as a block```css
<style>
body{
margin: 0;
padding: 0;
background: #262626;
}
.center{
display: flex;
align-items: center;
justify-content: center;
right: 5;
height: 3vh;
}
.center a{
position: relative;
display: block;
text-decoration: none;
color: red;
overflow: hidden;
font-size: 10xp;
padding: 10px 10px;

transition: .2s;
font-family: 'Lexend Peta';

}
.center a:hover{
color: yellow;
background: red;
box-shadow: 0 0 10px red,
0 0 10px red,
0 0 10px red,
0 0 10px red;
transition-delay: 1s;
}
a span{
position: absolute;
display: block;
}
a span:nth-child(1){
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg,transparent,red);
}
a:hover span:nth-child(1){
left: 100%;
transition: 1s;
}

a span:nth-child(3){
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg,transparent,red);
}
a:hover span:nth-child(3){
right: 100%;
transition: 1s;
transition-delay: .5s;
}
a span:nth-child(2){
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(2){
top: 100%;
transition: 1s;
transition-delay: .25s;
}
a span:nth-child(4){
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(4){
bottom: 100%;
transition: 1s;
transition-delay: .75s;
}
</style>```

earnest phoenix
boreal iron
#

Can’t help you on mobile, sorry what element needs to be a block and what do understand as block hashflushed

earnest phoenix
#

what's better for...of or array.forEach

wheat mesa
#

From what I was told by js master Tim, it depends on the use case

#

I generally use for...of

#

I think it’s faster in most cases but that’s pretty much speculation on my end from what I’ve been told when learning js

earnest phoenix
#

forEach can give you the array it was called on which makes it good for one liners

boreal iron
earnest phoenix
#

why is .env not accessible when called from another file

#

works only in main

earnest phoenix
#

na

#

windows

#

bruh fucking javascript

#

now it works

#

ok so when i do this

#

it works in directory where .env is

#

but not in child directory

#

you can set path, now it works

outer perch
#

is there a way to check if the target has a role above the user trying to mute?

earnest phoenix
#

check role position

small tangle
#

assuming you are using discord.js there is this method

small tangle
#

^^

outer perch
#

and there's the method .highest right?

small tangle
outer perch
midnight swallow
#

Does anyone have a good knowledge on How to deploy next/react using vercel?

earnest phoenix
flat copper
#
const guilds = _.chunk(client.guilds.cache.map(g => {
        console.log(g.name)
          return `**__Guild: ${g.name}\nId: ${g.id}\nOwner: ${client.users.cache.get(g.ownerId).name}#${client.users.cache.get(g.ownerId).discriminator}\nMembers: ${g.memberCount}`
      }), 5)```
err: cannot read property "name" of undefined
earnest phoenix
#

client.users.cache.get(g.ownerId).name is the owner cached

earnest phoenix
#

check if the user is cached

hollow depot
#

ok so, sorry if im bothering with this issue but i cant find a solution

im trying to send a response on a VPS, so who visits ip:port sees that
i had an issue doing this earlier, i fixed that but i got another issue, this is the error im getting:

Error: listen EACCES: permission denied 0.0.0.0:80
    [...]
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1346:8)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'EACCES',
  errno: -13,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 80
}```
i checked on the aws instance panel, i already changed the permissions and the ip should be accessible by http
flat copper
earnest phoenix
#

you mean make it bold?

flat copper
earnest phoenix
#

<b>text</b>

earnest phoenix
flat copper
#

oki thnx

earnest phoenix
#

ig fetching the guild again might give you the updated data

#

html question: how do I smoothly scroll the page to a heading?
setting the hash to #heading directly jumps to the heading

small tangle
#

Does anyone experience problems with Discords CDN regarding AccessDenied errors? i randomly get these

earnest phoenix
#
transition: padding 0.25s, transform 0.25s, height 0.25s, width 0.25s;

in scss how do I avoid repeating the 0.25s

earnest phoenix
lament rock
tardy hornet
#

any one knows how can i make a custom stocks graph that i can change how it looks

#

idk how to explain

small tangle
#

can i add an user agent directly via url param?

#

but thats weird, i never needed to do that

lament rock
#

not a url param

small tangle
#

im just adding my profile picture via cdn link in the embed

#

never needed an user agent header for that

lament rock
#

Well. There was a bug with Discord where that was required a while ago, but that apparently got fixed, but idk if that thing resurfaced

small tangle
#

yeah it was in august

lament rock
#

Doesn't hurt to try it and see

small tangle
#

to add the user agent?

lament rock
#

Yeah

small tangle
#

yea lemme see, thanks for the input

visual bone
#

Using python "official" top.gg package:
The return info at the vote event is super poor, any way to get the voter details ect?

slender thistle
#

Fetch data from the Discord API

#

Also not sure why you put the official on quotes

unkempt jay
#

:3

lyric mountain
#

There's not really much more detail they can give if not the current

#

Well, maybe last vote date, but that's stretching

loud tree
#

`import random

test_seed = int(input("Type your seed\n"))
random.seed(test_seed)

random_side = random.randint(0, 1)

if random_side == 0:
print("Heads")
else:
print("Tails")`

#

did i code right?

#

any simplicity?

sick agate
#

does random.seed do anything?

loud tree
sick agate
#

idk then

loud tree
#

i could have done with comp. time

#

still i did it manually

earnest phoenix
#

my button is not showing as a block it is showing as a line-block and i have display: block;

loud tree
#

stacks overflow it once

earnest phoenix
#

how?

loud tree
#

just go to stacks overflow and type your problem you are facin

earnest phoenix
#

my code: ```css
<style>
body{
margin: 0;
padding: 0;
background: #262626;
}
.center{
display: flex;
align-items: center;
justify-content: center;
right: 5;
height: 3vh;
}
.center a{
position: relative;
display: block;
text-decoration: none;
color: red;
overflow: hidden;
font-size: 10xp;
padding: 10px 10px;

transition: .2s;
font-family: 'Lexend Peta';

}
.center a:hover{
color: yellow;
background: red;
box-shadow: 0 0 10px red,
0 0 10px red,
0 0 10px red,
0 0 10px red;
transition-delay: 1s;
}
a span{
position: absolute;
display: block;
}
a span:nth-child(1){
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg,transparent,red);
}
a:hover span:nth-child(1){
left: 100%;
transition: 1s;
}

a span:nth-child(3){
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg,transparent,red);
}
a:hover span:nth-child(3){
right: 100%;
transition: 1s;
transition-delay: .5s;
}
a span:nth-child(2){
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(2){
top: 100%;
transition: 1s;
transition-delay: .25s;
}
a span:nth-child(4){
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(4){
bottom: 100%;
transition: 1s;
transition-delay: .75s;
}
</style>```

loud tree
#

embed ahm?

earnest phoenix
#

embed?

#

idk with css so

loud tree
#

idk then

earnest phoenix
#

ok ty

loud tree
#

np np ask someone else

#

big Brainers

earnest phoenix
#

like...?

loud tree
#

@earnest phoenixask some one in general chat to look up

earnest phoenix
#

ok ty

stray seal
sick agate
#

check from db that this person has premium or not

wary forge
#

^

rose warren
#

I believe Tim already answered you about this earlier today...

#

Amazing that you got exactly the same response from this person 👆

native compass
#

how can i create collector for my bot vote

earnest phoenix
#

my button is not showing as a block it is showing as a line-block and i have display: block;

#

my code:

<style>
body{
    margin: 0;
    padding: 0;
    background: #262626;
}
.center{
    display: flex;
    align-items: center;
    justify-content: center;
    right: 5;
    height: 3vh;
}
.center a{
    position: relative;
    display: block;
    text-decoration: none;
    color: red;
    overflow: hidden;
    font-size: 10xp;
    padding: 10px 10px;
    
    transition: .2s;
    font-family: 'Lexend Peta';
}
.center a:hover{
    color: yellow;
    background: red;
    box-shadow: 0 0 10px red,
    0 0 10px red,
    0 0 10px red,
    0 0 10px red;
    transition-delay: 1s;
}
a span{
    position: absolute;
    display: block;
}
a span:nth-child(1){
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,transparent,red);
}
a:hover span:nth-child(1){
    left: 100%;
    transition: 1s;
}

a span:nth-child(3){
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(270deg,transparent,red);
}
a:hover span:nth-child(3){
    right: 100%;
    transition: 1s;
    transition-delay: .5s;
}
a span:nth-child(2){
    top: -100%;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(2){
    top: 100%;
    transition: 1s;
    transition-delay: .25s;
}
a span:nth-child(4){
    bottom: -100%;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(4){
    bottom: 100%;
    transition: 1s;
    transition-delay: .75s;
}
</style>```
split hazel
#

is there a way to ask a follow up question with interactions?

earnest phoenix
#

i think

wary forge
native compass
split hazel
earnest phoenix
wary forge
earnest phoenix
split hazel
#

like /add

What would you like to add?
"text"

earnest phoenix
#

idk then

#

sorry

wary forge
# earnest phoenix i dont code css

I am saying put your code in https://codepen.io so that it'll be easier for others to read and understand.

earnest phoenix
#

ok one sec

wary forge
#

Sign up and then create a new pen

#

i can edit it in real time then :v

slender thistle
#

Implicit:
result = "Heads" if not random_side else "Tails"

earnest phoenix
wary forge
earnest phoenix
#

ok one sec

#

go to css @wary forge

#

ok

wary forge
#

ok.

earnest phoenix
#

:)

slender thistle
#

Ternary operators ❤️

loud tree
#

i have just started to learn

#

py

visual bone
#

they provide bot id and if weekend

#

if im not mistaken

slender thistle
#

You are mistaken

#

topggpy types represent such data within type annotations and documented fields

visual bone
spark flint
#

how do I put markdown in HTML

#

context

visual bone
#

just plonk it in

spark flint
#

i tried html <div class="aside"> {{longdesc}} </div>

spark flint
earnest phoenix
spark flint
#

wdym

#

what is it for?

earnest phoenix
#

No what framework

spark flint
#

HTML

earnest phoenix
#

Just html?

spark flint
#

the {{}} is from Quart in Python

earnest phoenix
#

Ah

#

I thought you were using smth like vue or smth

solemn elk
#
.replace(/\[(.*?)\]/g, '<a href="$2">$1</a>')

How can I get the '$2'? I've so far gotten the $1 which is the text and not the link, I want to get the value that is in between brackets after the []

#

That's what it looks like right now

lament rock
solemn elk
slender thistle
quartz kindle
#

anyone wanna help me configuring nginx? lmao

spark flint
#

i hate configuring nginx lmao

quartz kindle
#

a simple hello world node.js app is giving me 17k reqs per 10 seconds
the same app with ssl drops down to 3k per 10 seconds
both of those are without nginx

#

with nginx it gets even worse

#

3k in 10 seconds without ssl, 1.5k with ssl

#

at this point i dont even know why im bothering with nginx

#

might as well just run node directly

slender wagon
#
var activeWord = await wordsDiv.$eval(".active", (word) => word.innerText);

hi, how can i handle this, let's say the element ".active" isn't a thing i don't want the entire app to crash cuz of it
i want to console log it and continue running the app

#

using puppeteer btw

novel snow
#

So I have been trying to figure out the messages.read intent, But when I am trying to invite a bot with it I need to have a redirect URI, Why precisely is this and what do I need to do? Trying to make a automod for 1 channel specifically but can't access message.content.

#

How does OAUTH2 even work?

summer briar
#

Can someone tell/give me a name for my bot please ? 😭
My bot kinda can do anything possible

spark flint
#

call it Infinity or something cringe

earnest phoenix
#

That works

summer briar
sage prairie
#

Bruh

summer briar
sage prairie
novel snow
#

Bruh

woeful pike
spark flint
#

alr ty

#

i'll work out how to do that lmao

modest maple
#

If its just text use normal formatting

#

Or the string templating lib in the stdlib

lyric mountain
#

well, unless u want slash cmds, in which case u should get application.interactions too

#

oauth2 is a two-step authorization basically

#

u ask the user for a token, then u use that token to exchange for the actual info

stray seal
#

With node.js, you use npm start, what do you use for Bash?

fresh bluff
#

My code is crazy

stray seal
fresh bluff
#

Let me see the issue

quartz kindle
#

add an anchor url

fresh bluff
#

Did you Make this or no?

#

Let me see something

#

I will Invite it

quartz kindle
#

you need an element with an id

#

for example <div id="myid"></div>

#

then give the button a link to that id

fresh bluff
#

@covert gale is there a Broken command?

quartz kindle
#

<a href="#myid">

fresh bluff
#

Whats the Issue with the bot?

#

oh ok

#

ok

errant flax
#

how do i change the embed hex color

#

in html

heavy bluff
#

@Monty#7398Hello mr . my bot goto top.gg but my friend his Make and my friend is Owner The Bot In Top.gg Can help me .894388400059207690

errant flax
#

ah ty

#

is there a way to bypass 30m?

#

oh ok thx

errant flax
#

and also how do i add this big img?

errant flax
#

it didnt send the img for some reason

timid widget
boreal iron
#

Don’t use relative paths for fs methods

#

Use the absolute path

#

__dirname + /path

errant flax
#

how do i add this big img for my site embedding

wheat mesa
#

I've got no experience with this, but if you look at the meta tags for discord.com you can see it has this for that image: <meta data-react-helmet="true" property="og:image" content="https://discord.com/assets/652f40427e1f5186ad54836074898279.png">

lament rock
#

discord embeds use opengraph meta

rose warren
errant flax
#

tried to change width and height and the outcome was this

#

for the img im using this (the src value)

rose warren
#

You can't use an svg with the og protocol

#

Svg isn't really an image format, it's html code.

#

You have to use a raster image

errant flax
#

raster what

rose warren
#

Like jpg or png

errant flax
#

so how do i use topgg stats thing with a .jpeg/.png file?

rose warren
#

You can't

pale vessel
rose warren
#

Widgets are so 90s anyway KEKW I wonder if they'll get a design upgrade with the new site 👀

loud tree
earnest phoenix
#

Do you guys know how to fix pm2 when the error will automatically restart, help me

#

npm i pm2-discord

errant flax
#

hey ive requested something to dblstatistics.com abt getting like a png thing it responds with this

split hazel
#

uh I guess that's an image?

#

definitely a binary of some sort

errant flax
royal portal
errant flax
novel snow
#

Or am I stupid?

earnest phoenix
#

npm i pm2

outer perch
#

v13 is just prepared for that upcoming change, coming in April iirc

#

that's why there is already the Intents option for that

novel snow
#

Why would the messages.read intent require OAUTH2 Though?

novel snow
#

Yeah it does for some weird reason

outer perch
#

right now you don't need anything other than this

outer perch
#

Thonk I think that's another subject besides the one I as trying to answer

#

I was talking about bot Intents, idk anything about OAuth2

outer perch
novel snow
#

What would messages.read do then?

outer perch
#

messages.read I think it's for another thing other than bots

#

you just need the bot scope

novel snow
#

Ah

#

Alright, Thank you!

outer perch
#

as @lyric mountain said, select the bot scope and ignore the rest

#

that's just for you to build the invite link

#

for the code, just get GUILD_MESSAGES as an intent early if you want

outer perch
#

or, you can make your bot act through slash commands with the interactions feature

pale vessel
errant flax
novel snow
#

Thank you my guy!

flat copper
#

why discord webhooks are too slow

earnest phoenix
#

they are lazy

flat copper
#

ig its sending msg after 10 or 15 min

earnest phoenix
#

its probably your end

#

webhooks work fine for me

flat copper
earnest phoenix
#

idk, just tested it, works fine

flat copper
#

discord bug?

earnest phoenix
#

how are you sending them

flat copper
earnest phoenix
#

code maybe

flat copper
# earnest phoenix code maybe
async function sendWeb(name, av, message, Channel, msg){
let channel = message.guild.channels.cache.get(Channel)
if(!channel.permissionsFor(message.client.user.id)
					.has('MANAGE_WEBHOOKS')
			)
				return message.channel.send({
					embeds: [{
						title: 'Invalid Permission',
						description: `**I dont have permission to Manage Webhooks**! ${
							channel.name
						}`,
						color: 'RANDOM'
					}]
				});

  
  let webhook = await message.guild.channels.cache.get(Channel).fetchWebhooks();
					
					webhook = webhook.find(x => x.name === 'DEMON-CHAT-BOT');
					if (!webhook) {
						webhook = await message.guild.channels.cache
							.get(Channel)
							.createWebhook(`DEMON-CHAT-BOT`, {
								avatar: av
							})
					}
					await webhook.edit({
						name: name,
						avatar: av
					});
					webhook.send(msg).catch(err => {});

					await webhook.edit({
						name: `DEMON-CHAT-BOT`,
						avatar: message.client.user.displayAvatarURL({ dynamic: true })
          })
}```
earnest phoenix
#

if you are not getting errors

flat copper
#

nope

earnest phoenix
#

its probably host

flat copper
#

?

earnest phoenix
#

where are you hosting

flat copper
#

@drowsy crag

earnest phoenix
#

dlscord

#

posting scams in dev server, smart idea

earnest phoenix
#

unfortunate, they try to steal your steam account lol

hybrid cargo
#

@rose warren

small tangle
#

dlscord lol

outer perch
#

not even that

#

it's .net

#

what in the world

spark flint
#

lol

mighty cypress
#

?av 289473498114555906

spark flint
#

dblav 289473498114555906

livid jackalBOT
#
spark flint
#

thats what you wanted anyways

mighty cypress
#

@spark flint lol thanks

feral aspen
#

How to fix? 😂

#

Wot, why do I have a star.

earnest phoenix
#

In a situation where I just need a reverse proxy, should I opt for nginx or traefik

lyric mountain
#

nginx is the standard ig

#

pretty lightweight, easy to configure, reliable

earnest phoenix
#

Upon further research I’m gonna go with traefik as it suits my needs and use case better

earnest phoenix
#

how do i add a text in my top.gg bot page?

#

like above a button

#

@boreal iron any idea

lyric mountain
#

u cant afaik

#

I mean, you TECHNICALLY can

earnest phoenix
#

wdym?

lyric mountain
#

but would mean a lot of fiddling with position: absolute and left/top

#

like, u cant add new elements to the page, only change their styles

earnest phoenix
#

ouf

lyric mountain
#

but u can move text around by positioning

#

but that also means you'll be stuck to a single platform (anywhere else and it'll look out of place)

earnest phoenix
#

like that would work?

lyric mountain
#

ye

#

do note my last message tho

#

you'll be sacrificing responsiveness

earnest phoenix
#

or @lyric mountain is there a code that i can change the invite button name then reset after like 5 sec

#

change the invite in the button then reset it back to invite?

#

can i?

#

will it work?

lyric mountain
#

no u cant

#

u can only style elements, not change their content

earnest phoenix
#

i can

#

i select the invite thing

#

not button

#

the invite text instead

lyric mountain
#

u cant, css cannot change elements' content

earnest phoenix
#

but can i reset after 5sec?

lyric mountain
#

css is style/animations only

earnest phoenix
#

fuck

#

ty anyway

quartz kindle
#

you kinda can

#

using css pseudoelements

#

with the content field

earnest phoenix
#
options: [{
name: x,
description: x,
type: 10,
required: true}]
cinder patio
#

I'm gonna guess that the number's too big

#

just use the user option type?

#

that or string

earnest phoenix
#

I need message id

severe perch
#

should be a logical error

earnest phoenix
#

What you mean?

severe perch
earnest phoenix
#

Its all number as you can see

severe perch
earnest phoenix
#

I just required if it is number

cinder patio
#

use the string option

earnest phoenix
#

An option but not a solving i think

cinder patio
severe perch
earnest phoenix
#

This interaction is failed

severe perch
#

@earnest phoenix I am not sure but usually ids are in string format

earnest phoenix
#

options.number is crashed i think

old cliff
#

Ids are long for ints or numbers

severe perch
#

My skill issue

earnest phoenix
#

Yes that was

#

But its so dumb

solemn elk
#

Discord isn't too good at taking large numbers in slash commands

#

Instead of an int take a str

rocky hearth
#

in ts, I want to make a Magic Utility Type that adds a type to each of the properties, like this. Whats the best way to achieve this?

type Magic<S, A> = {}

type Result = Magic<
  {
    a: string
    b: number
  },
  null
>

/* 
Result should be of following type
  { 
    a: string | null, 
    b: number | null 
  }
*/
earnest phoenix
#

You are not authorized to perform this action on this application

#

Why i get this error on slashcommands

lyric mountain
#

add application.interactions scope to invite

earnest phoenix
#

Alr did

#

And i get it on console

lyric mountain
#

now ask to re-authorize the bot on that server

earnest phoenix
#

İts global and bot online on just 1 server

lyric mountain
#

show relevant code

#

and console output

earnest phoenix
#
  const { REST } = require('@discordjs/rest');
  const { Routes } = require('discord-api-types/v9');

  const rest = new REST({ version: '9' }).setToken(process.env.token);

(async () => {
    try {
        console.log('Started refreshing application (/) commands.');

        await rest.put(
            Routes.applicationCommands(client.conf.clientId),
            { body: client.slashCommands },
        );

        console.log('Successfully reloaded application (/) commands.');
    } catch (error) {
        console.error(error);
    }
})();
#
DiscordAPIError[20012]: You are not authorized to perform this action on this application
    at SequentialHandler.runRequest (/rbd/pnpm-volume/9378658a-fa99-401c-9690-215512043a17/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.js:197:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (/rbd/pnpm-volume/9378658a-fa99-401c-9690-215512043a17/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.js:99:20)
at async /app/bot.js:122:3 {
  rawError: {
    message: 'You are not authorized to perform this action on this application',
    code: 20012
  },
  code: 20012,
  status: 403,
  method: 'put',
  url: 'https://discord.com/api/v9/applications/843505868275449866/commands'
}
lyric mountain
#

hmmm...aren't slashes officially supported by d.js?

earnest phoenix
#

Actually no

#

It makes really big problems

#

When my bot relog most command not working

#

If i dont invite bot again

lyric mountain
#

are u reloading slashes on every start?

earnest phoenix
#

Probably yes

#

What should i do

lyric mountain
#

idk, for that matter we'll need tim

proven lantern
#

updates to slash commands take 2 hours to propagate

earnest phoenix
#

Yes but it works when i reinvite

#

So its discord problem

proven lantern
#

it;s like dns

#

its how it works

earnest phoenix
#

?

proven lantern
#

discord isn't going to fix the issue

earnest phoenix
#

Then why they will force to use their shit?

proven lantern
#

standards are a good thing

#

getting all the messages and checking to see if it's a commands is poopy

#

then parsing out the parameters

#

oof

lyric mountain
#

never had issues with the old way tbh

#

I mean, client side param checking is cool and nice

earnest phoenix
#

But its better than wait 5 min for check a command

proven lantern
#

i had to switch to a vps instead of serverless hosting

#

now i get to switch back

earnest phoenix
#

Just think you got a big bot and it crashed

#

Your users will have to wait 2 hours for using command

#

Is it good ?

proven lantern
#

you dont need to wait 2 hours if the endpoint goes down

#

just bring it back online and its fixed

earnest phoenix
#

then dont update your global commands every time you start your bot

#

Even 10 minutes are ugly

proven lantern
#

it's instant

earnest phoenix
#

What you suggest?

lyric mountain
#

the ONLY thing holding me back atm is slashes not allowing multiple command signatures

earnest phoenix
#

unless you add a new command or update a command

#
  console.log("Slash Commands");
    fs.readdirSync("./commands/").forEach(async dir => { 
      const commands = fs.readdirSync(`./commands/${dir}/`).filter(file => file.endsWith(".js"));
        commands.map(async cmd => {
          let file = require(`./commands/${dir}/${cmd}`);
          let name = file.name || "No command name.";
          let description = file.description || "No Description";
          let options = file.options || [];
          
            const data = { name, description, options };
            let option = name == "No command name." ? "❌" : "✅";
          
              if (option == "✅") {
                await wait(500);
                client.slashCommands.set(name, { ...data, run: file.run });
                
                await client.application.commands.create(data)
                  .then(console.log(`Global Slash Command: ${name} Loaded ✅`))
                  .catch(console.error) };
    });
  });