#development

1 messages ¡ Page 1772 of 1

earnest phoenix
#

You are missing a (

hot sage
#

One of the parentheses?

earnest phoenix
#

Mhm

hot sage
#

Is it at the end of the embed part?

latent heron
#

sendembed isn't even a useable method in the discord.ext.commands.Context object

#

and even if you're declaring it as a variable, you formatted the discord.Embed and are missing a ,

#

you have an indent error where member.ban(...) is and it will break the script

earnest phoenix
#

This is why fl0w is here to be smurt

latent heron
#

you're declaring an embed description incorrectly, you would just do a kwarg description="..."

#

you aren't actually sending anything with the embed, you're only declaring a coroutine method to create a discord.Embed object

#

you're missing a ) for the end of it all

hot sage
#

Ok

latent heron
#

there are plenty of other issues, but those should be the first set of them to fix

hot sage
#

Alr

snow urchin
opal plank
#

@lusty quest it might be worth for now using ur old repo instead of mine

#

and slowly building up to what i wrote instead

crimson vapor
#

@opal plank are you still working on the example bot?

crimson vapor
#

sure

#

what u doin rn

#

ok ill wait for a pong

weary crypt
#

lol

opal plank
#

@crimson vapor just overall improving it with comments n shit

crimson vapor
#

o

opal plank
#

its suppose to be a noob-friendly example

#

easily deployable

#

im playing with the slashClient

#

this is pog im not gonna lie

weary crypt
#

slash commands are epic

crimson vapor
#

pog

opal plank
weary crypt
#

o?

opal plank
#

yeah

#

this is pog

weary crypt
#

I wanna create one that can parse through Enums and such

#

The one I use as of right now cannot do that

sudden geyser
#

everything in this world is an enum

crimson vapor
#

@opal plank you wrote this code for the reload command?

crimson vapor
#

its super hard to read at first glance

opal plank
#

its pretty simple

#

its like this

crimson vapor
#

not confusing or anything

opal plank
#

clear() to remove all commands
and addMultipleIn() to scan the folder

crimson vapor
#

just like

#

wtf you doing with prettier

opal plank
#

the rest is extra

#

its my prettier config

crimson vapor
#

yea, isnt prettier supposed to make code readable?

opal plank
#

correct

#

and it is readable

weary crypt
#

ooo sooo pretty :)

crimson vapor
#

uhh

weary crypt
#

:(

crimson vapor
#

where is the spacing

opal plank
#

its ur shitty colors that make it non redable

crimson vapor
#

bro

#

what shitty colors should I use then

weary crypt
#

erwin is using good colors

opal plank
#

^^

weary crypt
#

That is basically what I use honestly

opal plank
crimson vapor
#

"beginner friendly"

opal plank
#

thats what the comments are for

crimson vapor
#

you gotta also add spacing smh

weary crypt
#

agreed

opal plank
#

i only add spacing with stuff thats not related

#

so i bulk the by relativity

#

theres no need to turn a single function into 500 lines when its only 100

crimson vapor
#

beginner dev or beginner to detritus? or both?

opal plank
#

detritus

crimson vapor
#

ok

#

so basic knowledge

opal plank
#

evie is the one writing an idiot's guide for detritus

#

im just doing a very basic, well commented example that can be used

crimson vapor
#

thank you for adding unreachable code

#

makes me happy

weary crypt
#

I never comment my code lol

opal plank
#

cake's is the only one with a decent repo, but his syntax will absolutely destroy your brain

#

advanced wise

opal plank
crimson vapor
#

ill remove it for you dw

weary crypt
#

I only give summaries when my IDE tells me about it lol

vivid fulcrum
#

this color scheme is hotter

crimson vapor
#

ehh

opal plank
crimson vapor
#

colors are fine

#

spacing is not so good imo

opal plank
#

i personally dislike backgrounds like that

weary crypt
crimson vapor
#

makes it hard to find what you want

#

I actually like those backgrounds

vivid fulcrum
#

pussy grabber's token got yeeted when my old account got deleted

#

😔

weary crypt
#

I dont like those backgrounds either

vivid fulcrum
#

it looks better when there's totally not a selfbot running

forest herald
#

Any javascript developers here that could tell me why the code that I commented out makes the function return undefined? Also yes I know this code is horrid but dont make fun of me.

crimson vapor
#

erwin

opal plank
crimson vapor
#

hmmm

opal plank
#

the parsedArgs are different than d.js

#

i added the message and args there so people have a reference

crimson vapor
#

thats probably going to enforce bad habits

#

ngl

opal plank
#

i even did a solid and did Promise<any> on the returns so they dont have to worry about types

crimson vapor
#

io

#

hahahaha

opal plank
#

wait

#

did that actually pass?

crimson vapor
#

yes

opal plank
#

oopsie

crimson vapor
#

im removing it smh

opal plank
crimson vapor
opal plank
#

i feel bad for the people who will come in here and think "oohw, what a cute girl". Yall dont know the verocius and vile anime yall looking at

opal plank
crimson vapor
#

ok so thats a mistake ig

weary crypt
#

Not too sure, I dont really program in java

crimson vapor
#

@opal plank why did you duplicate code wtf

earnest phoenix
#

I made my bot from BDFD will i get help?

crimson vapor
#

where? the entire switch case

opal plank
crimson vapor
#

you duplicated the command part

opal plank
#

where?

earnest phoenix
crimson vapor
#

in the switch case for the reload

weary crypt
#

I like the way you make fun of Erwin's code :))

opal plank
opal plank
earnest phoenix
#

:/ ok

crimson vapor
#

both

#

are they not duplicates of each other?

opal plank
#

it had different stuff in my code

#

the switch is for specific ones

#

the default one reloads all

crimson vapor
#

wtf

#

did you push?

opal plank
#

a while back

#

not anytime soon

crimson vapor
opal plank
#

wont matter

crimson vapor
#

will there be conflicts if I make changes

#

probably actually

#

smh

opal plank
#

imagine not resolving conflitcs

#

i got git kraken

crimson vapor
#

effort

opal plank
#

im cool

crimson vapor
#

I have github education

#

im cool

sudden geyser
# forest herald Any javascript developers here that could tell me why the code that I commented ...

I think your issue may be your intent on returning from the function.

fetch(...) returns a Promise and you're using .then twice to manipulate the return type and value. However, in your second .then call, you're returning from the anonymous function passed, but not using the value from the overall promise.

So, return the value of calling fetch(...).then(...).then(...). You'll also need to await it since calling .then on a promise will always return another promise, even if the return value from the function passed isn't a promise.

sudden geyser
crimson vapor
#

@opal plank how can a message not have a channel?

opal plank
#

it was a type thing in detritus a while back

crimson vapor
#

ah

#

cache

#

no?

opal plank
#

i think that was it

opal plank
#

u yucko for not using gitKraken for versioning control and conflict fixing

round cove
#

Why would I use git kraken when things like VSCode or Rider have built in conflict managing.

woeful pike
sudden geyser
#

VSCode doesn't have great support for Git built-in (unless you're using an extension but ew)

