#development

1 messages · Page 1773 of 1

thorny prawn
#

oh

silk drift
#
const app = express();

const webhook = new Topgg.Webhook(process.env.WEBHOOK_TOKEN);

app.post('/dblwebhook', webhook.listener(vote => {
    // vote will be your vote object, e.g
    console.log(vote.user); // 395526710101278721 < user who voted\

    // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}));

app.listen(80);

I currently have this code running on my bot bot when i test it there is no output.
the secret is the same on server and website
i currently have http://xx.xx.xxx.xx:80/dblwebhook as the ip

cinder patio
#

go to your bot's page, there should be an estimate to when your bot's gonna get approved

thorny prawn
#

ok thanks a lot!

solemn latch
silk drift
#

yes

solemn latch
#

where are you testing this at? on a home network? vps/replit?

silk drift
#

from my home pc atm

cinder patio
#

that's why it's not working

solemn latch
#

youll need to port forward

earnest phoenix
#

it wont work on local device you need a public ip

cinder patio
#

you need to setup port forwarding

silk drift
#

ah ok sad, i used the old dbl webhook system before and it worked fine but apparently its deprecated rn

#

thx

#

can i still use the old dbl api or not anymore?

#

for the time being

solemn latch
#

the api hasnt had any major reworks for quite awhile.

neat crater
#

How do I check for ghost ping in discord.py(I am using discord.ext)

slender thistle
#

Oh no someone deleted a message which has user mentions in it

#

That must mean I should cache it in my bot object as a dictionary

#

And using on_message_delete probably store the message itself or its contents

neat crater
slender thistle
#

rtfd

#

Message.mentions probably

hot sage
#

what do these errors mean?

slender thistle
#

The alias hit is already an existing command or alias

hot sage
#

ok

wheat sun
#

Two commands with same name

hot sage
#

i thought i removed it

slender thistle
#

That or you are setting a command alias which is the same as another command's name

hot sage
#

ok ty

#

i fixed it

slender thistle
#

Which... ironically, the error says pretty clearly

hot sage
#

i had to remove the hit alias

wheat sun
#

And yeah message.mentions

hot sage
#

How would I make a random joke generator?

clear marlin
#

there are apis for that, you should search it up

hot sage
#

Ok

#

I'll check them out

old cliff
#

Scrap reddit

earnest phoenix
#

or make an ai to generate jokes

opal plank
#

or just write 1000's of jokes and randomly select one

solemn latch
#

or steal 1000's of jokes and randomly select one

wheat sun
#

^^ Why start from scratch when others have done it?

hot sage
#

ok

#

yeah imma just take jokes lol

opal plank
#

@wheat sun@solemn latch both of u missed an important part

hot sage
#

and do it like a 8ball command

opal plank
#

the part where they write 1000's of jokes in pain, agony and tears

hot sage
#

true

opal plank
#

i wish to see such pain

hot sage
#

lmao

wheat sun
opal plank
#

i'll sleep better at night knowing someone wrote 1000's of jokes by hand

hot sage
wheat sun
#

lol

crimson vapor
#

@opal plank your code stinks

opal plank
crimson vapor
#

np

opal plank
#

if you can even call that thing code

crimson vapor
#

me when I almost commit my token

opal plank
#

thats what i got off my original bot and stripped off

crimson vapor
#

well its all fucked up

opal plank
#

got verified, pog

crimson vapor
#

ok but like

opal plank
#

got a cool badge next to my pfp now

#

speaking of verification, did u push the changes?

crimson vapor
opal plank
#

FUCK THAT

#

ADD COMMENTS

#

THATS IT

crimson vapor
#

I DID

opal plank
#

THE REST IS FOR SCRUBS

crimson vapor
#

I added comments

#

and spacing

#

and removed useless stinky code

opal plank
#

the moment i hit ctrl + s it'll all be gone, just letting you know

crimson vapor
#

wtf why

opal plank
#

cuz thats how my linter is setup

wheat sun
#

when a programmer that doesn't care about code appearance meets one that does

opal plank
#

it lints it on ctrl+s

crimson vapor
#

im using your linter

opal plank
#

unless i put the other config, it should remove unecessary lines

crimson vapor
#

one sec

wheat sun
#

"More lines = need to scroll more, and that's no good"

opal plank
#

look, im no fan of brainfuck code

#

nor mimified code

crimson vapor
#

nor am I

#

which is why I use newlines

opal plank
#

but adding lines evcerywhere is stupid imo

#

bulk parts that are related to eachother

crimson vapor
#

you heard it here first, readability is stupid

#

im installing eslint rn

#

pain

opal plank
#

yeah fuck readability, if u arent used to seeing bulky code, u aint a good dev

crimson vapor
#

no

opal plank
#

fuck adding newlines every line

crimson vapor
#

thats not how it works

#

not every line

#

smh

#

just for this im going to push a light theme in the .vscode/settings.json

opal plank
#

you can clearly see where each thing belongs

#

cuz i add spacing on fucking different sections

crimson vapor
#

I do spacing for every change in purpose

#

also your comments were wack

opal plank
#

make them better then

crimson vapor
#

add a spcae and start with a capatilized letter

opal plank
crimson vapor
#

smh

#

I did

opal plank
#

good

crimson vapor
opal plank
#

imagine

crimson vapor
#

fast™️

opal plank
#

big yikes

crimson vapor
#

yea

opal plank
#

oh btw i finished my slashcommands framework for buttons and dropdowns

crimson vapor
#

nice

#

my cpu is barely at 20%

#

why is this so slow

opal plank
#

i should be able to effortlessly port my normal commands to have their slash commands counterparts

crimson vapor
#

probably

opal plank
#

not probably

#

its a statement

#

i can

crimson vapor
#

I choose a different approach for mine

#

rewrote the entire thing

opal plank
#

eeew rewriting

crimson vapor
#

33%

opal plank
#

i should be able to legit just copy paste the code from the normal command onto the slashcommands and change 2 lines, boom, done

crimson vapor
#

thats nice

#

40%

#

you only use cc once

#

and thats when you check if it exists

opal plank
#

thats a "copy paste header" for all commands

#

also take a look at this

crimson vapor
#

I remove useless shit

opal plank
#

dont u dare

crimson vapor
opal plank
#

then they need commandClient, those fucks will legit try passing it on the function like client

#

its there to be as example

#

even if its unused

#

HENCE WHY ITS IN THE FUCKING EXAMPLE FOLDER

#

U DORK

crimson vapor
#

thats in the reload folder

#

dum dum

opal plank
#

same shit

crimson vapor
#

admin*

opal plank
#

the only 2 commands there are examples

crimson vapor
opal plank
#

imagine not waiting promises

#

nor catching them

#

pleb

crimson vapor
#

ok

#

I added await

#

smh

opal plank
#

bet u didnt add a catch block

crimson vapor
#

why would I

#

its one fucking line

opal plank
#

imagine not handling promises

#

noob

crimson vapor
opal plank
#

"noob friendly"

#

goes and destructures the fucking payload context

crimson vapor
#

you said detritus beginner not total beginner

opal plank
#

its an example million, people need to know the structure at which the payload comes

crimson vapor
#
  async run(payload: Context, __args: ParsedArgs): Promise<any> {
    await payload.message
      .reply('Repo: <https://github.com/erwin1234777/detritus-example>\nLibrary: <https://detritusjs.com/>')
      .catch(async err => {
        await payload.message.react('❎').catch(() => {
          /* Voided */
        });
        console.error(err);
      });
  }```
opal plank
#

that works, yes

crimson vapor
#

I hate your eslint rn

opal plank
#

you welcome

crimson vapor
#

im not linting

#

this shit is stupid

#

cant find plugin

#

installs plugin

#

cant find plugin

crimson vapor
#

@opal plank I give up

#

your lint shit is broken

opal plank
crimson vapor
#

¯_(ツ)_/¯

crimson vapor
#

what

opal plank
#

the person goes and thinks: "Oh, i should probably use the standardized method of chores/bugs and shit to make it all pretty"
meanwhile the commit names:

#

made some changes

#

no shit sherlock

#

i thought you could commit without changing anything

crimson vapor
#

bro

#

im so good

#

im the best

opal plank
#

bruh

#

what

#

the fuck is this

crimson vapor
#

fuck

#

why did I add an extra d

opal plank
#

forEach

#

and using this on the example

#

bruh

crimson vapor
#

wdym

#

oh

#

its a class

opal plank
#

noob friendly bruh

#

this

#

use the payload like a normal human being lol

crimson vapor
#

but the payload has it as optional

#

useless checks

opal plank
#

still easier to read, according to your own mindset

#

and easier for a new user to know what an object is, rather than this

#

specially cuz its a class extension

#

so theres no this.commandClient seen in there

crimson vapor
#

how is js const cc = payload.message.commandClient if (!cc) return better than js this.commandClient

opal plank
#

yeah

#

where is commandClient here

#

the only things the user sees is this

crimson vapor
opal plank
opal plank
#

i dont see it in the file

crimson vapor
#

I see

#

you never learned about extending classes then

#

bro thats like the first thing people learn

opal plank
#

the whole point of it is being user friendly, by using this. keyword, you force the user to first know what this does, where this.commandClient is, and have them figure out where the extended class is coming from

crimson vapor
#

if they know how to code

opal plank
pale vessel
#

erwin momento

weary crypt
#

@earnest phoenix finished reading the rust docs 😎

earnest phoenix
weary crypt
#

Boring, but I needed to do it to basically see the cool stuff it can do

earnest phoenix
#

Beauty of rust

#

boring as hell but useful as fuck

weary crypt
#

I plan on using rust down the line tho. But it is a lot like C#

#

I really like it.

earnest phoenix
#

Indeed

#

I like rust as well

#

Dont use it though personally

#

Mainly cause it is boring to code in

weary crypt
#

Yea it is, I have to agree with that. But it is still useful to learn

#

I plan on either learning Python next, or going in more depth with C++

earnest phoenix
#

why not learn kotlin

#

pretty sexy

#

and I feel if you know any type safe language kotlin would be easy to grasp

weary crypt
#

I have to look at that. But I believe I have heard of it before

#

I forget who mentioned it in a video

earnest phoenix
#

Its syntax is similar to that of typescript

#

but also a lot of other languages as well

#

It is pretty nice to code in I've been using it for the past two weeks

weary crypt
#

Yea prolly learn it down the line somewhere. Play around with rust a bit more.

earnest phoenix
#

Ye

#

I just don't have a need to do any low level shit so rust isn't for me :^)

weary crypt
#

I believe there is a repo for Rust, in web development that it out performing everything as of right now

earnest phoenix
#

Rust can be used for web dev with web assembly or smth iirc

hexed vortex
#

ok so hi, ive recently been working on a banking system and now i have a buy command, im working on a work command however when ever you check to see how many more minutes till u can work again, it is always on 5 and it doesnt send any messages besides the "we cant work right now wait 5 mins" and i use repl.it and code everything before in vsc. then copy everything to repl.it.

main.js: https://hastebin.com/ipatonobaf.js
bank.json(the db): https://hastebin.com/oxulubexog.json

earnest phoenix
#

Haven't you already been answered how to solve this?

#

or is it a different issue now

hexed vortex
#

this is a work command not buy

#

wrong main.js

weary crypt
#

Maybe you should try and figure it out yourself, nothing personal either. Just better for learning

hexed vortex
#

also that was the wrong code XD wrong one in hastebin

weary crypt
#

Damn, maybe you do need some help lol

hexed vortex
#

Yeah thats why i came here, this is my last resort, djs couldnt help :C

hexed vortex
weary crypt
#

I dont work in JS so not likely

quaint wasp
#

Wrong channel

#

😳

sudden geyser
weary crypt
#

maybe? It had a few controversies with the dev.

sudden geyser
#

Yeah because he was using a lot of unsafe {...}

weary crypt
#

yea lol

#

man got so angry

sudden geyser
#

I've only written the routing and structuring for a few endpoints but it's nice to use right now

#

I'm using SQLx as well but haven't gotten far

#

Postgres and immutable data doesn't play well

#

and I sadly can't find any popular database based around immutability

woeful pike
#

actix is so good

woeful pike
sudden geyser
#

I'm designing a wiki-based project and things shouldn't be disappearing/changing out of no where.

#

But I've also chosen it because it's nice to always have a record of what's happened throughout the history of some data

#

For example, when a user's account was published, modified (and what changed), deletions, etc.

woeful pike
#

I mean you can just set rbac rules on the db you're using and only login with a writeonly user

hexed vortex
woeful pike
#

a database choice also brings a lot of tooling and ecosystem with it. I don't see the point in giving up the maturity of something like postgres just to not have pages deleted

hexed vortex
#

nvm about that

woeful pike
#

you might want to read up on something called event sourcing for Wikipedia clones

sudden geyser
#

I like to experiment and seek out alternatives to see if something else is able to solve a problem I'm having and how it may benefit me to use it (e.g. TimescaleDB though I ended up scrapping it). At the same time, I'm very stubborn about solutions trying to get "in your way", growing attached.

I'm a bit confused on the definition of event sourcing (https://martinfowler.com/eaaDev/EventSourcing.html), but it's very similar to my current implementation. For example, say I have an articles table.

  • The articles table has an id field and that's it.
  • An articles_assets table stores the history of all articles. I'd like to improve the current implementation, but alternatives are a bit difficult since it may become too rigid.
  • The articles_publications table is for setting the public version of an article. An article can exist without a publication (in draft) and an article asset can appear multiple times in it (e.g. a rollback). It's just the asset ID, so it's cheap.
  • The articles_deletions table for if an article is deleted. An article can be republished via articles_publications.
slender wagon
#

how do i check if an object list includes a certain text

wheat sun
#

a list of objects?

   * check for text *```
?
slender wagon
#

oh okayy

#

so a foreach function should do it?

wheat sun
#

I would just iterate through all objects and check each one

slender wagon
#

so what i wanna do is basically

#

i'll check for the key

#

and if the key exists i'll get the value from it

wheat sun
#

If you have it all as a dictionary, there is Object.keys() that makes a list of the keys

#

Then can check if the key is in that list

sudden geyser
#

You could do ofobj.find((obj) => obj.key === "...")

#

You'll get the object if it's found.

#

So you can just pluck out the value from there.

slender wagon
#

oh oki

hardy loom
#

what does defo mean

sudden geyser
#

Give us context

wheat sun
hardy loom
wheat sun
#

Then "definitely"

#

"Do all the files definitely exist in commands?"

sudden geyser
#

It's a slang for definitely

hardy loom
#

ok

slender wagon
#

@sudden geyser sorry to bother ```js
if (ofobj.find((obj) => obj.key === window.location.hostname)){

}

how can i access the same obj inside the function 
cuz i want to get its value
sudden geyser
#

Save it to a variable beforehand

#

Then check if it's undefined (not found)

#

If it is do magic

#

else don't

slender wagon
#

so basically all i want to get is the obj ```js
ofobj.find((obj) => obj.key === window.location.hostname

i want to get this obj and the proceed to get its value
#

inside the function

#

nvmmm

#

i did it

#

E

hot sage
#

i am getting the error of "embed is not named" which, im assuming means that it isnt identified, but i did.

timber fractal
#

Is there someone that can help me to count all messages from 10 seconds and dont ask me why

hot sage
#

here is the code its connected to

timber fractal
pale vessel
#

Look at the lines

hot sage
#

o

#

heck

pale vessel
#

embed is not defined at that scope yeah

hot sage
#

ty that fixed it

pale vessel
#

Dunno if this is valid though

hot sage
#

yeah imma change it

pale vessel
#

Why did you str() the method

hot sage
#

idk

#

im glad im here when i need help

#

cus i am an idiot

woeful pike
#

nah you're just refusing to put in the effort to learn the basics

wide wharf
#

How do I let a bot join a channel and stay in it? (asking because all the bots I know just leave the channel if there aren't any ppl in the vc)

#
client.on('message', async message => {
    if (message.member.voice.channel) {
        const connection = await message.member.voice.channel.join();
    }
});
hot sage
#

i just don't realize obvious things

#

like when i forget to add the bot token DumbPingu

woeful pike
#

it sounds like you jumped into making bots without really understanding how to use python. If you've spent time looking over classes and functions you'd at least have a vague idea that

variable = str(...)(...)

makes no sense

#

so you're just trying random shit hoping it works like I said

#

which isn't necessarily a bad way to go about things but if other people have to do the learning for you it's not cool

#

I think a more respectful way to go about this would be to ask for what concepts you might be lacking with the code you've tried and try to go back and learn those before moving forward

hot sage
#

ok

woeful pike
#

so if you ask me you probably need a refresher on classes and functions. Also look up keyword arguments (kwargs) if you don't know what they are because you're using it a lot here

slender thistle
#

What am I reading

#

Ok I see what I'm reading

#

I'm not liking what I'm reading

pale vessel
#

Uh, okay, I guess.

drifting wedge
#

from ..userprofile import createUser how can i import a function from a file?

#

in py

humble rock
#

Excuse me a question, I entered an array in the config index server database, which immediately has an object called "No Changes Recorded.", but which when it receives a new timestamp, that "No Changes Recorded." the timestamp is deleted and inserted so that only 1 object remains in the Array. I wanted to ask you if I had done well

boreal iron
#

@drifting wedge Could you fix your CSS issue?

slender wagon
#

css sucks

humble rock
#

Could anyone give me an answer pls

sudden geyser
boreal iron
#

🤦‍♂️

quartz kindle
#

u suck

#

:^)

sudden geyser
#

the web sucks

boreal iron
humble rock
drifting wedge
#

I got really mad

#

So took a break

#

Uhh I'm without my pc rn

#

But like this entire issue doesn't even make sense

#

Cuz like why is it going down?

#

I think it might be the height

#

Lemme try that...

boreal iron
#

I'm at my PC for the next few minutes... lemme know if you can't get it running

drifting wedge
#

alr ty

#

omfg i hate life

#

@boreal iron its working

#

AHHH

#

fml

#

totally didnt waste all day yesterday

boreal iron
#

poor dude

#

taking a break often helps

drifting wedge
#

it looks smexy now doe

pale vessel
#

Okay, but does it function

sudden geyser
#

Small suggestion: indent the inner list in server management

drifting wedge
#

it does

drifting wedge
#

thanks

#

5px

#

may be too small tho

#

8px now

#

its ok ig

#

but i dont think it even matters all that much

#

doesnt look all that great

slender thistle
#

Maybe try 10

#

Or 15-20

drifting wedge
#

i did

#

looks bad

#

ok gtg thanks all

#

ill try it later ig

slender thistle
#

You look bad

stiff lynx
#

Its possible to have a different bot logo for every server?

wheat sun
#

With webhooks?

#

Same way Tupper (or something I forgot name rn) can act as characters

stiff lynx
wheat sun
fading pond
#

can you trade multiple characters at once in mudae

slender thistle
#

No

wheat sun
rocky hearth
#

how can I ignore this error in ts Could not find a declaration file for module "blah blah"

earnest phoenix
#
4|vib      |     at Vibely.<anonymous> (/root/vibely-2/src/base/Util.js:57:68)
4|vib      |     at Vibely.emit (node:events:365:28)
4|vib      |     at GuildDeleteAction.handle (/root/vibely-2/node_modules/discord.js/src/client/actions/GuildDelete.js:51:14)
4|vib      |     at Object.module.exports [as GUILD_DELETE] (/root/vibely-2/node_modules/discord.js/src/client/websocket/handlers/GUILD_DELETE.js:4:30)
4|vib      |     at WebSocketManager.handlePacket (/root/vibely-2/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
4|vib      |     at WebSocketShard.onPacket (/root/vibely-2/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
4|vib      |     at WebSocketShard.onMessage (/root/vibely-2/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
4|vib      |     at WebSocket.onMessage (/root/vibely-2/node_modules/ws/lib/event-target.js:132:16)
4|vib      |     at WebSocket.emit (node:events:365:28)
4|vib      |     at Receiver.receiverOnMessage (/root/vibely-2/node_modules/ws/lib/websocket.js:835:20)
4|vib      |     at Receiver.emit (node:events:365:28)
4|vib      |     at Receiver.dataMessage (/root/vibely-2/node_modules/ws/lib/receiver.js:437:14)
4|vib      |     at Receiver.getData (/root/vibely-2/node_modules/ws/lib/receiver.js:367:17)
4|vib      |     at Receiver.startLoop (/root/vibely-2/node_modules/ws/lib/receiver.js:143:22)
4|vib      |     at Receiver._write (/root/vibely-2/node_modules/ws/lib/receiver.js:78:10)
#

Could anyone guide me

crimson vapor
#

just so you know, you cut off the top part of the error

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

crimson vapor
#

true

trail finch
#

um I mean permission-

long crow
# crimson vapor true

It is related to GUILD_DELETE which mean, related to guildDelete event, and I'm a god now?

tulip cradle
#

Anyone know how to send embed with normal msg attached

#

Like

#

Here msg

here embed

#

message.send(embed, msg);

#

I am right?

tired adder
rocky hearth
#

y Im getting this error?

marble juniper
#

read the error

rocky hearth
#

but Im checking, if its undefined

#

let pos?: Position is invalid too

crimson vapor
#

what would that do?

prime mist
crimson vapor
#

its literally saying its undefined

prime mist
crimson vapor
#

you can do let pos!: Positon but thats stupid

prime mist
#

Just do let pos: Position | undefined = undefined

rocky hearth
#

Ooh, I thought unintialised variables are already undefined. So ts should pick that too

prime mist
#

Well, TS is just trying to prevent you from doing something stupid :)

lusty quest
#

ts is a nightmare. i use it now for about 2 weeks and had so many stupid errors

#

even some stuff that makes 0 sense

crimson vapor
#

ive not had any issues with ts tbh

#

any issues were just fucked up settings or something
at least for me

silent forge
#

Where to play Rpg???

wheat sun
silent forge
lusty quest
crimson vapor
#

could you link me to the message?

crimson vapor
#

was it giving you an error?

lusty quest
#

there is no error, it just wont load the events

crimson vapor
#

could be because of how his code was actually

#

try pulling

#

I changed something

lusty quest
#

all i know is that the websocket connection state is non existant

crimson vapor
#

oh?

lusty quest
#

yea, digged quite deep into what happens, and at the last time the websocket state where just ''

crimson vapor
#

hmm

#

strange

lusty quest
#

yea

crimson vapor
#

idk why typescript would have that issue, were you using ts-node?

lusty quest
#

tried ts-node but mostly i run it with the debugger

#

so i can easy attach breakpoints

#

and dig deeper in wtf just happened

crimson vapor
#

using his things?

lusty quest
#

ye

#

the debugger scripts

crimson vapor
#

could be issues with that

lusty quest
#

not really, i run the same scripts on a different bot written in TS with detritus and it just works

crimson vapor
#

hmm

#

that sucks then

lusty quest
#

also running with ts-node gives me the same issue

crimson vapor
#

what about tsc and node .?

lusty quest
#

node wont work bcs in how its coded

crimson vapor
#

I changed that

#

because Erwin being mean to node . users

lusty quest
#

i dont care about it anymore tbh, i just build off the Frankenstein ive made out of the notsobot repo

crimson vapor
#

so its only that repo being stupid?

lusty quest
#

it looks like it, like ive tried to run it inside a new VM with the same result

crimson vapor
#

alright well I blame erwin's code

lusty quest
#

it worked for you, Erwin and Evie

crimson vapor
#

no

#

not eactly

#

I changed a few things to make it work how I wanted it to

lusty quest
#

but it worked with the debugger right?

crimson vapor
#

yes

lusty quest
#

so it worked

crimson vapor
#

well I can't say yes

#

because I didn't test the commands

#

but I think so

lusty quest
#

well its already further than i went

crimson vapor
#

ah

lusty quest
#

like for me it just gets stuck at loading the events

#

and never goes online

crimson vapor
#

super strange

#

hmm

willow mirage
#
<Box backgroundColor="#fff5fd" h="100%" mt={-2}>
    <Navbar props={data.getUser}/>
    <Header/>
    <Session/>
</Box>

How I can fix this shit?

stiff lynx
#

docs about customized status with the discord bot and in how much servers is it and how much users?

wheat sun
crimson vapor
#

@opal plank bonk how do I use detritus for slash commands?

summer torrent
crimson vapor
summer torrent
crimson vapor
#

o

#

ty for link

stiff lynx
#

the Number of members matters for verification?

wide crow
wide wharf
#
container@DBH~ Server marked as starting...
[Pterodactyl Daemon]: Pulling Docker container image, this could take a few minutes to complete...
[Pterodactyl Daemon]: Finished pulling Docker container image
:/home/container$ /usr/local/bin/npm i && /usr/local/bin/node /home/container/${BOT_JS_FILE}
container@DBH~ Server marked as running...
npm WARN Invalid name: "IsmailZ 2.0"
npm WARN container No description
npm WARN container No repository field.
npm WARN container No README data
npm WARN container No license field.

up to date in 5.215s
found 0 vulnerabilities

internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module 'discord.js'
Require stack:
- /home/container/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/container/index.js:1:17)
    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) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/container/index.js' ]
}
container@DBH~ Server marked as offline...

[Pterodactyl Daemon]: ---------- Detected server process in a crashed state! ----------
[Pterodactyl Daemon]: Exit code: 1
[Pterodactyl Daemon]: Out of memory: false
[Pterodactyl Daemon]: Aborting automatic restart, last crash occurred less than 60 seconds ago.
#

I can't use npm install discord.js in my panel...

earnest phoenix
#

why?

willow mirage
#
<Box backgroundColor="#fdfdfd" p={6}>
    <Flex 
        justifyContent="center" 
        alignItems="center" 
        w="100%"
        mt={5}
    >
        <Heading textAlign="center" fontSize="1.5rem" mb={5} display="block">
            Những cán bộ của chúng tôi
        </Heading>
        {Data.map(userData => <UserInfo key={userData.id} data={userData} />)}
    </Flex>
</Box>

How I can make the Heading to not be in-line ?

#

anyone any idea :<?

stiff lynx
wide wharf
#

I have to put modules in my package.json they say

#
{
    "name": "IsmailZ",
    "version": "1.0.0",
    "description": "A Discord bot!",
    "main": "index.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
    },
    "keywords": [],
    "author": "IsmailZ",
    "license": "ISC"
}
#

How to put modules in this^^

paper wren
#

This is on sale

crimson vapor
#

@ripe prairie

wide wharf
#

@rustic nova

sick agate
wide crow
rustic nova
#

@paper wren dont advertise referral links, thanks

#

also unrelated to this channel aswell

cobalt spruce
#

#WHAT THE HELL

sick agate
#

forcefully stop it

#

run then reload and run it and stop it

wide wharf
earnest phoenix
wide wharf
#

Can't

#

type anything in the console

sick agate
#

uh

wide wharf
#

So I have to do it with the package.json file

#

but idk how

#

lmao

scarlet stratus
wide wharf
earnest phoenix
wide wharf
#

I can't type any command

#

It just dissapears when I click enter

scarlet stratus
#

Use requirements.txt if it's online oof

wide wharf
#

And how?? I'm new to this lol

wide wharf
scarlet stratus
#

But i guess you gotta find out how it works on js

wide wharf
#

Uh

#

:/

quartz kindle
wide wharf
cobalt spruce
sick agate
#

read my other message under that

earnest phoenix
#

I have a JSON string and I want the browser to save it as a file. How do I do that?

#

I can use an anchor with the download attribute but what will i put in the href?

earnest phoenix
earnest phoenix
#

replit is just high

formal pulsar
#

Today I try to make a more decent command handler

boreal iron
earnest phoenix
#

Save the JSON string locally as file
download the file so i can download the file???????

boreal iron
#

🤦‍♂️put the string into a file on your webserver temporarily

earnest phoenix
#

or

#

object urls

#

which works

boreal iron
#

Many roads lead to Rome

earnest phoenix
#

...

#

Why did it delete my message

lusty quest
#

you cant dotpost

earnest phoenix
#

That is the debug logs

#

Looks normal to me i think

lusty quest
#

looks fine

zenith terrace
#

Setting a heartbeat interval for 41250ms.

#

moment

earnest phoenix
#

kekw

#

@lusty quest Hate myself

#

Forgot to supply the GUILD_MESSAGES intent

#

me big brian

lavish bramble
#

If I try to list all roles of server
It gives me error description is too long

#

In embed

#

Can I do if embed is too long then it sends that in second embed automatically

#

Like dyno!

#

Ping me if you got it

earnest phoenix
#

You can paginate it

#

or only show a few

lavish bramble
#

But in dyno its not paginated

earnest phoenix
#

Idk how dyno does it

#

But if your roles exceed the character limit discord has for embeds then nothing you can do but paginate it or show a few

#

or split the embeds

wide wharf
#

There's something wrong with my bot's status... "streaming in undefined servers"

#
client.user.setActivity(`in ${client.guilds.size} servers! :tada:`, { url: 'https://www.twitch.tv/ItsIsmailZ', type: 'STREAMING' });
earnest phoenix
#

don't you have to access the cache now for the size or nah

#

@wide wharf You're using v12 of discord.js right?

lavish bramble
earnest phoenix
#

then you have to access the cache first

wide wharf
earnest phoenix
#

client.guilds.cache.size ...

pale vessel
#

var guildsButArray = [];

for (var guild of client.guilds.cache) {
    if (guild[1]) {
        if (guild[1].id) {
            guildsButArray.push(guild[1].id);
        }
    } else {}; // void
}

client.user.setActivity(`in ${guildsButArray.length - 1 + 1} servers! :tada:`, { url: 'https://www.twitch.tv/ItsIsmailZ', type: 'STREAMING' });```
earnest phoenix
#

Why

pale vessel
#

my code

earnest phoenix
#

Why do that

#

Just access the cache to get the size

#

lmfao

#
  • 1 + 1
#

lmfao

pale vessel
#

huh

earnest phoenix
#

I don't understand you flazepe

pale vessel
#

:o

earnest phoenix
#

Now then

#

time to see how mikro orm works

zenith terrace
pale vessel
#

yeah

zenith terrace
#

10/10 answer

pale vessel
#

they say for loops are fast

hexed vortex
vivid fulcrum
#

debug your code

#

your args are probably undefined

#

but debug it

near stratus
zenith terrace
#

ye ^

#

theres a whole bunch you left out without () @hexed vortex

humble rock
#

does item have .join()

#

someone can answer me?

torn nebula
#

yes if item is an array

humble rock
near stratus
humble rock
#

item is the content of the array

torn nebula
#

[] this is array \🙄

near stratus
humble rock
#

(Example1, Example2)

near stratus
#

in arrays we don't use () we use []

#

so it shouldn't be (ex1, ex2) rather [ex1, ex2]

humble rock
#

yeah, so [] has function .join()

near stratus
#

yes

#

[].join() would return ""

humble rock
#

oooh, the content (https, ://, top) is a String so i've to check String functions

near stratus
#

just weirdly

humble rock
#

I would like to list (\ n) all items by removing [] how do I do?

#

ex:
Item1
Item2
Item3

torn nebula
#

.join("\n")

earnest phoenix
#

@near stratus wow your pfp utandm

opal plank
#

.join(`\n`)

willow mirage
earnest phoenix
#

Samsung sam has been discontinued

#

due to the horny

willow mirage
#

fuck

earnest phoenix
#

Samsung also came out and said she's 17

#

:^)

willow mirage
#

bruh

#

sad

earnest phoenix
torn nebula
willow mirage
earnest phoenix
#

?

willow mirage
sudden geyser
#

🚪 🚶‍♂️ samsung girl

earnest phoenix
#

@sudden geyser Wow your badge is cool kaybet

sudden geyser
#

early supporter bad

earnest phoenix
#

Why

sudden geyser
#

because people ask to buy your account for $800

earnest phoenix
#

Hahaha

#

Lol

lost heath
#

lmao

sudden geyser
#

that was my highest offer

#

second highest was $700

earnest phoenix
#

I wish I had my account with that badge

#

$700 = 5600 ₺

#

got locked out of it

#

Why im turk

compact echo
sudden geyser
#

mmlol

#

the offerers are probably scammers or flippers

#

buy for 3.6k then sell for 4k

earnest phoenix
#

Who would buy an account just for a badge

#

makes no sense

#

Scammers = gays

sudden geyser
compact echo
#

watch a 2 year old on discord be like that

sudden geyser
#

I knew some guy who bought some account for maybe 1k because it had that golden badge thing

hexed vortex
zenith terrace
#

yes

compact echo
#

what golden badge thingy

#

is it uh

#

bug hunter?

zenith terrace
#

bug hunter

compact echo
#

ah.

sudden geyser
#

no

compact echo
#

what

zenith terrace
sudden geyser
zenith terrace
compact echo
#

ohhhhh the gold hypesquad

sudden geyser
#

Just wondering, but has anyone tried using graph databases

hexed vortex
hexed vortex
tribal siren
#

smh

hexed vortex
tribal siren
#

ok

zenith terrace
hexed vortex
sudden geyser
#

do you know what line the error is coming from

#

because it means you're trying to access 0 on an undefined property

#

e.g. const array = undefined; array[0]

hexed vortex
#

this is the code its happeing in:

if(args[0] == 'work'){ let MoneyJSON = JSON.parse(fs.readFileSync("./DB/bank.json")) if(!MoneyJSON[message.author.id]){ let ErrorEmbed = new Discord.MessageEmbed() ErrorEmbed.setTitle("Nope!") ErrorEmbed.setDescription("You do not have a bank account created!") message.channel.send(ErrorEmbed) return } let deltatime = Math.floor((new Date(). getTime() - MoneyJSON[message.author.id].lastwork) / (300000)) if(deltatime < 5){ let Erorr = new Discord.MessageEmbed() Erorr.setTitle("Nope!") Erorr.setDescription(We are on break! You can have us work again in ${5 - deltatime} minutes!`)
message.channel.send(Erorr)
return
}
MoneyJSON[message.author.id].bal += (MoneyJSON[message.author.id].worker) * 3
MoneyJSON[message.author.id].lastwork = new Date().getTime()
fs.writeFileSync("./DB/bank.json", JSON.stringify(MoneyJSON))

  let WorkerEmbed = new Discord.MessageEmbed()
  WorkerEmbed.setTitle("Off to work we go!")
  WorkerEmbed.addFields('Coins Earned:', $(MoneyJSON[message.author.id].worker) * 3)
  WorkerEmbed.addFields('You Now Have:', $(MoneyJSON[message.author.id].bal) * 3)
  message.channel.send(WorkerEmbed)
}

})

