#development

1 messages Β· Page 1750 of 1

opal plank
#

you can name it whatever you want

rocky hearth
#

so u use ts-node to make bots

opal plank
#

i do

#

i dislike having to compile it everything with tsc

rocky hearth
#

how can i make it work with require-all package

opal plank
#

i would need to check what require-all even is

rocky hearth
#

it requires all the packages in a directory.

pale vessel
opal plank
pale vessel
#

bruh

opal plank
pale vessel
#

I used to do that but it was EXTREMELY slow

#

For now I use tsc

opal plank
#

the difference i get is about 500ms in difference

#

its completely irrevelant for me

#

and it only affects startup

rocky hearth
#

I'm requiring all the files in the commands folder, and making a map of it, assigning it to client.commands

opal plank
#

why not do it the normal way instead of breaking your whole dev configs in favor of a single package?

#
for (let file of fs.scanDir('/cmds').filter(name => name.endsWith('.ts'))) client.commands.set(require('./cmds' + file).name, require('./cmds' + file));

this is gross, but its one line

#

also, since you are using typescript, i'd recommend using detritus for your library

#

this is all you would need to scan ur commands folder with detritus

rocky hearth
#

I've used, commando. Now making a new bot for slash commands

opal plank
#

commando is an insult to be compared with detritus

#

would definitively recommend using detritus if you starting a new bot tho

rocky hearth
#

ok, then I hv to chekc it then

eternal osprey
#
inline:false
name:'PROGRESS'
value:'**Level**: 53 (19.74%)\n**XP**: 69,320/351,125\n**Area**: 7 (Max: 7)\n**Time travels**: 2'``` 
how do i get all the contents that comes after the word: Time travels?
earnest phoenix
#

With regex or other, how do you check if a message contains an url (and not just https: // but a real clickable link)
thx

opal plank
sudden geyser
timid timber
#

I Want My Bot To Send A Message To A Server At A Given Interval.

#

How To Do This?

sudden geyser
#

What language are you using?

timid timber
#

ext

sudden geyser
timid timber
#

ok thnx

rocky hearth
#

erwin, ts-node will start the bot, how do I restart it on file changes, do I hv to use nodemon for that?

earnest phoenix
opal plank
#

why do you need to restart on file changes?

rocky hearth
#

so, I could test the changes i hv made, instantly

opal plank
#

again, why do you NEED file cahnges?

#

the code will get compiled either way, and you already using ts-node

#

so, i dont see the point of needing to use nodemon here at all

#

it seems you only using nodemon to keep the app alive

#

i've sent u my vsc config exactly so you can recompile it easily

#

,

sudden geyser
rocky hearth
#

I dont want rerun the dev script, everytime I make changes.
nodemon could do that for me, if it sees changes in the files

opal plank
#

recompiles and re-runs it

#

can be annoying specially when you save stuff and it restarts the bot without you intending to

#

aslo, you should use a debugger with vsc attached to the node for proper testing/development environments

#

aka, press f5 while in vsc

eternal osprey
rocky hearth
#

so can we make node . also to recompile itself when it sees changes

opal plank
opal plank
eternal osprey
#

hey

#
 if(response.includes())```how do i check if it contains a number between 2-19?
cinder patio
#

use some

#
response.some(num => /* check if number is between 2 and 19 here */);
eternal osprey
#

yeah i saw that in the docs already! Thanks!

hearty perch
#

I'll just one thing, it's not very nice you call a video shit. Nothing more.

eternal osprey
#

as response is a string

#

and i just read in the docs that it is only for arrrays

slender thistle
#

Ah, that

cinder patio
#

You can use regex

slender thistle
#

I haven't watched the video myself so really I didn't call it shit for its quality or anything. I'm simply used to using the word itself often, that's all

cinder patio
#

@eternal osprey

sudden geyser
#

Software rot is the grim reaper to programmers.

cinder patio
#

Maybe there's a way to check if there's a number between a range via regex... not sure

sudden geyser
#

@eternal osprey if the string only features a number and nothing else, you can use parseInt(..., 10) to convert the string to a number.

earnest phoenix
#

is this work for

#

bot description like hydra

slender thistle
#

Has anyone here worked with Pypy and its compatibility with CPython?

earnest phoenix
#

Wanted to try it, but I need walrus so bad, so haven't tried it mmulu

slender thistle
#

Walrus is love

snow urchin
#

wut

vivid fulcrum
#

you're lacking a package-lock.json

snow urchin
#

im using yarn, soooooo......

prime glacier
#
        return message.channel.send(
          "Only server owner can perform this action"
        )```

i dont have ownership but command is still working
snow urchin
#

you put it in the right place?

prime glacier
#

yeah

#
if (args[0] === "create") {
      if(message.author.id !== message.guild.ownerID)
        return message.channel.send(
          "Only server owner can perform this action"
        )

      
message.channel.send(new MessageEmbed()
      .setTitle("Success")
      .setColor("RED")
      .setDescription(`Successfully **created backup** with the id \`${ID}\`\n**Usage**\`\`\`${prefix}backup load ${ID}\`\`\`\n\`\`\`${prefix}backup info ${ID}\`\`\``))
      
      }```
pale vessel
#

hmm, try logging the IDs console.log(message.author.id, message.guild.ownerID);

prime glacier
weary crypt
#

my guess, it may not be reaching the if(message.author.id !== message.guild.ownerID)

prime glacier
pale vessel
weary crypt
#

^

prime glacier
weary crypt
#

Also that is not what I am saying, basically saying that arg[0] may not be equal to "create"

long crow
#

might be owner id is not cached, so you need to fetch it

wheat mesa
#

Pretty sure you have to fetch the owner first. Not entirely sure.

prime glacier
# pale vessel log it before that if condition
if (args[0] === "create") {
      console.log(message.author.id, message.guild.ownerID);
      if(message.author.id !== message.guild.ownerID)
        return message.channel.send(
          "Only server owner can perform this action"
          
        )```
still nothing
prime glacier
long crow
#

what um? I dont understand

prime glacier
#

wait

