#development

1 messages ยท Page 1789 of 1

tired panther
#

@silk ridge you have to check if the command exists

earnest phoenix
#
// Get command from the collection
const cmd = <Client>.commands.get(command);

// If the command doesn't exist in the collection, return
if (!cmd) return;

// Execute the command if available
cmd.execute(<Your parameters goes here>);
zinc wharf
#

Lads, we have an error here

lean bobcat
#

Can u check the decomplied zip I don't much about this decompling and java

slender thistle
#

<Client>.commands.get(...)?.execute(...)

lean bobcat
#

Can u check the decomplied zip I don't much about this decompling and java

slender thistle
#

Stop spamming

vivid fulcrum
#

no ๐Ÿง

west spoke
zinc wharf
#

I may be stupid, but I believe he's missing the .cache

tired panther
slender thistle
#

I think I'm slowly going crazy. This has me wheezing for some reason.

earnest phoenix
west spoke
#

poor shiv

zinc wharf
#

Did say I was stupid

silk ridge
#

wait....there are no errors ๐Ÿ™‚

zinc wharf
opal plank
#

yes

lean bobcat
#

Sir

silk ridge
#

i did add instead of ping ๐Ÿ˜„

west spoke
vivid fulcrum
#

im not doing work for you unless you pay mr

#

me

west spoke
#

didn't someone mention that already

silk ridge
earnest phoenix
opal plank
earnest phoenix
opal plank
#

funfact, i didnt say the word once

#

it was all implied and you knew about it

#

nvm i did say it

lean bobcat
sage bobcat
opal plank
#

shush

west spoke
#

lol

earnest phoenix
#

Gigachad

sage bobcat
#

One message removed from a suspended account.

silk ridge
# earnest phoenix But you will run into more errors like these if you don't execute the commands d...

i did like this

const client = new Discord.Client()

const fs = require('fs');
client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./Commands').filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
    const command = require(`./Commands/${file}`);
    client.commands.set(command.name, command);
}

const prefix = process.env.PREFIX

client.on("ready", () =>
{
  console.log("Bot is Ready!")
})

client.on("message", message =>
{
  const args = message.content.slice(prefix.length).trim().split(/ +/);
    const command = args.shift().toLowerCase();

   if (!command) 
   {
     return;
   }
   else if(command)
  {
    client.commands.get(command).execute(message, args);
  }
 
})

client.login(process.env.TOKEN)```
west spoke
#

tfw no code blocks

vivid fulcrum
earnest phoenix
tired panther
vivid fulcrum
earnest phoenix
#

And you're not even getting the command to see if its available in the collection

sage bobcat
#

One message removed from a suspended account.

opal plank
#

let me get u the features rq

tired panther
earnest phoenix
#

Oh no

lean bobcat
opal plank
#

aliases, help, description, permission checking, error handling, priority, argument parsing

#

literally everything you'd have on a command handler, it has it already

earnest phoenix
#

Ah yes here we go again, today's #development sponsor: Raid Detritus Legends

opal plank
#

look, they asked

#

@tired panther and those are only the options for the command itself, there are more on the handler

#

custom prefixes and a ton of other shit

tired panther
opal plank
#

and heres the best part

tired panther
#

Could you show the Ratelimit functionality?

west spoke
#

I should make a super light and basic discord api

silk ridge
# earnest phoenix Oh no
const client = new Discord.Client()

const fs = require('fs');
client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./Commands').filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
    const command = require(`./Commands/${file}`);
    client.commands.set(command.name, command);
}

const prefix = process.env.PREFIX

client.on("ready", () =>
{
  console.log("Bot is Ready!")
})

client.on("message", message =>
{
  const args = message.content.slice(prefix.length).trim().split(/ +/);
    const command = args.shift().toLowerCase();

if (!client.commands.has(command))
{ 
  return
}
  else
  {
    client.commands.get(command).execute(message, args);
  }
  
 
})

client.login(process.env.TOKEN)```
#

now it is..........

west spoke
opal plank
earnest phoenix
opal plank
#

you set which type it'll apply for

earnest phoenix
#

Also you can just if (...) return; instead of if (...) { return; }

opal plank
silk ridge
opal plank
#

so you'd do something like this for example

#

so you can only use 10 commands for 12 seconds in dms, after 12 seconds it resets it

#

just like discord

#

uses per amount of time

west spoke
#

I find it easier to read with single line IFs using brackets

opal plank
#

like presences

#

5 every 60 s

west spoke
#

makes it a bit easier to see what effects what

slender thistle
#

I'm proud of myself for the dumbest crap ever

#

Dash is a bitch

tired panther
opal plank
#

as if someone is trying to spam it?

#

nah, it'll just not run the command if they are ratelimited

tired panther
#

they shouldnt be linear (5+5+5) => rather more (5 + 10 + 12 + 14 + 16 +20 + 40 + 100)

opal plank
#

this is the same way discord ratelimits it

#

i think you can set the ratelimit for users too

#

let me double check

#

oh yeah you can

tired panther
#

Did they made a Guide lol?

opal plank
#

kinda

#

i have a basic repo for people to get the gist and @umbral zealot should have some vids coming up

umbral zealot
#