round cove
woeful pike
#

classes? yes

crimson vapor
#

now that I think of it, its kinda annoying to have commands as classes

opal plank
weary crypt
crimson vapor
#

there is no intellisense for the functions

sudden geyser
#

I don't see what's wrong with commands as classes.

opal plank
#

cuz i want it to super() from the baseCommand

woeful pike
#

once upon a time I was trying to make my own command framework but I gave up because it wasn't interesting. This is what the interface looked like https://github.com/moedevs/discord-ahagon

GitHub

A zero bloat discord.js command framework. Contribute to moedevs/discord-ahagon development by creating an account on GitHub.

earnest phoenix
#

Oh no

crimson vapor
#

zero bloat

#

is bloat

earnest phoenix
#

zero deps :^)

opal plank
#

its top notch shit

crimson vapor
#

why do you need deps for a djs command handler

woeful pike
#

everyone knows bloat is a completely meaningless word you can safely throw around

crimson vapor
#

@slim heart

round cove
#

yeah my discord bot is blockchain

#

why do you ask?

crimson vapor
#

kekw

sick agate
round cove
#

It's a meme

sick agate
#

Ok

sudden geyser
#

stay in the immutable game

slim heart
#

bloat is less about performance issues and just throwing shit in you’ll never use making things scattered and complicated

round cove
#

people that use create-react-app ^

woeful pike
#

I quite liked this

const commmand = {
  // ...
  effect: (ctx, args) => {
    const start = new Date();
    console.log(`${ctx.message.member} used ban`);
    return (bannedMember) => {
      const time = new Date() - start;
      console.log(`Banned ${bannedMember.user.username} in ${time}ms.`);
      analyticsLibrary.send(time, { command: ctx.command.name });
    }
  },
  run: (ctx, args) => args.target.ban(args.reason)
}

the same way React.useEffect works

latent heron
#

i mean

#

commands as classes kinda smart imo

#

reusable objects at any time

slim heart
#

what

woeful pike
#

except they're never reused

latent heron
#

ok fair enough

woeful pike
#

you create a new class for every command lol

slim heart
#

^

latent heron
#

i can't argue that part

slim heart
#

also they don’t need to be classes to be reused either lmao

latent heron
#

i think command classes are good if you use like numerous prefixes

slim heart
#

huh

latent heron
#

or need a bot that works with both slash commands and its own prefix

woeful pike
#
const cleanup = await effect()
const data = await run()
await cleanup(data)
latent heron
#

in the case of d.py it helps

slim heart
#

discord-rose only has object commands and u can add slash commands in with the same func as message commands

latent heron
#

prob not TS or JS though

slim heart
#

there’s no diff and shouldn’t be really

crimson vapor
#

berry I didn't bring you here to talk about discord-rose smh

woeful pike
#

what's the point of creating a new class for every command lol the whole point of classes is that you instantiate a class to represent a command

slim heart
#

too late

latent heron
#

uhh

#

koder

opal plank
woeful pike
#

you have one command class and you create an instance of it to represent a command

opal plank
#

thats why its extending it

round cove
#

Since I started doing discord bots I've followed a weird command thingy

#

who wanna trash me

woeful pike
#

but a class already does that

opal plank
#

thats the whole point

latent heron
#

its ok dylan kind of does it too

opal plank
#

instead of rewriting functions for the handler over and over, its easier to just pull it from one place with super() and extend

lyric mountain
#

ye

slim heart
#

creating a new command context esc instance is fine for example but creating a class for a static command is dumb

sudden geyser
#

A class is useful for many activities, one of them being state. A lot of users don't need state with their classes or have other methods of holding state (varies across languages), but the best way to learn when to use classes is to program in another language (e.g. functional).

round cove
#
import { Message } from 'discord.js';

export const command = {
  desc: '',
  name: '',
  args: '',
  alias: [],
  type: '',
  run: (message: Message, args: string[], client: InsertBotClientClassNameHere) => {},
};
#

🙂

lyric mountain
#

master class + extending is a very organized way of doing stuff

opal plank
#

^^

crimson vapor
latent heron
#

if you're really obsessed with OOP though yeah sure

