#development

1 messages Β· Page 1836 of 1

lyric mountain
#

Depends on the size

earnest phoenix
#

damn

cinder patio
#

A help command is pointless if all your commands are slash commands, but I'm not sure if top.gg allows bots without a help command if all their commands are slash commands

nocturne grove
#

thanks. Oh that's a good point, didn't think of that

lyric mountain
#

I think slash commands are messy when you have 100+

#

Everything thrown out of category

nocturne grove
#

yes that's absolutely true
You can say that we lost control over our commands

long crow
#

I add the help command even if I have all my command as slash command, since maybe like server with 10+ bot using slash, it doesn't show up all and scrolling through the slash command is not very intuitive as now

lyric mountain
#

I will keep both normal and slashes

#

The user decides which one he wants to use

nocturne grove
long crow
#

only listing main command

nocturne grove
lyric mountain
#

Not at all

#

I made my command handler parse slashes into normal

nocturne grove
lyric mountain
#

So it's 1 code for both types

nocturne grove
#

oh that's nice. So you added a lot of properties to them?

lyric mountain
#

Well...no bcuz it's java

nocturne grove
#

ohh

lyric mountain
#

I use annotations to process the commands

long crow
#

Simple one, I can add like selectmenu for details, that an options

lyric mountain
#

Those annotated with @SlashCommand are slash-compatible

#

And those annotated with @Command are normap commands

#

If the command has both then the handler will call the proper type

nocturne grove
#

ohh so not every command can do both slash and messages?

lyric mountain
#

Since each type comes from different events I can just filter what type I should proccess

#

Not yet

#

I have too many commands, it takes some time

long crow
nocturne grove
nocturne grove
long crow
#

For sure it is

nocturne grove
#

nice one

quartz kindle
#

if you have simple commands, you dont need a help command

#

but if like me, your commands require 90 pages of docs....

#

lmao

umbral lake
#

hey, my bot wants to send a embed, he can speak in the channel but he has missing permissions :/

nocturne grove
#

lmao Tim

nocturne grove
umbral lake
nocturne grove
#

yes, for embeds it does

umbral lake
#

okay

nocturne grove
#

if it's sending an embed using a normal message

boreal iron
#

Found another "great" change in djs v13
Assigning an integer to an embed value will cause an error (RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.)
djs doesn't converter the value to a string anymore, v12 did

nocturne grove
#

yes awesome 🀣
coincidentally I saw that already

nocturne grove
earnest phoenix
#

hello

#

how can setup

#

image like this

#

in html

#
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <title>KIRA</title>
    <meta name="description" content="BEST MUSIC AND MEME BOT FOR DISCORD">
    <meta name="theme-color" content="#ffc107">
    <link rel="icon" type="image/png" sizes="300x250" href="https://images-ext-1.discordapp.net/external/Ww48p9i_BhGad7v3H6vEXgIhoE1DIrRMjDAv8im8w-Q/%3Fwidth%3D613%26height%3D613/https/media.discordapp.net/attachments/843830735940878336/854619748155523132/20210616_124308.png">
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Alfa+Slab+One">
    <link rel="stylesheet" href="assets/fonts/font-awesome.min.css">
    <link rel="stylesheet" href="assets/fonts/ionicons.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
    <link rel="stylesheet" href="assets/css/styles.css">
</head>```
#

my website codes head

rose warren
long crow
nocturne grove
#

oh I've got time enough I think, and else I can update my bot without that command help feature

lethal trout
#
const Discord = require('discord.js');

/**
 * @param {Discord.Client} client
 */
module.exports = (client) => {
    client.on('interactionCreate', async (interaction) => {
        if (interaction.isCommand()) {
            let cmd = client.slash_commands.get(interaction.commandName);
            if (!cmd) return;

            await interaction.defer().catch(e => {});

            let options = interaction.options._hoistedOptions;

            cmd.run(client, interaction, options);
        }
    })
}```


error:

await interaction.defer().catch(e => {});
^

TypeError: interaction.defer is not a function```

long crow
#

because .defer() already been changed, take a look at the documentation

twilit geode
#

i need to edit it so that I can get transparency btw

shadow frigate
#

discord.js

const client = new Discord.Client({ ws: { intents: ["GUILDS", "GUILD_MEMBERS", "GUILD_INTEGRATIONS", "GUILD_WEBHOOKS", "GUILD_MESSAGES", "GUILD_MESSAGE_REACTIONS", "GUILD_VOICE_STATES"] } });

returns CLIENT_MISSING_INTENTS, and my bot is under 75 and is not verified.

twilit geode
shadow frigate
#

Oh shit

#

lmao rip

#

yea forgot,

#

cheers

twilit geode
shadow frigate
#

Big up tom scott

twilit geode
#

yessirrr

shadow frigate
#

@twilit geode rip, saying same thing lmao

twilit geode
#

really

#

psh idk then

pale vessel
#

Me neither

twilit geode
lyric mountain
#

that's java tho

sterile thicket
#
module.exports = {
    usage: 'whatever',
    run () => {
        how do I put the value of "usage" here?
     } 
}```
fallen holly
#

what does guildOnly mean

quartz kindle
sterile thicket
quartz kindle
#

run() { this.usage }

boreal iron
#

run.away

sterile thicket
#

Away?

vivid fulcrum
#

it's a joke

sterile thicket
solemn latch
#

run: async (message) => { this.usage }

sterile thicket
#

run() { this.usage } works however

solemn latch
#

πŸ‘€ then what are you asking for?

sterile thicket
#

Uh

#

It's working fine in my eval

#

Not on actual command file

#

Weird

brave garnet
#

asap unrelated question - is there a way for bot to set up variables for users and not having all the database? for example me normally can have notes on users. how can bot achieve the same thing (i use python btw)

tulip ledge
#

Json file? Google spreadsheet?

brave garnet
#

no. only using discord. nothing outside...

#

i can make you a notes cause i have a place under ur profile. bot doesnt see normally profile as user so i think a variable should be here.... or not?

solemn latch
#

Seems like a really bad way to do things, is there a reason having such a weird requirement?

brave garnet
#

i wanted to make roles with password =p

#

(aka sudo and passwd =p)

#

one per server

solemn latch
#

then you should be using a database for that, especially anything which uses a "password"

brave garnet
#

i dont want to take data of all users on discord =p

solemn latch
#

then dont make it imo

brave garnet
#

bruh

solemn latch
#

if you dont want to do the work, dont make it

fallen holly
#

good alternatives for replit.it so i can code my discord bot on v13 and host it with uptime robot

brave garnet
#

i just dont want to mess up with international laws =p

solemn latch
#

international laws? πŸ‘€ what laws?

brave garnet
#

privacy, etc...

solemn latch
#

if anything storing stuff like that on discords servers is more illegal

#

πŸ‘€

brave garnet
#

nope cause then discord handle it =p

solemn latch
#

not how that works πŸ‘€

brave garnet
#

?

#

bro

solemn latch
#

youll want a privacy policy for something like that, passwords are PII, and your storing them on a service in a way not meant for storing PII.
Very much a big concern

#

so youll need to disclose that to all users in a legal fashion(privacy policy)

brave garnet
#

yeah, cause of that i wanted to store data in discord guilds so i dont have acces and then its correct and i dont need to messup with laws =p

solemn latch
#