`

sudden geyser
#

what would make your life 100x easier is if you had a stacktrace

hexed vortex
#

what is stacktrace

#

oh

quartz kindle
#

it would be easier to see the problem if your code was properly indented/formatted

#

you have an extra closing bracket

hexed vortex
#

welp i just um

sudden geyser
#

9 of what

#

bananas?

hexed vortex
#

errors

quartz kindle
#

your code is doing this essentially:

    if (message.content.startsWith(activator)) {
       var args = message.content.substring(activator.length).toLocaleLowerCase().split(" ")
        // lots of commands here
        // broken command that accidentally closes the top "if"
    } // if accidentally closed
    // args doesnt exist here
    if (args[0] == 'buy') {
      // more commands
    }
sudden geyser
#

it should still exist

#

since var is bound to the function scope

quartz kindle
#

still its only created if the if passes

#

if the message does not start with activator, then there is no args

sudden geyser
#

ah fair

hexed vortex
quartz kindle
#

did you understand what i said?

#

from the code i showed

hexed vortex
#

yes

#

var is fine

#

well this works

#

ONE sec

quartz kindle
#

sounds like you didnt lol

hexed vortex
#

this is all fine its a case then break

#

thats the end of my buy command

quartz kindle
#

thats not the problem

#

your code will error anytime someone sends a message that does not start with your prefix

hexed vortex
#

oh it does

cobalt spruce
worn sonnet
#

Yay! My bot is approved#

quartz kindle
#

congrats

earnest phoenix
#

Congrats mate

errant perch
#

Congratulations

clear marlin
#

congobongo

compact echo
#

🎉 congrats

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

solemn latch
#

seems one of your commands closes the top if

near stratus
pale vessel
#

Why

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

So im now using prisma for my open source bot

#

:^)

sudden geyser
#

I just stick with SQL toolkits

#

Like Rust's SQLx toolkit

earnest phoenix
#

Is it possible to get the form data from the SubmitEvent directly in the onSubmit prop of a react form element?

silk wadi
#

👋

#

Is there HTML? 🤔

earnest phoenix
#

I assume anyway

plain brook
earnest phoenix
#

Figures

plain brook
silk wadi
#

im not much of a CSS dev so im not sure how much I could help you

plain brook
#

Ooh ok

#

Thanks for help

earnest phoenix
#

Well what issues are you having

silk wadi
#

but have you included some HTML as well?

earnest phoenix
#

Why would they need to include html

silk wadi
#

for some of the css

earnest phoenix
#

doesn't top.gg just look at the classes and use the values from it

silk wadi
#

like there was

#

.bot-container or something

earnest phoenix
#

top.gg already has all the html

#

they are just overriding the classes with new values

silk wadi
#

oh ok

quartz kindle
sage bobcat
quartz kindle
#

all i have is a giant backlog of unfinished stuff

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

sa

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

how about finishing my hash benchmarks

#

lmao

#

i need to work on my api, and have 3 websites to work on as well >.>

#

plus a couple pieces of software i didnt even start yet

hot sage
#

Why am I getting a syntax error at the end? I don't see why I am getting an error.

pale vessel
#

What's the error

sudden geyser
crimson vapor
#

fast

sudden geyser
#

that ain't right

pale vessel
#

hmm

earnest phoenix
#

hello

pale vessel
#

What's not right

hot sage
sudden geyser
#

why hello there

earnest phoenix
#

wht / this prefix command name

sudden geyser
#

The ]) at the end does not make sense

earnest phoenix
#

i see it in groovy

sudden geyser
#

A slash

earnest phoenix
#

oh

sudden geyser
#

Are you looking for slash commands?

pale vessel
#

oh I see

sudden geyser
#

Oh wait I see now

pale vessel
#

look closely

sudden geyser
#

It was just wrapped

pale vessel
#

It's not wrapped

sudden geyser
#

It seems like it is

hot sage
#

i still dont see it

pale vessel
#

@hot sage Close that embed.add_field()

hot sage
#

ok

sudden geyser
#

The line is wrapped by their editor so it appears on the next line, but the real issue was the add_field bit like you said

hot sage
#

i am blind

cobalt spruce
prisma sedge
#

helo someone code me a botum

woeful pike
#

fyi you can drop the [] in

''.join([a.b for a in c]]
#
''.join(a.b for a in c)
earnest phoenix
#

can someone help

solemn latch
#

Seems like Data is undefined.

earnest phoenix
#

ik but the guy never showed me how to define it but his works

digital ibex
#

@earnest phoenix

earnest phoenix
#

i18n is so confusing

sudden geyser
#

localization is confusing in general

elfin vale
#

does anyone know, are buttons supported in the newest discord.js?

earnest phoenix
#

in v13 yea

#

v13 which is master right now

elfin vale
#

so if i clone from github I should have it?

earnest phoenix
#

No

#

just use discord.js master

sudden geyser
#

that would be cloning

earnest phoenix
#

How is that cloning

#

master is available on github

sudden geyser
#

which you clone

elfin vale
#

i meant using git clone or npm install... :v

earnest phoenix
#

yarn add discordjs/discord.js or npm i discordjs/discord.js

#

will install the master branch from github

hot sage
#

So, I am trying to do error handlers, and I am trying to have it so there can be a missing argument error handler, and a missing permissions handler for one command, but only the missing permissions handler is working

#

python ^

slender thistle
#

Show code

hot sage
#

idk why but i did each one away from each other

#

top image's code is above bottom image's

slender thistle
#

Yeah well sherlock

#

You see

#

When you do @x.error, it overwrites whatever was put before

#

You use ONE error handler for ALL exceptions

#

Not TWO SEPARATE events for different exceptions

hot sage
#

oh ok

#

I was thinking that i should do that, but for some reason thought against it

rocky hearth
#

is editing a message is slower than editing a interaction?

vivid fulcrum
#

huh?

rocky hearth
#

sory I meant interaction

vivid fulcrum
#

they're probably about the same

#

the difference isn't something to care about though

#

internet speed, cpu speed, whether the api is crowded etc.

#

are many of the factors when doing REST requests

#

so it genuinely does not matter

#

do whatever looks the best in your eyes

#

to me responding to an interaction with type 7 instead of directly editing the message looks cleaner

#

because it's the "proper" way to do it

#

and it just looks consistent

earnest phoenix
#

what's type 7

cinder patio
#

I'm not sure

#

It's worded a little weird in the docs but I guess it edits the interaction response

opal plank
#

or CHANNEL

#

depending if u looking at callback response types or application types

earnest phoenix
#

are the /commands out officially?

#

with the docs and stuff

#

cool

#

In some languages yea

#

discord.js doesn't "officially" support it.

#

Its in the master branch

#

still being developed

#

ah i see cheers

humble rock
#

why my embed doesn't have a thumbnail?

zenith terrace
#

are you doing the .send({embed}) thing

humble rock
zenith terrace
#

yes

humble rock
#

i did

zenith terrace
#
thumbnail: {
  url: ...
}```
humble rock
#

