#development

1 messages · Page 1724 of 1

shadow compass
#

that would make my day

lyric mountain
#

how much? KEKW

sudden geyser
#

yeah sure

shadow compass
#

ok well

umbral zealot
cinder patio
#

why wouldn't it

sonic basin
#

ok

shadow compass
#

but is there any way to do that pinging every minute thing

sonic basin
#

then i give it a try

umbral zealot
#

just don't do it

shadow compass
sonic basin
#

but don't do it

lyric mountain
sudden geyser
#

Yeah it's easy, but it's discouraged so no

shadow compass
#
  • its more practice
sonic basin
#

tell the man

umbral zealot
#

Tell him to fuck off and you won't do things that break the terms of service

sonic basin
#

to not

lyric mountain
#

you "can" eat metallic sodium

#

but you shouldn't

umbral zealot
#

yes

sonic basin
#

or tell the man "make your own bot"

lyric mountain
#

very against tos

sonic lodge
#

does he want to publish that bot to bot lists

sonic basin
cinder patio
#

Why are they making you do a bot anyways 😛

sonic basin
lyric mountain
sonic basin
#

not appears, bot testers won't allow it

shadow compass
#

thanks for your time

sonic basin
#

anybody knows what that M char means?

lyric mountain
#

modified

sonic basin
#

but i saved it

lyric mountain
#

it's still modified

#

you probably enabled VCS

cinder patio
#

but you haven't pushed it

sonic basin
#

ohh

#

i don't want bc i host it on my server pc

#

bruh

#

ok I can live with that M

lyric mountain
#

no you cant

sonic basin
lyric mountain
#

just do git commit -m"added new files"

umbral zealot
#

This means you did not commit this file to git

#

it's only on your local computer

sonic basin
#

ok i know

umbral zealot
#

you need to commit and push

cinder patio
#

🤨 why don't you want to push your changes to github

lyric mountain
#

non-committed files are still prone to being lost

sonic basin
lyric mountain
#

as I said

sonic basin
cinder patio
#

you can make the repo private

lyric mountain
#

git commit -m"update"

lyric mountain
sonic basin
#

how

misty sigil
#

just make the repo private

sonic basin
#

I'm not english so it is a little bit hard to explain

lyric mountain
#

that said, you SHOULD 1001% use git

cinder patio
#

You can delete the .git folder too if you don't want to bother

lyric mountain
#

else your files are as fragile as a toast in a hurricane

solemn wedge
lyric mountain
#

also don't forget to add config.json to .gitignore

#

you can never be too safe

umbral zealot
#

did we mention we should use .gitignore to hide the config.json?

crimson vapor
#

I don't think so

sonic basin
#

thanks

#

tomorrow i make it open-source

#

I know

cinder patio
#

and make sure you hide the .gitignore by adding it to the config.json file

cobalt spruce
#

what did happen to replit hosting thing?

#

even i have console thing

#

the bot wont even launch

cinder patio
#

your app needs to listen to a port

#

don't comment out the server

cobalt spruce
#

my discord bot

cobalt spruce
#

u can see that in the code

cinder patio
#

I just told you, your app needs to be listening to a port afaik. Create a simple http server so your bot runs. you don't need to do anything with it

cobalt spruce
#

can i send you the repl link?

safe ruin
#

Hello guys, I have a music bot and it gives an error like how to fix it " TypeError [ERR_INVALID_ARG_TYPE]: The “listener” argument must be of type Function "

vivid fulcrum
#

what's your code

cobalt spruce
#

discord js

safe ruin
#

I'm looking for a screenshot of the error pls wait just a sec

vivid fulcrum
#

it's just a module based event listener

#

stolen of course

#

not their code

cobalt spruce
#

am using a npm called slappey to make it easier

lyric mountain
safe ruin
#

and this is error.

vivid fulcrum
#

why are you copypasting code

lyric mountain
#

The Easy Way™️

vivid fulcrum
#

also the product of copypasting

lyric mountain
#

The Easy Pasta™️

vivid fulcrum
#

i hate it when people program in their own local language

#

that's so dumb

cobalt spruce
#

take alook at ur dm

woeful pike
#

let 🌯 = 1;

vivid fulcrum
cobalt spruce
#

i didnt copy past

#

lol

solemn latch
#

woo.eat(🌯);
console.log(🌯); // 0

safe ruin
#

how can i fix it

vivid fulcrum
#

re-write your code in such a way that it's actually yours and in a way that you understand what it does

cobalt spruce
#

ur telling rewrite ur code

vivid fulcrum
#

cant even mention them cause cancer username

cobalt spruce
vivid fulcrum
#

???

#

i dont have a public bot

cobalt spruce
#

i know

#

bruh

vivid fulcrum
#

what was the point of your message????

lyric mountain
#

also what's up with eval cmds?

cobalt spruce
#

idk

cobalt spruce
#

isnt it true cry?

lyric mountain
#

???

vivid fulcrum
#

literally what are you trying to do lol

#

insult someone or what

cobalt spruce
#

u can say weird or lazy

vivid fulcrum
#

i didn't tell you to re-write it

cobalt spruce
#

both works

vivid fulcrum
#

i was referring to the person with the cancer username, not you

lyric mountain
#

but anyway, doesn't look like you have much code

safe ruin
#

Thanks man

lyric mountain
#

a rewrite is still doable

solemn latch
#

am i the only one that rewrites code quite a lot? 👀

safe ruin
#

problem solved. but why is it giving such an error? Is there a document that explains this?

umbral zealot
#

I do that shit constantly

solemn latch
#

I just wrote a crap ton of code yesterday, planning on rewirting it next week because i am confident I can make it cleaner.
thats part of development imo.

umbral zealot
#

yep, absolutely

lyric mountain
#

let's say I hope there isn't a fourth

solemn latch
#

4th is no fun.

#

3rd and im done for a few months atleast lol

vivid fulcrum
#

i rewrote my entire database system yesterday to make it thread safe

solemn latch
#

oh pog

vivid fulcrum
#

it was not fun i was about to rip my hair out

lyric mountain
#

gotta say, that was more effective than I thought

solemn latch
#

maybe its just something that comes with experience, knowing and being willing to rewrite code?

cobalt spruce
lyric mountain
#

code rewrites are something that come after you look at your code and think "damn that shit's disgusting"

#

then you suddenly get the urge to rewrite it

cobalt spruce
lyric mountain
#

nah, non-working codes are easily solvable

cobalt spruce
#

but not for me

sudden geyser
solemn latch
#

oml