your doing it in a more legal nightmare fashion though πŸ‘€

brave garnet
#

means?

tulip ledge
#

Pretty sure using discord channels as storage is against tos no?

solemn latch
#

your making it worse on yourself legally

tulip ledge
#

Someone told me that once

solemn latch
#

thinking its somehow discords responsibility because you misuse their stuff makes no sense.

#

use a database, or dont do it at all

brave garnet
#

how no sense? discord only knows the data then =p

#

if it even exist =p

solemn latch
#

ill just say it again, what you are planning to do is possibly illegal, and will get you banned from discord.
use a database.

brave garnet
#

bro. i dont wanna mess up with tons of paper =p

vivid fulcrum
#

discord requires you to secure and encrypt all of their data you store

solemn latch
#

and the law required encrypting it and securing passwords. which isnt possible by using discord as a database

brave garnet
solemn latch
#

its on their servers, but its still 100% on you

nova basin
#

Help me please i have error zerotwocry

module.exports = {
	name: "lewd",
	category: "NSFW",
	execute(message, args, client) {
		message.delete({timeout: 5000})
    var superagent = require('superagent');

        if (!message.channel.nsfw) {
            message.react('πŸ’’');
            return message.channel.send(new Discord.MessageEmbed()
						.setColor('#ff0000')
						.setTitle(errMessage)).then(msg => {
      msg.delete({ timeout: 5000 })
      })
        }

    var lo = new Discord.MessageEmbed()
                .setDescription(`Por favor, espere...`)
                .setTimestamp()

    message.channel.send(lo).then(m => {

        superagent.get('https://nekobot.xyz/api/image').query({ type: 'lewd'}).end((err, response) => {

            var embed_nsfw = new Discord.MessageEmbed()
                .setTimestamp()
								.setFooter(message.author.username)
								.setTitle('Aqui estΓ‘ sua imagem...πŸ‘€')
								.setColor('#FF1493')
								.setDescription(`**[A imagem nΓ£o estΓ‘ carregando? Clique aqui](${response.body.message})**`)
                .setImage(response.body.message)
            
            m.edit(embed_nsfw);
        });
    });
}
}```
tulip ledge
brave garnet
#

i dont have acces to that then

vivid fulcrum
#

"i killed a person inside of mcdonalds, so it's actually mcdonalds' fault, not mine!"

brave garnet
#

?

vivid fulcrum
#

in the ddevs guild

civic scroll
#

@nova basin response.body.image is an empty string

tulip ledge
#

Even for β€œgame” data?

#

I compress it but dont encrypt it

vivid fulcrum
#

depends what you mean by game

#

any of discord's data needs to be encrypted

tulip ledge
#

A custom game in discord

#

I only use the ID of the user

vivid fulcrum
#

oh

#

you're fine then

#

things implied are message contents, roles, owner information etc.

#

but intermediate data like ids alone are fine

brave garnet
#

i can ping user using id =p

#

without nick

solemn latch
#

your storing PASSWORDS

#

use a database

brave garnet
#

passwords to give someone a role =p

solemn latch
#

its still a password

#

it needs to be treated like one

#

theres nothing that will change about this. You are required to use a database here.

brave garnet
#

so u say - i need to invest real money to give some pepol a command? yes?

tulip ledge
#

Arent you also legzlly required to encrypt passwords?

solemn latch
#

yes

tulip ledge
solemn latch
#

or well, you are legally responsible for the security of stored passwords

brave garnet
tulip ledge
#

Kekw

solemn latch
brave garnet
#

only external database if cant be opensource =p

#

so ok. i make bot as abandonware =p

tulip ledge
#

If u dont wanna spend money, dont do it then

#

What you want to do is ILLEGAL

quartz kindle
#

writing a custom discord websocket with 0 dependencies be like:

socket.on("data", data => {
  ...
  onFrame(data);
})

function onFrame(frame) {
  ...
  onMessage(frame);
}

function onMessage(message) {
  ...
  onPacket(message)
}

function onPacket(packet) {
  ...
  uncompress(packet)
}

function uncompress(packet) {
  ...
  unpack(packet)
}

function unpack(packet) {
  ...
  emit(packet)
}
earnest phoenix
brave garnet
restive furnace
#

hashing passwords? phew its easy just use some secure algo and ur fine

brave garnet
#

hash. xd. live source is public =p

#

i need to use external db then =p

tulip ledge
#

unless u wanna pay a fine or end up n jail when u get caught

brave garnet
restive furnace
#

what? you can litetally just store the passwords (as HASHED) in the same database

#

as rest of your stuff

brave garnet
tulip ledge
#

He uses replit

brave garnet
#

+1

restive furnace
#

just use mongodb cluster or smth

visual scaffold
restive furnace
stable eagle
#

Yeah

restive furnace
#

read the message below

brave garnet
#

(😳 too late - i type using one hand now =p)

brave garnet
visual scaffold
#

hi who know what app abey using?

restive furnace
#

depends hiw big your bot is

#

but for a bot like with under 1000 servers it'll be fine

brave garnet
visual scaffold
#

kk im ghost again πŸ‘»

restive furnace
lyric mountain
#

I don't get it, what's the issue with public source code again?

restive furnace
brave garnet
#

:-|

lyric mountain
#

...that's...man why do you make bots then?

restive furnace
#

^

brave garnet
#

for fun?

#

im just bored at summer

restive furnace
#

then dont make it public if u dont want to worry about this kind of stuff?

lyric mountain
#

then why are you even complaining?

#

like, you can't expect to stay free for the whole life of your bot

brave garnet
#

and even if - this mine bot have other purpose than getting cash. its just to show m$ that they arent alone =p

lyric mountain
#

m$?

brave garnet
#

microsoft

restive furnace
#

micro$hit

lyric mountain
#

bots go a loooooong way before they become self-sustaining money-wise

#

you need to input cash at the start tho

#

like any real life business

brave garnet
#

nope. i just made it for showing pepol opensource =p

lyric mountain
#

showing what?

brave garnet
#

and for me it isnt business =p

#

and im not gonna take part in business when project is against giant business =p

lyric mountain
#

against who?

brave garnet
#

m$

lyric mountain
#

...boy

#

like, you're not competing against microsoft at all

brave garnet
#

im a WOMEN u dumb?

lyric mountain
#

if anything you're competing against other bots

brave garnet
lyric mountain
#

even if they do, what then?

#

it's not like it'll change anything

restive furnace
#

discord refused that anyway

#

atleast what i heard

lyric mountain
#

ye, they refused

brave garnet
restive furnace
#

and they bought github, and just good things happened for it ever since then

#

nothing to worry about

tulip ledge
#

Can you please just stop arguing about this

brave garnet
lyric mountain
brave garnet
restive furnace
#

also currently best discord alternatives are propiertary anyways, so...

lyric mountain
#

how many? 5? 50? 500?

#

opensource doesn't mean safer code at all

brave garnet
#

idk yet. i just pushed to topgg

lyric mountain
#

that "hacker" topic not again

brave garnet
lyric mountain
#

errr...no

tulip ledge
#

Opensource allow for finding vulnerabilities to exploit

restive furnace
#

^ there might be some nasty backdoors too

lyric mountain
#

I can for sure write an opensource code that WILL have a virus and you'll have no way of knowing

tulip ledge
#

Look at how people in 2b2t exploited a bug in paperspiggot

brave garnet
#

?

tulip ledge
#

All because they had access to the source code

lyric mountain
#

it's like being a doctor and giving poison to your patients

#

will they know it? no

#

even if they have the name

#

the full compound of the drug

#

knowing the recipe doesn't mean you know WHAT it does

#

same with opensource

#

don't get me wrong, I'm an opensource enthusiast, but I hate when people bash at proprietary stuff just for "not having open source code"

brave garnet
#

anyways - now i will ask other pepol and shut

earnest phoenix
#

my code is dumb

#

i need help with this

lyric mountain
#

code?

lyric mountain
#

is "RANDOM" a thing?

#

and what does akaneko() return?

tulip ledge
#

I think akaneko() returns {}

earnest phoenix
#

maybe @tulip ledge

earnest phoenix
deep juniper
#

Help, the repl.it doesn't want to recognize my bot token

quartz kindle
#

did you add it correctly?

earnest phoenix
#

my bot has worked for a long time, but once it reached about 150 servers it doesnt start the shards, then the bot is really laggy and messed up. it was fine before this, and i tried using it on a smaller bot and it worked

what would be the reason for it working on a smaller bot but not a bigger bot?

i get the error: "shard 0's client took too long to become ready"

#

No error

plain talon
#

You could just do <@{roleid}>

plain talon
#

why on earth are you running shards with 150 servers

delicate zephyr
plain talon
#

im not sure

#

i assumed it was like channels

earnest phoenix
delicate zephyr
#

<@&585528734904352769>

#

yea

#

it is

earnest phoenix
plain talon
#

kinda ironic

#

how

#

you're having an issue with shards

delicate zephyr
#

never a bad idea to plan scaling

earnest phoenix
#

yea and its better to fix it now than run into the problem when its in a lot of servers

delicate zephyr
#

^

earnest phoenix
#

i have no idea what process would cause the shard to take so long to start

warped lintel
#

hello

quartz kindle
#

do you use fs a lot?

#

where is your bot hosted?

earnest phoenix
#

i use fs just to load the commands and events, but i have those output when they load and theres no issue

#

and its hosted on a vps

lyric mountain
quartz kindle
#

try listening to debug logs

lyric mountain
#

that "1" is the base shard

quartz kindle
#

client.on("debug", console.log)

#

if your logs dont have a timestamp on them by default, add a time yourself

#

client.on("debug", log => console.log(new Date(), log))

lyric mountain
#

do you make many transactions with the db btw?

#

also, is the db on the same machine as the bot?

earnest phoenix
#

"failed to find guild, or unknown type for channel "

quartz kindle
#

thats normal if you're using discord.js v12

#

it happens on stage channels

earnest phoenix
#

oh

quartz kindle
#

the important part of the debug logs is the timings

#

how long does it take to reach the different points of the connection

#

to see which part is taking so long

#

btw do you have fetchAllMembers or similar?

earnest phoenix
#

i completely forgot about that

quartz kindle
#

thats likely the culprit

earnest phoenix
quartz kindle
#

πŸ‘

earnest phoenix
#

thank you

sour cargo
#

Hey guys, im working with discord py, and is there a way for bots to send messages in threads? I looked around the api and cant find anything

solemn latch
#

Your connection to mongodb isn't correct. The uri isn't defined.

#

Line 17 index.js

quaint rampart
#

do you guys think this is secure? basically whenever the app starts it gets data from notobs.js obfuscates it and then writes it to main.js ||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||||​||β€Žβ€Ž||β€Ž||β€Žβ€Ž||β€Žβ€Ž||β€Žβ€Ž||β€Žβ€Ž|| https://embed.rauf.wtf/?title=clapclap&color=2f3136&image=https://cdn.clapan.wtf/gn5.png&redirect=https://cdn.clapan.wtf/gn5.png

split hazel
#

i cant tell you its secure if i dont know what you're doing that for

split hazel
#

not helpful

#

why are you obfuscating it

#

to send it to the client?

#

if so obfuscation isn't "secure" but it can deter someone from looking thoroughly at the code

earnest phoenix
#

I can not tag the role

async run(client, message, args) {
    if (message.channel.type === 'dm') return
    let user = message.author.username;
    let voice = message.member.voice.channel;

    if (voice) {
        message.channel.send(`${message.guild.roles.cache.get(
          "Staff"
       )} ${
          message.author
        } **Need your help :exclamation:** 
      Reason: ${args.join(" ") || "`\No Reason\`"}
      Voice Chat: \`${voice.name}\``);
    } else {
        message.channel.send(` ${message.guild.roles.cache.get(
          "staff"
        )} ${
          message.author
        } **Need your help :exclamation:** 
      Reason: ${args.join(" ") || "`\No Reason\`"}
      Voice Chat: \`The user is not in the room\`  `);
    }
  }
}
sour cargo
#