oh

humble rock
zenith terrace
#

whats your code

humble rock
#
            const embed = new MessageEmbed({
                author: {
                    name: 'Partnership Stats for - ' + guild.name,
                    icon_url: guild.iconURL({ dynamic: true })
                },
                thumbnail: {
                    url: guild.iconURL({ dynamic: true })
                },
                color: '#9D37C6',
                fields: [
                    {
                        name: `${client.emojis.cache.get('850732067876241418').toString()} Total Partner Managers`,
                        value: `**${Guild.totalPartnerManagers} ${client.emojis.cache.get('851006300883779594').toString()}**`
                    }, 
                    {
                        name: `${client.emojis.cache.get('851076208904634378').toString()} Last Five Timestamps`,
                        value: Guild.PartnerManagerTimestamp.join('\n')
                    }
                ] 
            });
#

no thumbnail and author icon too

hot sage
#

This is a error handler for a user info command, i have an alias for it as user-info, and thats what i want people to use instead of user, but it isn't showing the error message that it is supposed to

#

it also isn't showing when using the user command

#

and i copied it from another error handler that worked

humble rock
zenith terrace
distant cobalt
#
client.on('message', message => {
    console.log('hi1')
    if(!message.content.startsWith(prefix) || message.author.bot) return;
    console.log('hi2')
    const args = message.content.slice(prefix.length).split(/ +/);
    console.log('hi3')
    const command = args.shift().toLowerCase();
    console.log('hi4')

    if(command === 'staffMsg'){
        client.commands.get('staffMsg').execute(message, args);
        console.log('hi5')
    } 

    if(command === 'openTicketMsg'){
        client.commands.get('openTicketMsg').execute(message, args);
    } 
})```

hi1
hi2
hi3
hi4``` For some reason, this would usually work. But it seems like the if statements aren't working.