prime glacier
# long crow what um? I dont understand
if (command === "backup") {
    if (!args[0]) {
      message.channel.send(
        new MessageEmbed()
          .setColor("BLUE")
          .setAuthor(
            message.author.username,
            message.author.displayAvatarURL({ dynamic: true })
          )
          .setTitle("Commands")
          .setDescription(
            `something stuff etc`
          )
      );
      return;
    }
if (args[0] === "create") {
      if(message.author.id !== message.guild.ownerID)
        return message.channel.send(
          "Only server owner can perform this action"
        )

      
message.channel.send(new MessageEmbed()
      .setTitle("Success")
      .setColor("RED")
      .setDescription(`Successfully **created backup** with the id \`${ID}\`\n**Usage**\`\`\`${prefix}backup load ${ID}\`\`\`\n\`\`\`${prefix}backup info ${ID}\`\`\``))
      
      }```
wheat mesa
#

@prime glacier you have to fetch the server owner first. message.guild.members.fetch(message.guild.ownerID) <- something more like that

long crow
#

fetch return a promise too

wheat mesa
#

^^

prime glacier
#

oh

wheat mesa
#

no

prime glacier
#

owner = message.guild.members.fetch(message.guild.ownerID)

#

const

wheat mesa
#

fetch the owner id, then check if the user that is typing the command matches the id

prime glacier
opal plank
#

@prime glacier@wheat mesathe heck you both going on about?

#

guild.ownerId is already there

long crow
#

not cached

opal plank
#

why you fetching the owner just to gte the ID you ALRADY have

long crow
#

so it null

opal plank
#

guild.ownerId is already there tho

wheat mesa
#

ownerID returns undefined if you don't fetch it

#

I tested it

opal plank
#

wait what?

wheat mesa
#
message.guild.members.fetch(message.guild.ownerID)
console.log(message.guild.ownerID)
``` Outputs the ID of the owners, but ```js
console.log(message.guild.ownerID)
``` Outputs `undefined`
opal plank
#

ownerid is ALWAYS present in a guild object

wheat mesa
#

Β―_(ツ)_/Β―

solemn latch
#

Still no need to fetch if you already have it

trail finch
#
let d
    let timeout2 = 86400000
    if(daily !== null && timeout2 - (Date.now() - daily) > 0){
            let time2 = ms(timeout2 - (Date.now() - daily));
            d = `:alarm_clock:  | \`Daily\`  (${time2.hours}h ${time2.minutes}m ${time2.seconds}s)`
    } else if (daily === null && timeout2 - (Date.now() - daily) < 0) {
        d = ":white_check_mark:  | `Daily`"
    }```

I have used quick.db cuz I made the whole bot using it and dont wanna change it (too lazy) so the problem is.. it is showing undefined... I defined them rlly nicely but still
solemn latch
lucid prawn
opal plank
#

like, whats the point?

#

guild already has the id

warped ravine
#

how can i solve this error?

opal plank
#

how do you even FETCH the owner if u dont have their id?

wheat mesa
#

Nevermind, it's outputting correctly now

prime glacier
#

πŸ‘€

#

chill

opal plank
#

yall tribbing balls hard

#

either way

wheat mesa
#

Yeah lmao

weary crypt
#

Everyone makes mistakes lol

opal plank
wheat mesa
#

My bot kept logging it as undefined when I tested it

opal plank
#

thats all u need @prime glacier

wheat mesa
#

then it worked when I cached it

#

Β―_(ツ)_/Β―

#

Now it's working without caching it

#

odd

opal plank
#

probably did a typo

wheat mesa
#

probably

prime glacier
warped ravine
prime glacier
solemn latch
opal plank
sudden geyser
#

probably a null shard

prime glacier
sudden geyser
#

maybe they're not sharding

warped ravine
opal plank
earnest phoenix
cinder patio
#

Hmm... so let's say I have the string "\n" in javascript, is there a function which I can use to escape all the special characters? So it would become \\n

silent hornet
#

hi anyone know how to reload a json file? (into discord.js)

weary crypt
earnest phoenix
#

You can also use parenthesis if you hate tagged functions

quaint wasp
#

umm

opal plank
quaint wasp
#

Error: val is not a non-empty string or a valid number. val=undefined

marble juniper
pale vessel
#

@opal plank What's the difference between Extract and Pick?

cinder patio
pale vessel
#

TS

opal plank
#

tsconfig?

earnest phoenix
pale vessel
cinder patio
vivid fulcrum
#

why not just do a simple regex replace

opal plank
earnest phoenix
#

it is escaping correctly in the second one

opal plank
#

most of the times i use classes to protect stuff

sudden geyser
#

seems to work

cinder patio
#

Yeah but my string is in a variable

#

I'll use regex

opal plank
silent hornet
#

hi anyone know how to reload a json file? (into discord.js)

opal plank
#

im starting to see a pattern here
i write code
2 weeks later, i review my old code and curse myself for writing whatever the fuck that is
rinse and repeat

solemn latch
#

πŸ‘€ yeah very common with me too. But I like rewriting code so no harm

opal plank
#

well yeah, me too, but sometimes i just look at it and think wtf dude, why u wrote this shit?

earnest phoenix
#

pun intended?

sudden geyser
#

It’s harder to read code than to write it.

opal plank
#

probably

earnest phoenix
#

why you wrote this shit with two backticks

cinder patio
#

Ugh this is annoying

opal plank
#

i legit wrote this 2 weeks ago ```ts
\`\`\text`\`\`\text2`\`\`\

earnest phoenix
#

it doesn't display as a code block on mobile

cinder patio
#

I need JS to understand the "\n" string literally... ok wh-

opal plank
#

instead of ts "``text````text2``"

#

ah fucking discord and backticks

earnest phoenix
vivid fulcrum
#

\ is an escape character

#

\n in a string doesn't actually mean that the literal characters \ and n are in the string

opal plank
#

this

cinder patio
#

yeah

sudden geyser
vivid fulcrum
#

so why are you looking for a backslash when there isn't one in a string

earnest phoenix
cinder patio
#

okay yeah but my string is in a variable

#

a parameter to be specific, and I need to know the length of the returned value of String.raw, and I don't want the person who uses the function to pass the string and it's length...

rocky hearth
#

in tsconfig, i hv set a rootDir to "src", but ihv some ts files in another folder, which I dont want to be included.
so vsc is complaining, that, these files are not included in rootDirs

cinder patio
#

pass the directory you want ts to ignore

earnest phoenix
#

try running this in the console

let string = `bruh\nbruh`;
console.log(string);
let string2 = String.raw`${string}`;
console.log(string2);
#

aeon is having a stroke running that

#

oh wait found the error on line 3

cinder patio
#

hmm okay

rocky hearth
#

Feud, can u ans this

cinder patio
#
abstract class X {
   
  abstract fn(a: number) : number
}
#

ah wait you don't want to redeclare the parameters? Nope you cannot do that

rocky hearth
#
class Y extends X {
 fn(a: number) { // Here can I avoid giving the type again. As I've already given it abstract method
  }
}
cinder patio
#

well, actually maybe the snippet above will do it, haven't used abstract classes myself

brittle hamlet
#

I have a doubt to change the background of my bot's page with a picture where do I have to insert css?

rocky hearth
brittle hamlet
#

In the long description section?

pale vessel
#

yes, inside the style tag

brittle hamlet
#

ooh thanks I am bit weak in css is it <style></style> right?

warped ravine
#

how can i solve this error?

rocky hearth
solemn latch
# warped ravine

seems to be the same error as the last error you asked for help with. just what your doing is different.

warped ravine
solemn latch
#

yes, but its the same issue

warped ravine
#

what can i do to fix it

#

?

solemn latch
#

are you using a sharding manager?

#

stuff like fetchclientValues and broadcastEval is one shard communicating with other shards, if you dont have multiple shards, they dont work.

warped ravine
#

Hmmm...

#

'bot' says no shard. Got it right?

earnest phoenix
#

I want help

zenith terrace
#

you can only get help if you pay a fee, which is telling us help with what

earnest phoenix
#

How to

#

Add link in embed like Invite bot to the server

#

Can anyone tell me?

zenith terrace
#

by putting the bots invite link ?

#

you mean the blue text?

earnest phoenix
#

Wait

#

[Invite] (link)

#

or something similar

zenith terrace
#

you can only make a blue invite in the fields or description

earnest phoenix
#

learn more about markdown

#

Like add me

#

How to insert link inside the word

#

Learn about markdown

sudden geyser
#

[title](url)

earnest phoenix
#

oh

earnest phoenix
#

Not working at all

solemn latch
#

can you show what you used

earnest phoenix
#

Ty

eternal osprey
#

I check for a specific word in the string

#

after that I could remove all the intents from the args

brittle hamlet
#

Can anyone tell me which dimension's photo will be ok to replace as the background in the bots page?

sudden knoll
#

If anyone uses Python's apscheduler, which persistent job store do you recommend?

earnest phoenix
#

I did not recive a dm from Luca :<

knotty obsidian
#

What method should I use for managing temporary mutes
Do I make a thread and make it wait out the time there (might get messed up when its terminated) or do I make it constantly check the time and see if anyones time is up yet

#

The first one can get messed up a lot for long temporary mutes

lyric mountain
#

rule of thumb is, if something:
A - needs to work regardless of restarts OR
B - needs to be used after a long period of time

you use a db

#

setInterval/setTimeout are really meant for short-lived tasks only

near stratus
lusty quest
#

use redis and use the ttl field, and listen to events send from redis, will tell you when the time is over

lyric mountain
#

'-'

knotty obsidian
#

wait what if i just make a thread that waits and if anything goes wrong i just store the time in a database and each time the bot restarts it checks if there is any unfinished buisness?

lyric mountain
#

don't use waiting threads

#

JS is not the brightest thread-user already, plus making one per muted user will kill your bot quite quickly

near stratus
lyric mountain
#

still

lusty quest
#

i prefer to use redis, i can store there the muted users and it will send a event call if a ttl runs out, it also tells me what dataset runs out, makes it easy to manage, also you dont have to run timeouts

lyric mountain
#

just do a simple timestamp check

#

create a loop that checks timestamp every X minutes

near stratus
lyric mountain
#

if users mute start + length is smaller than current timestamp just unmute

near stratus
#

A Whole database ?

lyric mountain
near stratus
knotty obsidian
feral skiff
#

Can bots have a rpc?

lyric mountain
#

no

lyric mountain
knotty obsidian
#

am using java

lyric mountain
#

good boy

#

wise choice

knotty obsidian
#

sarcastic?

sudden geyser
#

no sarcasm

knotty obsidian
#

lies

sudden geyser
#

casually spits coffee out of mouth

#

jk

knotty obsidian
#

my friend teached me how to make bots with java

#

so im still using it

#

and everyone hates me for it

lyric mountain
#

no joke, like, java is the threading boy

knotty obsidian
#

python is better they say

#

Β―_(ツ)_/Β―

sudden geyser
#

my friend always complains about threading problems they've had developing a music bot

#

but don't get discouraged because some person online told you not to use it

#

usually they're only looking at certain surfaces

#

You should experience it for yourself and make the decision

lyric mountain
#

like, I'm a java programmer too

#

python and js stand no chance when it comes to threading

sudden geyser
#

well js has no threading

#

and python's GIL makes threading useless

lusty quest
#

js can use worker threads, as some sort of multi threading

#

but its not as well integrated as in other languages

sudden geyser
#

that's more node-central

umbral zealot
#

not really no

#

web workers also work in browser.

sudden geyser
#

ah

knotty obsidian
#

also wher can i get the discord reddit thing

sudden geyser
#

didn't know that

craggy pine
#

We're not mee6 support my dude.

sudden geyser
craggy pine
#

It's just how it returns the info shrug

#

I just want the ID part so I can use it via a URL for an image.

cinder patio
#

use a for..in loop

#

or Object.entries / Object.keys

craggy pine
#

I play playing with Object.keys / entries actually.

#

Likely the solution but figured I'd ask.

sudden geyser
#

If you mean by the ID being dynamic so you can't just access it like normal, Object.keys like fued said

craggy pine
rustic nova
#

hey hey, question about anyone who has ever worked and/or is currently working with backups on multiple servers:

So we had a recent case with an ex-developer implementing a backdoor into our system, which was not allowed as stated on their NDA, but that's a different story.

This ex-dev started deleting random files for the past week or so, without us realizing. Due to us not realizing it and us not actively making backups (which was definitely a dumb idea lmao), we lost a large portion of our files, mostly minor ones, yet partially important.

So we're thinking about using off-site backups using multiple backup servers from contabo, especially their Big SSD options, and I'm kinda thinking about getting the vps seen in the screenshot. To note, this will PURELY be used for storing backups for up/downloading.

So I generally need past experiences from users on contabo, aswell as experiences from users who either used backup servers and/or are still actively doing so. (also possibly other hosts that might be interesting)

Thanks

solemn latch
rustic nova
#

you mean the s3 vom aws? Can take a look at it ThumbsUp

sudden geyser
#

Has anyone played around with or used a time-series database (if so, what was your use case)?

solemn latch
#

I had looked into it once, not really used any though other than stuff for like graphana.

prime glacier
#
guild.channels.cache.map((ch) => {
        if (ch.type === "category") {
          categories.push(ch);
        } else {
          channels.push(ch);
        }
      });```

how to separate it like
categories separate
voice channels separate
text channels separate
vivid fulcrum
#

just use filter lol

sudden geyser
#

You want some grouping

vivid fulcrum
#

though filtering would be O(3)

prime glacier
#

oh wait

sudden geyser
#

Wouldn't it be more like O(n * 3)

vivid fulcrum
#

yeah i iwas about to say that

#

im super tired i should stop talking lol

cinder patio
#

That's still O(n) tho

sudden geyser
#

sleepℒ️

prime glacier
#
if(ch.type === "voice")
voice.push(ch)
})```
#

?

vivid fulcrum
#

don't use map

#

use a simple for loop

prime glacier
#

what do you mean πŸ‘€

cinder patio
#

discord.js has a partition method

#

which separates a collection based on a condition

#

The first snippet is exactly what partition does (but with a for loop)

tender prairie
#

Hi, I didn't get bot because of that code from top gg and now it's out of the code that I'm sending to top gg doesn't answer please what to do now πŸ₯Ί

prime glacier
cinder patio
sudden geyser
#

That just checks when your bot joins a guild/server and leaves if it's under 500 members

cinder patio
#

I think that top.gg declined their bot because of that

#

the bot left the test server right away

sudden geyser
#

oh lol

cinder patio
#

but that's just an assumption

solemn latch
#

why is guild called client πŸ‘€

#

i was so confused

tender prairie
#

I didn't know it contained Pau Code

sudden geyser
#

If that is the reason, either whitelist the test server, set a deadline before leaving, or (recommended solution) don't gatekeep your bot from joining servers solely because of the member count.

quartz kindle
#

dafuq

cinder patio
#

yup

solemn latch
#

most servers your bot will be invited to will have less than 500 users anyway

tender prairie
#

My boot is taken from top gg and I don't want any more 😭

vivid fulcrum
tender prairie
quartz kindle
#

thats what a boot means lol

weary crypt
#

why would you take his boot 😒

tender prairie
earnest phoenix
#

greennames are cobblers (boot developers)

sage bobcat
#

One message removed from a suspended account.

cinder patio
#

You know shit got real when you have to measure the speed of your parser in nanoseconds

tired panther
cinder patio
#

just parser

earnest phoenix
#

compilers suck at speed

cinder patio
#

        A?: fn(func: (a: a, b: b)) {
            let a = [1, 2, 3, 4, 5, 6, 7];
            for i in 0..100 {
                print(i);
            }
        },

        b: g
    }

324000 nanoseconds to get that ^ parsed - I actually don't know if that's a good thing or no

earnest phoenix
#

what lang is that

cinder patio
#

Parsed a 200-line string in 2ms

sudden geyser
#

I think it's some language he's developing

#

Feels like Rust and TypeScript

cinder patio
#

My 2 favs

earnest phoenix
#

Rust is my fav because deno runs supa fast because of that

cinder patio
#

I mean... Deno uses V8, which is written in C++

#

Only the std is written in rust afaik

earnest phoenix
#

The std is a repo of typescript modules that bring node features to deno

#

It has absolutely nothing to do with rust

cinder patio
#

then what IS written in Rust?

sudden geyser
#

The internals

earnest phoenix
#

The runtime

sudden geyser
#

CLI, core, runtime, etc.

tired panther
#

Does anyone knows a good Dark++ them of vs code for sublime text?

sudden geyser
#

A dark theme in general or a "Dark++"?

#

If it's the former SynthWave '84

tired panther
tired panther
#

searching this kind of sublime theme

crimson vapor
#

you know you could use template literal strings for that, right?

sudden geyser
#

ah

#

I don't know any then, sorry

tired panther
crimson vapor
#

yeah ik

#

also might want to use a code formatter kekw

quaint wasp
#

what does discord developer licens let u do?

sage bobcat
tired panther
quaint wasp
#

whats that?

#

I mean..

#

What does it do and stuff?

sage bobcat
#

One message removed from a suspended account.

quaint wasp
#

How do people play it?

tired panther
#

btw found one, it is named sublime-vscode-plus

sage bobcat
#

One message removed from a suspended account.

quaint wasp
#

wow

sage bobcat
#

One message removed from a suspended account.

quaint wasp
#

Do I need to have the licens to see/play them too?

#

o

sage bobcat
#

One message removed from a suspended account.

quaint wasp
#

so yes..

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tired panther
#

you can invite peoples, public

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quaint wasp
#

o well how do I play them? I dont have them..

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quaint wasp
#

Where?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

@quaint wasp Buy one from the game's discord server

quaint wasp
#

ok..

#

thats a thing?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

People with the license can put store channels on their server

quaint wasp
#

ummmm u should do it in dms next time..

sage bobcat
#

One message removed from a suspended account.

tardy hornet
#

how can i do that there will be 2 prefixes?

const prefix = ['e!', 'E!']?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quaint wasp
earnest phoenix
sage bobcat
#

One message removed from a suspended account.

tardy hornet
#

like

earnest phoenix
#

why

tardy hornet
#

all in the index

#

used to it

#

any idea how?

#

someone?

solemn latch
#

i mean, your example of two prefixes can be one.

#

when you check the prefix normally, just make it lower case, and tolowercase the input.

#

that will allow e! and E!

tardy hornet
#

and what if i use cases

tired panther
#

Which addon is a good code formatter for vs code?

crimson vapor
#

you can use the built in one kekw

sudden geyser
#

depends on the language

#

If it's JS I default to ESLint

crimson vapor
tired panther
crimson vapor
#

could use prettier

deep mantle
#

for discord.py, does client.get_user() get rate-limited?

sudden geyser
#

get_user looks from the cache I believe

#

So probably not

deep mantle
#

ok thanks

vivid fulcrum
#

if it isn't async then it's just a cache lookup

earnest phoenix
#

discord py also handles ratelimiting

sudden geyser
#

yeah just cache

deep mantle
#

thanks

tardy hornet
#

const prefix = 'e!' 

 if(!message.content.startsWith(prefix)){return}

how can i make that even if its E! and not e! it will work as a prefix?

sudden geyser
#

Convert the content to lower case

#

with .toLowerCase()

tardy hornet
#

i did and it did not work

sudden geyser
#

Then you did it incorrectly

#

Can you show your implementation

umbral lake
#

hey

#
client.on("presenceUpdate", (oldPresence, newPresence) => {
    const leguild = client.guilds.get("839892155891318854"); 
    const rolemdrr = leguild.roles.cache.find(role => role.id === "839894783928696893");
    if (newPresence.activities[0] && newPresence.activities[0].state.includes(".gg/candys")) {
        newPresence.member.roles.add(rolemdrr)
    } else {
        newPresence.member.roles.remove(rolemdrr)
    }
});
sudden geyser
#

hi

umbral lake
#

whats not works?

#

its when

sudden geyser
#

Did you enable intents?

umbral lake
#

oh

#

wait

tardy hornet
sudden geyser
#

You need to convert the content (message.content is the content of the message as a String) to lower case (.toLowerCase() on a string)

#

Then you can check if it .startsWith(prefix)

tardy hornet
#

something like

#
if(!message.content.startsWith(prefix).toLowerCase()){return}
#

wait no it wont work

vivid fulcrum
#

re-read what lite said

crimson vapor
#

whats the point of using {} if you are keeping it in the same line?

pale vessel
#

yes

umbral lake
#

@sudden geyser its says: client.guilds.get is not a function

earnest phoenix
umbral lake
#

oki I test

long marsh
#

Anyone here use OVH?

umbral lake
#
client.on("presenceUpdate", (oldPresence, newPresence) => {
    const leguild = client.guilds.cache.get("839892155891318854");
    const rolemdrr = leguild.roles.cache.find(role => role.id === "839894783928696893");
    if (newPresence.activities[0] && newPresence.activities[0].state.includes(".gg/candys")) {
        newPresence.roles.add(rolemdrr)
    } else {
        newPresence.roles.remove(rolemdrr)
    }
});
#

@earnest phoenix remove is undefined

long marsh
#

Trying to open a port on OVH for the /dblwebhook, but their firewall settings don't exactly seem to be allowing it from the provider. I just need to open TCP 3000 right?

#

Well, the port I chose was 3000

#

Nvm - I'm an idiot

knotty obsidian
#

Is there anything simular to os time in java?

solemn latch
#

like getting the epoch time?

#

System.currentTimeMillis();

knotty obsidian
#

ok thx

#

that gets the milliseconds right

solemn latch
#

yep

knotty obsidian
#

k so i just /1000 and i get the second

#

k nice

#

wait what type does it return?

#

a string, int or long

solemn latch
#

long

boreal iron
#

cough been called bigint over here oldEyes

lyric mountain
#

long makes more sense

#

it's a long value

cinder patio
#

y'all know what else is long?

solemn latch
#

bigint and long is not the same thing in java

cosmic forum
#

Anyone know how I could check if a string entered, for example, aakhilv.me, is a valid domain using nodejs?

sudden geyser
#

If you'd like to verify its existence, you'd probably need to send a request to the site.

#

You can use the url to verify if a URL specified is valid (but not if it's accessible)

cosmic forum
#

Ah, so something like this?

let fetch = require("node-fetch");

fetch("https://example.com")
  .then(req => {
    if (req) {
      // Do something...
    } else {
      // Do something else...
    };
  });
sudden geyser
#

I think it would error if it couldn't reach the site for some reason (.catch((err) => {...})).

cosmic forum
#

ah ok, thx

proven lantern
cosmic forum
#

Lite's answer works best I believe.

proven lantern
cosmic forum
#

I see

#

thanks

quaint wasp
#

How do I controle where things are with HTML? Bc my site kinda looks messy..

placid iron
#

CSS

quaint wasp
#

o...

#

ummm

#

whats that? Is that like html or is it totatly different?

quartz kindle
#

css and html work together

#

they are totally different in how they are used but are essentially two halves of the same thing

#

html is the architect, css is the designer

neat oxide
quartz kindle
#

scripting languages used in website development

lyric mountain
#

a web page has 3 elements

#

css, html and js

#

remove one and u have a shitty page

quiet pawn
#

im trying to make a command to grab system info on the bot like uptime and cpu usage any ideas?

#

(js)

lyric mountain
#

uptime just store the starting millis when u boot up

#

then compare with current millis

#

cpu usage idk

quiet pawn
#

what about cpu suage?

#

o oki

#

i've only found out how to log it to console

#

not in a message

lyric mountain
#

dot dot dot

#

just send the message then

#

same thing

quiet pawn
#

wont work

lyric mountain
#

how so?

quiet pawn
#

it wont send in the embed

#

just get a error

lyric mountain
#

then build the embed

quiet pawn
#

saying its not defined

quiet pawn
#

lol

lyric mountain
#

you need to define the variable lul

#

know what? show code

quiet pawn
#
const Discord = require('discord.js');
const Discord = require('discord.js');
var os = require('os');
const osu = require('node-os-utils');
const cpu = osu.cpu
var osutils = require("os-utils");


module.exports = {
    name: 'botinfo',
    description: 'botinfo',
   async execute(client, message, args, command) {  
if(message.author.id === "411704274599542794" || message.author.id === "681276518051348509" || message.author.id === "308440976723148800" || message.author.id === "427103309199835138" || message.author.id === "826127445592768602" || message.author.id === "712797947699527711"){    
        


     var usedMemory = os.totalmem() -os.freemem(), totalMemory = os.totalmem();

     var  getpercentage = 
    ((usedMemory/totalMemory) * 100).toFixed(2) + '%'

  
    osutils.cpuUsage(function(v) {
      console.log("CPU Usage (%) : " + v);
   });


    const embed = new Discord.MessageEmbed()
        .setTitle(`${client.user.tag} INFO`)
        .setColor(3447003)
        .addField('Bot INFO Below', '\u200B' )
        .addField("Server Count", `${client.guilds.cache.size +1} Servers`, true)
        .addField("Total Member Count", `${client.guilds.cache.reduce((a, g) => a + g.memberCount, 0)} Users`, true)
        .addField("Bot Latency", `${Date.now() - message.createdTimestamp}ms`, true)
        .addField("API Latency", `${Math.round(client.ws.ping)}ms`, true)
        .addField('System INFO Below', '\u200B' )
        .addField("Used Ram", `${getpercentage}`, true)
        .addField("Ram used in GB", `${(usedMemory/ Math.pow(1024, 3)).toFixed(2)}GB`, true)
        .addField("Up Time", osutils.sysUptime() + `ms`)

        .setTimestamp()

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

how it gets cpiu usuage

    osutils.cpuUsage(function(v) {
      console.log("CPU Usage (%) : " + v);
   });
lyric mountain
#

now the error

quiet pawn
#

1 sec

lyric mountain
#

btw, thats one long if

quiet pawn
#

?

#

u can see usage at top

#

and the bottom error is trying to send to embed

#

oki so

#

i feel really dumb

#

i fixed it

earnest phoenix
quiet pawn
#

o

#

pog

#

thank you

distant cobalt
#
const Discord = require('discord.js');

module.exports = {
    name: 'ping',
    description: "this is a ping command!",
    execute(message, args){
        const msg = message.channel.send('Pinging...')
        const client = new Discord.Client()
        
        const embed = new Discord.MessageEmbed()
            .setColor('RED')
            .setTitle('Pong!')
            .addFields(
                {name: `Websocket heartbeat: `, value: `${client.ws.ping}ms.`},
                {name: `Roundtrip latency: `, value: `${msg.createdTimestamp - message.createdTimestamp}ms.`}
            )
            .setTimestamp()
        message.channel.send(embed)
    }
}``` why doesn't this work
#

