#development

1 messages · Page 1545 of 1

pale vessel
#

200px right?

gilded olive
#

@opal plank not yet

pale vessel
#

oh that looks like 25px

opal plank
blissful coral
#

Uhhh whatever the default response from discord.js when you use displayAvatarURL() is

#

png format

#

25px iirc

sacred trout
#

from discord.ext import commands, cooldown, BucketType

gilded olive
#

I will soon probably tho erwin, have something in the making pog_champ

#

uh huh

#

that isn't what you need

opal plank
#

another contender joins the ring, it seems

pale vessel
#

well in your code you used 200x200

blissful coral
#

I did 25, 25, 200, 200

gilded olive
#

you call it like this

extensions = ["cogs.SomeCog", "cogs.SomeOtherCog"]
for extension in extensions:
  bot.load_extension(extension)``` @sacred trout
sacred trout
gilded olive
#

wherever your bot is run

lyric mountain
#

No

#

That'll just draw the image from right to left

#

It's be canvas.width / 2 - 100 actually

opal plank
#

so i can finish my wiki

gilded olive
opal plank
#

enemies is another im looking foward to

#

but thats going to be later down in dev

#

we are working in something a bit more...spicy

sacred trout
gilded olive
#

that is indeed funny

#

youre trying to import commands from discord.ext.commands

#

see the logic there?

#

it would be from discord.ext import commands...

#

lol

sacred trout
#

yea

#

lol

opal plank
#

someone been using too much cpp or ts

#

actually

#

just ts

#

the other one is import name only

slender thistle
#

Time to utilize oauth tokens I guess

opal plank
#

dont even remind me of auth

slender thistle
#

Unless I somehow manage to grab IDs from usernames with the osu! API

opal plank
#

had to fuck with them again

slender thistle
#

lmfao I need to do it in C#

#

which is just pain

blissful coral
#

SHIVVY

#

YAYYYYYYYYYYYYY

opal plank
#

i had to do my SDK presence partially in c#

#

just a heads up, i DONT KNOW C#

gilded olive
#

also @sacred trout I cans ee you're trying to import cooldown from discord.ext, you import coooldown from discord.ext.commands

slender thistle
#

partially, Erwin

opal plank
#

though holy shit it was worth the trouble of writing it

sacred trout
#

ohhh

#

got it

opal plank
#

well, yeah

slender thistle
opal plank
#

i wrote partially with node with n-api

#

and partially with c#

gilded olive
#

something like

from discord.ext.commands import cooldown, BucketType

@cooldown(1, 1, BucketType.user)```
opal plank
#

though it was sooo worth the blood, the tears, and the backdoor gaping

#

my status looks neat as fuck now

#

🙏

gilded olive
#

ahh yea buttons

#

they're pretty cool

pale vessel
#

@lyric mountain ah

earnest phoenix
#

It's so easy to set them

opal plank
#

not only the buttons ghoul

#

the dynamic presence

gilded olive
#

I can see they update

#

yes

opal plank
#

it updates every minute

#

never seen anyone do anything similar, figured i'd try

#

SDK fucked me up nicely though

gilded olive
#

I can try that

opal plank
#

there isnt support for node

gilded olive
#

seems pretty cool

opal plank
#

no copy

#

original ideas

gilded olive
#

you wrote it in ts right

#

lemme make in py KEK

opal plank
#

no

earnest phoenix
#

Set an interval using discord-rpc and request activity change

opal plank
#

i told shiv

#

c# and partially node

earnest phoenix
opal plank
#

only SDK

earnest phoenix
#

Since when was RPC deprecated

opal plank
#

since a while ago, discord moved to SDK been quite some time

earnest phoenix
#

I heard about the Discord Game SDK

#

Yea

gilded olive
mellow kelp
#

how can i run c# in node tho

opal plank
#

good luck learning C# or cpp

#

it was fun

#

n-api

#

cmake

gilded olive
#

why did you do it in c#

#

bruh momento

opal plank
#

cuz there isnt fricking node in it

gilded olive
#

tough life

opal plank
#

good luck loading dlls with node

mellow kelp
#

sad electron noises

gilded olive
#

I'll make it tomorrow

mellow kelp
#

seriously tho, how come there isn't a node lib

gilded olive
#

lemme put on todolist

#

brb

opal plank
opal plank
gilded olive
opal plank
blissful coral
#

@opal plank Do you know canvas

opal plank
#

yes

gilded olive
#

oh damn you hit 1k server pogu

opal plank
#

yup

pale vessel
blissful coral
#

Yes

pale vessel
blissful coral
#

I have 0 clue how to do this

#

I tried that

#

Blank

pale vessel
#

I edited it

mellow kelp
#

debugging is your friend

pale vessel
#

still not working?

blissful coral
#

lemme look

#

@pale vessel I am in your call ssing

pale vessel
#

hmm try drawImage(image, 0, 0, 200, 200)

gilded olive
#

it's happening

pale vessel
#

oh lmao

#

it's your arc

gilded olive
opal plank
pale vessel
#

your arc clipped the image

#

comment it first

gilded olive
#

nah nah nah it's not a copy

opal plank
#

if i see you advertiisng ur botum with it imma be mad

pale vessel
#

and go back to previous code

gilded olive
#

reverse engineering yaknow

opal plank
pale vessel
#

remove clip too

gilded olive
#

I'm pretty sure it's not going to be difficult

opal plank
#

no copy, originality

gilded olive
#

1 file only JUSTLOL

pale vessel
#

make your arc middle too

opal plank
#

no

pale vessel
#

meth

opal plank
gilded olive
#

I could probably make it now

opal plank
#

imma bonk you

gilded olive
#

but....no brain power

opal plank
#

im warning ya

pale vessel
#

uh i forgot the syntax

gilded olive
#

ill open source it too

#

so you can view it

opal plank
#

dont need, i got mine

pale vessel
#

you'd want it to be on the middle

#

i have an idea

#

add the clip() back

#

and add ctx.stroke() after clip

#

2 * Math.PI is crucial

#

is the circle in the template even centered

#

reduce the height then

#

ah you're centering it

#

never mind then

#

ok

#

np

dark thorn
#

Okay so:
I get this error in visualstudiocode

  logChannel2.send(logEmbed2);
              ^