yeah I'm sort of working on it ๐Ÿ˜„

opal plank
#

she didnt link it on the server yet, so i assume its still being made

sage bobcat
umbral zealot
#

it's far from ready

opal plank
#

figured as much

#

let me link what we have so far

sage bobcat
#

One message removed from a suspended account.

umbral zealot
#

like for example literally having 100% wrong information about sharding in the guide

opal plank
#

hug

sage bobcat
#

One message removed from a suspended account.

slender thistle
#

ads

crimson vapor
#

yes

opal plank
#

for now i'd recommend using my repo and the docs link

slender thistle
#

Shame on you Erowoin

opal plank
#

the docs you can pretty much use inside with typescript and intellisence

crimson vapor
#

my slash command bot > Erwin's basic bot

opal plank
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tired panther
opal plank
crimson vapor
#

what

opal plank
#

my main bot uses both the same thing for slash commands and normal commands

#

merge them into the same repo

crimson vapor
#

im not fucking with regular commands on detritus

#

its just an image bot

opal plank
#

i still need to test that extension evan told me about

#

to extend the message structure and add the button collector

crimson vapor
#

why would I use regular commands for that

opal plank
#

imagine not having both in the same repo

#

smh

sinful thistle
#

Can someone help me with this error?

crimson vapor
#

wdym "both in the same repo"

#

there are no regular commands

tired panther
opal plank
#

add token in config and add ur id in the whitelist

#

and then run it with f5

#

that simple

crimson vapor
#

stinky

#

use tsc then node .

#

like a normal person

opal plank
#

nah, imma add the transpiler only flag

pulsar spade
#

Is there way make captcha system with python?

crimson vapor
#

why what

opal plank
#

and theres already a node . script in it

#

cuz debugger attached?

#

like an ACTUAL dev?

#

imagine running node without a debugger when you are in development

crimson vapor
#

ah yes

#

gotta use my debugger on a cloned bot

#

lesgo

opal plank
#

if you using ti as a framework, yeah, you should

#

breakpoints n shit

tired panther
opal plank
#

legit tho, if u are using console.log() to debug things, you're doing it wrong

#

debuggers are exactly for that

crimson vapor
#

ok but like

#

what do you expect from me?

opal plank
#

be a good dev?

crimson vapor
#

im sorry im american

zenith terrace
#

whats a good dev

sinful thistle
#

a good dev?

#

idk ask discord

crimson vapor
#

discord doesnt know what a good dev is

sinful thistle
#

I mean they have devs also right?

#

they would know ig

opal plank
#

you clearly havent been using discord for longer than a couple weeks

#

crash gifs, exploits that take down guilds, changing ui's multiple times, adding useless shit

#

and the list goes on

sinful thistle
opal plank
#

then you're relatively new

sinful thistle
#

alr

opal plank
#

wanna see what a good dev is?

sinful thistle
tired panther
#

uhm...

#

what to do?

sinful thistle
opal plank
#

fuck where is it

sinful thistle
#

Where is what?

opal plank
#

and which folder did u open

crimson vapor
#

the if else thing? the one you posted on your reddit a while ago?

opal plank
#

you gotta be in detritus_example

#

their beta test

crimson vapor
#

not if else

opal plank
#

they legit released a build that literally crasesh when you open

crimson vapor
#

idk

#

callback hell?

sinful thistle
#

me rn on replit:

opal plank
#

not a single person tried the app out before publishing it

tired panther
#

did this

opal plank
woeful pike
opal plank
#

run with the explorer enabled one

woeful pike
#

hello guys I'm having some issues

#

pls help

sinful thistle
#

bruh what

tired panther
west spoke
sinful thistle
#

Not cool

#

smh

opal plank
#

and click the green button

tired panther
opal plank
#

i really need to remove the other ones

tired panther
sinful thistle
#

It keeps saying I need to select a language even tho I did

#

on visual

opal plank
#

i hate that sharex skips the first second

woeful pike
#

time to pr the fix

opal plank
#

too lazy for that

#

prob slow pc

#

running a few vm's in the background

woeful pike
#

jaex abi pls fix

opal plank
tired panther
#

SHould I do npm i ts-node?

silk ridge
#

hi

opal plank
#

and one of the is hungry af

opal plank
silk ridge
#

added another command like this same but not working ๐Ÿ˜ฆ

opal plank
#

when you clone the bot, it doesnt download the dependencies

#

you need to either npm i, or yarn install

tired panther
#

I saved them globally

woeful pike
#

you're.. running a typescript file with node and a ts-node require? wtf

opal plank
#

just ts-node

#

"runtimeArgs": ["-r", "ts-node/register", "--inspect=4765"]

woeful pike
#

why do u need that

#

or is that what vscode defaults to

opal plank
#

nah, thats what i set to

#

instead of tsc

#

and running just node

#

im very much fond of ts-node

#

i need to add the transpileronly flag there

woeful pike
#

yeah but why not just ts-node file.ts

opal plank
#

so if people want to run it in prod, there wont be any diff than trasnpiling it beforehand

#

u need it globally to run it

#

otherwise it'd error with the same thing he showed

woeful pike
#

put it in an npm script

tired panther
#

interesting