zenith terrace
#

ok it dont make a different the dynamic

zenith terrace
rocky hearth
#

can two buttons have same custom_id?

zenith terrace
#

probs not

humble rock
distant cobalt
#
client.on('message', message => {
    console.log('hi1')
    if(!message.content.startsWith(prefix) || message.author.bot) return;
    console.log('hi2')
    const args = message.content.slice(prefix.length).split(/ +/);
    console.log('hi3')
    const command = args.shift().toLowerCase();
    console.log('hi4')

    if(command === 'staffMsg'){
        client.commands.get('staffMsg').execute(message, args);
        console.log('hi5')
    } 

    if(command === 'openTicketMsg'){
        client.commands.get('openTicketMsg').execute(message, args);
    } 
})```

hi1
hi2
hi3
hi4``` For some reason, this would usually work. But it seems like the if statements aren't working.

cinder patio
#

Instead of console logging random strings, log command

#

see what it really is

zenith terrace
cinder patio
#

Also those if statements completely defeat the point of storing your commands in a map

rocky hearth
#

so can I hv a button with no label or emoji?

#

just empty disabled button

zenith terrace
#

you dont need an emoji, pretty sure you need a label

rocky hearth
#

button, with emoji and no label works fine

#

I want to align 4 buttons in a plus shape