general question - how do we know what version of the api our bot is on?

solemn latch
stark abyss
#

I am having hard time converting base64 to blob in node js i tried some libraries but they lead to weird errors

uneven fulcrum
#

this.on('guildMemberUpdate')

#

now how do i track the roles

#

when someone gets a new role?

stark abyss
#

why do I need blob?

#

apparently the api I was using is no longer accepting base64 and + this is with react nepheh

quartz kindle
#

dafuq

#

blob is basically irrelevant in node.js

#

its more of a browser thing

#

if you need it client side, you can send it as whatever, then convert to blob there

stark abyss
#

I don't understand what you mean by there

quartz kindle
#

on the browser

#

not in node

stark abyss
#

so like how? I barely know the client side and browser

quartz kindle
#

what api is this that requires blobs?

stark abyss
#

trace.moe api

quartz kindle
stark abyss
#

yes

quartz kindle
#

where does it say it needs blob?

stark abyss
quartz kindle
#

are you doing this on the browser or in node?

stark abyss
#

node

quartz kindle
#

are you using the form-data package?

stark abyss
#

no

#

oh wait I am nepheh

quartz kindle
#

then you can add the file as a stream or as a buffer

stark abyss
#
      let formData = new FormData();
      formData.append("image", result.base64);
        var traceData = await fetch("https://api.trace.moe/search", {
          method: "POST",
          body: formData
        })
#

my old code now I just need to change base64 to blob

quartz kindle
#

what is result?

stark abyss
#

is that relevant?

quartz kindle
#

yes

#

otherwise i cant know how to convert it

stark abyss
quartz kindle
#

ok

#

you should be able to do this then

#

.append("image", Buffer.from(result.base64, "base64"))

stark abyss
#

Buffer isn't defined

#

Can't find variable: Buffer*

quartz kindle
#

then you're not doing this inside node.js

stark abyss
#

Um so what am I doing this in?

wheat mesa
#

Has anyone had issues with their VPS hanging when trying to start their bot?

quartz kindle
#

likely in the browser

#

do you have a window variable?

stark abyss
#

no

quartz kindle
#

a document variable?

stark abyss
#

I believe not

quartz kindle
#

if you console.log(window) does it show anything?

stark abyss
#

no you are right i am doing this in browser

#

it console loged [object]

quartz kindle
#

yes, then its browser

#

so you need to use browser js and convert to blob

#

but i dont think there is a direct conversion

stark abyss
#

okay I gotta go now but I think I can figure this out now thank you

solemn latch
#