opal plank
#

thats an option too, but i might get screeches about stuff being saved globally

#

huh?

woeful pike
#

seems kind of counter intuitive to require tsnode like that

opal plank
#

it is a bit, but its just saved as dep

#

line 6, 25 huh

#

let me check that

#

oh

#

i know why

#

fucking @crimson vapor

crimson vapor
#

why not use tsc to find the errors?

tired panther
#

wrong confis.json fle name

opal plank
#

thats cuz he added a .example on it

crimson vapor
#

yes bro

#

I did

tired panther
#

yeah lol

opal plank
crimson vapor
#

because u stupid and pushed the config.json to git

opal plank
#

remove the example. part

crimson vapor
#

dumdum

opal plank
#

wdym im stupid

#

its literally MEANT to be there

#

with placeholders

#

so it doesnt error like this

crimson vapor
#

it doesn't error if you set it up properly

tired panther
#

okay it finally started, what should I do know?

crimson vapor
#

why would you push config.json to github

#

thats like not gitignoring .env

pulsar spade
#

Can I make captcha system using python ?

crimson vapor
#

probably

opal plank
#

discord suddenly disconnected me

silk ridge
#

hi anything ?

slender thistle
#

I heard Python

near stratus
crimson vapor
slender thistle
#

CAPTCHA WITH PYTHON? MAY I INTRODUCE YOU TO DASH

opal plank
#

thats it

pulsar spade
#

Dash?

opal plank
crimson vapor
#

I hate that

#

especially since

  1. 2FA enabled
  2. phone always dead
slender thistle
woeful pike
opal plank
pulsar spade
#

Python

opal plank
#

my 2fa is also enabled

crimson vapor
#

nice

opal plank
#

literally pain

woeful pike
#

captchas are so 2011 man

slender thistle
crimson vapor
#

I have my discord on my old phone so I keep that charged so I can log on

silk ridge
woeful pike
#

yeah

pulsar spade
#

I know but how can I make it work before join anyone on discord

tired panther
pulsar spade
#

Server

near stratus
slender thistle
#

It took me like a day to understand how to get my DataTable cells callback to actually fire

woeful pike
#

hcaptcha is the worst thing in the world

opal plank
#

you should use --trasnpileronly

#

ts-node keeps a cache of ur code in memory

near stratus
woeful pike
opal plank
#

what should've been about 80-100mb, is prob using a bit more than that based on how many users ur bot has

woeful pike
quartz kindle
#

i hate both equally

#

but i've had less problems with hcaptcha

pulsar spade
#

Need a website?

quartz kindle
#

what about it was so terrible for you?

pulsar spade
#

But I saw some server ask captcha

woeful pike
#

hcaptcha has terrible images you can never know wtf you're looking at I always have to do multiple rounds

pulsar spade
#

Before joining

woeful pike
crimson vapor
#

captcha is so annoying

woeful pike
#

so incredibly stupid

crimson vapor
#

can we just remove it

quartz kindle
#

well idk about implementing, i never used any

#

but solving them, hcaptcha never gave me issues

woeful pike
#

I'm removing captcha from the voting page

crimson vapor
#

I can never solve hcaptchas on the first try

#

its so hard

quartz kindle
#

recaptcha often fucks me over, asks for three verifications in a row for no reason

#

specially if you use a privacy browser

#

and privacy addons

#

recaptcha goes crazy

woeful pike
#

yeah never first try because it gives you an image like this and asks you if there are any motorcycles in it

crimson vapor
#

google chrome ยฏ_(ใƒ„)_/ยฏ

crimson vapor
solemn latch
#

i like when its a picture of something that could be the other thing.
like "click trucks"
shows a boat, and it thinks its a truck.

woeful pike
#

privacy addons tend to throw off abuse prevention yeah

near stratus
woeful pike
#

there's quite a bit of fingerprinting involved to prevent automation/abuse so

crimson vapor
#

they can have my cookies if I don't have to do any more captchas

quartz kindle
#

ye i've had tons of issues with recaptcha on brave, it refuses to accept i got them right and keeps saying it failed

woeful pike
#

firefox with tracking protection probably fucks over a bunch of websites

silk ridge
#

Can anyone help me ๐Ÿ™‚

opal plank
#

fuck me

quartz kindle
#

ew no

opal plank
#

@woeful pike do you know if i can add flags to tsnode in the args?

slender thistle
#

Erwin coming out I see

west spoke
near stratus
crimson vapor
woeful pike
opal plank
#

i think i might have to go with variables

woeful pike
#

no if you're using -r haha no I don't think so

opal plank
#

fml

west spoke
#

@pulsar spade you alright?

silk ridge
#

k bye i will help myself ๐Ÿ™‚

opal plank
#

how the heck am i gonna do this then

pulsar spade
#

Lol

opal plank
#

TS_NODE_TRANSPILE_ONLY should be the flag

#

can i just run it in the tsconfigs, i wonder

#

or do i literally need to use env

#

wait, oh shit i can do that with ts-node-transpile-only?

#

aha

#

@tired panther

#

add /transpile-only flag

#

didnt need to fuck with the env's

pulsar spade
#

Py vs js

opal plank
#

and works fine

#

coolio