sudden geyser
#

hey at least its a zero cost abstraction

vagrant prairie
#

hi

#

my bots been in review for so long

opal plank
#

Atom added bot (7h ago)

opal plank
#

would it be bad to setup a selfbot to reply with that ? THINKING

dusky sundial
vagrant prairie
#

a

#

how did u

lyric mountain
opal plank
#

not like it would be that hard at all tbh

vagrant prairie
#

lol

opal plank
#

if only 80% of .js libs accepted user tokens

vagrant prairie
#

xd

opal plank
#

eris accepts it

#

some old branches of d.js do too

opal plank
#

and i think even detritus can do it

vagrant prairie
#

a bot gets declined in 6 days

#

my bot got declined 2 times(bcz of it being offline due to i didnt have vps, now i do)

#

each with 6d gap

#

;-;

#

i think

dusky sundial
#

The wait time changes all the time, we don't decide the time it takes. That's just how it is

vagrant prairie
#

how many bots do u get?

#

every day

#

approximately

dusky sundial
#

Not sure, probably in the hundreds

vagrant prairie
#

oh god

#

how many are accepted

modest maple
#

hunreds

#

and hundreds

vagrant prairie
#

cause

dusky sundial
#

I believe the accept rate is about 30%

vagrant prairie
#

there is a botghost bot in there

#

A BOTGHOST

#

.COM

opal plank
#

thats one sketchy link

vagrant prairie
#

FUDGING BOT

dusky sundial
#

botghost is fine, as long as they have 5+ custom commands

vagrant prairie
#

oh no

#

u got my ip

#

;-;

#

or not

modest maple
#

CoffeeSip talk about freaking out

vagrant prairie
#

Decline Rate
69.24%

#

69%

opal plank
#

ik, but still one sketchy af link

vagrant prairie
#

Queue size
2.6K

opal plank
#

also wtf

#

why doesnt it fit to screen?

#

yikes hardcoded sizes

vagrant prairie
#

do F

opal plank
#

gotta be on 75% to fit it all

#

imagine not using viewport

hollow bronze
#

!fuck @lyric mountain

opal plank
#

oh shit this aint general

#

fair assessment

vagrant prairie
#

my bot

opal plank
#

too bad top.gg removed the referrals

soft glade
#

i have a money or economy bot should i call it and my deposit and withdraw commands onlu work if you type how much you want to take in or put out instead is it possible to say "all"
What would i change on here to make it do that?

@client.command(aliases=['dep'])
async def deposit(ctx, amount=None):
    await open_account(ctx.author)
    if amount == None:
        await ctx.send("Please enter the amount")
        return

    bal = await update_bank(ctx.author)

    amount = int(amount)

    if amount > bal[0]:
        await ctx.send('You do not have sufficient balance')
        return
    if amount < 0:
        await ctx.send('Amount must be positive!')
        return

    await update_bank(ctx.author, -1 * amount)
    await update_bank(ctx.author, amount, 'bank')
    await ctx.send(f'{ctx.author.mention} You deposited {amount} coins')
opal plank
soft glade
#

......................

#

hm

#

i gotta see if thats true

opal plank
#

dunno py, but usually people would account for decimals and other shit like that

soft glade
#

i dont think it does

opal plank
#

try it

soft glade
#

ok

dusky sundial
soft glade
soft glade
#

thank you

opal plank
soft glade
#

no errors

opal plank
#

its weird how my least used refferrers are top.gg

dusky sundial
opal plank
#

right up there

twilit hemlock
#

How to make a shown in {} guilds status

soft glade
twilit hemlock
#

JS

opal plank
twilit hemlock
#

you know the bot status

#

It will say

opal plank
#

yes

twilit hemlock
#

shown in 100 guilds

soft glade
opal plank
#

which library u using?

twilit hemlock
#

Yea

opal plank
#

@twilit hemlock

twilit hemlock
#

read

dusky sundial
twilit hemlock
opal plank
soft glade
opal plank
#

thats a language

#

not a library

twilit hemlock
#

Idk

dusky sundial
#

of course you need something inside the if statement as well. I assume you know python

opal plank
#

discord.js? eris.js? detritus.js? discordrose?

twilit hemlock
#

Discord.JS

opal plank
#

<client>.setActivity()

twilit hemlock
#

I have it to set activity

opal plank
#

use string templates to get how many guilds is in ur cache

twilit hemlock
#

I just need to shoe members

opal plank
#

members or guilds?

twilit hemlock
#

rn it just says something

#

Guilds

#

How many servers it’s in

opal plank
#

<client>.guilds.cache.size

twilit hemlock
#

Let me get my code

#

Ok

opal plank
#

that'll get you your guild count

#

then just add that on the string

twilit hemlock
#

Sec

#

How can I change this to add that, I’ll just delete the randomizer


const activities = [
    "Getting Created",
    "Jack is good",
    "OK",
  ];
  
  bot.on('ready', () => {
      setInterval(() => {
        bot.user.setActivity(activities[Math.floor(Math.random() * activities.length - 1)], { type: 'PLAYING'})
        .then(Presence => console.log(`Activity set to ${Presence.activities[0].name}`))
        .catch(console.error);
      }, 5 * 60 * 60); // 1000 ms = 1s, 1s * 60 = 60s (1m), 1m * 60 = 1h
  });
#

it won’t colorize cause I’m on mobile

opal plank
#

so what am i suppose to look?

twilit hemlock
#

how to add the guilds into that

opal plank
#

onto ur activities

twilit hemlock
#

Yea

opal plank
#

yea

twilit hemlock
#

Nevermind

#

I’ll just figure it out

opal plank
#

i literally just gave u the answer

twilit hemlock
#

I literally just asked a question

opal plank
twilit hemlock
#

Ok

vagrant prairie
#

my bot

#

is

#

an

#

abomination

opal plank
#

mine too

vagrant prairie
#

its an abomination

#

of minecraft

#

minecord

#

dank memer

opal plank
#

oh, mine is just a genshin abomination

vagrant prairie
#

lol

#

like'

#

who needs

#

d!helpdm

#

or d!creditdm

#

lemme find out how many files only for commands

#

one second

#

43

#

43 FUDGING FILES

lyric mountain
vagrant prairie
#

anyone there?

opal plank
vagrant prairie
#

good point

#

is using anything besides online illegal for bots?

#

e.g