humble rock
#

sorry for my english

cinder patio
#

You can have 3 rows with 3 buttons on each row, and disable the ones that won't be needed

#

otherwise it's not possible

zenith terrace
rocky hearth
zenith terrace
#

because you need either one

cinder patio
#

ah

zenith terrace
#

thats like saying you are adding a title to an embed with nothing in it

cinder patio
#

you can just put an empty space, no?

#

" "

rocky hearth
#

any empty chars?

#

oh lemme try

humble rock
cinder patio
#

maybe a zero-width space if discord trims the input

rocky hearth
#

fk, it worked with a space

humble rock
#

why

zenith terrace
#

whats the full code

daring jay
humble rock
# zenith terrace whats the full code

here the full command code

const Partnerchannel = require('../../database/schemas/PartnershipChannel');
const GuildConfig = require('../../database/schemas/GuildConfig');
const error = require('../../utils/embeds/ErrorEmbed');
const { MessageEmbed } = require('discord.js');

module.exports = {
    name: 'partner-stats',
    desc: 'Check all stats and details about Partnership module.',
    run: async (client, message, args) => {

        const guild = message.guild

        const channel = await Partnerchannel.findOne({
            serverID: guild.id,
            serverName: guild.name
        }).channelID;

        const Guild = await GuildConfig.findOne({
            serverID: guild.id,
            serverName: guild.name
        });

        if(!Guild) {
            return error(`Something went wrong while executing the command.`, message, message.channel, client);
        } else {

            console.log(guild.iconURL({ dynamic: true }));
            const embed = new MessageEmbed({
                author: {
                    name: 'Partnership Stats for - ' + guild.name,
                    icon_url: guild.iconURL({ dynamic: true })
                },
                thumbnail: {
                    url: guild.iconURL({ dynamic: true })
                },
                color: '#9D37C6',
                fields: [
                    {
                        name: `${client.emojis.cache.get('850732067876241418').toString()} Total Partner Managers`,
                        value: `**${Guild.totalPartnerManagers} ${client.emojis.cache.get('851006300883779594').toString()}**`
                    }, 
                    {
                        name: `${client.emojis.cache.get('851076208904634378').toString()} Last Five Timestamps`,
                        value: Guild.PartnerManagerTimestamp.join('\n')
                    }
                ] 
            });

            message.channel.send(embed);
        }
    }
}
zenith terrace
#

try message.guild.iconURL(), probably wont make a different but worth a shot

opal plank
rocky hearth
#

YUP 😆

opal plank
zenith terrace
humble rock
#

i give up to add a thumbnail, nothing works /:

#

i tried all possible things

opal plank
#

curious, brain, feud, evie, everyone starting to use detritus

zenith terrace
#

oof

#

advertiser

opal plank
#

next target will be tim

zenith terrace
#

lol

rocky hearth
#

detritus is blessing for ts haters

lost heath
#

has buttons been added to d.js yet?

rocky hearth
#

its on master branch, not yet stable