#

and dont ask why my beta/test bot has 45k users

brazen oriole
#

why does your beta/test bot have 45k users

tired panther
opal plank
#

i know it works without it

#

but you asked about ram usage

earnest phoenix
opal plank
#

this should greatly reduce it

#

even if its already lower than djs even with that flag off

pulsar spade
sinful thistle
#

Can someone help me?

zinc wharf
#

"const"

#

Not "contst"

#

@sinful thistle

sinful thistle
#

oh

sage bobcat
#

One message removed from a suspended account.

sinful thistle
#

ty

sage bobcat
#

One message removed from a suspended account.

sinful thistle
#

I spelt it wrong lol

opal plank
sinful thistle
#

Jesus I keep finding errors the console says this part is an error can someone help me?

opal plank
#

looks fine to me

#

need context

sinful thistle
sinful thistle
opal plank
#

wdym where u put that

#

i meant i cant tell you whats wrong without more context

#

post more code

sinful thistle
#

Oh

#

Does this help?

#

@opal plank

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sinful thistle
#

Oh shit

small sand
#

I got my two bot to work now

sinful thistle
#

still says theres a error

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

can you give context to line 36?

sinful thistle
earnest phoenix
#

also the keyword is "const [VAR_NAME] = [OBJECT]"

sage bobcat
earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sinful thistle
#

@earnest phoenix

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

solemn latch
#

const is only for defining a variable

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

...change it to const savedMsg = message.channel.send("You can't ban yourself bozo");

solemn latch
#

it wont log the message, just a promise

sage bobcat
earnest phoenix
earnest phoenix
#

not the problem

sinful thistle
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

what's the error message

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

I DO that's the correct statement!!

earnest phoenix
#

I'll have you know that [comical developer blabber]

sinful thistle
#

is your user the same as your discord?

earnest phoenix
#

Yes

zinc wharf
sinful thistle
#

I'm new to this shit

zinc wharf
#

The how the christ do you have the bot developer role then

sage bobcat
#

One message removed from a suspended account.

small sand
#

?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sinful thistle
#

Alr

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

young lark
#

hi guys i'm new here

earnest phoenix
#

Hi

zinc wharf
#

I have honestly lost too many brain cells from that 1 screenshot

earnest phoenix
#

it gets worse

small sand
# sinful thistle Alr

How did you get the bot developer role do they give it to you when your bot get in or what do you have to do

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wheat mesa
#

Iโ€™m not quite sure how the bot developer role works at this point...

zinc wharf
earnest phoenix
#

Maybe he used git clone ๐Ÿ˜„

wheat mesa
#

Maybe

zinc wharf
wheat mesa
#

I think it would be pretty obvious if it were a copied bot though

earnest phoenix
#

I KNOW HOW TO USE DISCORD.JS!!!!

#

(and node)

zinc wharf
#

Clearly not

#

I've never known someone to do what you've done

earnest phoenix
#

what

earnest phoenix
#

idefk

wheat mesa
#

Send the code?

earnest phoenix
wheat mesa
#

Pretty sure to save a message like that you have to use async/await...

zinc wharf
#

If you want to send text from a const, don't put "message.channel.send" there. Just do const cantBanYourself = "You can't ban yourself!", and in the message.channel.send do ${cantBanYourself}

solemn latch
#

pog finally someone who didnt leak their token on replit

wheat mesa
#

Okay well thatโ€™s why

#

You donโ€™t have any curly braces

#

After your of statement

#

If*

earnest phoenix
#
"process.env.token"
#

back to minecraft

earnest phoenix
#

npm module discord-buttons wants to know your location...

[Allow] [Deny]

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

huh?

slender thistle
#

lol what

solemn latch
#

๐Ÿ‘€ your code structure entirely changed

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

i don't see it anywhere

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

sorta

#

I changed a bit but not this much

solemn latch
#

๐Ÿ‘€

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

"target.role.add(const Discord = require("discord.js") [missing parenthesis]" ????????

slender thistle
#

what is that

#

This hurts

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

slender thistle
#

nani

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

...vps?

slender thistle
#

you just create a repl and press the Run button

sage bobcat
#

One message removed from a suspended account.

slender thistle
#

Ma'am I'm disappointed in you

sage bobcat
#

One message removed from a suspended account.

slender thistle
#

not using repls for testing stuff smh

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

...create a repl, chiose the language, write the code, keep possible secrets, manage possible pr, check versioning, manage a team, write code, press run!

fucking start all over there was an error

sage bobcat
#

One message removed from a suspended account.

fluid sphinx
#

Is anyone else having issues with editing embeds. It just says "Your message is empty"

#

The way I got around it was putting it in an object: {embed: embed}

earnest phoenix
#

make sure your message.channel.send has an actual message in it

#

plus the embed

fluid sphinx
#

Yeah the message.channel.send has the embed and then when you go to edit it, it says the message is empty when you try to put an embed

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

woeful pike
#

express bad

near stratus
earnest phoenix
#

mfw muted for bad code

stiff lynx
#

a lot of Maps in the code can slow the bot?

earnest phoenix
umbral zealot
near stratus
earnest phoenix
#

koa

#

sounds interesting

timid widget
#