client.user.setPresence({
    status: "idle",  // You can show online, idle... Do not disturb is dnd
    activity: {
      name: `v 1.2.3 | ${client.guilds.cache.size} servers | d!help`,  // The message shown
      type: "WATCHING" // PLAYING, WATCHING, LISTENING, STREAMING,
    }
  });```
or 
```js
client.user.setPresence({
    status: "dnd",  // You can show online, idle... Do not disturb is dnd
    activity: {
      name: `v 1.2.3 | ${client.guilds.cache.size} servers | d!help`,  // The message shown
      type: "WATCHING" // PLAYING, WATCHING, LISTENING, STREAMING,
    }
  });```
strange moth
#

not sure why it would be 🤔

twilit geode
#
String sql = "CREATE TABLE IF NOT EXISTS warehouses (\n"
                + "    id integer PRIMARY KEY,\n"
                + "    name text NOT NULL,\n"
                + "    capacity real\n"
                + ");";

can someone help explain what this sql script does? from what I can tell it makes a table called warehouses, if there wasnt one, but idk how the \n and everything else works

opal plank
#

@vagrant prairie the only thing thats TECHNICALYL not allowed is mobile status since its not shown in the documentation

#

but its rather easy to do

vagrant prairie
#

Oki

vivid fulcrum
#

and the thing in the parentheses are column definitions

lyric mountain
#

if so, do yourself a favor and update to JDK 15 to use text blocks

wheat mesa
#

Ok so I'm probably missing something stupid here, but I'm trying to convert youtube to mp4 files, then send them through a discord bot. How would I do this? I keep getting an error of FFmpeg/avconv not found!.

const fs = require('fs')
const ytdl = require('discord-ytdl-core')
const Discord = require('discord.js')

module.exports = {
    name: 'download',
    description: 'Downloads a specified youtube URL',
    args: true,
    usage: '[URL: Youtube]',
    staffOnly: false,
    CanMentionRole: false,
    execute(message, args) {
        let stream
        let userArgs = args.slice(0).join(' ')
        try {
            stream = ytdl(userArgs, { fmt: 'mp4' })
        } catch(e) { return console.log(e) }
        stream.pipe(fs.createWriteStream('./download/DiscordVideo.mp4')).on('finish', () => {
            try {
                message.channel.send(new Discord.MessageAttachment(__dirname+'/download/DiscordVideo.mp4'))
            } catch(e) { return console.log(e) }
        })
    }
}
lyric mountain
#
String sql = """
                CREATE TABLE IF NOT EXISTS warehouses (
                    id integer PRIMARY KEY,
                    name text NOT NULL,
                    capacity real
                );
            """;
#

way better

earnest phoenix
odd stratus
wheat mesa
#

I get a ton of errors whenever I do npm install ffmpeg-static

odd stratus
#

Such as?

wheat mesa
#

nvm, just uninstalled and reinstalled it

#

So close, yet so far. Anyone know what's going wrong here?

vivid fulcrum
#

can't you directly pass the stream to send

wheat mesa
#

What would I do instead?

vagrant prairie
#

im ngl

twilit geode
vagrant prairie
#

id like that bot

wheat mesa
#

Yeah, exactly why I'm trying to make it

#

Sadly I'm failing horrendously haha

vivid fulcrum
#

don't pipe the stream into a file

#

instead

#

just pass the stream to the MessageAttachment constructor

#

you'll have to provide the file name too

#

you can do that in the second argument of the MessageAttachment constructor

#

djs will automatically consume it

wheat mesa
vivid fulcrum
#

the file name is sent to discord

#

it's not for saving locally

#

it's just so discord knows what to name the file

#

you can't have nameless attachments

vagrant prairie
#

how do i ban bots

#

from using

#

my bot

vivid fulcrum
#

check if the message author is a bot

#

if so, return out of the handler

vagrant prairie
#

in every command?

vivid fulcrum
#

just your handler lol

vagrant prairie
#

oki

#

ima try google to find the code

wheat mesa
#

Now I have this code: ```js
const fs = require('fs')
const ytdl = require('discord-ytdl-core')
const Discord = require('discord.js')
const ffmpeg = require('ffmpeg')