round cove
#

You're joking right million

latent heron
#

but most of the devs in here are functional programmers

woeful pike
#
export class Meme extends Command {
  constructor() {
    super(commandData)
  }

  run(data) {
    f(data)
  } 
}

vs

export new Command({ ...commandData, run: f })
crimson vapor
#

yes

pale vessel
crimson vapor
#

wtf

#

I was

pale vessel
#

yes

round cove
#

I legit did not know the client was on the message

#

Wait

sudden geyser
opal plank
#

rather than re-writing the handlers for each of the commandHandlers function, just extend them

pale vessel
#

weary

crimson vapor
slim heart
#

i just


export default {
  command: 'ping',
  exec: (ctx) => ctx.reply('pong')
} as CommandOptions```
pale vessel
#

client is everywhere

opal plank
#

and the way detritus works is by importing whatever default object/class u give it

latent heron
#

yes lol

woeful pike
#

all of these could just be object parameters

round cove
#

Wait

#

I extend the client class and add my own methods

#

That's why I have to pass.

latent heron
#

like a good half of the people i see in #development do func programs

#

thats bs

opal plank
#

@woeful pike i'd have to write those in ALL commands otherwise

woeful pike
#

no you don't just have one function that spreads an object into a default object

opal plank
#

its much easier to just extend it and pass the run()

woeful pike
#
export default { ...baseCommand, ...customCommand }

all the behavior is still there

round cove
#

Xet's got a point

opal plank
#

you could, yes

woeful pike
#

ofc in practice it would be more like

export default makeCommand({ ...baseCommand, ...customCommand })

so you can add custom behavior to how commands are constructed

opal plank
#

but then again, extend it would work just as fine

latent heron
#

or just don't write in typescript

#

😎

woeful pike
#

I just hate classes lol this is the worst thing added to js and classes are so verbose

latent heron
#

write in php instead

wheat sun
#

I just arrived, but...
If you want to update your bot or disable a command/section, do you prefer it to all go down and restart or just the one command/section?

slim heart
#

classes should be used when you’re making many of something that needs different instances. commands are things you define once and use so why class

opal plank
#

this after classes has been fun

#

beforehand binding this was a bitch

#

a total bitch

round cove
latent heron
#

what's wrong with normalizing classes apart of your code?

woeful pike
#

how has the class syntax made working with this easier?

#

arrow functions yes but class doesn't change the way this works

latent heron
#

i mean it feels really preferential at that point to use classes or not

#

it's a way of organizing code

opal plank
#

cuz you dont have to re-bind that shit everywhere, as long as you're inside of a class, you know it refers to the class itself

#

and it stops there nowadays

#

before used to be a pain to rebind it

round cove
woeful pike
#

you already didn't have to do that with the prototype syntax. Binding this depends on how you call the function from the outside

latent heron
#

compile moment

woeful pike
#
const func = classInstance.method;
func()

is gonna blow up whether you have class or not

latent heron
#

not a class issue then @round cove

woeful pike
#

but factory functions on the other hand

const func = regularObject.function;
func()

feelsgood

#

friendship with this ended, now makeThing is my best friend

latent heron
#

how does it blow up

#

if you're still able to call it the same way then it should be fine no?

opal plank
#

i mean, i guess i could, but then again, delcarations doing it that way would be a pain imo

#

having the classes already provides ts with the declarations of the types

opal plank
#

without the need to cast into the exports

#

or cast when importing

latent heron
#

why do you have to declare slash contextualized parameters through an interaction dict

#

that's cringe

woeful pike
slim heart
#

rather than coding the same thing twice

#

its just an easy drop in to support them

latent heron
#

aren't you still having to change how the class is exported though

slim heart
#

interaction is just the raw interaction data

latent heron
#

to recognize interaction creation

slim heart
#

hm?

latent heron
#

hold on lemme scroll up

#

oh well im crazy

hot sage
#

how would i add an embed to this, like it sends an embed saying that they have been banned

#

oops

#

either way, how would i add it, since i want a kick message too

latent heron
#

have you checked the d.py docs for it

weary crypt
#

Yea, I told him earlier that checking docs/google are the best things to use.

latent heron
#

what a chad

#

asking the question again

weary crypt
#

Different question I believe

latent heron
#

he did this earlier with the ban command

weary crypt
#

oh lol

#

then yes, chad

latent heron
hot sage
placid field
#

Yo bois

rose warren
#
const client = new rpc.Client({ transport: 'ipc' })

client.on('ready', () => {
    client.request('SET_ACTIVITY', {
        pid: process.pid,
        activity : {
            details : DESCRIPTION,
            assets : {
                large_image : "image-1",
                large_text : LARGE_TEXT
            },
            buttons : [
                { 
                    label : LABEL,
                    url : URL
                },
                {
                    label : LABEL,
                    url : URL
                }
            ]
        }
    })
})
client.login({ clientId : CLIENT_ID }).catch(console.error);

This is giving me this error (I replaced the values with placeholders here)

Error: connection closed
     at IPCTransport.<anonymous> (/node_modules/discord-rpc/src/client.js:118:16)
     at Object.onceWrapper (events.js:418:26)
     at IPCTransport.emit (events.js:311:20)
     at /node_modules/discord-rpc/src/transports/ipc.js:141:18
     at decode (/node_modules/discord-rpc/src/transports/ipc.js:92:5)
     at Socket.<anonymous> (/node_modules/discord-rpc/src/transports/ipc.js:120:7)
     at Socket.emit (events.js:311:20)
     at emitReadable_ (_stream_readable.js:562:12)
     at processTicksAndRejections (internal/process/task_queues.js:83:21)```