It says NaNms

#

Not a number

sudden geyser
#

You shouldn't be reinstantiating the client.

distant cobalt
#

wdym?

sudden geyser
#

Your second issue is .send returns a promise

umbral zealot
#

means const client = new Discord.Client() should not be here. you should only have one of those

sudden geyser
#

You should get the client instance through message.client

umbral zealot
#

also yes, await or resolve the send, that's a promise

sudden geyser
#

and resolve the promise returned by message.channel.send(...)

distant cobalt
umbral zealot
#

yes

distant cobalt
#

alr.

umbral zealot
distant cobalt
#

ok

sudden geyser
#

you probably only need the mdn references

distant cobalt
#

how do i get the original client instead of making a new client/

#

cuz i think that's the problem.

sudden geyser
#

Like I said,

You should get the client instance through message.client

distant cobalt
#

ok.

sudden geyser
#

message was defined as a parameter for your execute function.

distant cobalt
#

alright

#

thank you guys, it works.

umbral zealot
drifting wedge
#
  let e1 = document.getElementById("serverevents");
  let e2 = document.getElementById("botactions");
  let e3 = document.getElementById("warnings");
  let e4 = document.getElementById("jl");
  e1.classList.remove("audit_log_selector_item_selected");
  e2.classList.remove("audit_log_selector_item_selected");
  e3.classList.remove("audit_log_selector_item_selected");
  e4.classList.remove("audit_log_selector_item_selected");

  s = document.getElementById(s);
  s.classList.add("audit_log_selector_item_selected");```
any way i can do like a loop for this?
sudden geyser
#
for (const id of ["serverevents", "botactions", "warnings"]) {
  document.getElementById(id).classList.remove("audit_log_selector_item_selected");
}```
#