Hey Tim, do you know any easy way to work with chunked video file uploads in nodejs?
Do I need to just make it by hand, it seems simple enough, just a few nights should be able to do it.
Just couldn't find a library that already did it.

wheat mesa
#

Any reason this happens? It should be ~1600 total users, but sometimes on startup it'll log other numbers, like 400

#

Stats defined as such: ```ts
let guildCount = 0;
let userCount = 0;
let memberCount = 0;
let totalUsers = 0;
let channelCount = 0;

  for (const shard of (client.client as ClusterClient).shards.values()) {
    guildCount += shard.guilds.size;
    userCount += shard.users.size;

    for (const guild of shard.guilds.values()) {
      memberCount += guild.members.size;
      totalUsers += guild.memberCount;
    }

    channelCount += shard.channels.size;
  }
solemn latch
wheat mesa
#

The cache isn't the problem though

#

I'm not caching the users

#

*most of them

#

Also my VPS often hangs after loading the events to my client, but this issue doesn't happen on my pc. Probably just because I have a semi-crappy VPS, but maybe someone else knows what's happening (happens even when not using pm2 to start the process)

solemn latch
#

Was thinking of just stealing some php code which does it tbh. But that's no fun.

quartz kindle
#

you're doing it in php?

solemn latch
#

Nah nodejs

quartz kindle
#

lul

#

how are you receiving it in node?

#

express?

solemn latch
#

Yeah

quartz kindle
#

using formdata?

solemn latch
#

Currently yes

#

Was using multipart but cloudflare wasn't happy about it.

quartz kindle
solemn latch
#

Oh hey cool

wicked pivot
#
if((test[button.clicker.user.id].date + 20000) > Date.now()){}```
then, test .... = Date.now() and if the person waited 20 seconds before doing an action the if is executed
fallen holly
#

can someone help me
i'm using new command and event hander
but its not working

wheat mesa
#

show your code

fallen holly
#

using replit

#

it's showing this

#

> Verified-Bot@1.0.0 start /home/runner/Verified-Bot
> node index.js

/home/runner/Verified-Bot/node_modules/discord.js/src/util/BitField.js:152
    throw new RangeError('BITFIELD_INVALID', bit);
    ^

RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: GUILD_EMOJIS.
    at Function.resolve (/home/runner/Verified-Bot/node_modules/discord.js/src/util/BitField.js:152:11)
    at /home/runner/Verified-Bot/node_modules/discord.js/src/util/BitField.js:147:54
    at Array.map (<anonymous>)
    at Function.resolve (/home/runner/Verified-Bot/node_modules/discord.js/src/util/BitField.js:147:40)
    at Client._validateOptions (/home/runner/Verified-Bot/node_modules/discord.js/src/client/Client.js:546:33)
    at new Client (/home/runner/Verified-Bot/node_modules/discord.js/src/client/Client.js:73:10)
    at Object.<anonymous> (/home/runner/Verified-Bot/index.js:2:16)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  [Symbol(code)]: 'BITFIELD_INVALID'
wheat mesa
fallen holly
wheat mesa
#

np

quaint rampart
wheat mesa
#

security through obscurity isn't real security

#

You can always deobfuscate things if you're dedicated enough

#

Then they can edit your code

quaint rampart
#

true

livid lichen
#
    const CurrentPage = await message.channel.send({
      embed: TestEmbed,
      components: [
        new Discord.MessageActionRow().addComponents(backwardArrow, closeArrow, forwardArrow)
      ]
    });
```Hi. I'm using Discord.js v13.0.1 and, for some reason, CurrentPage never sends an embed.
#

Why is this?

summer torrent
#

it should be an array

#

[TestEmbed]

livid lichen
#

oh, thank you

errant flax
#

what line?

long crow
#

and poof , slay question gone unanswered with the deletion of the original query

lethal trout
summer torrent
lethal trout
#

Code:

//in options
{
            name: 'target',
            type: 'USER',
            description: 'Select a bot',
            required: true,
        },

//in running the file
const user = client.users.cache.get(options[1].value)
//in embed
.setAuthor(user.user.tag, user.user.displayAvatarURL({
                dynamic: true
            }))```

Error:

.setAuthor(user.user.tag, user.user.displayAvatarURL({
^

TypeError: Cannot read property 'tag' of undefined```

errant flax
#

user isnt defined

#

or the user isnt in the bot's cache

lethal trout
lethal trout
errant flax
#

console log the user

long crow
#

what is options?

lethal trout
#
if (!options[2].value) {
                        ^

TypeError: Cannot read property 'value' of undefined```

i made option2 optional
#

and its a string

pale vessel
#

Then it won't be included in the options if you made it optional

#

Unless the user gave it a value

#

of (!options[2]) is enough

uneven fulcrum
#

I get undefined when i do this

      // Verify the token set here and the one from the webhook server match
      if (request.headers.authorization === authenticationToken) {
        var webhook = request.body;
        console.log(webhook)
        }
    });    ```

this is the donatebot.io api
wheat mesa
#

@drowsy crag

sterile thicket
#

I want to search bot role, which is auto-created when joining the server, by its name, even though if they change the name of the role... Any way other than saving the role in the db when they are created?

pale vessel
#

Role objects can have the tags object, which includes the bot_id property. You can find your bot's role using that by ID

errant flax
sterile thicket
pale vessel
#

Er

#

It's in the role object itself?

#

The role object contains the ID

glass barn
#

guys apdu`fa manjilla drga pontumo ?

earnest phoenix
#

Hello i get abortcontroller is not defined error on djs 13

#

How to fix it ?

#
const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('interactionCreate', async interaction => {
  if (!interaction.isCommand()) return;

  if (interaction.commandName === 'ping') {
    await interaction.reply('Pong!');
  }
});
earnest phoenix
#

const token = this.client.token ?? this.client.accessToken; ^ SyntaxError: Unexpected token ?

#

Console error

radiant kraken
#

what node version are you using

earnest phoenix
#

16.6.1

sterile thicket
#

I have been testing slash...
And now I have two slashes in my guilde...
How can I remove one?

marsh bluff
shrewd hazel
#

Oh my g

earnest phoenix
#

@livid jackal

near stratus
earnest phoenix
#

i want to invite top.gg bot to my server

near stratus
earnest phoenix
#

yepp

near stratus
#

You can't

earnest phoenix
#

and what does dsl doo

near stratus
#

they're private bottum

near stratus
earnest phoenix
#

ok

near stratus
earnest phoenix
#

so whats use

#

of this bot

near stratus
#

It posts your server status to top.gg

earnest phoenix
#

hmm

#

ok

errant flax
#

dunno if im supposed to ping but @ripe prairie

sterile thicket
#

How do I map() this?

pale vessel
#

.map()

#

🩴

#

fetch().then(collection => collection.map(...))

sterile thicket
safe jungle
#

gw lagi buat inventory sama toko eh tapi sum nya error wkkwkw

errant flax
#

?

safe jungle
#

aa

#

apa?

errant flax
#

can u speak english? isee

umbral lake
#

hey, in javascript, how to replace multiples values and send the message edited?

cinder patio
#

message.replace

hot sleet
#

guys i have never used webhook before

#

how to set up one ?

#

mention me if you want to help .

slender wagon
#

is there a way i could open a url on a browser using C#

#

nvm i just used process.start

quartz kindle
#

you cant update node with npm

slender wagon
#

npm is the child of node

errant flax
waxen bough
#

it works hahahha

#

nevermind

hot sleet
#

xD

waxen bough
#

fixed

hot sleet
#

good job

waxen bough
#

i learned commands.set() is bad practice hahha

errant flax
#

why lul

boreal iron
#

The bulk update method is helpful not bad practice.
Even if you wanna reload existing commands without restarting your application you gonna send an empty array to remove all registered slash commands.
…commands.set([]);

hot sleet
#

i just started using discord.js v1.13

#

with very simple code i get this error ```CSS
C:\Users\Zyad\Desktop\Formova Discordv1.13\node_modules\discord.js\src\rest\RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^

SyntaxError: Unexpected token ?
←[90m at Module._compile (internal/modules/cjs/loader.js:720:22)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:643:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:556:12)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:683:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:16:16)←[39m
at Object.<anonymous> (C:\Users\Zyad\Desktop\Formova Discordv1.13\node_modules\←[4mdiscord.js←[24m\src\client\BaseClient.js:4:21)
←[90m at Module._compile (internal/modules/cjs/loader.js:777:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:643:32)←[39m
PS C:\Users\Zyad\Desktop\Formova Discordv1.13>```

hot sleet
#

oh

#

ok

#

ty. i stopped coding for more than a year

#

alot of things need update

waxen bough
#

i guess when i did commands.set() on my bot my client didn't update the commands and was executing a non-existent command.

sterile thicket
#

I did this but it still doesn't show the list of members to select from.

options: [
      {
        type: "USER",
        name: "user",
        description: "Select a user",
        required: true,
      },
    ],```
shrewd hazel
#

Oh ny god

#

D:

rose warren
#

It's easy

#

I'm actually having fun converting my 103 commands to slash commands.

#

They're pog

tired panther
tulip ledge
#

How do u make it so only the user who executed the slashcommand can see the response

rose warren
#

Yeah I considered that but I'd rather just switch everything over. Slash commands is where Discord wants us all to go eventually so I decided to just move it all.

rose warren
tulip ledge
#

With ephemeral: true?

rose warren
#

That doesn't include subcommands

tulip ledge
#

Oh so thats what it is

rose warren
#

It's 100 top level commands

tulip ledge
#

I still dont get what subcommands are supposed to be

rose warren
#

/marry accept @user would be a subcommand of /marry for example

tulip ledge
#

Oh

small tangle
#

Or /music play and /music stop e.g.

vagrant sedge
#

man

#

is there a simple db?

#

sqlite has a syntax which is simple

#

but sometimes isn't

quartz kindle
#

its probably the simplest you can get

vagrant sedge
#

oh nvm i found the constraints schematic

quartz kindle
#

unless you wanna go for key-value dbs

vagrant sedge
#

sql has schematics πŸ’€

vagrant sedge
small tangle
#

E.g. mongodb has bson iirc

#

Jsonlike

quartz kindle
#

not talking about json lol

vagrant sedge
#

oh k

quartz kindle
#

there are many key-value dbs

#

such as redis, leveldb, rocksdb, etc

stark flare
#

/help

wise niche
#

im struggling with the spotipy documentation can someone help me? i cant find how to pull all the tracks from a given playlist ive searched everywhere

crude egret
#

Okay. Discord.js V13. How do I listen to dm's? I had a system set up for it on V12, but that ain't working no more.

crude egret
#

I saw that, but I have no clue how to use it.

earnest phoenix
#

I can not tag the role

async run(client, message, args) {
    if (message.channel.type === 'dm') return
    let user = message.author.username;
    let voice = message.member.voice.channel;

    if (voice) {
        message.channel.send(`${message.guild.roles.cache.get(
          "Staff"
       )} ${
          message.author
        } **Need your help :exclamation:** 
      Reason: ${args.join(" ") || "`\No Reason\`"}
      Voice Chat: \`${voice.name}\``);
    } else {
        message.channel.send(` ${message.guild.roles.cache.get(
          "staff"
        )} ${
          message.author
        } **Need your help :exclamation:** 
      Reason: ${args.join(" ") || "`\No Reason\`"}
      Voice Chat: \`The user is not in the room\`  `);
    }
  }
pale vessel
#

Because the role isn't found

#

Use IDs not names

#

If you want to use names, use roles.cache.find()