module.exports = {
name: 'download',
description: 'Downloads a specified youtube URL',
args: true,
usage: '[URL: Youtube]',
staffOnly: false,
CanMentionRole: false,
execute(message, args) {
let stream
let userArgs = args.slice(0).join(' ')
try {
stream = ytdl(userArgs, { fmt: 'mp4' })
} catch(e) { return console.log(e) }
//stream.pipe(fs.createWriteStream('./download/DiscordVideo.mp4')).on('finish', () => {
try {
message.channel.send(new Discord.MessageAttachment(stream, 'DiscordVideoFile'))
} catch(e) { return console.log(e) }
//})
}
}
``` Is this what you meant? I'm not sure if something is going wrong with downloading the file or if I'm doing something wrong with the MessageAttachment, but it hangs for about 20 seconds, then throws (node:15480) UnhandledPromiseRejectionWarning: AbortError: The user aborted a request.

vivid fulcrum
#

yeah, it's what i meant

#

that error is occuring at the ytdl line

#

try catch is useless at the send part because you aren't awaiting it

#

wait nvm

#

it's occuring at the send

#

just noticed the unhandled promise

#

side note, you should add .mp4 to the file name

#

anyway

#

have you tried a shorter video or something?

#

also

#

it'd be nice if you could provide the entire stacktrace

wheat mesa
lyric mountain
#

WHAT kind of filthy dependencies are those that still require 2000's java?

wheat mesa
# vivid fulcrum it'd be nice if you could provide the entire stacktrace
UnhandledPromiseRejectionWarning: AbortError: The user aborted a request.
    at RequestHandler.execute (C:\Users\jacks\node_modules\discord.js\src\rest\RequestHandler.js:93:15)   
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async RequestHandler.push (C:\Users\jacks\node_modules\discord.js\src\rest\RequestHandler.js:39:14)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9656) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
lyric mountain
#

like, java 1.8 is the reason java's reputation is so low among starters

vivid fulcrum
#

yeah that stacktrace isn't detailed

#

make your execute method async

#

and await send

#

you should get a much more detailed stacktrace

wheat mesa
#

I feel like something is going wrong with the ytdl line, I have no idea if I have to be using encoderArgs or something

#

new error is this

#
    at RequestHandler.execute (C:\Users\jacks\node_modules\discord.js\src\rest\RequestHandler.js:93:15)   
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async RequestHandler.push (C:\Users\jacks\node_modules\discord.js\src\rest\RequestHandler.js:39:14)
    at async Object.execute (C:\Users\jacks\Desktop\WaffleBot WIP\commands\download.js:21:17) {
  code: 500,
  method: 'post',
  path: '/channels/748573140766031923/messages'
vivid fulcrum
#

hm

#

code 500 means internal server error

#

which means the error isn't on your side

#

rather, it's on discord's

wheat mesa
#

Perhaps something is going wrong with the ytdl line causing discord to not like it?

vivid fulcrum
#

doubt it

#

it could be your internet speed hanging the connection for too long

#

but again

#

for a 2 second video

#

to hang it for so long

wheat mesa
#

My internet speed should be plentiful for that haha

vagrant prairie
#

@vivid fulcrum can u tell me the code

vivid fulcrum
#

no

vagrant prairie
#

pls?

vivid fulcrum
#

how much are you willing to pay

craggy pine
vagrant prairie
vivid fulcrum
#

i'm being serious

#

my precious brain cells can't work for free

vagrant prairie
#

he gonna hax bot

#

fine

#

uh

#

1mo of patreon at my bot?

#

xd

craggy pine
#

Wdym "hax bot"

wheat mesa
craggy pine
vagrant prairie
#

nono

#

he is using

#

another bot

#

to play MY bot

#

and get money

craggy pine
#

So....

#

Just ignore bots?

wheat mesa
#

If you're having trouble, a quick google search of "How to get a bot in discord.js/discord.py to ignore other bots" should answer it

strange moth
vivid fulcrum
#

lmfao i just noticed

#

it was a joke...
tab opened "joke defination"

wheat mesa
#

ugh, discord-ytdl-core isn't very popular so there's not a lot of things out there surrounding it

quaint wasp
steep drum
#

Command is not defined. It's probably not in any of those maps you're trying to retrieve it from

quaint wasp
#

it is..

vivid fulcrum
#

log it and you'll see that it isn't

twilit geode
#

so idk

#

ill look

lyric mountain
#

what?

#

like, how would using lambda prevent updating to jdk 15?

wheat mesa
#

My brain is fried

#

No idea what's wrong with this anymore

vivid fulcrum
#

have you tried using ytdl-core alone

wheat mesa
#

I'll try that rq

#

I hate life

#

It worked

#

Thank you so much for the help

vivid fulcrum
#

lmfao

#

np

#

discord-ytdl-core hasnt been updated for almost an entire year

#

nvm

#

i was looking at the wrong repo

wheat mesa
#

Crap, it doesn't get sound though

vivid fulcrum
#

yeah uh

wheat mesa
#

From what I'm seeing 360p and above need to have sound grabbed separately

vivid fulcrum
#

for higher quality videos, youtube doesn't return the video and the audio combined

#

yeah

#

you need to download separately and mux

lavish bramble
#
client.on('messageDelete', async (message) => {
  
  const logs = client.channels.cache.get('835389487134932992')
  const entry = await message.guild.fetchAuditLogs({type: 'MESSAGE_DELETE'}).then(audit => audit.entries.first())
  let user = ""
  
    if (entry.extra.channel.id === message.channel.id
      && (entry.target.id === message.author.id)
      && (entry.createdTimestamp > (Date.now() - 5000))
      && (entry.extra.count >= 1)) {
    user = entry.executor.username
  } else { 
    user = message.author.username
  }
  logs.send(`A message was deleted in ${message.channel.name} by ${user}`);
})

How can I show the message too?

zenith terrace
#

message.content

pearl trail
#

message.content?

vivid fulcrum
#

continent

wheat mesa
lyric mountain
#

18p

wheat mesa
#

lol

#

18 limits to 360p but has audio I believe

lyric mountain
#

720p is the highest you can go

#

1080p onwards remove audio

#

iirc

ember orbit
#

:0000000000

#

:000000000

#

No way

#

It’s you :000000000000000000000000000000000000000

lyric mountain
#

are you yet another speedrunner?

ember orbit
#

Yes

#

:000000

wheat mesa
#

Okay this is gonna sound stupid but... How do I edit a message sent by my bot in discord.js?

#

Nevermind, I'm just stupid

odd stratus
pure stream
#

Hey

#

does anyone know how i would create a math bot for discord.py?

#

im not sure how to get the bot to recognize certain things you say like a certain number

sonic lodge
pure stream
wheat mesa
#

After about 2 hours of troubleshooting, I'm finally realizing that my package.json file did not have discord.js listed as a dependency, and that's why my host wasn't working. I hate life so much.

long crow
#

dont hate life, life is beautiful

wheat mesa
#

Meh

#

On the bright side, my bot is not hosted 🙂

earnest phoenix
#

i neeed meme api

#

like this

#
https://meme-api.herokuapp.com/gimme
#

but indian

#

need

solemn latch
#

I dont know any meme api's

summer torrent
#

use reddit if there is indian meme subreddits

untold token
#

@lean ivy If you want absolute permission/error handling then you could check for the permission every time you perform an action that would require a particular permission - but, a framework could make it a lot less code to write.
Most publicly available frameworks won't do that though. You could write it yourself easily.

earnest phoenix
#

so

#

i need

earnest phoenix
#

i give you rebbit link cn any one make

#

pls

lean ivy
#

yeah sure I have the initial "hey I need these perms"

summer torrent
lean ivy
#

but checking every action afterwards that yall call optional

earnest phoenix
lean ivy
#

and cancelling if it cant do it

summer torrent
#
solemn latch
lean ivy
untold token
#

I use Akairo (a framework for djs)

solemn latch
#

oh ezpz, one sec

lean ivy
#

I still dont even know what youre describing

earnest phoenix
#

Bot that snipe messages plz

untold token
#

What I'm describing is a way to check for permissions and perform certain actions without having to rewrite the same code hundreds of times.

lean ivy
#

I know what a command handler is

untold token
#

After all that's pretty much the purpose of functions.

earnest phoenix
#

How do we do a bot

untold token
#

No, not a command handler

lean ivy
#

youre calling the function anyway are you not

untold token
#

You're missing what I'm saying.
What I'm saying is that you could perform the permission checks and error handling in separate functions that you call in each command, rather than writing the code over and over again.

lean ivy
#

id rather just modify djs

untold token
#

You could do that. Or you could modify an existing framework.
Or, you could just build on top of your own bot, which may be the simplest way.

solemn latch
#

from a practical perspective thats what your doing.

#

you can easily add a method to djs reactions which does the check built in.

untold token
#

To a certain extent, Structures.extend exists for this purpose

solemn latch
#

^

lean ivy
#

does djs actually send the request before throwing an error or does it already do the check itself

solemn latch
#

depends afaik.

untold token
#

^

#

Well

#

If it's doing something that requires permission, obviously it needs to send a request

lean ivy
untold token
#

From what I know it doesn't cache permissions or act on them if they exist

lean ivy
#

but thats the exact same as what im doing

#

sending a request

#

checking

untold token
#

It'll send the request and if Discord's API says you have no access, it'll say so respectively

lean ivy
#

I thought you meant for permissions

untold token
#

There's a way to check permissions without having to send the request

lean ivy
#

I know

solemn latch
#

if(message.guild.me.has("manage_messages") reaction.delete();

^ this is all you realistically need to do to not require the permission.

untold token
#

power might go out im scared

lean ivy
#

thats actually less effective

solemn latch
lean ivy
#

because the bot could have it in the channel

untold token
solemn latch
#

if you wanted to do it by channel that works too.

lean ivy
#

youre calling that a framework?

untold token
#

No

lean ivy
#

ok good

untold token
#

Wouldn't be a framework so much as just utility functions

lean ivy
#

I like your funny words magic man

untold token
#

What I'm saying is that if, in your commands, you run the same exact code for lots of commands, you can just move that code to a separate function, then just call it and pass the necessary parameters (channel perhaps, etc.). Then you can do that for every new command that you will need to use the same code in, without having to rewrite it all.

#

That, and if you end up changing it, you won't have to do it for every single command that uses it, it'll just be changed in the function.

solemn latch
#

something I would recommend you doing with your reaction menu actually since you seem to have quite a few.

untold token
#

Actually I'm gonna write this down for my next rewrite so I don't forget. I'm realizing how much code I reuse right now lol

solemn latch
#

👀 yeah rewirting some stuff currently due to this same issue.

lean ivy
#

id rather not have to require a new module each time and just check for the perm

solemn latch
#

i mean its a lot more than just that.

#

its a time saving measure for modifications down the line

latent heron
#

Its more about maintainability

#

Easier to maintained code inferred on than reused numerous times

lean ivy
#

ill just modify djs

solemn latch
#

like, if you did this from the get go, it would be a literal 2 minute fix to solve this for all your commands

untold token
#

That's a valid way to do it, but those changes won't carry over to if you reinstall/update djs.

lean ivy
#

Ill just maintain my own fork if it comes to it kek

untold token
#

Not unless maybe you fork it and find some way to deploy it yourself

#

Yup okay

lament rock
#

interfacing with Discord.js' Structures class is pretty cool, but internal stuff might change you override and stuff will break. What I've learned to do is to just make my own proprietary libs based on my needs which has worked out well for memory efficiency and being able to correctly infer types and such

#

More of an advanced topic though

#

Pain in the ass to offer feature parity when making modular interfaces such as a rest only lib and a gateway only lib. Writing a layer to merge the two would suck

twilit hemlock
#

hi

#

im using js

#

and the guy said to use <client>.guilds.cache.size

#

to display severs in my custom status.

#

idk how to implement it tho

#
const activities = [
    "Getting Created",
    "Jack is good",
    "OK",
  ];
  
  bot.on('ready', () => {
      setInterval(() => {
        bot.user.setActivity(activities[Math.floor(Math.random() * activities.length - 1)], { type: 'PLAYING'})
        .then(Presence => console.log(`Activity set to ${Presence.activities[0].name}`))
        .catch(console.error);
      }, 5 * 60 * 60); // 1000 ms = 1s, 1s * 60 = 60s (1m), 1m * 60 = 1h
  });```