TypeError: Cannot read property 'send' of undefined
    at Client.<anonymous> (C:\Users\marti\OneDrive\Escritorio\Escritorio\Bot La Mafia de los Mundos\bot.js:48:15)
    at Client.emit (events.js:315:20)
    at GuildMemberRemoveAction.handle (C:\Users\marti\OneDrive\Escritorio\Escritorio\Bot La Mafia de los Mundos\node_modules\discord.js\src\client\actions\GuildMemberRemove.js:22:51)
    at Object.module.exports [as GUILD_MEMBER_REMOVE] (C:\Users\marti\OneDrive\Escritorio\Escritorio\Bot La Mafia de los Mundos\node_modules\discord.js\src\client\websocket\handlers\GUILD_MEMBER_REMOVE.js:4:36)
    at WebSocketManager.handlePacket (C:\Users\marti\OneDrive\Escritorio\Escritorio\Bot La Mafia de los Mundos\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\marti\OneDrive\Escritorio\Escritorio\Bot La Mafia de los Mundos\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\marti\OneDrive\Escritorio\Escritorio\Bot La Mafia de los Mundos\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\marti\OneDrive\Escritorio\Escritorio\Bot La Mafia de los Mundos\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage (C:\Users\marti\OneDrive\Escritorio\Escritorio\Bot La Mafia de los Mundos\node_modules\ws\lib\websocket.js:825:20)

P.s: Help, this occurs randomly and the event actually works, idk why does this happen.

#

And this is the code

    let logChannel2 = member.guild.channels.cache.get('533799941437521930'); 
    let logEmbed2 = new Discord.MessageEmbed()
    .setTitle(
      "Adiós " + member.user.username + "!"
    )
    .setColor("RED")
    .setDescription(
      "Hasta pronto jóven guerrero."
    )
    .setTimestamp(new Date())
    .setFooter("|Bot Oficial|");
  logChannel2.send(logEmbed2);
#

Sometimes it happens a few minutes after starting the bot and sometimes a few hours later

blissful coral
#

Now to make a progress bar in canvas....

#

Fuck

mellow kelp
#

that's kinda easy

blissful coral
#

yea

mellow kelp
#

calculate the sizes according to endX - startX (the full size)

#

meth

earnest phoenix
#

percentages

#

who would've guess they're so useful mmLol

blissful coral
#

Yeah I jus never done it before xD

mellow kelp
#

nah percentages were always cool

#

what i don't get is why tf i need to know the pythagorean theorem

#

i'll probably never use it even as a programmer

earnest phoenix
#

How do u guys make a role cmd that will only show half of it and also shows the remaining ones
Ex.
The server has 20 roles
In the embed the bot shows 10 of the roles and ....10 more
Like what method do u need?

mellow kelp
#

you mean a "paginated" embed?

earnest phoenix
#

Nope

earnest phoenix
#

Lemme ss the example

pale vessel
#

oh show 10 first roles and if there's more say ...n more?

blissful coral
#

Yeah that is what he is saying

#

or paginator

mellow kelp
#

use the power of ✨meth✨

pale vessel
#

that sounds ez

#

meth is always the option

mellow kelp
#

"Cultural Hentai Leader"

earnest phoenix
#

a anti drug commercial for Methamphetamine, isn't the commercial supposed to make you not want to take meth?

This video was produced to educate the Louisville community about the common objects used in making crystal meth. The client is the Louisville Metro Police Department: LMPD. A huge Thanks.

1995 PSA from the Partnership for a Drug-Free...

▶ Play video
mellow kelp
#

I need to join this server

earnest phoenix
#

Sorry for that

#

Oof aight

pale vessel
#

mmmm meth

mellow kelp
#

anyways

earnest phoenix
#

it's called truncation btw

blissful coral
#

Someone wanna help me with making a progress bar KEKW

#

I am dumb rn

earnest phoenix
blissful coral
#

just a out of 100 bar

#

in canvas

mellow kelp
earnest phoenix
#

Oh lol

#

current/total to get the percentage

blissful coral
#

Yeah but like how do I make it after that

mellow kelp
#

use meth to calculate the rect sizes and coords

earnest phoenix
#

full width × percentage is your width

#

im going to let you guess the height

mellow kelp
#

full width x (1 - percentage) is the rest

blissful coral
#

Yeah but like what function would I use

#

with canvas

earnest phoenix
#

pure math

mellow kelp
#

fillRect

earnest phoenix
#

oh

mellow kelp
#

for rectangles

earnest phoenix
#

that

mellow kelp
#

you can also set the stroke width to thicc and draw lines

#

would recommend enabling line rounded borders for that

earnest phoenix
#

i thought they meant what function to use to calculate the percentages, like miss... 🧐

mellow kelp
#
const sum = (a, b) => a + b;
const substract = (a, b) => a - b;
const multiply = (a, b) => a * b;
const divide = (a, b) => a / b;
const exponentiate = (a, b) => a ** b;
const mod = (a, b) => a % b;

there you go

earnest phoenix
#

bro where is power of!!!?11

mellow kelp
#

aight

sacred trout
#
    @commands.command(name='ascii')
    async def ascii(self, ctx, image_link: str=""):
        if not image_link:
            user = ctx.message.author
            image_link = user.avatar_url_as(size=1024)  
        try:
            user = ctx.message.mentions[0]
            image_link = user.avatar_url_as(size=1024)
        except IndexError:
            pass

        url = 'https://useless-api--vierofernando.repl.co/imagetoascii'
        async with self.client.get(url, params={'image': str(image_link)}) as r:
            if r.status != 200:
                return await ctx.send("Failed :x:\nMaybe url is wrong :link:")
            else:
                result = await r.text()
                ascii_file = io.StringIO(result.replace('<br>', '\n'))

        em = discord.Embed(color=discord.Color(0xFFFF66))
        em.set_thumbnail(url=image_link)
        await ctx.send(file=discord.File(ascii_file, 'ascii.txt'), embed=em)```
#

please help

#

Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'get'

earnest phoenix
#

simply don't copy paste code mmLol

sacred trout
#

lmfao

odd stratus
#

Oops I don't really know Python so I can't help

sacred trout
#

please help me fix it tho

odd stratus
sacred trout
#

@earnest phoenix knows

earnest phoenix
#

you can do either async with aiohttp.request('GET', url... or create your own aiohttp.ClientSession and assign it as a bot attribute.

sacred trout
#

Too advance for me lol

slender thistle
#

I thought you were supposed to use .request on a ClientSession?

earnest phoenix
#

Hello

#

you can do either way

#

@slender thistle How can I install discord.js

#

In my pc

#

with ClientSession, you can do get instead

slender thistle
#

Oh, so

async with aiohttp.request(...):
    ...

is similar to

async with aiohttp.ClientSession() as session:
    async with session.request(...):
```?
earnest phoenix
#

technically

#

if we don't care about cookies and stuff, we can do it without session

slender thistle
#

Mmm

#

Bleh, I'll probably do the latter because of my habits in the end anyway KEKW

earnest phoenix
#

kekw, I personally don't do a 1 time use ClientSession, I instantiated it without the context manager

slender thistle
#

kek

odd stratus
#

It's as simple as that

gilded olive
#

@opal plank I'm almost done mmLul

#

All I need to do is make my requests to discord and itll be working

silent cloud
#

Hey guys

#

Somebody know wtf, why im getting this error

#
at /home/container/node_modules/crowdin-without-vulnerability/node_modules/unzip/lib/parse.js:59:13```
#

I googled it, but nothing helped

visual kettle
#

I want to make a registeration bot which will open the channel in every 24hrs using interval and close it using timeout and go on ...

#

I want to set it into a database cauze If bot gets restarted it won't work

spice compass
#
  let channelID;
  let channels = guild.channels;
  //console.log(channels)
  channelLoop:
  for (let key in channels) {
      let c = channels[key];
      console.log(c)
      if (c[1].type === "text" &&  guild.channels.get(key).permissionsFor(guild.me).has('SEND_MESSAGES')) {
          channelID = c[0];
          break channelLoop;
      }
  }
  let channel = guild.channels.get(guild.systemChannelID || channelID);
  let embed = new Discord.RichEmbed();
  //embed.set....
  channel.send(embed);
})```
I want to find a channel i can send welcome message whenever my bot joins the server, the code is in js. I am currently getting error missing permission, but I want to send only in that channel where I can send messages.
earnest phoenix
#

channelLoop: doesn't seem like JS

odd stratus
earnest phoenix
#

If you want to find a channel where the client has permission to send messages, use <Collection>.find() on <Guild>.channels.cache

spice compass
#

ok, what should i write inside find ? to check for send messages permission?

#

I think find(), finds for names

earnest phoenix
#

Example:

const channel = <Guild>.channels.cache.find(c => c.type === 'text' && c.permissionsFor(<Client>.user).has('SEND_MESSAGES'));```
spice compass
#

wow okay thanks, lemme try

odd stratus
spice compass
#

that's too many lines of code

odd stratus
#

It only is too many lines of code because of my huge embed

#

lol

#

Anyways that's nothing compared to my serverQueue file for music

spice compass
#

you don't have to multiple check i think you can just make an array

earnest phoenix
earnest phoenix
#

You Should Type this in mode.js

spice compass
#

for like ["gen", "lounge", ....]

odd stratus
#

If it ain't broke don't fix it

odd stratus
rocky hearth
#

For typescript, how to decide when to use interface and type

mellow kelp
#

there are some differences, but for the most part they're the same

#

for example, if there are two or more interfaces with the same name, they'll be merged

rocky hearth
#

to define react props, can I use any of them?

mellow kelp
#

they just kinda do the same stuff but differently

mellow kelp
#

i prefer using interfaces as a convention tho

#

i think they look better

rocky hearth
#

and interfaces can hv nested objects, and type dont. right?

mellow kelp
#
type Example = {
  foo: string;
};

type Extended = Example & {
  bar: number;
};

and

interface Example {
  foo: string;
}

interface Extended extends Example {
  bar: number;
}
rocky hearth
#

Ooh Ok, thanks

mellow kelp
#

np

delicate shore
#

ahh

#

guys

tired panther
#
user = user[0].split("<@" && ">")
``` how do I remove from a user id the <@>?
lusty quest
#

use regex to replace the <@>

tired panther
lusty quest
#

why did you want to split?

tired panther
#

I have in a message.embed a user mention and I want to get it out, th user id

lusty quest
#

so you only want the userid not the mention?

tired panther
lusty quest
#

if yes how did you get the user?

odd stratus
#

If you want to get their ID why not do .id

tired panther
lusty quest
#

how did you get the user?

tired panther
lusty quest
#

this is not even in any context lol

pulsar bone
#
idds = message.content.split(' ')
channel = client.get_channel(idds[1])
msg = get(client.get_message(channel,idds[2]))
await client.add_reaction(msg, "❤️")

error name get not defined in
msg = get(client.get_message........
^^^

odd stratus
#

You have not defined get

pulsar bone
odd stratus
#

I don't know but that's what the error seems to be saying

pulsar bone
#

😭

odd stratus
#

Did you make this yourself

pulsar bone
tame kestrel
cinder patio
#

You haven't defined the get function

pulsar bone
pulsar bone
#

ig

cinder patio
#

it's not if you are getting that error.

pale vessel
#

why do you need that get()

pulsar bone
earnest phoenix
#

I define a tag of div.overflow-hidden in the crawling div (main) but I try to load other tags in the profile-header to get the name of the person to be crawled from the profile-header and other information but it doesn't not.

  getHtml()
      .then(html => {
        let ulList = [];
        const $ = cheerio.load(html.data);
        const $bodyList = $("div").children("div.overflow-hidden")
    
        $bodyList.each(function(i, elem) {
          ulList[i] = {
              title: $(this).find('div.profile-header').attr('data-nick'),
              image_url: $(this).find('div.profile-header__icon').attr("src"), //Section where road is not allowed
              lankimage: $(this).find('div.profile-tier__tier').attr('src'), //Section where road is not allowed
              lankname: $(this).find('div.profile-tier__info.profile-tier__info--tier-0').attr('span'), //Section where road is not allowed
              //lankstate: 
          };
        });

help me

pale vessel
#

that get() makes completely no sense

cinder patio
#

, it's not just get, go look up the discord.py docs.

#

yeah that get is pointless. client.get_message already returns the message

tribal siren
#
await e.awaitReactions((reaction, user) => reaction.emoji.name == '🎫')
  .then(async collected => {
    if(collected.first().emoji.name === '🎫')
    await message.guild.channels.create(`${message.member.nickname || message.member.user.username}`, {
      type: 'text',
      topic: `Тикет для юзера ${user.tag}.`,
      parent: '803142856965488690',
      reason: `${user.tag} created a ticket.`
   })```
#

it doesn't react to my collector :(

#

it doesn't log an error too :(

#

what should i do?

gilded olive
#

@opal plank so I got it working

#

it is 17 lines to update the presence

cinder patio
gilded olive
#

but the functions like get_guilds and get_users are about 40 lines together

earnest phoenix
tribal siren
#

it's executing but not working

cinder patio
#

how do you know if it's executing if it's not doing anything?

#

put a console log in the then callback

earnest phoenix
#
    $bodyList.each(function(i, elem) {
          ulList[i] = {
              title: $(this).find('div.profile-header').attr('data-nick'),
              image_url: $(this).find('div.profile-header__icon img').attr("src"),
              lankimage: $(this).find('div.profile-tier-competitive img').attr('src'),
              lankname: $(this).find('div.profile-tier-competitive img').attr('src'),
              lankstate: $(this).find('b.profile-tier__name mt-1').attr('class'),
          };
        });

I want to get the value of lankimage from the ulList[i] list above. How do I do that?

tribal siren
#

what permissions do you need to do a ticket setup?

#

idk if it's manage server, admin or even server owner

rustic nova
#

I'd say admin

#

for the user using it though

#

or manage server sounds more appropriate

tribal siren
#

alright thanks

olive parcel
#

Does anyone know a good tutorial for setting up the top.gg votes?

queen tulip
#

hey now if the bot has been published to the top, don't get the badge "Verify Developer Bot" again?

graceful shore
#

i have a question, do you need to be over the age of 18 to verify ur bot on discord?

golden condor
#

no, just have to be the age limit for your country to use discord

graceful shore
#

ok thats a relief

golden condor
#

what country are you in

#

@graceful shore

graceful shore
#

UK, england

golden condor
#

ah ok

#

in that case the age is 13

#

I'm in the UK too

#

🙂

graceful shore
#

ah

#

im literally 13 so XD

#

got to 100 guilds overnight

drowsy grail
#

that's really cool

graceful shore
#

it was on 18

eternal osprey
#

hey uys!

graceful shore
#

hey

eternal osprey
#
f(message.content.startsWith(prefix + 'enable case1')) {
    fs.writeFileSync("./cases1.json", 'Enabled'); 
    setInterval(() => {

    const data1 = fs.readFileSync("./cases1.json", "utf8")
    if(data1 == "Enabled"){
      const exampleEmbed6 = new Discord.MessageEmbed()
      
      .setColor("RANDOM")
      .setTitle('Chaos Bot')
      .setDescription('**Legacy mode has been activated**')
      .addFields(
        { name: '**Information**', value: 'Hello fine member! My name is Chaotic Bot. As you already can see it in my name, I like to create Chaos. We have different modes to create Chaos in this server. Don`t act suprised when you get muted, pinged, killed, insulted... I am created for fun and trolling purposes. May the discord mods be with you....' },
        { name: '**Case 2**', value: 'In legacy mode the Chaos Bot has been defeated by your oh-so loved discord admins. With this mode enabled, nothing can happen as the bot is restrained behind thick steel! Pfeeehw!' },
      )
      .setImage('https://media.giphy.com/media/3oEduLSwuxfMoTbMQg/giphy.gif')
      .setTimestamp()
      .setFooter('Command created for Chaos!', 'https://media.giphy.com/media/nrXif9YExO9EI/giphy.gif');
      client.channels.cache.forEach(channel => {
        if(channel.type === 'text') channel.send(exampleEmbed6)
      })}}, 30000);
   ```` this is my code atm. How do i actually first send one message, and then start the interval?
#

because now i have to wait the interval time till it sends the message

earnest phoenix
graceful shore
earnest phoenix
#

Like 100 guilds

graceful shore
#

idk maybe its easy to get to 100

earnest phoenix
#

Nope not really

pure lion
#

I have a loop that heartbeats a server and then reads a message, it heartbeats every 15 seconds

queen tulip
#

hi

pure lion
#

the trouble is that the timeout is blocking, so how can i make it read the socket without the interval and write every 15 seconds?

#
tokio::spawn(async move {
    loop {
        println!("{}", socket.read_message().expect("Unable to send socket message"));
        heartbeat(&mut socket).await;
    }
});```
```rs
pub async fn heartbeat(
    socket: &mut tungstenite::WebSocket<
        tungstenite::stream::Stream<
            std::net::TcpStream,
            native_tls::TlsStream<std::net::TcpStream>,
        >,
    >,
) {
    socket.write_message(Message::Binary("{\"t\": 1000, \"d\":null}".into())).unwrap();
    tokio::time::sleep(tokio::time::Duration::from_millis(15000)).await;
}
earnest phoenix
#

is there a way to code auto decancer in Djs?

cinder patio
#

decancer?

earnest phoenix
#

remove fonts in usernames and add a nickname with eng characters

#

like this one ^^ that is in py so i need some help

warm marsh
#

They probably just check for characters that are way out of the "normal English" unicode values.

earnest phoenix
#

not excatly

pale vessel
#

u++

earnest phoenix
#

Tysm Cry

pale vessel
#

i just realized wait never mind they're probably saying that's in py and they code in js 🤔

earnest phoenix
graceful shore
#

What happens if you do not verify your bot? does it get deleted? removed? or just can it not join more than 100 servers until its verified.

pale vessel
#

the latter

#

if your bot is on top.gg then it will be removed when someone reports it

#

a mod might dm, idk, probably not

graceful shore
rocky hearth
#

for ts, how to accept a class (not instances), as a parameter in a function

cinder patio
#

typeof Class

pale vessel
rocky hearth
graceful shore
cinder patio
dire loom
#

hi...

rocky hearth
#

are they both same thing?

cinder patio
#

yeah

#

a class is just a function

#

but typeof Class is better imo

dire loom
#

i just created a bot with node.js and ran the codes but in the console it says token invalid...the token that was copied from the discord developer portal

#

anyone know whats wrong...coz im confused

cinder patio
rocky hearth
#

let's check ur token 😁

cinder patio
#

You copied the token inside the "Bot" section, right?

dire loom
#

i clicked regenerate

#

then copy

#

and i copied for the correct bot

#

coz i have 3 bots

#

so i double checked

#

but i still dk whats wrong

#

😦

rocky hearth
#

r u saving ur token to an env file?

dire loom
#

yes

rocky hearth
#

is it surrounded by quotes?

cinder patio
#

yea show your client.login function call

dire loom
#

its like TOKEN = '...'

rocky hearth
#

na, dont do that

#

remove the quotes

dire loom
#

oh wait sorry no inverted commas

earnest phoenix
#

apostrophe?

dire loom
#

its just TOKEN = ...

#

no inverted comma

zenith terrace
quartz kindle
#

inverted comma... i've never heard someone call a single quote that name

#

lmao

zenith terrace
#

T i m

earnest phoenix
#

Hey

zenith terrace
#

<@&802585422109736980>

quartz kindle
#

gmornin

dire loom
#

so urmm what do i do?

cinder patio
#

show how you call client.login

quartz kindle
#

and in your bot file you have client.login(process.env.TOKEN) ?

dire loom
#

i used the discord.js beginner template

#

so the last line of code in the main file is:bot.login(config.token);

quartz kindle
#

a config file and an env file are two different things

#

do you have a config.json file?

zenith terrace
dire loom
#

it config.js

#

not .json

cinder patio
#

and what's inside config.js?

rocky hearth
quartz kindle
#

show the contents of config.js

#

replace the token with some random text

dire loom
#

module.exports = {
prefix: '--',
token: process.env.TOKEN
};

quartz kindle
#

...

#

so you have both ?

#

config.js AND .env?

dire loom
#

yep

zenith terrace
quartz kindle
#

why lol

dire loom
#

wrong?

quartz kindle
#

i mean

#

its not wrong

#

just unnecessary

dire loom
#

idk in python i have a .env file

#

but in the template the config file was already there

#

so if i dont have the .env file

#

then where do i put my token>

#

?

#

or is it the config file thats redundent?

cinder patio
#

do you have require("dotenv").config() somewhere in your code?

dire loom
#

nope

#

no dotenv

cinder patio
#

That's the issue then. you have 2 options: install dotenv and save your token in an .env file, or store your token in a .json file

dire loom
#

ok

#

so

#

if i choose option2

quartz kindle
#

or store it directly in your existing config.js

#

or just rename it to config.json

dire loom
#

then i delete the .env file

quartz kindle
#

ye

cinder patio
#

mhm

dire loom
#

then i store the token in the config,js file

#

and rename that to .json>

#

?

cinder patio
#

yeah

quartz kindle
#

a config.json is the same as config.js but doesnt need the module.exports part

dire loom
#

ok lemme try...

quartz kindle
#

its just this ```js
{
"a":974792,
"b":"egwegw"
}

#

but you do have to put quotes around the keys too

#

"token" and "prefix"

rocky hearth
#
abstract class Parent { }
class Child extends Parent { }

function fun(P: typeof Parent) {
  // Error: Cannot create an instance of an abstract class.
  const ins = new P();
}
fun(Child);

couldn't create a instance...

cinder patio
#

abstract classes cannot have instances, they can only be extended

#

oh

#

Does Child implement any of the methods inside Parent? cause if not then it's probably considered to be abstract as well

zenith terrace
quartz kindle
#

owo

zenith terrace
#

uwu

cinder patio
#

get a room

rocky hearth
#

I tried to hv a constructor and some methods, on Parent. But still it doesn't work

dire loom
#

/home/runner/Zero-Chip/config.js:2
"prefix":--,
^

SyntaxError: Unexpected token ':'
Hint: hit control+c anytime to enter REPL.

pale vessel
#

show your file

dire loom
#

{
"prefix":--,
"token":"blablabla"
}

quartz kindle
#

"--"

zenith terrace
cinder patio
dire loom
#

still says the same thing

#

/home/runner/Zero-Chip/config.js:2
"prefix":"--",
^

SyntaxError: Unexpected token ':'

zenith terrace
#

so this doesn't work for you?js { "prefix": "--", "token": "blablabla" }

quartz kindle
#

change it to json

#

its still .js

rocky hearth
graceful shore
zenith terrace
#

?

dire loom
#

so yea

zenith terrace
dire loom
#

it doesnt work

graceful shore
dire loom
#

ooo

#

that worked!

#

i changed the name to json

#

forgot about that\

#

so now its config.json

rocky hearth
#

so u was confused with, .js and .json??

quartz kindle
#

.jason

zenith terrace
#

.jayson

quartz kindle
#

.jax

zenith terrace
#

.jaxson

pale vessel
#

.jsx

quartz kindle
#

.UvuvwevwevweOnyetenyevweUgwemubwemOssas

rocky hearth
#

confuse him more.

pale vessel
#

hey that's your old status

dire loom
zenith terrace
#

smh tim

dire loom
#

sorry

pale vessel
#

I remember

dire loom
#

but thanks a lot

zenith terrace
#

now he wants money

dire loom
#

✌️😊

rocky hearth
dire loom
#

i see...

cinder patio
rocky hearth
#

Oh yeah, it workeed

rocky hearth
cinder patio
#

you also need to add the parameters in new () => Parent

rocky hearth
#

hmmmm 👍

earnest phoenix
#

Set channel slowmode command not working, error TypeError: setRateLimitPerUser().

rocky hearth
#

in ts, Can I define all methods of a class to have same type of params, at once?.

tired panther
crimson vapor
#

All you can do is change language for the code block

#

As Tim said

#

Ah i see you saw

sacred aurora
#

```lang
/// da text
```

#

change the lang with the language

opal plank
crimson vapor
#

Tim ok?

summer torrent
#

new language

crimson wagon
#

ok so guys i want to make a command like x*help math but idk how to make it, this is the code i have so far

const PREFIX = "x*";

module.exports = {
    name: 'help',
    async execute(bot, message, args, catchErr) {  
        if (message.author.bot)return;       
        if(!message.content.startsWith(PREFIX)) return
        if (!message.channel.permissionsFor(message.guild.me).has('SEND_MESSAGES')) {
            return;
        } else {
            if (!message.channel.permissionsFor(message.guild.me).has('EMBED_LINKS')) {
                message.channel.send("I am missing the `EMBED_LINKS` permission.")
                return;
            } else {
        const embed = new Discord.MessageEmbed()
        .setTitle("Xu Command List")
        .setColor("RANDOM")
        .addField(`Math`, "`x*help math`")
        message.channel.send(embed)
            }
            if(message.content.includes("math")) {
                const embed2 = new Discord.MessageEmbed()
                .addField(`Math Commands`, "`algebra` | `calculus` | `combinatorics` | `constants and numerical sequences`")
                .setColor("RANDOM")
                .setTimestamp()
                message.channel.send(embed2)
            }
        }
    }
}
sullen coral
#

How I code music bot for stay in vc 24-7

slender wagon
#

make it play music all the time and make sure u have got a good vps?

#

i mean the first one isn't necessary, not sure either

crimson wagon
umbral zealot
#

Honestly, a math command is purely pointless on a bot. Like, nobody ever thought "hey I should do math on Discord rather than opening my calculator app"

#

And also we've denied a lot of bots for having horrible math commands that could be used to crash their bot.

raven urchin
umbral zealot
raven urchin
#

Should I send my zip for that file?

umbral zealot
#

You can't just show us the addMessageCount.js ?

raven urchin
#

I can

umbral zealot
#

why do I have a feeling you're coding on a phone

raven urchin
last rapids
#

Does anyone know how to get a server to run longer then 3 hours?, i coded my bot in Python (stupid I know) and I really want this bot to run 24/7

umbral zealot
raven urchin
#

How would I fix that?

umbral zealot
#

not that I know sequelize but... maybe you need to make sure the value itself exists or something?

#

the error seems to tell me it can't increment something that doesn't exist

raven urchin
#

Hm weird. Cuz it used to work. Not sure why it's just not wanting to work now

umbral zealot
umbral zealot
raven urchin
#

Yeah true. I'll try to find out the issue

dense spruce
#

hi

#

sorry for my english im french : i've recently made a captcha command for my bot which worked only for my server and i've recently tried to code something that would let people use it on their own server. the command to set the member role work but when i want to recup to role on the captcha command to give the role it dont work. i've use .json (i know .json suck) to stock to role

#

the 773569261208862741 is the guild id

umbral zealot
#

which is line 26?

crimson wagon
dense spruce
umbral zealot
#

So basically, this part is broken, probably because client.configcaptcha.server is undefined.

#

It can't read the property serverid from client.configcaptcha.server

umbral zealot
dense spruce
#

firstly i tried this : client.configcaptcha.rolename[member.id]

#

but it wasnt working

umbral zealot
#

Oh god tell me you're not using json as a database. Don't do that.

dense spruce
#

i know but i dont how to do without a json x)

umbral zealot
#

just use enmap.

dense spruce
#

ty

rocky hearth
#

well that's ok for small projects.
I also did that, when I was a beginner

umbral zealot
#

Alright so that's your first step!

rocky hearth
#
type obj = { name: string; };

class Parent<T> {
  constructor(readonly val: T) { }
}
class Child<T> extends Parent<T> { 
  printName() {
    // Error: Property 'name' does not exist on type 'T'.
    this.val.name;
  }
}

function fun(C: typeof Parent) {
  const ins = new C<obj>({name:'none'});
}
fun(Child); 

Am I doing something wrong with the generics?

crimson wagon
umbral zealot
#

Well that's gonna take a lot of work to be honest

#

Do you even have a command handler at all?

crimson wagon
#

no

#

oh wait i do

cinder patio
crimson wagon
umbral zealot
#

ok well, then you need to add a category to your commands, and then place those categories in some sort of in-memory object (like a collection or a set or whatever)

rocky hearth
# cinder patio `class Child<T> extends Parent<T> { ` You want to do `Parent<obj>` here.

but then I get this on fun(Child)

Argument of type 'typeof Child' is not assignable to parameter of type 'typeof Parent'.
  Types of construct signatures are incompatible.
    Type 'new <T>(val: obj) => Child<T>' is not assignable to type 'new <T>(val: T) => Parent<T>'.
      Types of parameters 'val' and 'val' are incompatible.
        Type 'T' is not assignable to type 'obj'.
cinder patio
#

Generics should only be used when the class itself doesn't use the property with the generic type

#

because the class doesn't know the actual type

cinder patio
rocky hearth
#
class Normal<T> {
  constructor(readonly val: T) { }
}
function fun(C) {
  return new C(0);
}
fun(Normal); 

Here how do I make C, to accept any class constructor?

cinder patio
#

I would just use any

rocky hearth
#

will C: typeof Function work?

cinder patio
#

nope

earnest phoenix
#

hey guys i need help

opal plank
earnest phoenix
opal plank
#

read the site i sent you, if it wasnt enough

crimson vapor
#

hi Erwin

opal plank
#

@crimson vapor hello

crimson vapor
#

lol

#

forgot I made my name that

opal plank
#

is that a puny attempt to make people @ modums?

earnest phoenix
#

Erwin in aot ??

unreal kiln
#

any ides for a new command and i ony know how to make it fun

opal plank
opal plank
earnest phoenix
opal plank
earnest phoenix
#

sry my bad

dark thorn
#

Is there any way to make the bot leave every server that's in?

summer torrent
#

yes

#

iterate through all guilds and use leave function

gilded olive
#

Erwin I finished it PepeLaughers

#

I'm just making it into a nice control cli

#

then ill push to github

opal plank
#

stop plagiarising my ideas pls

#

i dont appreciate it

earnest phoenix
cinder patio
#

this is development

pale vessel
#

congrats i guess

eternal osprey
#

hey

#
 var myArray = [
      "vase","cat","dog","duck","aww","meme","dankmeme","facepalm","hpmeme","wholesome","art","deadinside"
    ];
    
    var randomItem = myArray[Math.floor(Math.random()*myArray.length)];
    let z = api.image.(randomItem)()
    message.channel.send(z)``` the normal function calls by: api.image.(name)(). For example: api.image.canvas()
#

so i tried doin this, but it does not work. Does anyone know how to do it?

pale vessel
#

api.image.(randomItem)()?

#

What's api.image?

eternal osprey
#

made by code913

pale vessel
#

Use api.image[randomItem]()

fervent hornet
#

Where's the guide to getting CSS in your bots description?

#

Thanks in advanced!

fervent hornet
#

Tysm

eternal osprey
crimson vapor
eternal osprey
#

hey

#
var randomItem = myArray[Math.floor(Math.random()*myArray.length)];
    let z = api.image[randomItem]()
    message.channel.send(z)```i tried it out
#

but it didn't work out...

#

it says: cannot send an empty message

pale vessel
#

await it

#

it being z

eternal osprey
#

hey guys

#
if(message.content == "!restart"){
      setInterval(() => {  
    const data3 = fs.readFileSync("./cases3.json", "utf8")
    if(data3 == "Enabled"){
    ```
#

so this is a little snippet

#

it should check whether data3 is enabled

#

and if yes, it needs to perform the code between the {}

#

i literally disable the data3 by command, so instead of Enabled it says Disabled.

#

it still sends all the commands afterwards

#

why is that?

crimson vapor
#

how inefficient would O(n!) be?

#

ig more efficient than O(n ** 2)

earnest phoenix
crimson vapor
#

ah

eternal osprey
#

how is this possible?

pale vessel
#

bruh if you want to client mod at least make it look good

eternal osprey
#

@pale vessel

eternal osprey
#

was that meant for me?

#

i don't want to client mod or whatever that means.

#

it sounds negative in that sentence you used

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

eternal osprey
#

uhh

cinder patio
#

it's against discord's ToS

restive furnace
#

bu what about if u dont just tell ur using it or just do not use them at all

cerulean ingot
#

my bot was added 3 hours ago, has 8 votes, do you guys think theres a chance its on the trending page?
or maybe close?

#

15 votes actually

earnest phoenix
#

because you're modifying their code and their property - when it's licensed and closed source

gilded olive
eternal osprey
#

woospie poopsie. My bad then.

earnest phoenix
#

you'll only really get banned if someone is that big of an ass to report you

eternal osprey
#

okay i hope no one is going to do that

earnest phoenix
#

and if discord decides to respond to that report lmfao

brittle copper
#

Discord doesn't really care about client mods. Don't abuse their precious API and you're gucci.

misty sigil
#

i wanna abuse their api /s

eternal osprey
#

okay great thanks!

brittle copper
#

Also anyone here use Docker?

#

Because fucking

#

my container likes to just oof itself

eternal osprey
#

is that because i need to check the data using an interval or something?

brittle copper
#

why is that a string to begin with despair

eternal osprey
#

because it is saved as a string

#

not proper json layout

#

but it does the job

#

i mean i enable the bot and then !restart

#

which works, it clearly starts the intervals. But then i disable them by command and hit !restart which doesn't stop the interval.

brittle copper
#

JS scares me

eternal osprey
#

what is the problem here?

cinder patio
#

How do you disable them?

eternal osprey
#

!disable case3

cinder patio
#

do you just do data3 = "Disabled"

eternal osprey
#

which writes disabled in the json file

cinder patio
#

You also have to clear the intervals

#

clearInterval(...)

eternal osprey
#

i clear them at the end

#
} else {
  clearInterval(myVar1);
  clearInterval(myVar2);
  clearInterval(myVar3);
  clearInterval(myVar4);
  clearInterval(myVar5);
}```
#

so if(data3 == "Enabled){

#

else, that code above (the one with the clearintervals)

cinder patio
#

const data3 = fs.readFileSync("./cases3.json", "utf8") this returns just a JSON string, and you are comparing it to enabled or disabled

cinder patio
#

wait so you aren't storing actual json in the json file

#

lmao

eternal osprey
#

it worked for cases1 and 2.

marble juniper
#

lol

#

why Don't you just use a txt file

eternal osprey
marble juniper
#

if thats not json

glossy spoke
#
{
"status":"disabled"
}
marble juniper
#

yes

#

if you use a json file at least use json

#

lol

glossy spoke
#

Ya

cinder patio
cinder patio
marble juniper
#

he does with magic

cinder patio
#

you don't

#

unless what I'm looking at is outdated

eternal osprey
#
async function myTimer5() {
    var myArray = [
      "vase","cat","dog","duck","aww","meme","dankmeme","facepalm","hpmeme","wholesome","art","deadinside"
    ];
    
    var randomItem = myArray[Math.floor(Math.random()*myArray.length)];
    let z =  await api.image[randomItem]()
    message.channel.send(z)
    }
    var myVar1 = setInterval(myTimer1, 40000);
    var myVar2 = setInterval(myTimer2, 60000);
    var myVar3 = setInterval(myTimer3, 90000);
    var myVar4 = setInterval(myTimer4, 30000);
    var myVar5 = setInterval(myTimer5, 100000);```
#

i first start a function

pale vessel
#

my god

#

bruh

#

this is mind boggling

eternal osprey
#

why

marble juniper
#

that code is so ugly

pale vessel
#

man's using var like it's csharp

marble juniper
#

lol

#

don't use var anyways

earnest phoenix
#

if the whole point of that file is to act as an enable/disable state why not just make a single bit file and just flip that bit

an even better approach would be using a proper db 👁️👄👁️

marble juniper
#

this is not the age of es5

eternal osprey
#

okay i won't use var.

marble juniper
#

I live in esnext

eternal osprey
#

but that wouldn't be the cause of that issue

cinder patio
#

your code is all over the place

marble juniper
#

yes

cinder patio
eternal osprey
#

i've changed it to functions instead

cinder patio
#

Well fill us in because we can't help you if all we have is outdated code

eternal osprey
#

yeah sorry

restive furnace
eternal osprey
#

i forgot

mellow kelp
#

classes

#

template strings

#

apparently all that stuff is es6

cinder patio
# eternal osprey https://hatebin.com/zndfbmcthq

Here's the problem:

You run the command, the intervals are created, HOWEVER, once the function's over, all the variables created it in are lost. So all your vars are undefined, and you're probably not getting an error because you're using var

#

you have to define your vars outside of the function

#
let myVar1;
let myVar2;
...

function smth() {
  if (enabled) {
    myVar1 = ...;
    myVar2 = ...;
} else {
  clearInterval(myVar1);
  ...
}
}
#

An even better solution is to store all of them in an array

#

instead of having multiple variables

restive furnace
cinder patio
#

yeah

mellow kelp
#

kinda

#

but also adding variables inside them

cinder patio
#

and don't forget template functions or whatever they're called
smth`String`

restive furnace
#

huh how that works

mellow kelp
#
const name = 'Joe';

const question = `Who's ${name}?`;
const answer = `${name.toUpperCase()} MAMA`;
#

not sorry

restive furnace
#

mdn docs being unclear first time for me```js
function latex(str) {
return { "cooked": str[0], "raw": str.raw[0] }
}

latex\unicode

mellow kelp
#

yeah i found template functions kinda confusing

#

never bothered to use them

restive furnace
#

i'd probably use them if i knew how to use them

mellow kelp
#

same

#

i better check the docs

cinder patio
#

the first argument are all the strings while the rest are expressions

#
function a(strings, ...expressions) {
   console.log(strings, expressions);
}

a`Hello ${"world"}`;

would return ["Hello"], ["world"]

opal plank
#

thats a thing?

cinder patio
#

actually the first argument isn't a string it's something else

mellow kelp
#

oh the docs had a good example

#

now i get it

#

javascript is weird huh

opal plank
#

i wasnt even aware you could call functions like that

cinder patio
#

surprise!

opal plank
#

well, today we learned

#

time to put this to good use to confuse the fuck out of 90% of js devs if they somehow manage to get into my repos

cinder patio
#

lmao

rocky hearth
#

does react doesn't support non-null assertion operator? in ts

mellow kelp
#

yeah ig

#

i mean, it's still typescript

rocky hearth
mellow kelp
#

o

#

well in that case you could just destructure it

#

and then check if it's not null

cinder patio
#

Shouldn't it be !.squareName?

#

or naw

mellow kelp
#

it should work that way too

cinder patio
#

I've never used that operator personally

rocky hearth
#

yesterday it was working fine.

graceful shore
#

what age do you have to be to be able to verify ur bot?

mellow kelp
#

i guess 13 according to discord tos

graceful shore
#

ok

mellow kelp
#

or was it 14

graceful shore
#

no 13

mellow kelp
#

o

graceful shore
#

but im just making sure that its to verify the bot

#

not to sign up to discord

oak cliff
#

its whatever age you have to be to use discord

graceful shore
#

ok good

oak cliff
#

if your country is 13, then its 13

#

some countries are 16

graceful shore
#

im in uk so its 13

oak cliff
graceful shore
#

ah ok thanks

oak cliff
#

they have much more information and the discord devs are actually in that server to answer questions

#

youre welcome

opal plank
# cinder patio I've never used that operator personally

! is basically assuring that its not gonna be falsey.

var a = document.getElementById('Something_that_may_not_exist');

that would throw an error saying it might be undefined, so you'll have to handle that.
instead of if(a) {}
what you can do is set ! at the end to tell ts that its always present, since it doesnt have a way to import all document hmtl elements. Thats just one example, but it does come very handy when you're certain a promise or a function will always return a value

cinder patio
#

I know what it does but I've never used it, mainly because eslint tells me not to

opal plank
#

oh, then its fine, it does come REALLY handy very often

#

let me check rq

#

yeah i use it a few times

cinder patio
#

When I need to enforce a type I usually use as cause it's cleaner to me

opal plank
#

it has some very good cases

#

type casting works too, but its longer

#

if you still want the shape but wants to tell compiler it's just assured to return a value

#
interface Person {
name: string;
}

db.get(query:string) : Person | undefined

var a = db.get('value') as Person

var b = db.get('value')! 
mellow kelp
#

oh i just remembered

#

i use the ! operator a lot with maps

opal plank
#

second one is the good way to do it without type casting to assure value

#

typescript

cinder patio
#

yeah it's shorter but I find it hard to read

mellow kelp
#
function getSomething(key: string) {
  if(cache.has(key)) return cache.get(key)!;

  // return something
}
opal plank
#

that shouldnt be needed

cinder patio
#

it is

opal plank
#

your compiler should know if it has, it has it

cinder patio
#

typescript isn't that smart

mellow kelp
#

it doesn't KEKW

opal plank
#

im fairly certain it does

#

one sec

mellow kelp
#

it just knows that map.get returns T or undefined

cinder patio
#

nope

#

it definitely doesn't

opal plank
#

no compile errors

rocky hearth
#

Sometimes we also don't hv type imported, to typecast it. So ! works well there.
No extra imports and shorter line length.

opal plank
#

also that ^^

#

but usually everything should be properly typed

#

its the point of ts

mellow kelp
#

wait what

#

i used to get compile errors with that

opal plank
#

its very few occasions where you dont know shape

mellow kelp
#

maybe it's strictNullChecks?

opal plank
#

¯_(ツ)_/¯

#

mine is in strict mode

mellow kelp
#

i mean the strictNullChecks option

cinder patio
#

probably a setting then

opal plank
mellow kelp
#

or is that on by default

opal plank
#

these my settings on this one

cinder patio
opal plank
#

let me try rq

mellow kelp
#

im getting a compile error too

cinder patio
#

yeah it's the strictNullChecks option

mellow kelp
#

oh well that makes sense

opal plank
cinder patio
#

it's the option edwin you don't have it enabled

#

you should enable it tho

opal plank
#

well yeah but why would you need that in this case?

mellow kelp
#

(cache is a Map<string, number>)

cinder patio
mellow kelp
#

yeah that's why i always have strictNullChecks on

rocky hearth
#

why do you first check with has??
and not if(!var) return?

opal plank
#

that makes working with maps an absolute nightmare though

mellow kelp
#

that's why i use objects now kek

opal plank
#

you'll like have to compile extra code and more complexity or slap a no-check tag there

mellow kelp
#
const cache: Record<string, number> = {};

function getSomething(key: string): number {
  if(key in cache) return cache[key];

  // return something
}
cinder patio
#

well, if you have the option disabled you lose some of the advantages of typescript

#

null and undefined safety.. which is a huge part of why typescript exists

opal plank
#

normally it will warn about null and undefined

rocky hearth
#
const a = cache.get('');
if(!a) return;
a // a definately has a available now

is it a bad thing?

cinder patio
#

edwin enable the option and see how many compile errors you have 😅

#

I'm curious

opal plank
#

aight, lets see

mellow kelp
#

i find it kinda long tho

rocky hearth
#

but isn't it better not to traverse the map twice?

mellow kelp
#

oh there's an issue on this

opal plank
#

none

mellow kelp
#

whoa epic ascii art over there

#

figlet?

opal plank
#

dont recall

scenic kite
#

Im new

#

Wait

#

I dont get bot developer :(

opal plank
#

you need to have ur bot approved

cinder patio
#

oh so you code as if it's enabled? Like if the option is disabled you don't have to use ?. or !

opal plank
scenic kite
cinder patio
#

you will get the role after it's approved

opal plank
#

so, this options doesnt do anything to me

rocky hearth
#

my vsc is closed, no terminals are open, no process is running. But still my localhost:5000 is running. How?

cinder patio
#

so keep it enabled spongerino

opal plank
#

no thanks, i dislike seeing unecessary errors like that one

#

if it has(), it exists

#

there are a couple things i dislike about ts

#

like array.push() methods not checking typings

#

nor Object.assign()

#

since both modify the original

#

and there isnt type checking on them

#

those are some easy ways to create bugs in your code if you dont do the type checking of the interfaces beforehand

#

Ts does have flaws, never said its perfect, but i account for that stuff when im coding, so it should be fine

#

its like @quartz kindle yolo'ing everything in js

cinder patio
#

array.push() checks for typings

opal plank
#

it doesnt

#

Object.assign() and array.push() doesnt check it

cinder patio
opal plank
#

oh, array does

#

there was something else that didnt

#

with arrays, i cant recall what

#

this shouldnt pass at all

#

but it does

slim heart
#

is there a way to like update google tag manager?

opal plank
#

also, my bad

slim heart
#

cuz my site is lazy loaded now so it just only runs when you first go to it

opal plank
#

my snippet is wrong

#

now its right

quartz kindle
#

yolo

opal plank
#

Yoooloooo

cinder patio
opal plank
#

hmmm that might be the proper way, but the method itself should be shielded

#

without the need for observables/generics

cinder patio
#

ye

quartz kindle
#

does that mean i can aboose it without ts screaming at me?

#

codes in object.assign to avoid ts errors

rocky hearth
#

O^

graceful shore
#

now i have to wait for the "suspicious growth" thing to go away

opal plank
graceful shore
#

;-;

opal plank
quartz kindle
#

what does ts do if you use jsfuck?

opal plank
#

will probably self delete