shrewd hazel
long crow
#
const client = new Client({
    partials: ['CHANNEL', 'GUILD_MEMBER', 'MESSAGE', 'REACTION', 'USER'],
    intents: ['GUILDS'],
    shards: 'auto',
    makeCache: Options.cacheWithLimits({
        MessageManager: {
            sweepInterval: 600,
            maxSize: 50,
        },
        UserManager: {
            sweepInterval: 600,
            maxSize: 10000,
        },
        ApplicationCommandManager: {
            sweepInterval: 600,
            maxSize:300,
        },
        VoiceStateManager: {
            sweepInterval: 600,
            maxSize: 3000,
        },
    }),
});``` Is this good enough? for the cache management?
#

discord.js new makeCache feature

quartz kindle
#

those are all useless if you only have the GUILDS intent and nothing else

long crow
#

What about ApplicationCommandManager?

pale vessel
#

What even is that for

quartz kindle
#

guild.commands

long crow
#

only guild? how bout global

quartz kindle
#

you cant have more than 100 guild commands, so maxSize 300 is meaningless

quartz kindle
long crow
quartz kindle
#

the limit is per guild

#

all limits are per instance

long crow
#

oh

earnest phoenix
#

Hi, How to make the command work in uppercase and lowercase letters

#

How i use

#
module.exports = class SayCommand extends BaseCommand {
  constructor() {
    super('staffhelp', 'Moderation', []);
  }

  run(client, message, args) {
    if (message.channel.type === 'dm') return
    if (message.member.roles.cache.find(r => r.name === "OP | Tokyo Bot")) {  
      const Discord = require('discord.js');
      const MessageEmbed = args.join(" ");
      message.delete();
      const embed = new Discord.MessageEmbed()
        .setTitle('COMMENDS')
        .addField('Help', 'The bot command list')
        .addField('Say', 'This command say message')
        .addField('AddRole, RemoveRole', 'Adding a role/remove role')
        .addField('Tempmute', 'Give mute temporarily')
        .addField('Mute, Unmute', 'mute/umute for user')
        .addField('Kick', 'kick for user')
        .addField('Ban, Unban', 'ban/unban for user')
        .addField('Lock, Unlock', 'Lock a management room and cancel a management room')
        .addField('Dm', 'Send a private message')
        .addField('Clear', 'This command allows you to delete some messages')
        .setTimestamp()
        .setFooter('Made by TOKYO#0002', client.user.displayAvatarURL())
        
      try {
        message.channel.send(embed);
      } catch {
        message.channel.send(`sorry cannot respond to you command at the moment`)
      }
      
    }
  }
}
solemn latch
earnest phoenix
#

here

quartz kindle
#

he means in the message event

earnest phoenix
#
module.exports = class BaseEvent {
  constructor(name) {
    this.name = name;
  }
}
#

here

quartz kindle
#

the message event

#

client.on("message")

earnest phoenix
#

can someone help

earnest phoenix
sudden geyser
#

aka just follow the stacktrace

earnest phoenix
quartz kindle
earnest phoenix
#

On djs 13 cant i use message event?

obsidian flint
#

you actually can

earnest phoenix
#

I tried messageCreate but not working

obsidian flint
pale vessel
#

isn't that deprecated

#

oh

#

messages load slow the hell

earnest phoenix
quartz kindle
#

what is LOCALE?

obsidian flint
sudden geyser
#

And what is locale anyway

earnest phoenix
#

to help with embeds

quartz kindle
#

i mean, what is the value of the LOCALE variable

earnest phoenix
#

const { LOCALE } = require("../util/EvobotUtil");

sudden geyser
#

that doesn't tell us what the value is

#

It could be a string, number, object, class instance (object), a function, etc.

earnest phoenix
quartz kindle
#

that was a question asking to see the code where you do it

earnest phoenix
#

Do not know, where to

quartz kindle
#

search your files for client.on(

#

and show when you find it

earnest phoenix
#
module.exports = class SayCommand extends BaseCommand {
  constructor() {
    super('staffhelp', 'Moderation', []);
  }

  run(client, message, args) {
    if (message.channel.type === 'dm') return
    if (message.member.roles.cache.find(r => r.name === "OP | Tokyo Bot")) {  
      const Discord = require('discord.js');
      const MessageEmbed = args.join(" ");
      message.delete();
      const embed = new Discord.MessageEmbed()
        .setTitle('COMMENDS')
        .addField('Help', 'The bot command list')
        .addField('Say', 'This command say message')
        .addField('AddRole, RemoveRole', 'Adding a role/remove role')
        .addField('Tempmute', 'Give mute temporarily')
        .addField('Mute, Unmute', 'mute/umute for user')
        .addField('Kick', 'kick for user')
        .addField('Ban, Unban', 'ban/unban for user')
        .addField('Lock, Unlock', 'Lock a management room and cancel a management room')
        .addField('Dm', 'Send a private message')
        .addField('Clear', 'This command allows you to delete some messages')
        .setTimestamp()
        .setFooter('Made by TOKYO#0002', client.user.displayAvatarURL())
        
      try {
        message.channel.send(embed);
      } catch {
        message.channel.send(`sorry cannot respond to you command at the moment`)
      }
      
    }
  }
}
#

it

quartz kindle
#

there's no client.on here

sudden geyser
#

where's waldo

quartz kindle
#

good question

earnest phoenix
# quartz kindle there's no `client.on` here
async function registerEvents(client, dir = '') {
  const filePath = path.join(__dirname, dir);
  const files = await fs.readdir(filePath);
  for (const file of files) {
    const stat = await fs.lstat(path.join(filePath, file));
    if (stat.isDirectory()) registerEvents(client, path.join(dir, file));
    if (file.endsWith('.js')) {
      const Event = require(path.join(filePath, file));
      if (Event.prototype instanceof BaseEvent) {
        const event = new Event();
        client.events.set(event.name, event);
        client.on(event.name, event.run.bind(event, client));
      }
    }
  }
}
#

here?

quartz kindle
#

now show the file that has name: "message"

#

in your events folder

#

probably message.js

earnest phoenix
#
module.exports = class MessageEvent extends BaseEvent {
  constructor() {
    super('message');
  }
  
  async run(client, message) {
    if (message.author.bot) return;   
    if (message.content.startsWith(client.prefix)) {
      const [cmdName, ...cmdArgs] = message.content
      .slice(client.prefix.length)
      .trim()
      .split(/\s+/);
      const command = client.commands.get(cmdName);
      if (command) {
        command.run(client, message, cmdArgs);
      }
    }
  }
}
#

it?

quartz kindle
#

yes

#

this is your message event

#

now to make commands case insensitive, just use toLowerCase

#

if all your command names are lower case, you can just dd it to cmdName

#

cmdName.toLowerCase()

earnest phoenix
#

this is leading to locale error

eternal osprey
#

hey:

  const lat1 = raid.lat;
              const lng1 = raid.lng.substring(1);
              setInterval(async () => {
                fs.writeFileSync("./lastcoordinate1.json", [lat1, lng1]);
              }, 10000);```
(node:16968) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Array
sudden geyser
#

You can't specify an array as the data type to write to the file.

#

Either convert it to a string with JSON.stringify or transform it into a buffer

earnest phoenix
earnest phoenix
#

late reply ik

#

Does someone know how did they change client.commands.has()?

novel snow
#

I am confusion

#

Does anyone know what this is?

#

I can't figure out why this is a issue with Parse-MS

rancid moss
novel snow
#

Sourcecode shit its not code its a error log

#

All code involved, I know, Yes, Its very complex

rancid moss
novel snow
#

I don't even have the original source files for that anymore

#

I am just trying to figure out why parse-ms gets this anymore

#

I have been disecting this shit just to figure new things out

quartz kindle
quartz kindle
earnest phoenix
quartz kindle
#

how about you just console.log(LOCALE)?

earnest phoenix
#

maybe

#
i18n is not defined``` now this the error
#

if (message.member.permissions.has(Permissions.FLAGS.SEND_MESSAGES)) return;

#

Permissions is not defined

mild agate
#

Is there a way to set type as extension of a class? In typescript

lament rock
mild agate
#

no like const a: extends Class = ...;

lament rock
#

just set it as a typeof Class

#

or if it's an instance, omit the typeof

earnest phoenix
#

i keep getting this bug error

quartz kindle
#

show your play.js file

tulip ledge
mild agate
#

so const a: typeof Class = ...; ?

mild agate
nocturne grove
#

can anybody please help me with some regex? Been trying for more than 1 h but still fails.
Imagine I want a string that starts with Hi and ends with }}, but does not end with }}}
What would that look like?

#

/{{Hi.*?[^}]}}/g tried this and lots of others

#

with ?<! things, with more [], with a dollar sign etc.

quartz kindle
nocturne grove
#

it will not define itself

earnest phoenix
#

How

#

On client ?

lament rock
nocturne grove
#

I think it is <Discord>.Permissions

quartz kindle
#

Permissions its an object on Discord

earnest phoenix
#

Okay thanks

mild agate
#

nvm ill set it as any

#

:^)

lament rock
#

Then you don't need to type cast it

#

JUST declaring it works

tulip ledge
#

I mean you could always create a custom type no?

mild agate
#

I decided that because its internal and not accessible by anyone ill set it as any lol

earnest phoenix
#

How did they change message update ?

#

I couldnt find it on guide

#

And not works message update

#

Or nwm i didnt define as old new

earnest phoenix
#

errors*

sterile thicket
#

message.guild.members.cache.map(m=>m.displayName)
Why doesn't this show me all the users in the guild?

earnest phoenix
#

random.choice(string.ascii_letters)

nocturne grove
worn hazel
#

Hey so uhm im running a website with express on nodejs
and im having a few error in my expess/ejs script
So basically i have this 1 button which runs the MyFunction() when clicked

function MyFunction(){
                money += 1;
                <% clicks += 1 %>
                <% if(clicks % 2 === 0) {
                    db.set(`coins-${req.session.userinfo.id}`, userCoins + 1); 
                } %>
}

Now here, the variable clicks is passed as 0 and others are also defined
the error is that no matter what is the value of clicks it will always run the db.set part and give the users 1 extra coin on just entering/reloading the page, making the function useless

vivid fulcrum
#

...so just do an extra check that makes sure clicks is not 0

#

also

sudden geyser
#

Is <% allowed to be multiline?

vivid fulcrum
#

you should batch your database updates

#

updating your database on every click is a big nono

#

you should make a debounced function

boreal iron
#

I don't fucking understand interaction command caching...

    async loadCommands(client)
    {
        const path = __dirname + "/commands";
        const dir = fs.readdirSync(path);
        const files = dir.filter((file) => file.endsWith(".js"));
        
        if(!files || !files.length) return this.#utils.log("Loading commands has failed", "warn");
        
        client.commands.clear();
        
        for(const file of files)
        {
            const command = require(`${path}/${file}`);
            
            client.commands.set(command.name, command);
        }
        
        for(const [id, guild] of client.guilds.cache)
        {
            if(!guild.available) continue;
            
            await guild.commands.set([]).catch((error) => this.#utils.handleError(error, "Deleting commands failed"));
            
            for(const [name, command] of client.commands)
            {
                if(command.guilds && !command.guilds.includes(guild.id)) continue;
                
                await guild.commands.create({ name: command.name, description: command.description, options: command.options }).catch((error) => this.#utils.handleError(error, "Registering command failed"));
            }
        }
    }

guild.commands.set([]) will update the commands on Discord; in this case it will delete all commands

Executing my reload command will call the function loadCommands() above.
It will delete all guild commands and should register the new commands loaded from the files.

Executing my commands again after the reload will still return the old result. Why?

Even need to fucking clear my browser cache after a reload or no slash commands will appear at all.

narrow fractal
#

Hey everyone!

I restarted my bot a few hours ago (Havent changed any code) and this started to happen, i have no idea why ^^"

pale vessel
#

How would it delete all commands like that?

#

You'd have to loop through all available commands and delete them individually, did you do that? So PUT actually replaces everything, including existing commands

boreal iron
#

I mean it works tho, but my commands don't get updated after registering them again via. guild.commands.create(...)

#

The content is still the same

#

somehow

sterile thicket
#
const fetcheduser = message.guild.members.fetch({ query: user, limit: 1 });```
now how would I get the id of `fetcheduser`?
solemn latch
#