rare moss
#
const client = new Discord.Client() // Your discord.js or eris client (or djs ShardingManager)
const AutoPoster = require('topgg-autoposter')

const ap = AutoPoster('Your Top.gg Token', client)

ap.on('posted', () => {
  console.log('Posted stats to Top.gg!')
})```
twilit hemlock
#

?

rare moss
#

thast how you post your stuff on top.gg

#

straight from the documentation

twilit hemlock
#

wym post ur stuff

#

i just want the custom status on my bot

rare moss
#

ur asking a non API question on the discord?

#

well i guess this isn't the API channel just assumed my bad, i dont kode in JS so idk

#

soz

twilit hemlock
#

this isnt api chat

lament rock
twilit hemlock
#

anyway

lament rock
twilit hemlock
#

ok so\

#

lets just delete the randomizer

#

and start over with just the servers

lament rock
#

You don't have to

twilit hemlock
#

o

#

ok

#

im not the best with this stuff im new

lament rock
#

if you want to use bot.guilds.cache.size, just put the Array in the ready event and you can use it in one of the strings, although that will only get you the current value of the guilds cache size from when your client reaches the ready state. It won't update unless you declare a function or getter to get the current value of the guilds cache size

twilit hemlock
#

yea idk how to do that

lament rock
#

You're telling me you don't know how to copy some lines of code and paste them somewhere else?

twilit hemlock
#

uh that sounds ez

lament rock
#

That's literally all you have to do

twilit hemlock
#

ok well ill see

lament rock
#

and then you can use the guilds cache size to get the number of guilds your bot is in when it reaches the ready state

#

and include that in one of the strings in the Array

quiet pawn
#

how do i make it so when someone votes for my bot on top.gg my bot sends a message to a channel i picked

twilit hemlock
#

how do i update my code in github and heroku

#

i have new code i need to add

#

idk what to type in terminal tho

#

it says its up to date but it isnt

#

nvm i figured

earnest phoenix
#

what is package of pagination?

earnest phoenix
#

ok working now

opal plank
#

@twilit hemlock pretty sure i was fairly specific as to how you were suppose to add it

#

read these

#

Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:

  • proper syntax
  • debuging code
  • basic features (vars, arrays, objects, functions)
  • read and understand docs
  • nodejs module system

As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.

Here are good resources to learn both Javascript and NodeJS:

Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/

Please take a couple of weeks/months to get acquainted with the language before trying to make bots!

#

@twilit hemlock read above ^^. EVERYTHING. otherwise you just gonna stay stuck here asking the same question over and over

twilit hemlock
#

Already figured it out

#

Thanks tho

#

I’ll read

opal plank
#

np

#

any specific questions, just ask

#

but you need to know those basics to even understand the explanation for most of the stuff you need

vale garden
#

you can verify it using a parent acc

#

and im not 16 but yea

#

lol

willow mirage
#

How im gonna fix this shiet?

#

tried with this

summer torrent
#

lib: ["es2015"]

willow mirage
#

did too

#

still error

earnest phoenix
#

Hello

dusky marsh
#

compilerOptions != complierOptions

willow mirage
round quiver
#

got a console error - can someone help (node:234) UnhandledPromiseRejectionWarning: VersionError: No matching document found for id "60881571964e0b0d32c71224" version 249 modifiedPaths "pokemon, time, pokemons" at generateVersionError (/home/runner/TrivialParallelYottabyte/node_modules/mongoose/lib/model.js:421:10) at model.Model.save (/home/runner/TrivialParallelYottabyte/node_modules/mongoose/lib/model.js:478:28) at module.exports (/home/runner/TrivialParallelYottabyte/events/message.js:147:19) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5)

acoustic citrus
#

when you finally make a bot for beta testing and realize how nice it is when you do it right

summer torrent
#

yeah

storm knot
#

My bot is on over 500 servers and now it just seems to crash for no reason whatsoever. I get no traceback and it just seems to happen at random times

willow mirage
#

Is there any TS discord lib?

lusty quest
#

but any js lib will work

willow mirage
willow mirage
#

nvm imma go google

lusty quest
lusty quest
willow mirage
#

kkk

lusty quest
#

there are 2 libs on npm called detritus, the one ive sended is the correct one

willow mirage
#

so there are no docs?

lusty quest
#

page works for me

willow mirage
#

huh

#

tf

#

hmm strage

lusty quest
willow mirage
#

smh

lusty quest
#

or just ask @opal plank he will probably berade you using it for the next days if he need to

willow mirage
#

I got IP blocked?

lusty quest
#

maybe

#

use a VPN

willow mirage
#

bruhhh

#

@lusty quest wait send me the link?

#

myabe the url is wrong

#

ahh it is normal

lusty quest
willow mirage
#

in Ignonito Mode doesn't work too

#

smh

lusty quest
#

maybe your country blocked the Server where the Docs are on

#

or your ISP

willow mirage
#

but it is 1.1.1.1 from cloudflare

#

. . .

pale vessel
#

wrong reply

willow mirage
#

.-.

pale vessel
#

oops

willow mirage
#

I wanna read the doc

long crow
#

The docs is not so great

pale vessel
#

The docs isn't that useful anyway

#

You're better off checking the source code and use intellisense

long crow
#

Not beginner friendly

pale vessel
#

It's true

#

The docs only show classes and their methods and properties

#

No examples either

long crow
pale vessel
#

Also, you should join their support server

#

You can get your answers there

willow mirage
#

ig I will stay with d.js

amber wagon
#

hey you said here that one can get 20 months on vultr if they have a card but it said that your credits will expire in a month , did i do something wrong or is it some type of limited offer

earnest phoenix
#

Cómo puedo tener la ID de un emoji

gritty ice
#

my bot suddenly goes offline while testing

#

this message not showing in console

#

just saying like this

lusty quest
#

you should resolve the pending promise

near stratus
lusty quest
#

also did you call your ready.js somewhere?

near stratus
mental geode
near stratus
#

I mean like inside client.on("ready" or something

gritty ice
near stratus
#

yea
if the ready event is not triggering that means the bot is not logging in

gritty ice
#

How to solve

#
const discord = require('discord.js');

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

const { Player } = require('discord-player');
const keepAlive = require("./server");
client.player = new Player(client);
client.config = require('./config/bot');
client.emotes = client.config.emojis;
client.filters = client.config.filters;
client.commands = new discord.Collection();

fs.readdirSync('./commands').forEach(dirs => {
    const commands = fs.readdirSync(`./commands/${dirs}`).filter(files => files.endsWith('.js'));

    for (const file of commands) {
        const command = require(`./commands/${dirs}/${file}`);
        console.log(`Loading command ${file}`);
        client.commands.set(command.name.toLowerCase(), command);
    };
});

const events = fs.readdirSync('./events').filter(file => file.endsWith('.js'));
const player = fs.readdirSync('./player').filter(file => file.endsWith('.js'));

for (const file of events) {
    console.log(`Loading discord.js event ${file}`);
    const event = require(`./events/${file}`);
    client.on(file.split(".")[0], event.bind(null, client));
};

for (const file of player) {
    console.log(`Loading discord-player event ${file}`);
    const event = require(`./player/${file}`);
    client.player.on(file.split(".")[0], event.bind(null, client));
};
keepAlive();
client.login(client.config.discord.token);```
#