then stuff afterwards

#

I don't know where you're getting s for your assignment to s though.

drifting wedge
#

its in the params of a func

#

forgot to add lol

#

but this is all in a function

distant cobalt
#
${channel.createInvite({ temporary: false, reason: 'Command used.'})} ``` is this right? cuz it doesn't work.
umbral zealot
#

That also returns a promise

distant cobalt
#

oh

#

what should i do?

umbral zealot
#

Read the resources I linked earlier to understand promises.

distant cobalt
#

Ok

#

I'm kinda confused.

umbral zealot
#

Then you should read more

#

and stop skimming resources

sudden geyser
#

It's okayβ€”you'll learn to use them through more reading and practice.

distant cobalt
#

ok

umbral zealot
#

Me: sends 25 minutes worth of reading
2 minutes later
Them: "I don't get it!"

pale vessel
#

What am I supposed to read anyway, right?!

untold token
#

So I have email through my web host, but when I route things through Cloudflare it's impossible to hide the origin IP for the email stuff because every time an email is sent the IP is included in the header, so I'm trying to find an alternative solution because I realize that I cannot have my email hosting from my web host because of this imshy only problem is that all involves spending money. Is it worth it? And does anyone with email on a custom domain have any suggestions as to how to go about this? I was just doing email things through my web host until I realized this was how it all works lol

#

I just need a new solution now cause I'm no longer comfortable with it now knowing this 02thinkinggif

earnest phoenix
#

I did not got a dm from Luca?

#

@gilded plank

umbral zealot
#

Turn on your DMs then. It's also possible it didn't send it - happens sometimes.

#

but you definitely did get a ping in #logs though, so, it's fine.

earnest phoenix
#

Oh

#

Ty

boreal iron
# untold token So I have email through my web host, but when I route things through Cloudflare ...

If you wanna host a serious mail service not being marked as spam by the recipient or being blacklisted by global listing services you will have to publish the mail servers IP address.
A valid RDNS record is also required not to issue the problems mentioned above.
As well as SPF, DKIM & DMARC are policies you have to setup to get trusted.

If that’s nothing for you at all you can actually use global mail gateways by Amazon, Google etc.

untold token
#

The problem is exposure of the web server IP, which is why I need an alternative to using my web hosting for email.

#

i.e. I just need another mail host or some other way to use my domain for email.

opaque acorn
#

one question. If I publish my bot but it's not finished yet but it has enough things to publish, can it be published?

#

then update the bot frequently

untold token
boreal iron
untold token
boreal iron
#

Well that’s unfortunate.
I guess you have no other choice than switching the provider or rent a separate server if that’s necessary.
Splitting up your services like I explained above between IPv4 and IPv6 is also a bad choice due the lack of IPv6 support (still).

#

At least I don’t know a different way.

untold token
#

Another thing I don't understand is why a secondary IP would help because they both just point to the same server anyway

#

And if I'm incorrect about that in regards to web/email hosting, then it still holds true to using the same VPS, if I was to go that way instead

umbral zealot
#

As someone who's worked for ISPs in the past : don't try to host your own SMTP server or send emails directly. You do not want to do that.

untold token
#

I know

#

It's annoying

#

And time-consuming

boreal iron
#

You said you don’t wanna expose the web servers IP.
Binding these services to two different IPs will end up in the same machine but it’s not possible for the client to detect that.

umbral zealot
#

There are plenty of services for this. Sendgrid being one of them.

untold token
#

I did it before, stopped when my VPS shit itself

umbral zealot
#

You literally just want to use something like sendgrid to send emails, that's it, problem solved.

untold token
#

I can use a different service to send?

umbral zealot
#

well it's going to use an SMTP anyway, of course, but I do believe it's possible to hide the originating IP.

boreal iron
#

Like I said already or using mail gateways (which will still expose your IP)

umbral zealot
#

Another one is mailchimp

#

So mailchimp or sendgrid, just do that.

untold token
#

I have 11 domains, I need a solution that wouldn't cost a fortune LMAO checked out ProtonMail and it doesn't look like that would be super cost-efficient
I'll take another look at MailChimp and I'll check out SendGrid

#

I understand there's no way to hide the origin IP, it'll always be exposed, but I just want it to not be my web server lol

#

And if possible, I'd prefer to hide my own IP as well for when I'm using Outlook and such. Can that be done at all? @umbral zealot

umbral zealot
#

No

boreal iron
#

Just to say you can even create an AOL email and use the SMTP authentication to send mails from any of your servers.
Which is possible by any (probably) mail provider.

umbral zealot
#

Unless you use a vpn or proxy, obviously

untold token
#

Right

#

Alright so avoid Outlook from now on lmao

#

(and ofc apps like it)

umbral zealot
#

Avoid sending emails at all if you're not on VPN and want to hide your IP.

untold token
#

I mean I'm able to send from RoundCube and only the server's IP is exposed

boreal iron
#

RoundCube is a mail client not a server

untold token
#

You're missing what I'm saying.

#

I know it's a client, I'm saying that it doesn't expose my IP, it exposes the server's IP.

boreal iron
#

The sending process has to follow the protocol

untold token
#

Unlike Outlook and other client apps which expose my IP.

boreal iron
#

Yeah

#

Simply test a few services by creating a script to send a test email changing the SMTP authentication credentials to see which one doesn’t

untold token
#

Ugh, why can't these services just be simple and tell me they'll just give me email hosting with custom domains

#

Gotta be obscure asf and oversimplify by saying "Custom Branding"

umbral zealot
#

Sendgrid and mailchimp don't "host" emails

untold token
#

And pile on all this other crap

#

Ehh

umbral zealot
#

they just... send. it's marketing services.

untold token
#

See idk anything about that

umbral zealot
#

It's meant to send and track emails

untold token
#

I just want mail hosting ;_;

umbral zealot
#

see who opened it, etc

#

Then your choices are basically Google and... google.

untold token
#

lol

umbral zealot
#

Making your own email server is fucking hell. don't do it. don't go there.

untold token
#

I have before

#

It's not fun

umbral zealot
#

it's not worth it

untold token
#

Couldn't even manage to do it on Linux, Windows Server was much easier

boreal iron
untold token
#

That's what I'm dealing with now, it's just that the mail exposes the same IP as the web server

#

There's no way to separate the two and there's no way for me to purchase another IP to begin with

#

They only offer that for VPS

boreal iron
#

Well then switch to a VM

#

Both web and mail server don’t consume much resources

#

An IP should be what.. $1 / month

untold token
#

I could just get a VPS exclusively for mail server zymochaidk

boreal iron
#

I wonder why your web server needs to be a dedicated server

untold token
#

But then I'd have to look into figuring out how to host a mail server on Linux, again. Like I said, way easier on Windows

boreal iron
#

What type of server is your server?
Dedicated or VM

untold token
#

VM

boreal iron
#

There’s actually no VM, VPS, Cloud etc.
A server can only be a dedicated one or a virtual machine

untold token
#

I have a web hosting package for all my domains, and I have a VPS
The mail comes with the web hosting package, but it uses the same domain as the web shit itself, so it's impossible to hide the IP unless I use something else for mail

boreal iron
#

just to say

untold token
#

Look I understand this, a VPS is a VM, who cares whether you call it a VPS or not, it's a VPS

#

I don't get the big deal

boreal iron
#

That was not exclusively for you

untold token
#

Ah

#

Well I mean I have another idea

#

Why even go through effort to hide the IP at all?

#

Is it really necessary?

boreal iron
#

I don’t know.
You said you need it.

untold token
#

I mean yeah, I want my shit to be secure

boreal iron
#

Hmm just binding the services to different IPs is far away from being secure

untold token
#

God why would GG set it up like this, it makes it impossible for people who actually care about hiding the IP to actually do so and use all the features they're paying for

#

It's stupid as hell

boreal iron
#

A proper firewall setup on the machine as well as a dedicated firewall and the required network knowledge will help but will never make you safe
That’s how the net is

untold token
#

You know what I mean

#

I just don't want the web IP out there, makes Cloudflare entirely redundant

boreal iron
#

Going further supporting SSL for your mail service RDNS will also require a webserver listening to the FQDN

#

Anything else unsecured is worse then writing a letter by hand and throwing it on the street

#

Making your own email server is fucking hell. don't do it. don't go there.

untold token
#

Idk why she said that, idk what part about it is hell

#

Worked out fine for me on Windows

#

Pretty easy

boreal iron
#

Even if it’s not he’s a little bit right, too

untold token
#

She*

boreal iron
#

Well setting the service up is but anything around can get difficult

rocky hearth
untold token
#

Because you haven't ensured that the channel type is one that actually has bulkDelete() @rocky hearth

#

DM's do not have it, for example.

rocky hearth
#

I checked, if its not dmchannel

umbral zealot
#

lol ts

untold token
#

Doesn't matter, you're working with the same property and the property type doesn't care whether you've already checked if it's a DM

#

The DMChannel type is included in the type of that property, regardless.

rocky hearth
#

but it does work before. in v12

#

im runing v13

umbral zealot
#

maybe they broke the types

untold token
#

You do realize they can update the types, yes?

rocky hearth
#

Ive used that checks alot.

untold token
#

And?

rocky hearth
#

ooh ok then

untold token
#

If they've changed the types, you have to adapt.

#

It's the way these updates usually go.

#

Every major update to Discord.js breaks something. It's been like that for ages.

#

@umbral zealot When you said that hosting your own mail server is hell, what did you mean exactly?

umbral zealot
#

I mean, if you do eventually figure out how to run all the software required, configure all the systems, the routers, the domains, the records, you realise soon enough that you will be blocked left and right by providers because you're sending mails and they don't know who you are.

#

One spam report and you're blacklisted.

untold token
#

But I used hMailServer last time and it worked fine?

#

I don't understand

boreal iron
boreal iron
untold token
#

My only issue with spam was because RDNS wasn't set up correctly, which I ended up fixing. Everything else was relatively straightforward

untold token
#

I can set up my own DNS records and I know how firewall works.

#

hMailServer does have a backup mechanism though.

#

Only thing is it's for Windows

boreal iron
#

I know but no auto backup and it’s not meant to handle big database sizes.

untold token
#

That last part may be correct.
The auto-backup part is not.

boreal iron
#

The integrated backup is to restore your server on a different hmailserver setup not to do redundant backups with integration checks.

#

Doesn’t mean hmailserver is bad

#

We’re moving far away from the original topic... I really need to sleep.

#

Just one thing...

#

If you switch to a VPS and wanna go on using hmailserver then choose a provider offering KVM access for the VPS as well as the possibility to install own OS images.
This will allow you to use Windows server without paying ridiculous license fees.
@untold token

untold token
#

I know this

#

But I have my own Windows Server licenses anyway

#

I'm not gonna do that

boreal iron
#

if all of that is necessary needed anyways

#

Well then not much more to say here... okeh

rocky hearth
#

If I Structure a class, what is the proper way of define its extended types and methods? in ts

untold token
#

I'm just gonna point out that the proper wording is to "extend" a class using Structures.extend()

#

Because Structures is a class, not a method of some sort (i.e. it's a noun and not a verb)

#

That would be a #support question, but the answer is at least 2-3 weeks. @delicate shore

untold token
#

@boreal iron @umbral zealot So I spoke with my host and got a bit of a clearer answer that I can live with. The IP is pretty well DDoS protected so I can really just live with the added risk of emails exposing it without any huge consequences. I'm just gonna leave the rest of it going through Cloudflare because of the other benefits it provides. Thanks for discussing it with me you two 02lovelove

umbral zealot
rocky hearth
#

No the new methods wont show up, in the instances provided by the library.
Like if I Structure the Message, and define a new method called, reactAllSync()
it wont show up, on the message event
@untold token

blissful coral
#

SO

#

I have this

#

In a JSON format

#

I need to go through each value and if it starts with command# do something with this

#

and I can't think about how for some reason

rocky hearth
#

each value or key?

blissful coral
#

key

#

then read the value of each key after

#

so a for loop of the whole thing and inside check if it starts with command# and parse the second part of it if it does

#

and then do stuff in my db with those values

rocky hearth
#

doesn't this format help u!

{
  "command#" : {
    "baby": true,
    "back": false
  }
}
umbral zealot
#
for (const [key, value] of Object.entries(yourdata)) {
  if(val === 'on') {
    // do something
  } else {
   // something else 
  }
};
rocky hearth
#

([key, val]) => ??

umbral zealot
#

ah yes probably

rocky hearth
#

he also want to check if key starts with command#

umbral zealot
#

well they can add that to the condition

#

the skeleton is there, I'm not gonna write the entire thing for them, yeah?

blissful coral
#

or would I pass a normal body?

umbral zealot
#

Object.entries is an actual function

#

yourdata would be your object

#

as an object, not as a string, of course. PArsed, not stringified.

blissful coral
#

Thought so

#

thx

untold token
#

Only structures can, as implied by the Structures naming

#

Not all classes are structures

#

And if I remember correctly, Message is one of them.

#

Well shit. Message is an extendable structure.

#

Can you show the code you're trying to use? Also, you have to call Structures.extend before your Client is instantiated. @rocky hearth

rocky hearth
#

all these classes can be exteded

untold token
#

Yes I know this, I checked, and corrected myself above

#

Again, please share your code

#

And/or do what I told you, which is to do it before instantiating the Client.

low river
#

i need a little help

blissful coral
#

When I run this in console it works

#

But when I run it inside the validateselect() function it doesn't

untold token
#

^

low river
#

alr so
i have some commands added in my bot
and if i trigger a command which is not there in the bot its just stops

blissful coral
#

any idea why it would do that?

low river
#

i think it has something to do with this

if(command.permissions.length){
        let invalidPerms = []
        for(const perm of command.permissions){
          if(!validPermissions.includes(perm)){
            return console.log(`Invalid Permissions ${perm}`);
          }
          if(!message.member.hasPermission(perm)){
            invalidPerms.push(perm);
          }
        }
        if (invalidPerms.length){
          return message.channel.send(`Missing Permissions: \`${invalidPerms}\``);
        }
      }

    if(command) command.execute(client, message, args, Discord);```
#

the error

#

like i dont have a bite command

#

so if i do =bite

#

it gives the error and stops the bot

near stratus
#

Scroll down a little bit and send the full Error

#

*error

low river
#

eh its in parts i am using command handlers

#

oh wait

#

i tried using else continue but it doesnt work

near stratus
#

according to your case the error should be at command.execute() but it's showing at if(invalidPerms.length)

#

wait a minute

low river
#

alr

near stratus
#

how is invalidPerms not defined

low river
low river
sly sierra
low river
#

alr ill try brb

rocky hearth
#

I hv imported this file before instantiated the client

#

This is the message event listener

low river
untold token
# rocky hearth This is the message event listener

Your IDE tells you that it doesn't exist because your IDE doesn't know that it exists. It's not like it's going to check whether you've extended the class and added that. What you could do is make the class in another file (make sure to say extends Message), and then run Structures.extend using that class instead of defining a new one. Then I think when you're referencing messages you could use as and reference your extended class. I'm not sure how it all works but I believe that may work.

rocky hearth
#

yeah, that is what I hv tried to do before. But it was hack alot of work.

#

got pissed of

untold token
#

That's TypeScript for you.

#

The other solution would be to modify Discord.js itself

#

Which would result in your adjustments being lost when you reinstall or update Discord.js

rocky hearth
#

what could be done is to extend the interface of each class

near stratus
# low river
if(!command){
    return;
}
if(command.permissions){
    //the rest
}
rocky hearth
#

and declare all methods there again

untold token
#

If you're redeclaring every single method then you're not "extending" anything, you're just redefining it. You don't have to do that.

untold token
#
interface InterfaceOne extends InterfaceTwo {

}
rocky hearth
#

so how do I do it. Is there no proper way? πŸ˜•

untold token
#

why you're extending an interface I have no idea because that won't help you unless you're doing it in Discord.js's files

#

the solution I gave you above, that is the proper way

#

I know of no other

#

TypeScript is a hassle. That's just how it is.

#

And I believe any other type-supporting language you use would give you the same issue

near stratus
#

@rocky hearth I don't have much experience but
Can't you create a different interface extending Message | TextMessage and use the new Interface from then

rocky hearth
untold token
#

unless he tweaked Discord.js to do so

untold token
near stratus
low river
#

i added this

untold token
#

oh yeah that way his changes aren't permanently gone after discord.js updates

low river
#

and did not remove .length

#

and now it works

#

thx a lot

near stratus
#

^Β°^

rocky hearth
#

I hv tried this before (ignore errors)
And it worked.
But again, had to define method signatures at 2 places
@untold token

low river
#

@sly sierra thx thankyou

low river
#

how to change the name of a user in your drive

sage bobcat
#

One message removed from a suspended account.

near stratus
low river
#

yes

near stratus
#

You can change the display name of your account by doing this:
1 - Type accounts into the Start menu, then choose the User Accounts link that appears.
2 - Click the option link to change your user name and save the changes.

This will change the name as shown on the login screen (Welcome screen) and the Start Menu. It will not change the folder name, however. This is because the folder is hard-linked to your account in many (hundreds, thousands) of places, and changing the folder name will render your account unusable.

The only way to change the folder name is to create a new account, move your files over to that account, then delete the old account. Don't delete the folder itself, just the account. And only delete it when you're done getting all the files out of it that you want to keep

#

You can't change the username in folder

earnest phoenix
#

how add bot server count in top.gg page

#

bot

near stratus
#

JS, Py, C#, Go ?

earnest phoenix
#

how add server counts

#

servers

near stratus
#
const Topgg = require('@top-gg/sdk')

const api = new Topgg.Api('Your top.gg token')

api.postStats({
    serverCount: client.guilds.cache.size,
})

(Not spoonfeeding)

near stratus
earnest phoenix
#

i need to do it in description

near stratus
earnest phoenix
#

soory but what

near stratus
#

There's a Wiget section in your bot settings page
Create an wiget from there and copy the code in your bot description page

#

That's only available after you send server counts using their api

frigid mountain
#

How is this not a function

 const sayMessage = args.join(" ");
low river
#

damn coding on phone

#

how hard is it

frigid mountain
low river
#

cant deny that

vivid fulcrum
#

args is not an array

frigid mountain
frigid mountain
vivid fulcrum
#

debug your code

#

find out what args actually is

near stratus
earnest phoenix
opal plank
pale vessel
#

I literally just opened this channel...

rocky hearth
#

I'm not using any frameworks. Does that library supports slash-commads?

pale vessel
#

So disappointed.

earnest phoenix
opal plank
opal plank
rocky hearth
#

can I find any yt video using detritus

opal plank
#

you'd be using the docs, not youtube

#

im thankful there arent youtube videos

#

otherwise it would become the same mess as d.js

#

even today there are people looking at youtube tutorials from v11

tired panther
earnest phoenix
#

cn any one tell free vps

wise ibex
earnest phoenix
#

cn anyone tell how add server count in top.gg page

marble juniper
#

is this normal or is it just because I don't have something running on localhost:3000

#

also oauth2 still has thier old logo lol

sudden knoll
marble juniper
#

Youu can post ur server count using the api

#

and any of the librarys listed there

#

lol

sudden knoll
#

don't use dbl if you're python tho, use topggpy

marble juniper
#

but why

sudden knoll
#

b/c dbl is a broken lib

marble juniper
#

dblpy is the officially supported lib for python

#

only the dbl package in js is deprecteated

earnest phoenix
#

i cnt know any thing