keep on getting this error,
Error: Could not locate the bindings file. Tried:

earnest phoenix
#

i only like express becuase i made a snarky name out of it for EXPRESSKCD (an express-based XKCD reader)

#

koa? more like... uhhh.........

#

uhhhhhhhhhhhh

umbral zealot
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

koda or koa

umbral zealot
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

what is differenc ebetween express and koa

#

other than average fan/enjoyer

solemn latch
#

Koa from what I hear is the successor to express.
Made by the same people just redesigned, so its probably a bit faster.

stiff lynx
#

Maps can slow down the bot?

#

because today my bot Is slowee than before

lyric mountain
#

don't think so

#

unless you're using maps wrongly

stiff lynx
#

maybe Is the VPS

lyric mountain
#

maps are always N(1) ops

#

I mean, the normal unordered hash-backed maps

sudden geyser
#

@flat copper You're trying to compare a Message with a Channel.

#

let channel = ... will be a channel, but .awaitMessages will be a Message.

#

Since you're trying to wait for user input (which will probably be the channel), it doesn't make to check the original message for a channel mention.

#

Instead, in the .awaitMessages filter, you should be filtering the content so it's from the user and that a channel was mentioned / found.

flat copper
#

I fixed it
Thnx

flat copper
#
if(!channel.permissionsFor(client.user.id).has("EMBED_LINKS", "SEND_MESSAGES")) return message.channel.send({embed: {
          title: "Invalid Permission", 
          description: `**I dont have permission to Send message and embed links**! ${channel}`,
          color: "RANDOM"
        }})
#

Why its not working?

wheat mesa
#

Youโ€™re trying to send an embed into a channel that you explicitly donโ€™t have permissions to do so in...

^ ignore this Iโ€™m stupid, didnโ€™t see it was message.channel.send, thought it was just channel.send

flat copper
#

Message.channel.send!

lyric mountain
#