index.js

near stratus
# gritty ice ```const fs = require('fs'); const discord = require('discord.js'); const clien...

introduction the right way to use code blocks ```js
const fs = require('fs');
const discord = require('discord.js');

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

const { Player } = require('discord-player');
const keepAlive = require("./server");
client.player = new Player(client);
client.config = require('./config/bot');
client.emotes = client.config.emojis;
client.filters = client.config.filters;
client.commands = new discord.Collection();

fs.readdirSync('./commands').forEach(dirs => {
const commands = fs.readdirSync(./commands/${dirs}).filter(files => files.endsWith('.js'));

for (const file of commands) {
    const command = require(`./commands/${dirs}/${file}`);
    console.log(`Loading command ${file}`);
    client.commands.set(command.name.toLowerCase(), command);
};

});

const events = fs.readdirSync('./events').filter(file => file.endsWith('.js'));
const player = fs.readdirSync('./player').filter(file => file.endsWith('.js'));

for (const file of events) {
console.log(Loading discord.js event ${file});
const event = require(./events/${file});
client.on(file.split(".")[0], event.bind(null, client));
};

for (const file of player) {
console.log(Loading discord-player event ${file});
const event = require(./player/${file});
client.player.on(file.split(".")[0], event.bind(null, client));
};
keepAlive();
client.login(client.config.discord.token);

#

also I have no Idea what I'm looking at

lusty quest
#

why did you load player events?

gritty ice
#

In main file everything right then why not logging I don't know

near stratus
gritty ice
lusty quest
#

also its possible that something in your ready event causes it to not get executed

gritty ice
#

3 min I'm now eating

gritty ice
#

Ok

lusty quest
#

just comment out everything inside the function in your ready event and just make a simple console.log instead

gritty ice
#

Lemme check

earnest phoenix
#

y’all know bout the new voice chat stage, is there a way I can see if a voice channel is a stage or not

#

Check it's type monkaHmm

tardy hornet
#

Error: Client network socket disconnected before secure TLS connection was established

lusty quest
#

some context?

tardy hornet
#

i will take it as a yes

lusty quest
#

well you just send in a error, with no explanation from where, and what you use

tardy hornet
#

i did not use any command or anything

#

this error just randomly pops and sometimes make the bot crash

lusty quest
#

music bot?

tardy hornet
#

nope

lusty quest
#

is there more to the stack above?

tardy hornet
#

that is all

lusty quest
#

you run it on your pc right?

tardy hornet
#

no

lusty quest
#

did you run it with nodemon in production?

tardy hornet
#

it crashed so i contacted the host and they said that they downloaded it so it will turn online when it crash

lusty quest
#

never use nodemon for production, its not ment for it, use pm2 instead

#

also pm2 can restart the process if it crashes

tardy hornet
#

what about the error tho?

lusty quest
#

so bcs of your error, i dont see from where it comes, looks like Discord, but i dont get it, does it happen all the time when it starts or just randomly?

earnest phoenix
#

@gilded plank

tardy hornet
#

and sometimes it does not even crash it

lusty quest
#

did you run some sort of proxy for your connection?

feral aspen
#

How does user token work, anyone?

umbral zealot
#

what token

earnest phoenix
#

sus I smell someone that's about to selfbot

umbral zealot
#

If you mean the discord one, it only works from the client, don't try to get it or use it, ever.

tacit sequoia
round quiver
#
    at generateVersionError (/home/runner/TrivialParallelYottabyte/node_modules/mongoose/lib/model.js:421:10)
    at model.Model.save (/home/runner/TrivialParallelYottabyte/node_modules/mongoose/lib/model.js:478:28)
    at leveling (/home/runner/TrivialParallelYottabyte/events/message.js:250:16)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async module.exports (/home/runner/TrivialParallelYottabyte/events/message.js:47:5)```