opal plank
rose warren
opal plank
#

sdk

rose warren
#

Got it 👍 thanks

earnest phoenix
#

How to make a leaderboard with a quick.db database ?

let votes = db.fetch(`vote_${member.user.id}`);

To make a top of the people with the most votes

opal plank
boreal iron
#

cough

opal plank
earnest phoenix
#

Oh ok

sudden geyser
#

I'm 99% sure quick.db doesn't have that capability.

opal plank
#

then return everything and parse in code

sudden geyser
#

A solution would be to fetch all entries and sort, but that isn't a great solution.

opal plank
#

or use a good database

#

like postgres

sudden geyser
#

give me an immutable database or give me death

slender wagon
#
let keys = ['2hundred of these', 'it is just too long to show']
if (window.location.hostname === keys[0]) value="yourcodehere";
if (window.location.hostname === keys[1]) value="yourcodehere1";

hi so i am trying to do something since i got like 200 domain names. I want to do the if check 200 times but it is just stupid to do it like that and there should be something else.
Meanwhile each value will be different for each of these i might make a array list of values with the same number as keys
what could be an easy way of going through this

sudden geyser
#

You could do keys.includes(...)

#

It would check if ... is in the array.

slender wagon
#

hmmm

#

this file will be hosted as a cdn

#

and 200 sites will have this

#

but each site should have a different value

#

keys are basically the domain names

boreal iron
#

Just remove the protocol from the hostname since it can be SSL or non SSL

#

Before searching for the value

slender wagon
#

the values will be random numbers needed for something else in the page

boreal iron
#

Instead of creating multiple arrays use objects

#

As multi-dimensional array

opal plank
#

4d arrays

boreal iron
slender wagon
#

hmmm

#

ohhh

#

u are a genius

#

i am stupid lmaoo

boreal iron
#

{
{
key: bla,
value: Erwin sucks
},
{
...
}
}

slender wagon
#

yep i understand

opal plank
boreal iron
slender wagon
#

thanks a bunch @boreal iron

#

will consider using objects more lmao

wheat sun
#

For discord.py, is there any considerable difference in terms of efficiency or latency, in having multiple commands in a few cogs vs multiple cogs with one command each?

boreal iron
#

Alright.... gonna prepare my bill real quick

slender wagon
#

E

opal plank
#

tis 50$ flat for any questions

#
  • comission
#

and tip

boreal iron
#

1/60 mins used

#

= 60 mins payment

opal plank
#

that'll be $876.73 sire, how would you like to pay?

boreal iron
#

Huh... cheap bitch

slender wagon
#

@boreal iron ayo any idea where i can turn a 200 lines text into a javascript object

#

is there like a converter

opal plank
opal plank
slender wagon
#

oh

boreal iron
#

But Erwins cheat works, too of course

sudden geyser
# wheat sun For discord.py, is there any considerable difference in terms of efficiency or l...

You would need to benchmark it yourself to see how the two perform, but I believe you should consider optimizing for the developer before optimizing for the program. The difference between the two in performance should ideally be the least of your concern and more about how the two differ in features and functionality.

For example, cogs are useful for classifying a set of commands under a parent. If you're making one cog for each command, you've made this feature useless.

wheat sun
slender wagon
#

u get what i mean?

slender wagon
#

same size with keys

#

cuz every domain name will have a different key

wheat sun
#

doesn't obj[key] return the value?

slender wagon
#

so basically keys is an array

#

now i want to make the obj[item] = item something else basically keyvaluehere: "myotherarrayhere"

wheat sun
#

dictionaries can have dictionaries and arrays as values, and if you have obj['a'] = 1 and then do obj['a'] = 2 it'll change the value, if it works similar to python xd

wheat sun
#

Could you rewrite? I understood almost nothing, and request what?

earnest phoenix
#

I had stroke

shadow frigate
#

anybody know an npm package to allow me to give youtube subscribers a role on discord?

wooden kindle
#

So I want to setup a logs channel like mee6 or really any bot has I know how to do it in console but how would I link it to a channel

#

If someone can help that will be cool

drifting wedge
#

is there a way to align stuff in css up>

#

so like it goes up by default

solemn latch
#

depends on the stuff

drifting wedge
#

uhh idk how to explain it

#

like its being pushed up?

#

is there like a margin-bottom:auto?

#

that works*

prime mist
#

Either make it a setting, or try to automatically create the channel with the API. Will depend on permissions etc

wooden kindle
solemn latch
#

console.log(stuff)

solemn latch
drifting wedge
#

uhh

lavish bramble
#

I want to do like to create a truth or dare team and people can join team by typing $join and so how to get list of team members and the player are in team can only play

db: old-wio.db

drifting wedge
#

not really

#

ok so lemme do it in pics

boreal iron
drifting wedge
#

this is normal

#

when i make the server management this invis

#

it just flops down lmao

boreal iron
#

Yeah there’s a reason why you can inspect in your browser for example

drifting wedge
#

you think i havent tried that?

prime mist
drifting wedge
#

i wouldnt be asking for help if it had worked

boreal iron
#

Okay since you’re arguing like that...
Do you think we got a magic glass ball to see the code?

drifting wedge
#

yes

#

i think you do

#

so tell my my issues pls and thank you

#

jk

#

so like is there a thing to push it up?

boreal iron
#

Because of the line break I would guess there’s a wrong display argument value set for the 1st child or the menu header

#

It should probably be display: block or inline-block

drifting wedge
#

ok lemme try

#

ty

boreal iron
#

What’s causing that anyways?

#

Did you open a sub menu or anything related?

drifting wedge
#