{embed: {

flat copper
#

Wait ill show you my full cmd

lyric mountain
#

no need to

#

as waffle said, you're basically doing this:

if (!cat.barks())
  cat.bark();
flat copper
#

Its modlogs setup
If user mention a channel
If my bot has no permission

#

..

lyric mountain
#

you cant send an embed if you are not allowed to

#

you're trying to send an embed to say you cant send embeds

wheat mesa
#

^^

flat copper
wheat mesa
#

What are you defining channel as

flat copper
#

See one time

#

So I'm sending the msg where author sends the msg

wheat mesa
#

Does your bot give you an error?

flat copper
#

Missing access

wheat mesa
#

Make sure youโ€™re sending the message into a channel that you have embed permissions in then.

flat copper
#

See its sending the msg bot not at mod log

wheat mesa
#

Does mod log have the proper permissions for the bot to have embed access though-

flat copper
#

Nope

wheat mesa
#

Then thatโ€™s your problem

lyric mountain
#

also, can the bot see the channel?

#

missing access is normally thrown when the bot doesn't have read access to a channel/guild

flat copper
#

Ooo ic

earnest phoenix
#

Is 80k cached users much from 500k ?

lament rock
#

how many guilds

earnest phoenix
#

4k

lament rock
#

80k is pretty excessive if cached in memory. I only have 46k cached on disk which spans over months.

earnest phoenix
#

700 mb ram per day

lyric mountain
#

well...it's discord.js after all

earnest phoenix
tacit sequoia
#

Lol

near stratus
#

that's why

tacit sequoia
#

Why do you require cache?

earnest phoenix
paper ferry
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

opaque seal
#

does someone know any great looking software documentation tool that supports MD files?
Something like vuepress or docasaurus but better looking

#

I don't think repl is ment as an hosting service

#

iterate over the guilds, get a channel and send a message?

sudden geyser
#

Also speak of the devil

#

Commonmark just released a new version after 2 years

opal plank
#

@quartz kindle u awake rn?

#

need sum assitรฒncรช with sqlite

#

or reading a file, that is

#

actually, nvm, found this

#

pog /s

#

hmmmmm where do they store this shit

restive nacelle
#

what kind of bot should i make? ๐Ÿ˜ฐ

#

idk what bot i should make

lyric mountain
lyric mountain
opal plank
opal plank
umbral lake
#
Collection(1) [Map] {
  '794885416821981206' => {
    reason: 'haha lol\n',
    user: User {
      id: '794885416821981206',
      system: null,
      locale: null,
      flags: [UserFlags],
      username: 'EL TOะ˜TOะ˜',
      bot: false,
      discriminator: '0006',
      avatar: 'a_10de547e3c789873d3ae9eaa775fb599',
      lastMessageID: null,
      lastMessageChannelID: null
    }
  }
}

how to take the reason?

lyric mountain
#

imagine you're acessing folders

#

. enters a folder/retrieve a value

#

so, you start root

#

root.reason

umbral lake
#

so

#

but

lyric mountain
#

because reason is a property in the root of the object

umbral lake
#

root not defined

lyric mountain
#

i know

#

that's why you don't simply copypaste what I write

#

root will be whatever you've defined as the variable

umbral lake
#

I do what so? sorry but I'm french and english I'm learning lol

#

oh

#

so

#

if I do root.reason?? xD

lyric mountain
#

or if you're acessing the map directly, it'll be <getting the entry>.reason

#

root is an example

#

not to be taken literal

umbral lake
#

oh

lyric mountain
#

for example, imagine that data is stored in a map called cheetos

woeful pike
#

that's literally not true lol

#

root.first().reason

lyric mountain
#

cheetos["key"].reason

woeful pike
#

you don't know the key obviously

lyric mountain
#

looks like the user id, so cheetos[user.id].reason

umbral lake
#

found

#
console.log(fetchBans.first().reason)
#

thx

#

but

#

the reason

#

is for any member?

#

I go test

restive nacelle
opal plank
#

nitro giveaway bots intensifies

pale vessel
opal plank
#

is there a way to monitor a folder in android for file changes?

umbral lake
#

@lyric mountain Idk how to add the rason with the content :/ :

client.on('message', async message => {
    if (message.content === 'banlist') {
        const fetchBans = await message.guild.fetchBans();
        const bannedMembers = (await fetchBans).map((member) => member.user.tag).join("\n");
        console.log(fetchBans.first().reason)
        if (!bannedMembers) {
          let msg = await message.channel.send("โŒ Aucun utilisateur n'est banni du serveur !");
        }
          const bin = await sourcebin.create(
        [
            {
                content: bannedMembers,
                language: 'text',
            },
        ],
        {
            title: `Liste des bannissements du serveur => ${message.guild.name}`,
            description: 'Synapse',
        },
        );
        let button = new disbut.MessageButton()
        .setStyle('url')
        .setLabel('Cliquez ici !')
        .setURL(bin.url);
          
        let componentButton = new disbut.MessageActionRow()
        .addComponent(button);
          
        const embed = new Discord.MessageEmbed()
        .setTitle(`Voici la liste des bannissements du serveur !`);
        
        message.channel.send({component: componentButton, embed: embed})
    }
});
lyric mountain
#

I have several questions

#

I suggest you to learn a bit more about javascript itself

umbral lake
#

yes but

#

I found how to get the reason

#

but to do this,to example: name: the user | reason: the reason

lyric mountain
#

just concat

umbral lake
#

how :/

lyric mountain
umbral lake
#

its not important this

#

just this

fresh verge
#

Whenever I add new stuff to a data model file, how can I make it automatically add the new stuff to existing data?

pale vessel
#

No

#

What are you using?

lyric mountain
umbral lake
lyric mountain
#

no

#

it's the reason for the first entry in the map

umbral lake
#

oh

#

wait

lyric mountain
#

please, learn js before attempting to make a bot

umbral lake
#

...

#

I have 2 certified bots before I'm using not discord.js

lyric mountain
#

yeah, sure

#

not wanting to put you down or anything, but that's a fundamental problem you got there

#

"how to access an entry in a map" and "how to access a property in an object"

opal plank
#

fetchBans never change when you do .map()

woeful pike
#

I have const fetchBans = await message.guild.fetchBans(); 2 certified (await fetchBans) bots before

opal plank
#

its a non destructive filter

pale vessel
#

Gotta make sure you fetch it

woeful pike
#

you can never be too sure that you awaited it

opal plank
#

await the console log too

woeful pike
#

you never know

lyric mountain
opal plank
#

like this?

woeful pike
#

u broke the code tho ๐Ÿ˜”

pale vessel
#

Forgot await here

opal plank
#

but i made sure to async the .map tho

woeful pike
#

but now it's an array of promises pensive

opal plank
#

i wonder how many errors TS will screech at me for

opal plank
woeful pike
#

also you forgot to await "\n"

crimson vapor
#

await promise.all

opal plank
#
        Promise.resolveAll(const fetchBans = await message.guild.fetchBans();
        const bannedMembers = (await fetchBans).map(async (member) => await member.user.tag).join("\n");
        await console.log((await (await fetchBans).first()).reason))```
#

done

woeful pike
opal plank
#

gonna frame that work of art

crimson vapor
#

You need more awaits

woeful pike
#

I still haven't made any progress with that await tool

#

ts-morph is shitty for doing AST modifications

opal plank
#

i havent made any progress, with anything

#

procrastinationโ„ข๏ธ

#

in fairness i got massive headaches

#

but still tho

#

productivity

#

how'd that rust thing go xet?

woeful pike
#

oh I didn't take a look at it

earnest phoenix
woeful pike
opal plank
#

thats pog

#

also, for the record

#

not nearly as many as i thought it would scream for

#

u using websockets for that realtime ?

woeful pike
#

ye

opal plank
#

pretty pog ngl

woeful pike
opal plank
#

ah there we go

crimson vapor
#

uwu sockets pog

opal plank
#

uwuBSockets

#

WeebSockets

#

didnt i make the same joke when tim mentioned it?

lyric mountain
woeful pike
#

I was gonna do it in another language but typescript is just so fucking good I can't

opal plank
#

sure did lmao

woeful pike
opal plank
#

someone who knows typescript and fucking appreciates it

woeful pike
#

also that's just the icon for some page I have in notion

lyric mountain
#

is that a chrome thing?

woeful pike
#

it's a pinned tab

lyric mountain
#

oh

woeful pike
#

typescript is both the worst shit in the world and the best thing ever

#

worst because it doesn't provide any real safety and makes it easy af to shoot yourself in the foot but great because it works well most of the time

opal plank
#

fighting typescript has to be some of the most infurating things to do in coding

#

specially when you're dealing with advanced types

woeful pike
#

I'm a seasoned typescript fighting veteran

opal plank
#

i have my hammer right next to me in case of rages

woeful pike
#

I just wish elm had an ecosystem as good as typescript and supported server side rendering

#

I'd ditch TS in a heartbeat

opal plank
#

never tried that, so i cant comment on it

woeful pike
#

it's really really good

earnest phoenix
#

Amateurs, fight against asm

opal plank
#

might give it a check at the very least

woeful pike
#

this guy is my favorite speaker

opal plank
#

haskell

#

of course

woeful pike
#

I can't help it I'm a huge simp

#

please just watch every talk this guy has

slim umbra
#

just use an actually typesafe language xd

woeful pike
#

at least watch this it's not as long as the first

slim umbra
#

not the monkeypatch trash that is ts

woeful pike
#

yeah elm will not let you deceive the compiler it's super solid

opal plank
#

thats a good thing in my book tbh, being able to opt out of the typechecker

woeful pike
#

if you listen to the first presentation he talks about how their production codebase didn't encounter a single runtime error until 4 years in

slim umbra
#

me when i am unsafe { safeโ„ข๏ธ }

woeful pike
#

in my experience if you're trying to deceive the elm compiler your approach is unsound

opal plank
#

typescript is amazing, but if u use it correctly, you might be getting those levels of stability

#

specially in strict checks

slim umbra
#

ehhhh no

woeful pike
#

you can't

umbral lake
#

Hey:

When I do this:

        const fetchBans = await message.guild.fetchBans();
        const bannedMembers = (await fetchBans).map((member) => member.user.tag).join("\n")
        const bannedMemberReason = (await fetchBans).map((member) => member.reason).join("\n")
        console.log(bannedMembers + "===" + bannedMemberReason + "\n")

the console.log is:
user
user2 === reason for user
reason of user2

How to do:
user === reason for user
user2 === reason for user2

If you don't understand, rip lol

woeful pike
#

you can't get rid of any

opal plank
#

that what meant

slim umbra
#

or unknown

opal plank
#

strict checks

#

implicityAny false

woeful pike
#

for example in nextjs your page props will always be any

#

even if you give it a type

opal plank
#

you'd be typecasting it

#

oh

#

really?

slim umbra
#

yeah

woeful pike
#
export default function Page({ some, property, here }) {
  return <div>...</div>
}

export function getServerSideProps(){
  return {
    props: {
      some: 1,
      property: 2, 
      here: 3,
    }
  }
}

there's simply no way to ensure type safety here

opal plank
#

should that implcity be pulled from the function?

woeful pike
#

you can give them the same type, use a wrapper function for getServerSideProps and make it super neat, use eslint rules to make sure you check for consistency but at the end of the day typescript cannot check to make sure that those 2 types match

opal plank
#

this would normally be implictly stated

woeful pike
#

you can give it a type, but giving it a type doesn't prevent you from passing something unrelated from getServerSideProps

#

because those 2 are not connected

opal plank
#

hmmmm

woeful pike
#

and the values come from the javascript side of the world

opal plank
#

i see what you mean

woeful pike
#

elm doesn't allow for stuff like that. It's both the language and the framework

#

that inconsistency is actually the reason why I broke production once lol. Working on making a generic wrapper for getServerSideProps but it's hard to cover every single case

#

not to mention you get completely magic props from things like [id].tsx in the filename

opal plank
#

i see

woeful pike
#

so part of me is always worrying because typescript has so many escape hatches even though the type system is incredible

opal plank
#

i've personally never got into a brickwall that i couldnt pass

#

even in cases like that, im usually stuck with using isntanceof

#

or something similar to properly pass the code

#

or merge union types

#

but thats about it

#

never actually found something i cant circumvent in ts

#

which is why i like it so much

woeful pike
#

I mean yeah but at that point you have to tell the compiler "dude just trust me I know what I'm doing" and you start out knowing what you're doing but that kind of turns into a lie after a while

opal plank
#

thats where bugs come in

#

its mostly human error

woeful pike
#

15 commits later, you've introduced a new type to that "dude bro trust me my duder" variable and never checked because you continued to assume typescript will just let you know when something is unsound

opal plank
#

"im pretty sure this returns this type, so just trust me"

woeful pike
#

I love the "if it compiles it works" concept but typescript is just not one of those languages

opal plank
#

in all honesty, part of that is to blame for those who dont use mocha or jest to test stuff

#

its mostly in hobbists codes

#

though i get the point

#

it should have its own checks internally

woeful pike
#

well testing is mostly for behavior I think you need a type system to prevent you from allowing behavior that shouldn't be possible

opal plank
#

"if it compiles it works"

#

without needing to rely on something else to check it for you

woeful pike
#

pls listen to the impossible state talk I linked pls pls pls

opal plank
#

i will

opal plank
woeful pike
#

yes

opal plank
#

added on the watchlist

woeful pike
#

it's elm but you're smart enough to understand what he's saying

opal plank
#

as long as its not very specific terms specifically for that lang, i shuold be fine

#

is that something i have to watch

woeful pike
#

this is probably the most language specific terminology u see

opal plank
#

or can i just listen to it like a podcast?

woeful pike
#

the code examples are important

#

so probably watch

opal plank
#

then i'll watch later

#

im going back and fourth too mcuh

woeful pike
#

and that's just

function back(arg1: History): History;
function answer(arg1: string, arg2: History): History;
rose lance
#

anyone has an idea why intellij is telling me this? all I could find on google was you can't use uppercase letters when searching for "property is not allowed" which isn't the case

woeful pike
#

is your file called package.json by any chance

rose lance
#

no the file is called template.json

opal plank
#

thats a neat approach to the problem tbh

#

watching it rn

woeful pike
#

that's why static typing is SO useful

opal plank
#

he covered basically everything ive said this far with testing

woeful pike
#

and why having so many holes in the type system can ruin something that's meant to be an amazing reassurance

opal plank
#

now i see why you so eagerly pointed to the link

#

@woeful pike so what he's doing is the equivalent of a private getter?

#

History.questions

#

but proposing using something similar in order not to break code

#

so you can have internals

woeful pike
#

yeah essentially it's private properties and public getters, nothing too revolutionary but I like this approach a lot more

opal plank
#

hmmm i see

woeful pike
#

because there's nothing magical going on here

#

in OOP "private" is like a pretty magical thing

#

like what does it mean for a function to be private vs public

#

but in elm/haskell a private function is just something you don't export

opal plank
#

i see

#

5 mins and its finished

#

lemme watch it till the end rq

#

that was a really good explanation

#

lowkey made me think about some stuff in my code i might wanna revise

#

cuz i do have some public libs

#

@woeful pikety for sharing that

woeful pike
restive nacelle
#

what kind of bot should i make? ๐Ÿ˜”

proven lark
#

idk

latent heron
#

โ˜บ๏ธ

#

@slender thistle

#

finished rewriting one of the commands now

slender thistle
#

oooo nice

misty sigil
#

what in fucks name

#

WHY IS IT SO LOOOOOOOOOOONG

latent heron
#

what

#

wanna see the original source code?

misty sigil
#

nah I can zoom in and read it

latent heron
#

i'll make you take that statement back

misty sigil
#

this is what it looks like for me

#

Jesus Christ

#

does it get any longer?

latent heron
#

lol

#

is that a question or are you requesting for that

misty sigil
#

both.

latent heron
#

if i look back at my old moderation bot

#

i can find you a 1.7K lines of code script

misty sigil
#

dm me it lmao

latent heron
#

that's more if i can find the bot

#

but ye @slender thistle the new code rewrite looks nice

misty sigil
#

but damn whatโ€™s the resolution on those

latent heron
misty sigil
#

I do not know python but that looks cool

arctic ingot
#

How my bot can announce when someone vote? JavaScript

latent heron
#

the new code rewrite is strictly following the PEP-8 standards of Python

#

as well as following very closely to Discord API documentation

misty sigil
arctic ingot
misty sigil
#

basically itโ€™s a

#

webserver that receives requests from top.gg

arctic ingot
#

Ok, I'll try

short siren
#

How can a colour code be an integer when hex colour codes include letters?

#

Then when I try and put it as a string it doesn't work

pale vessel
short siren
#

Ohh thanks ๐Ÿ™‚

lyric mountain
#

everything is hex if you try hard enough

earnest phoenix
#

Why i get this error

#

Does somebody know?

lyric mountain
#

the manager

#

is not ready yet

earnest phoenix
#

I can read

#

Its giveaway manager btw

#

I downlaoded it

lyric mountain
#

did you read the setup part?

earnest phoenix
#

Lemme check

#

@lyric mountain do you know it ?

restive nacelle
#

any ideas for what bot i should make? ๐Ÿ˜ฐ

wheat mesa
lyric mountain
#

but I'll ask once again, did you follow the setup steps EXACTLY as written?

earnest phoenix
#

@lyric mountain yes i did

#

There was typing if you using quick db copy and paste these and i did

#

But it saying 1 isnt positive

lyric mountain
#

well, do you know at least where the error is happening?

#

run the bot in debug mode

#

and use breakpoints

#

all you can do is hope that the error happens very early in the code

earnest phoenix
#

Actually error is about winnerCount when i type there it works with no problem but it means winner count isnt replaceable

lyric mountain
#

find where the error happens

#

in the code I mean

#

then show the code

#

without some code we're shooting in the dark

earnest phoenix
#

The problem arises when I want to start a giveaway

lyric mountain
#

did you try with more than 1 winner?

earnest phoenix
#

Yes

#

Even tried with 1000

#

But still saying 1000 inst positive

lyric mountain
#

run with debug mode

#

see what value is being passed

#

or just go the lazyman's route and add console.logs everywhere

earnest phoenix
lyric mountain
#

use debug

earnest phoenix
earnest phoenix
#

And there is typing on console 1 as winner count

lyric mountain
#

welp, not much I can help then

#

try seeing if the creator can be found on discord