A Message.js console error
lusty quest
#

it looks like the ID you want to query is not aviable

round quiver
#

oo

tacit sequoia
#

Not like it says that in the error or anything

round quiver
feral aspen
umbral zealot
#

Probably they were stupid and used client mods that grabbed it

#

or installed shady software.

earnest phoenix
#

ok?

latent heron
median iris
#

if i add monogo db to my bot, then bot will work faster ??

cinder patio
#

mongodb is a database

median iris
#

iK

#

IM JUST ADKI

#

askin

cinder patio
#

what are you using rn

lyric mountain
median iris
#

o

lyric mountain
#

databases if anything else would add more processing time, not remove it

median iris
#

So how can i make bot faster

lyric mountain
#

with better and more efficient code

median iris
#

O

#

Ok got it

#

:)

#

dude

#

my bot is added into 100+ server

#

now

#

how much time discord will take to verify

umbral zealot
#

About a month

median iris
#

WTF

umbral zealot
#

The verification queue is too damn long

#

they're doing their best

lyric mountain
#

can't blame them tho, although it was the decision of having a bizarrely small server cap

umbral zealot
#

They've made some mistakes for sure. Right now it's just a question of pure volume

near stratus
#

and It'll take 2months++ for intents verification

#

*whitelisting

median iris
#

no nsfw

#

its basic music bot

lyric mountain
#

mine took 1 month for guild_members + verification then 2 months for guild_presences (I forgot to ask for it during verif)

vagrant prairie
#

@earnest phoenix

eternal osprey
#

hey guys!

#

so i have a question, is there any way to retrieve a deleted embed by id?

#

or any deleted embed by any chance

#

not particular id

#
client.channels.cache.get("735243676460253225").messages.fetch(queueMessageId).then(queueMessage => {
         const userToRemove = user.userId;
         const userRemoved = removeUserFromQueueByUserId(userToRemove);
        
           assembleQueueMessage();
           if (Config.useEmbeds) {
             queueMessage.edit(embedQueue.setDescription(queueMessageText));
           } else {
             queueMessage.edit(queueMessageText);
           }
         
       })
        );``` i am constantly editing the embed as you can see, but there are cases where the embed could be deleted.How would i ever retrieve that embed?
earnest phoenix
#

does anyone know why he kick an account older then 30 days?
he must kick members under the 30 days.

const status = new db.table(`protect_guild_${member.guild.id}`);
            if (status.fetch(`status_${member.guild.id}`) === 'off' || status.fetch(`status_${member.guild.id}`) === null){
               return;
            }else{
                member.guild.members.cache.each(async member => {
                    const date1 = new Date(member.joinedAt).getTime();
                    const date2 = new Date().getTime() - 30 * 24 * 60 * 60 * 1000; //30 is 30 days

                  
                    if (date2 < date1) {
                      await member.kick();
                       }else{
                           return;
                       }
                
                    
                  });
            }```
lament rock
lyric mountain
lyric mountain
#

no, wait

#

you changed that didn't u?

earnest phoenix
#

no that is the code i have not edit that

#

but he stay kick member older then 30 days

lyric mountain
#

my mind glitched for a second

#

lemme re-format that code

earnest phoenix
#

and idk whats wrong

lyric mountain
#
const status = new db.table(`protect_guild_${member.guild.id}`);

if (!(status.fetch(`status_${member.guild.id}`) === 'off' || status.fetch(`status_${member.guild.id}`) === null)) {
    member.guild.members.cache.each(async member => {
        const date1 = new Date(member.joinedAt).getTime();
        const date2 = new Date().getTime() - 30 * 24 * 60 * 60 * 1000; //30 is 30 days
        
        if (date2 < date1) {
            await member.kick();
        }
    });
}
#

there, much better to read

earnest phoenix
#

i will try the code 🙂

lyric mountain
#

no, that's not fixed

#

I just re-formatted

#

and removed unnecessary if-returns

earnest phoenix
#

oh but whats wrong do you know that

lyric mountain
#

I'm thinking

#

it's just that I couldn't read the earlier code

earnest phoenix
#

oh okay

lyric mountain
#

that code seems fine tho

#

member account was created 01/01/2021

#

mb2 account was created 01/04/2021

#

member will not be kicked, mb2 will

earnest phoenix
#

so i can try the code? if it now working

lyric mountain
#

it's essentially the same code

#

all I did was this

#

flipped the first IF condition and removed the second

#

because the second would make the bot exit iteration if date was older than 30 days

earnest phoenix
#

not working he will kick me 2th account is older then 30 days

lyric mountain
#

the issue ain't in the code you showed then

#

actually...

#