yeah basically

#

is there a way to do flex-direction:row without flex?

wheat sun
boreal iron
drifting wedge
#

uhh ok so using block or inline

#

it works

#

but then it breaks the ui basically

boreal iron
#

But since I don’t know what you wanna do exactly and since I’m not able to use a web inspector I won’t really be able to help

drifting wedge
#

ok so it worked right

#

it doesnt move down anymore

lavish bramble
drifting wedge
#

but it looks weird

boreal iron
#

Block actually transforms your element to a div

lavish bramble
#

Name.

drifting wedge
#

it was a div already

#

dude im super confused

#

ok so using block or inline works

#

but then all the elements look weird

#

divs*

boreal iron
#

If so just add the following to your style sheet

div { border: 1px solid; }

And gimme a screenshot

drifting wedge
#

kk

boreal iron
#

Without display block

drifting wedge
#

oh this makes more sense now

wheat sun
# lavish bramble And how can I get the playes list

Not sure how quick.db works, but could create a table which is a match, joining is adding people to that table, leaving is removing them from table, and ending/finishing game is deleting the table. As for user info, the User object has the properties that can find in documentation

boreal iron
#

Click it now to move it down again with another screenshot

drifting wedge
#

see how the spacing

#

moves down?

boreal iron
#

Yes

drifting wedge
#

yeah so thats the problem

#

any ideas?

boreal iron
#

One sec

drifting wedge
#

alright

boreal iron
#

Okay what does your click actually change in your style sheet or which style does it add to the elements?

drifting wedge
#

ok

#

it makes the content in the container of the groups invisible

#

so like u see the server management "group"

#

the "moderation" div is inside it

#

so when u click it, that goes invis

boreal iron
#

I wonder about the div border we set

#

Change it to div { border: 1px solid yellow !important; } please to see the impact

drifting wedge
#

kk

#

ty btw

boreal iron
#

The selector needs to be global

#

Well it would be 120% easier with a web inspector tool

drifting wedge
#

wait so divs

#

like ALL Divs?

boreal iron
#

Yes all

drifting wedge
#

cuz i was just doing it for the class

#

im dumb

#

i added the rest to groups to make it easier

boreal iron
#

Ok now click it again please

drifting wedge
#

ok

#

ok so

#

for some reason

#

the first "group"

#

is fine

#

the rest still move the thingy down

boreal iron
#

Pic?

drifting wedge
#

uhh sure

#

1 sec

boreal iron
#

What I can see is the div around server selector is the parent of all divs inside

drifting wedge
#

i think ik whats the issue

#

i have the pic if u want

boreal iron
#

Sure

drifting wedge
#

but i can solve this on my own now

boreal iron
#

Alright looks better

drifting wedge
#

AHHH

#

it didnt work

#

i hate frontend 😦

#

@boreal iron

#

ill try to send code?

#

cuz its complicated af

boreal iron
#

Oof already turned off the PC notlikenoot

#

Thought you’re done

drifting wedge
#

ahhh

#

its fine ig

#

AHHH I HATE CSS

boreal iron
#

If it’s not urgent we can go on in a few hours

drifting wedge
#

idk why it was workign when i had so many

#

uhh itll be too late for me

#

its fine

#

dw

#

thanks tho

#

what WAS working tho was using block or inline

#

the only issue with that was that the individual elements werent aligned

#

which can be fixed

#

block*

#

inline doesnt work

boreal iron
#

Well the inspector tool in Firefox has a layout section for the selected element to see the outer and inner paddings/margins

#

No inline will basically transform the into a span element

#

Anyways need some sleep unfortunately until the work begins

#

Let’s talk later that day

drifting wedge
#

yeah alright

#

cya

#

thanks

kind fjord
#

wait what? Is it possible to make this kind of button?

wheat sun
#

This will make a fine addition to my collection

opal plank
#

im playing with it rn

wheat sun
#

I assume it replaces the on_reaction do this ?

opal plank
#

you save on a lot of requests doing it that way

wheat sun
#

Ooo

opal plank
#

so, heres the thing

#

you just send everything under components

#

rather than having to await react() on every message

#

rather than a request for the message itself PLUS 1 request per reaction, you bulk everything into 1

#

since you can create the message WITH all reactions along with it

wheat sun
#

Seems like embed menus and stuff are getting an upgrade

opal plank
#

absolutely

#

dropsdowns are fun too

#

but i cant show

wheat sun
#

Dropdowns as in?

#

Never heard of them

#

Unless mean channel categories

opal plank
#

you havent heard of them cuz they are in private testing

#

only staff and big lib devs have access to it

sage bobcat
#

One message removed from a suspended account.

opal plank
#

yes

sage bobcat
#

One message removed from a suspended account.

opal plank
#

hug?

wheat sun
#

Ah

sage bobcat
#

One message removed from a suspended account.

opal plank
opal plank
# wheat sun Ah

i got access to it, had acess to other stuff like buttons too

#

got to use it about 2 months prior its release

#

i still got access to threads and dropdowns

#

even though they arent out yet

wheat sun
#

Then I'll be waiting xd More options and things to do cool stuff are always welcome lol

prime mist
#

What's cool about buttons is that you can put anything in the custom_id, so you can easily parse out database IDs etc

wheat sun
#

Nice

#

I need to finish my bot and try it soon then xd

opal plank
#

i think they pushed it to v13

#

which god knows when it'll come out

wheat sun
#

I'm python though

#

I have no clue how to use js lol

opal plank
#

oh then u fine, just check the docs if they have it already

wheat sun
#

Ye, been reading them xd

opal plank
#