youll need to await it, but just .id on the resolved promise

pale vessel
#

TIL

#

I thought it was meant for upsert but an empty array would delete all commands, interesting

sterile thicket
#

My eval

vivid fulcrum
#

did you read it

boreal iron
# pale vessel I thought it was meant for upsert but an empty array would delete all commands, ...

I can see the issue can't be on Discords site causing this behavior.
Take a look at my code above, please.

  • client.commands.clear() will clear my command map (incl. the execute functions) - a property of client
  • requiring the command files
  • client.commands.set() will add the commands to the map

The same process will happen if I reload my commands.

Why the fuck does my property client.commands STILL contains the old properties not the new ones?
I mean I fucking cleared the map...

pale vessel
#

It wasn't related to your problem

boreal iron
#

lol I think I found the issue

#

const command = require(`${path}/${file}`);

pale vessel
#

Oof, you didn't delete the cache?

boreal iron
#

The required file is cached, that's why the command handler can't load it again

#

I forgot to change the line to readfilesync

#

dang πŸ˜†

#

Embaressing

sterile thicket
#

If you call this embarrassing... you don't know what is the height of it is.

sterile thicket
#

anyone for my rescue?

sterile thicket
solemn latch
#

Hmm

#

Weird

solemn latch
sterile thicket
#

ofc

#

I am using fetcheduser.id and fetcheduser.displayName

sterile thicket
#

nothing

#

no error or anything

#

There is a timeout though
Error [GUILD_MEMBERS_TIMEOUT]: Members didn't arrive in time.

hot sleet
#

guild.members.cache.get(guild.owneId)
is not working

#

i just started using discord v13

#

how can i fix this

quartz kindle
#

you have to fetch the owner

sterile thicket
quartz kindle
#

if you have the user, why not fetch it by id?

sterile thicket
hot sleet
sterile thicket
#

the bot commander will type the username

quartz kindle
#

cant they type the mention?

sterile thicket
#

and then my bot will grab it's id and other details

sterile thicket
#

@quartz kindle it also gives me the same disappointment when I fetch by id

#

await message.guild.members.fetch({ userID, force: true })

quartz kindle
#

what about .fetch(id)

sterile thicket
#

but I also wanna make the feature available to search by typing name

earnest phoenix
#

What are you talking about?

#

You can only fetch via ID

#

I haven't heard nor seen of any other way

sterile thicket
earnest phoenix
#

Well then there is your answer

sterile thicket
#

but I wanna grab the promise and put it in a variable

earnest phoenix
#

Then just assign the result to a variable

sterile thicket
earnest phoenix
#

Then await it?

quartz kindle
#

do you have the GUILD_MEMBERS intent?

sterile thicket
#

i did

quartz kindle
#

although in theory it shouldnt be needed with limit 1

earnest phoenix
#

You also have to have the MEMBERS partial enabled

quartz kindle
earnest phoenix
#

Since v12

quartz kindle
#

to fetch members by query?

earnest phoenix
#

To fetch a guild member you need the MEMBERS partial iirc

#

Maybe not with query but as far as my knowledge goes

quartz kindle
#

that doesnt make much sense

earnest phoenix
#

Maybe it is only a v13 thing

#

I honestly lose track of anything d.js related anymore

#

its all over the place

#

You are probably right tbh, it wouldn't make much sense

quartz kindle
#

member fetching was always weird, because you can fetch members from both the gateway and the rest api

earnest phoenix
#

Yea

quartz kindle
#

and djs does a mix of both in the same function

earnest phoenix
#

With v13 you no longer get direct message updates

crude egret
#

Ugh, I'm trying my best to send a message, then wait for the reply, then send another message in V13, but it just isnt WORKING 😭

earnest phoenix
#

you have to have the CHANNEL partial enabled to get the message event to fire in dms

quartz kindle
#

good thing i got rid of all partials in djsl

earnest phoenix
#

it will fire whats in it after the promise resolves

crude egret
#

Any chance you could give me an example? Cause right now, I don't have anything that works

earnest phoenix
#

Oh wait waiting for a reply

#

use a collector

crude egret
#

v13 just destroyed everything xD

#

Gimme a sec

earnest phoenix
#

that is v13 for ya

crude egret
earnest phoenix
#

I've gotten to the point where I pretty much just stopped using anything related to the discord api

crude egret
#

Why did they do V13? It's a mess

crude egret
earnest phoenix
#

I honestly haven't touched awaitMessages in a good year or two so idk if that is correct

quartz kindle
#

does awaitMessage even exist?

crude egret
#

Do you know how to do it without that?

quartz kindle
#

it should be awaitMessages

crude egret
#

And no, it doesn't anymore

earnest phoenix
#

Ah no

crude egret
#

Still deosn't work. I have tried next to everything with that stupid "awaitMessages"

earnest phoenix
#

It doesn't exist in v13

#

You have to use a message collector in v13 now I think

quartz kindle
earnest phoenix
#

Wait waht

#

I couldn't find that on the docs

#

Is that in master?

quartz kindle
#

in stable

#

which now v13 is

earnest phoenix
#

Wait they moved v13 to stable?

quartz kindle
#

filter was moved into the options object

#

yes, since v13 released

earnest phoenix
#

When did v13 release lmfao

quartz kindle
#

a few days ago lol