put this ```js
console.log("date1: " + date1)
console.log("date2: " + date2)

here
#

then show the output

opal plank
#

@lusty quest @willow mirage
Yall need detritus help still?

signal estuary
#

How do I get a user by ID? I tried:

let user = client.users.cache.get("USERID");

But it only returns undefined

lament rock
#

the user won't be cached depending on your client's intents. If you have GUILD_PRESENCES, they'll almost always be cached. If you have GUILD_MEMBERS, they'll show up in cache when their membership gets updated like join or update. If you have guild messages and/or DM messages, then they'll show up when they send a message. If you have voice states, then they'll show up when they join a voice channel iirc or on GUILD_CREATE when Discord sends all users already in a voice channel

lament rock
#

clients.users.fetch()

#

fetch will check if the user is cached and if not, fetch it from Discord

#

be careful with fetch, though since it has a limit to how often you can use it

signal estuary
#

I use this code to get the user

let user = msg.mentions.users.first();

But want to get the user by ID now (args[0]) How do I do that?
I tried
let user = client.users.cache.get("USERID");,
Client.fetchUser(id) and this
client.users.fetch('IDHERE')
But this didnt work

lyric mountain
#

var

zenith terrace
#

v a r

lyric mountain
#

doesn't most IDEs warn about var usage?

#

I mean, at least intellij does, it throws a big yellow waning whenever you try to use it

signal estuary
#

BROs I dont care about vars lets const etc, I can change it in the end, but thats not the point!!!

lyric mountain
#

maybe that is exactly the point

#

you really don't know what's the issue with var do you?

earnest phoenix
#

(yes, deno has a .com domain too)

lyric mountain
#

then what's the issue with var?

signal estuary
#

so just tell me how I get the user by ID, please

signal estuary
earnest phoenix
#

hoist

signal estuary
#

?

lyric mountain
#

ok, nice, at least you're aware (btw that code wouldn't be runnable because u use var b twice)

signal estuary
#

And now tell me how I how I get user by ID please....

earnest phoenix
lyric mountain
signal estuary
lyric mountain
#

also, console.log what's being passes as id

signal estuary
earnest phoenix
#

me and the bois copying code from a website that has an "intended feature" in it's name

signal estuary
earnest phoenix
lyric mountain
signal estuary
eternal osprey
#

hey! How do i add a role to a bot? I have this code but it gives me add of undefined error:

const botrole = client.users.fetch('745253908275920986') // this is my bot id
       botrole.roles.add(vip)
      
earnest phoenix
#

i have the code in the guildMemberAdd.js event

earnest phoenix
eternal osprey
#

aha

earnest phoenix
#

ok wth why are you fetching a user and applying the value to botrole

eternal osprey
#

got m, thanks.

earnest phoenix
#

you need to get a guildmember

earnest phoenix
#

you cant add roles to a user

#

somebody send 5head emoji

eternal osprey
#

why did it work then?

#

uhhm

#

owh no my bad.

earnest phoenix
#

No it didn't what BlobThinkGlare

eternal osprey
#

sorry, i was lookin wrong.

earnest phoenix
#

You can use <Guild>.members.fetch() to fetch the member and add the role

lyric mountain
earnest phoenix
earnest phoenix
eternal osprey
earnest phoenix
lyric mountain
#

that's the thing, there's nothing wrong

#

the account was created on 07/Apr

earnest phoenix
#

imagine debugging working code

lyric mountain
#

you're kicking accounts newer than 29/Mar

earnest phoenix
earnest phoenix
eternal osprey
lyric mountain
#

to make it easier to think logically, do this: const diff = new Date().getTime() - member.joinedAt

earnest phoenix
lyric mountain
#

then if (diff < 30 * 24 * 60 * 60 * 1000) //kick

lyric mountain
kind quest
#

Who has a lot of knowledge of js?

#

I want to start learning it but I need a few links on where to start learning like a js learning website....

lyric mountain
#

see, easier to check if account is older or newer than 30 days

earnest phoenix
kind quest
lyric mountain
#

where you check if date is bigger than the other

#

remove everything inside

earnest phoenix
#

i wok with date1 and date 2 not diff

lyric mountain
#

and put this const diff = new Date().getTime() - member.joinedAt

lyric mountain
#

diff is a better replacement

#

since you get the difference between two dates

#

it's way easier to check if account is older/newer than X days than checking two dates

earnest phoenix
#

so?

if (!(status.fetch(`status_${member.guild.id}`) === 'off' || status.fetch(`status_${member.guild.id}`) === null)) {
    member.guild.members.cache.each(async member => {
        const diff = new Date().getTime() - member.joinedAt();
        if (diff < 30 * 24 * 60 * 60 * 1000){ //kick
            await member.kick();
        }
        
    });
   }```
#

you should dm them before da kick

earnest phoenix
earnest phoenix
pale vessel
#

because it's not a function

#

it's a getter

lyric mountain
#

I gave an example

earnest phoenix
earnest phoenix
lyric mountain
#

no

earnest phoenix
#

so you can join you will see that you will kicked out of the server. i don't know why 🤷‍♀️

lyric mountain
earnest phoenix
#

well account created in 2017

lyric mountain
#

are you 100% sure?

earnest phoenix
#

yes

#

On my vps, I have a dashboard on my bot that I want to launch on a specific port and I can only launch it in port 80 (suddenly apache is turned off).
But how can I do so that when a person puts the link to the site, that his dashboard site loads with the port of the latter but that the port is not displayed in the url (it's in js and ejs the dashboard) and apache is started

lyric mountain
#

because the millis u gave me say otherwise

#

who are those 3 users?

earnest phoenix
#

idk

lyric mountain
#

I tested for the first

#

ah, I know why

#

you're using joinedAt

#

joinedAt is the time which the user joined the server

#

not the time accout was created

earnest phoenix
#

createdAt

#

i go try createdAt

pale vessel
#

have you tried reading the docs

narrow fractal
#

ah dutch

earnest phoenix
#

so you never make a mistake? do you want to say?

#

ad

#

fuck off 🖕

#

no making ads

#

@rustic nova acc modding

rustic nova
#

@maiden hill don't advertise

#

thanks

earnest phoenix
#

nP

prime glacier
#
client.on("presenceUpdate", (oldMember, newMember) => {
    if(oldMember.presence.status !== newMember.presence.status){
        const channel = member.guild.channels.cache.find(ch => ch.id === '836250294480142366')
        channel.send(`${newMember.user.username} is now ${newMember.presence.status}`);
    }
});```

no error but bot is not sending message
wheat mesa
#

I swear it's the simplest things sometimes. ```js
if(message.mentions.users.has(client.user.id)) {
message.reply(My prefix here is ${config.prefix})
return
}

#

Wait I'm so stupid

#

nvm fixed it

prime glacier
#

solved?

wheat mesa
#

Yup