@crimson vapor you seeing this shit?

#

the python users read the docs

#

why the fuck the js ones dont?

pallid heart
#

يزم

#

كسمكم

#

منايك

#

شراميط

wheat sun
#

@pallid heart It'll be easier to get help with development if ask in English. Not sure how many can understand what you are saying xd

crimson vapor
wheat sun
kind fjord
rocky hearth
#

what is message.reactions.holds? There is no doc for it

lusty quest
wheat sun
rocky hearth
wheat sun
#

Sorry, I don't know about RPG maker xd

prime mist
# rocky hearth

Who knows the deep inner mysteries of d.js? It traps developers with "easy OOP based code", then stings you with its complexity.

rocky hearth
#

lol yes.

#

there's no doc for, add method too
how js guyz would know about it?

lavish bramble
#
if(!message.guild.me.hasPermissionFor(message.member.voice.channel)) return message.channel.send("I need Connect permission to connect your vc!")```
wheat sun
#
try:
  *something something*
except command.MissingPermissions:
  *sends message that dont have permission*
lusty quest
#

its js

wheat sun
#

Then the js try...catch

lusty quest
#

haspermissionfor is a thing? cant find it in the docs

#

try permissionIn

wheat sun
lusty quest
#

has permission is for permissions like ADMINISTRATOR

#

permissionsin is for channel permission

#

also haspermission is deprecated

#

permissions.has is the new way

wise quartz
#

is there a way to check if someone actually voted for your bot?

wheat sun
wise quartz
#

Aight

copper cradle
#

that's aml you could expect from someone using js

earnest phoenix
#

How do you make the browser download the requested file instead of displaying to the user?

split hazel
#

you mean as in videos?

earnest phoenix
#

no

#

any file

#

like:

GET /file.pngoranyotherfiletype

i want the browser to download the file instead of display it as a png image

vivid fulcrum
#

iirc you cant

#

that behavior is browser defined

earnest phoenix
#

you click on the download button and it just works

split hazel
#

there's probably some hacky solution in approaching this

#

like downloading it via js and saving it somehow

earnest phoenix
#

i once tried to send a file with an invalid mime type so express changed it to application/octet-stream and the browser downloaded it

#

@split hazel @vivid fulcrum yeah application/octet-stream works

#

the browser literally saved the file as download

#

nvm content-disposition exists

ebon tree
#

I use discord.js and my bot is for economy how can I make it when someone vote my bot it's give him coins? How can I do it really

#

Like dank memer or other bots

quartz kindle
earnest phoenix
#

Does anyone know how i can report a bot

copper cradle
#

I sent them here bc I felt that wasn't completely related to the top.gg api

quartz kindle
#

how is it not related?

#

lmao

copper cradle
#

I mean they only need the api for the vote part

compact pollen
#

Hello

quartz kindle
#

which im pretty sure is what they're asking about (or both)

copper cradle
severe pike
#

How do I get/make a webhook to use for tracking voting? Do I have to make a flask webserver? Or is there an easier way?

lost summit
#

how do i verify my bot?

cinder patio
severe pike
#

Yea but you need a webhook for it?

earnest phoenix
#

hi cuties

severe pike
cinder patio
#

the library handles it for you

severe pike
#

Oh

#

Do i have to put anything in here?

cinder patio
#

yeah, the url to your webhook and the auth

severe pike
#

Where do i get the webhook?

cinder patio
#

A "webhook' is a regular web server, you give top.gg the url to a specific route of the web server and top.gg makes a request to that route when someone votes

severe pike
#

So I should be making a flask web server?

cinder patio
#

In the example code the url to the webhook would be:

yourdomain:5000/dblwebhook

#

no the library already creates the server for you

severe pike
#

oh

#

So how do I get the domain?

cinder patio
#

the domain would be the IP of your vps

severe pike
#

Local IP or public?

cinder patio
#

public

severe pike
#

Thanks a bunch dude ^ Sorry about all the questions ;p

cinder patio
#

uh.. do vps' providers even give you a local IP address

severe pike
#

Not sure, I just host it on my pi

cinder patio
#

that'll make stuff a lot harder for you tho

open tree
#

A

severe pike
#

Why?

Also should it look something like this?

client.dblpy = dbl.DBLClient(client, dbl_token, webhook_path="86.25.###.###:5000/dblwebhook", webhook_auth="password", webhook_port=5000)

willow mirage
#

a stupid question, should I make a nGinx server for a React front end app?

severe pike
#
dbl_token = "tokenhere"  # set this to your bot's top.gg token
client.dblpy = dbl.DBLClient(client, dbl_token,
                             webhook_path="86.25.###.###:5000/dblwebhook",
                             webhook_auth="password", webhook_port=5000)

I don't seem to be getting any response when I use the test webhook button on the topgg website.

earnest phoenix
#

The webhook_path should just be "/dblwebhook" and start the Webhook URL with http://

severe pike
#

should I put https:// myip : port/dblwebhook on top.gg site?

earnest phoenix
#

http://ip:port/dblwebhook

severe pike
#

Don't seem to be getting anything back from it

earnest phoenix
#

Did you save it?

severe pike
#
client.dblpy = dbl.DBLClient(client, dbl_token,
                             webhook_path="/dblwebhook",
                             webhook_auth="password", webhook_port=5000)

Yea saved it

earnest phoenix
#

Try accessing it through your browser, it should show 405: Method Not Allowed

severe pike
#

Doesn't load

earnest phoenix
#

You leak the IP btw

severe pike
#

ooops xD

earnest phoenix
#

Make sure port 5000 is open

cinder patio
#

it's a raspberry pi that's connected to their home network

#

you need to setup port forwarding

earnest phoenix
#

Ah, then yeah ^

severe pike
#

Go onto my router settings?

hexed vortex
#

Hello, so ive been working on a buy command for my econimy bot and as most know i use repl.it to keep it online and well when i tried to get it on it did go online but whenever you run the command to join the bank it doesnt send the embed, doesnt give me an error and doesnt write in bank.json
My code:
https://hastebin.com/narabunifi.js

earnest phoenix
#

I myself haven't tried doing it, so can't really help with that

severe pike
#

one sec I think i can do it i've done it once before

severe pike
#

Sorry not you tbone

lusty quest
#

... you use repl.it who offers some free database, and you still decide to use json?

lusty quest
#

also you run 2 message events, why?

hexed vortex
severe pike
#

I just did a command to check ports and 5000 seems to be listening?

earnest phoenix
#

Doesn't repl.it use an ephemeral file system anyway?

lusty quest
pale vessel
#

Nop

hexed vortex
#

can someone just help me not critisize me

pale vessel
#

That's heroku

earnest phoenix
#

Ah

lusty quest
#

i work on the other stuff

#

what embed doesnt work?

earnest phoenix
#

So you can actually use JSON there

hexed vortex
lusty quest
#

you dont need 2

#

but anyways, what embed fails?

hexed vortex
hexed vortex
#

as ive tested the !join command mainly

#

and yes i have a folder called DB then bank.json in it

lusty quest
#

you have a few embeds in the join command

hexed vortex
#

with {} in the folder

lusty quest
#

also does the "db" contain any data?

hexed vortex
hexed vortex
lusty quest
#

yes, but does it contain data?

hexed vortex
#

then there is bank.json in that folder

#

yes

lusty quest
#

ok so you expect to get the first error then?

hexed vortex
#

so it is getting the message.author.id and putting it there with there bal, worker, and lastclaim

lusty quest
#

ok so the thing doesnt contain data

hexed vortex
hexed vortex
#

fs.writeFileSync

#

to write into it

lusty quest
#

no it does not the json file is empty

hexed vortex
#

wdym

#

the {} are there

lusty quest
#

but looks like your first check if the user exist in the database causes your issue

#

yes, but its still empty there is no data in it

hexed vortex
#

yes but its supposed to write there id and then the lastclaim etc

lusty quest
#

yes, it doesnt write anything bcs it never reaches the part of the code

hexed vortex
#

so whats blocking it?

#

sorry im kinda new to coding, only been here for 6 months

lusty quest
#

where did you close the stuff from line 65?

#

in best case after the return

#

but i dont see the bracket there

hexed vortex
#

line 76

lusty quest
#

line 76 is for the json

hexed vortex
#

oh i think i forgot to close the code there

lusty quest
#

yea, you want to close it after the break

#

did you use an IDE?

#

like VSC?

hexed vortex
lusty quest
#

ok did you have the nice stuff linter installed?

hexed vortex
lusty quest
#

did you know how to install modules in VSC?

hexed vortex
hexed vortex
#

n

lusty quest
#

search for ESLint

#

it will help you a lot

hexed vortex
#

npm i ESLint

lusty quest
#

no

#

its a vsc package

hexed vortex
sudden geyser
#

You can install it globally since it doesn't have anything to do with the project other than during its development phase (and can be used in other projects).

lusty quest
#

it helps you with syntax errors

hexed vortex
#

this??

lusty quest
#

yes

hexed vortex
lusty quest
#

can also recommend Errorlens

#

told you

hexed vortex
#

in vsc this is what it says

#

but in discord nothing sends

lusty quest
#

yea then everything is fine

#

it doesnt say you if your code is written in a way that it cant work

hexed vortex
#

are u sure

lusty quest
#

it just tells you about syntax errors

hexed vortex
#

its not working my ENITER code besides !help

lusty quest
#

join doesnt work bcs your code blocks the entire code

cinder patio
#

eslint does much more

quartz kindle
#

you also need to generate an eslintrc.json file otherwise eslint wont work

lusty quest
#

you open a bracket at line 65 but never close it properly

sudden geyser
#

damn it

#

I was about to point it out

lusty quest
#

this prevents you from saving stuff

hexed vortex
#

would this work

  if(MoneyJSON[message.author.id]){
                let AlreadyCreated = new Discord.MessageEmbed
                AlreadyCreated.setTitle("Already Created")
                AlreadyCreated.setDescription("You Have Already Created An Account")
                message.channel.send(AlreadyCreated)
                return;
            }
lusty quest
#

try and see

hexed vortex
#

one sec

digital ibex
lusty quest
#

it tells you the error

hexed vortex
#

i fixed it

#

one sec

#

starting it up

digital ibex
hexed vortex
digital ibex
#

lol

mental raven
#

Why does this not work?

members = 0
bots = 0
for i in ctx.guild.members:
    if i.bot:
      bots += 1
    else:
      members += 1
print(members)
print(bots)
lusty quest
#

he sends you links to solve your issues

digital ibex
#

im giving them to u my man

hexed vortex
#

oh

hexed vortex
mental raven
digital ibex
#

google ur errors my man

hexed vortex
#

that worked

sudden geyser
hexed vortex
lusty quest
mental raven
sudden geyser
#

You're probably missing server member intents.

hexed vortex
#

nice

lusty quest
#

the d.js-guide has an really good guide in how to break down your bot into mutiple files, this makes managing the commands / events way easier

sudden geyser
#

You'll need to enable the intent on the developer dashboard and in your source code.

hexed vortex
mental raven
#

Wait lemme see something

lusty quest
#

what error?

hexed vortex
#

oh and now my buy commands arent working

lusty quest
#

there is probably some blocking code too

hexed vortex
#

um

lusty quest
#

so it writes, but doesnt substract and send the message

hexed vortex
mental raven
hexed vortex
lusty quest
#

wait it does, but you dont check if the sum is smaller than 0 after the transaction

hexed vortex
hexed vortex
#

it did it AGAIN

#

into the negitives

lusty quest
#

yes bcs you probably dont prevent it

hexed vortex
#

where do i not, i did it

regal creek
#

Whats the fastest way to check through a mongodb collection if a value contains X letter/string? Using regex would just give me every value/data that includes X? Let me know if you need better explaination

using mongoose

sudden geyser
hexed vortex
quartz kindle
#

you tried to access the property 0 of something that is not defined

lusty quest
lusty quest
#

if(10 * parseInt(amount) > MoneyJSON[message.author.id.bal]){

hexed vortex
regal creek
#

just had to lol

quartz kindle
#

lel

hexed vortex
#

hold on im looking

hexed vortex
quartz kindle
#

discord ids dont have a "bal" property

hexed vortex
lusty quest
#

you want to add it at the end

quartz kindle
#

i dont have your code so idk what you're saying

lusty quest
hexed vortex
#

also the new code:

quartz kindle
#

you did it right everywhere except here if(10 * parseInt(amount) > MoneyJSON[message.author.id.bal]){

#

just check how you did it in other places and do the same

quartz kindle
#

use MoneyJSON correctly

hexed vortex
#

Wait

#

i mean

#
if(10 * parseInt(amount) > MoneyJSON[message.author.id],bal){
                    let Error = new Discord.MessageEmbed
                    Error.setTitle("Nope!")
                    Error.setDescription(`You do not have enough money! Each worker costs $10\nYou have $${MoneyJSON[message.author.id].bal}`)
                    message.channel.send(Error)
                    return
quartz kindle
#

you put a comma

#

lol

hexed vortex
#

lokk at the other one

quartz kindle
#

no

#

you put a comma

hexed vortex
#

if(10 * parseInt(amount) > MoneyJSON[message.author.id].bal){
let Error = new Discord.MessageEmbed
Error.setTitle("Nope!")
Error.setDescription(You do not have enough money! Each worker costs $10\nYou have $${MoneyJSON[message.author.id].bal})
message.channel.send(Error)
return

#

not anymore is that good?

hexed vortex
quartz kindle
#

yes looks better

lusty quest
#

try and see

severe pike
#

So, i couldnt figure out port forwarding for my webhook. So im now using a third partty service which will send a discord webhook to a channel, and then i do some funky stuff to gather the userID of the person who voted within the message of the discord webhook 🤣

hexed vortex
ember estuary
#

Hello, who wants to buy a free fire account?

lusty quest
#

@round cove

hexed vortex
lusty quest
#

did you get errors?

#

@solemn latch work for you

quartz kindle
#

how do you "sell" something for free

sick agate
#

its in the game name

hexed vortex
#

what does it mean

lusty quest
#

you try to read some property that is not defined

#

did you uploaded the code?

hexed vortex
hexed vortex
lusty quest
#

hmm

quartz kindle
#

since woo is away, how about @drowsy crag ?

drowsy crag
#

where who what huh

quartz kindle
#

he just dmed me

#

the guy selling a free account

#

lmao

lusty quest
quartz kindle
drowsy crag
#

@ember estuary not the place to ask

hexed vortex
lusty quest
#

does it finish the rest of the code after the file write?

hexed vortex
#

this piece doesnt work

#

but the one above does

lusty quest
#

add a console.log("some random message") to it to see if it passes, or learn how to use the debugger

opal plank
#

preferably the latter

hexed vortex
#

of the MoneyJSON

lusty quest
#

the log usually where you want to check if the code runs throu

lusty quest
#

its not the most efficent way tho

#

but better than just guessing

hexed vortex
#

will this work

hexed vortex
#

that happend

lusty quest
#

you see the linter already told you what is wrong

hexed vortex
quartz kindle
#

learn about semicolons

zenith terrace
#

tim stinks of bot dev colour

quartz kindle
#

b-b-but

#

i showered yesterday

zenith terrace
last tapir
#

hi

#
const user = message.mentions.members.first();
const userID = user.id;
earnest phoenix
#

;

earnest phoenix
last tapir
#

Its only allowing user.user.id not user.id

#

wait it worked...

#

bruh

feral aspen
#

👀

trail finch
#

is there any way to view the highest permission an user has? node.js btw

quartz kindle
#

member.roles.highest

woeful pike
earnest phoenix
thorny prawn
#

i cant find the webhooks tab under settings. Could someone help me out?

earnest phoenix
thorny prawn
#

ok ill check it out

#

nothing under vote tab, only credits

earnest phoenix
cinder patio
#

Isn't it under bot info

thorny prawn
#

its not thr

thorny prawn
cinder patio
#

It's probs not there cause your bot hasn't been approved, then

solemn latch
#

yeah

earnest phoenix
#

under the edit tab

solemn latch
#

gotta be approved to use webhooks

thorny prawn
#

ok ill check with that

earnest phoenix
#

it will look like this if you bot is approved

solemn latch
#

you can try
https://top.gg/bot/YOURBOTIDHERE/webhooks
but it doesnt really do anything until approved

thorny prawn
#

how do i check whether my bot is approved or not?

cinder patio
#

if it was you'd have the bot developer role, also you'd get a DM by Luca

thorny prawn
#

how do i check queue

solemn latch
#

queue is confidential.