crude egret
#

I don't know what you are saying xD Discord bots are the first Javascript I have ever written, and any and all previous experience is with LuaU

quartz kindle
#

its already on v13.0.1

earnest phoenix
#

Lmfao

#

tim I might try your library out

#

I don't really meddle with dapi stuff anymore but i've gotten pretty bored

#

LuaU

#

Fucking roblox

crude egret
#

I'm just going back to my roblox game xD I'll figure this out some other day, when my braincells have recovered

#

Yeah

#

What's your issue with roblox?

earnest phoenix
#

Its completely broken

#

Not to mention absolutely garbage now.

crude egret
#

Uhm, okay? As a roblox developer, I disagree

earnest phoenix
#

I remember the days when things didn't cost an arm and a leg to buy in game items

crude egret
#

Oh I'm sorry that we have to make a living

earnest phoenix
#

Bro

#

Roblox was never meant to be for making a living.

crude egret
#

Yet I can show you a few games that are making around 3-12k a month

earnest phoenix
#

On kids

quartz kindle
#

you have to pay for everything, soon enough you'll be paying for oxygen as well, get used to it

crude egret
#

That is a common misconseption

earnest phoenix
#

Who know no better

earnest phoenix
crude egret
#

I have a graph of one of my games. It says that the majority is 18+

earnest phoenix
#

Even I was an idiot and spent over 200$ on that game for cool cosmetics

crude egret
#

Robux revenue is extremely high at 17+

earnest phoenix
#

Heres my take on it

#

You shouldn't rely on something like roblox

#

Yea its cool to get you started but if you truly care you'd do more

quartz kindle
#

if its making you good money, why stop lol

crude egret
#

Out of 944720 robux, 319680 was 18+, not to mention the 17+ catagory

earnest phoenix
#

Tim you need to earn (last I checked) 100k robux which equates to 350$ (Unless their rates have changed)

crude egret
#

Btw, 944720 robux translates to roughly 6.6k dollars a month

#

I have made a few hundred bucks off of making stuff for other people's games, and I promise you, 80% of them are 16+, aka capable of managing at least a small budget

earnest phoenix
#

My only point is why stop there

crude egret
#

Because that is the language and media that I'm best with

#

And it's not only that, roblox is expanding like crazty

earnest phoenix
#

Eh

#

I guess it sort of is

#

A lot of the OG games have died off for the most part

crude egret
#

And a lot of better ones has taken it's place. Go play Phantom Forces and tell me it isn't a banger game

earnest phoenix
#

Phantom Forces is old as fuck man

#

I remember playing that game in 2017

lunar cove
#

Well anyone know how to have empty field name in embed ?

.addField('','Nice to meet you, I\'m still under development, you can head to [#872762628131393567](/guild/264445053596991498/channel/872762628131393567/) to test me out.\n Baka !')```I'm getting error for this
quartz kindle
#

2017 is old as fuck?

earnest phoenix
#

In terms of roblox yes

#

Normally games dont last that long

crude egret
#

I know, still amazing though

#

I'm working on a game thats 5 years old, trying to revive it

#

It might work

quartz kindle
#

where games from 2005 at? lmao

crude egret
#

It might not

earnest phoenix
#

I used to have an account from 2010

crude egret
#

Games from 2005 are usually broken. Developers left them, roblox changed, and the games didn't

earnest phoenix
#

Had some cool stuffo n it

crude egret
#

I actually specialize in remaking old games

#

For the nostalgia

sterile thicket
#

@earnest phoenix @quartz kindle

quartz kindle
#

yes

#

its a collection

novel snow
quartz kindle
#

just get the first result

earnest phoenix
#

You have to get the first one

#

Collection#first()

sterile thicket
#

now what I really want is, get the same result no matter which one is used

earnest phoenix
#

You are getting the same reasult

#

only thing is

crude egret
#

Well, thanks for the peaceful discussion. It's been a while xD

earnest phoenix
#

it returns a collection when you supply a query and a limit

#

but since you are only getting 1 you can just do .first() on it

earnest phoenix
earnest phoenix
#

πŸ‘€

tired panther
#

He isnt finished yet

earnest phoenix
#

Ah

tired panther
#

Hopefully not typedoc πŸ™ˆ

earnest phoenix
#

I doubt it

#

he doesn't use ts

quartz kindle
earnest phoenix
#

O

#

Sounds cool

tired panther
sonic lodge
#

hi, im trying to upgrade to d.js v13 and no matter what i do, the ChannelManager cache is always empty
i can do client.channels.fetch('<id>') and it will fetch the channel, but the cache still doesn't change

#

anyone know a possible why

quartz kindle
tired panther
sonic lodge
#

oh these are my cache settings

        makeCache: Discord.Options.cacheWithLimits({
                ApplicationCommandManager: 0,
                BaseGuildEmojiManager: 0,
                GuildBanManager: 0,
                GuildInviteManager: 0,
                GuildStickerManager: 0,
                MessageManager: {maxSize: 100, sweepInterval: 2700},
                PresenceManager: 0,
                StageInstanceManager: 0,
                ThreadManager: 0,
                ThreadMemberManager: 0,
                VoiceStateManager: 0
        }),```
tired panther
quartz kindle
#

there is no forceset in djs

#

only in djsl

#

and hes not limiting channels

sonic lodge
#

GUILDS, GUILD_MESSAGES, GUILD_MESSAGE_REACTIONS, DIRECT_MESSAGES, DIRECT_MESSAGE_REACTIONS

tired panther
earnest phoenix
earnest phoenix
#

Pretty pog if you ask me

quartz kindle
#

indeed

tired panther
#

With .set?

quartz kindle
#

if you disable cache you cant

tired panther
#

whut, lol

quartz kindle
#

also, is it only channels that are missing? guilds are ok?

rose warren
#

Oh I'm using djs-light and the discord-hybrid-sharding packages for my re-write by the way guys thumbsup

quartz kindle
#

:3

rose warren
#

Installed them yesterday :)

earnest phoenix
#

what is discord-hyrbid-sharding

sonic lodge
sonic lodge
quartz kindle
earnest phoenix
#

I assume meister here made it

sonic lodge
#

ofc lol

quartz kindle
#

how are you checking if its missing?

tired panther
earnest phoenix
#

No idea what that really means tbh

tired panther
#

Yes, I made it lol

earnest phoenix
#

but sounds cool

sonic lodge
quartz kindle
#

what about with message.client.channels?

#

instead of bot.channels

sonic lodge
#

it's still the same, empty cache

quartz kindle
#

weird

#

and if you remove the entire makeCache does it go back to normal?

tired panther
quartz kindle
#

ok wikiman

#

lmao

earnest phoenix
#

I def understand that

#

with my smooth brain

proven lantern
#

anything wrong with this regex for checking if a word is a discord ID?

messagePiece.match(/^<@\D+>/)

tired panther
#

Lol

earnest phoenix
proven lantern
#

dang

#

messagePiece.match(/^<@!?\D+>/)

earnest phoenix
#

Also can it be any ID?

#

Like a role or channel

proven lantern
#

only player or bot ids

earnest phoenix
#

Ah okay

quartz kindle
#

are you using discord.js?

#

if so, doesnt discord.js have built in regexes?

earnest phoenix
#

I think they might actually

tired panther
#

You can check, message mentiom or use their util functions

proven lantern