#development

1 messages · Page 1449 of 1

pure lion
#

there's only connect

terse berry
#

I just want to set user = and find if the person is in a mutual server with the bot and if is, set user = mentionedUser that is in other server

earnest phoenix
honest perch
#

yes

crimson vapor
#

How do I iterate over a map?

earnest phoenix
#

how do i set my discord bot's activity

pure lion
#

oops didnt push

#

but still, i compiled locally and it did nothing

#

@earnest phoenix pushed

terse berry
#

is there something like client.guilds.members.cache.get(args[0]);? To get mentioned user from another server where the bot is present

earnest phoenix
#

@pure lion Did it fix it?

pure lion
#

nope

#

i just showed you how it wasnt fixed

#

el here

earnest phoenix
#

Oh yea, i thought you didn't push it so

quartz kindle
earnest phoenix
#

hello??

crimson vapor
#

alright ty

earnest phoenix
#

@pure lion I don't see how it doesn't work tf

#

how set bot status?

pure lion
#
{
    "compilerOptions": {
        "allowJs": true,
        "target": "ESNext",
        "outDir": "./dist",
        "module": "CommonJS",
        "strictNullChecks": false,
        "esModuleInterop": true,
        "strict": true
    },
    "include": ["src/*"]
}```
#

here's my tsconfig if it helps

earnest phoenix
neon heart
earnest phoenix
quartz kindle
pure lion
#

@earnest phoenix it did jack shit

#

@quartz kindle yes we're literally on fire and in so much pain ooohhhhh

earnest phoenix
#

how do i edit

pure lion
#

tim, vx

earnest phoenix
#

:C

pure lion
#

please help me with typing

earnest phoenix
#

Is there a way how to make a discord bot online while coding on mobile iOS?

pure lion
#

no

#

please don't use glitch

#

ever

earnest phoenix
#

y

#

Plus who here can make a bot on iOS and is able to help/teach me what to do?

#

helpp

#

I wanna make vote webhook

#

but i read the api

#

still dosent understand

quartz kindle
#

vote webhooks have nothing to do with discord webhooks

earnest phoenix
#

hun

#

so how do i make 1

quartz kindle
#

whats your programming language?

earnest phoenix
#

dbd

#

dbd.js

quartz kindle
#

wut

#

bot designer?

earnest phoenix
#

no

#

yes

#

but not app

quartz kindle
#

then what

earnest phoenix
#

dbd.js

#

NOT BDFD

ancient dagger
#

How do I make my bot send a message when it joins?

ancient dagger
quartz kindle
earnest phoenix
#

ye

quartz kindle
#

so your bot runs on node.js?

earnest phoenix
#

yes

#

ig

quartz kindle
#

where is your bot hosted? your pc?

ancient dagger
#

How do I make my bot send a message when it joins?

earnest phoenix
#

yes

quartz kindle
#

so not your pc

earnest phoenix
#

yes

honest perch
#

that would be helpful

earnest phoenix
#

i edit codes on pc

quartz kindle
#

are you using dblapi.js or top.gg-sdk?

earnest phoenix
#

i dunno

#

I dont even know how to use api

ancient dagger
quartz kindle
#

top.gg-sdk is the official library for top.gg

honest perch
#

module, for contacting the discord gateway

quartz kindle
#

you can use that for top.gg webhooks

honest perch
#

like discord.js

earnest phoenix
#

yes

#

i want that

honest perch
solemn latch
#

tim was responding to someone else.

ancient dagger
#

Ok

earnest phoenix
honest perch
quartz kindle
#

install it in your glitch project

earnest phoenix
#

kk

ancient dagger
#

Ok nvm ama figure it out

#

Bye

quartz kindle
earnest phoenix
#

$ npm i @top.gg/sdk
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@top.gg%2Fsdk - Not found
npm ERR! 404
npm ERR! 404 '@top.gg/sdk@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/12.0.0/_logs/2020-12-13T17_22_38_411Z-debug.log

#

@quartz kindle

#

sed

ancient dagger
earnest phoenix
#

help

#

npm i @top-gg/sdk @earnest phoenix

pure lion
#

auric have you figured out the poo?

earnest phoenix
#

oh the typings?

#

$ npm i top-gg/sdk
The authenticity of host 'github.com (140.82.114.4)' can't be established.e47e1d
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
[..................] - rollbackFailedOptional: verb npm-session 3ba8b24a5be47e1d

#

help

quartz kindle
earnest phoenix
#

tf

#

OH

#

wait

#

uhm lol

ancient dagger
opal plank
#

correct, lets see

quartz kindle
pure lion
ancient dagger
crimson vapor
#

lies tim

#

you use discord.js-light

opal plank
#

actually

pure lion
crimson vapor
#

prototype pollution go brrrrrr

pure lion
#

itll have native cache options

earnest phoenix
#

checking rn

pure lion
#

omg erwin

#

help

#

me

#

please

opal plank
#
interface lol {
funcName(param:string) => Promise<any>
}

@quartz kindle

#

rather than :

opal plank
pure lion
#

typings

#

let me scroll up

opal plank
#

what about typings?

ancient dagger
earnest phoenix
#

@quartz kindle

#

what do i do now

opal plank
#

where?

pure lion
#

well i have a .d.ts file and all my typedefs in place but when i compile it doesnt intellisense

opal plank
#

i dont see

ancient dagger
#

100 pings a sec lmao

opal plank
#

lemme grab a link

#

i assume so yeah @quartz kindle

earnest phoenix
#

@quartz kindle

quartz kindle
earnest phoenix
#

in where

opal plank
#

ts 4.0?

earnest phoenix
#

in package.json

#

i c

quartz kindle
#

its not ts

#

its .d.ts

opal plank
#

which is ts typings lol

#

declarations.ts

earnest phoenix
#

no

quartz kindle
#

yes, but i dont have ts installed

earnest phoenix
#

@quartz kindle help me when

opal plank
#

you forgot semicolon

pure lion
#

who

opal plank
#

funcNeme: (params:type) => returns

ancient dagger
quartz kindle
#

ah

#

you forgot them too

#

lmao

opal plank
#

did i?

#

oh shit, my bad

earnest phoenix
#

what do i do nowwwwwwwwww

opal plank
#

@pure lion wusup

pure lion
#

ok so

#
export class Client extends Emitter {
    token: string;
    socket: typeof Emitter;
    config: ClientOptions;
    /**
     *
     * @param {string} token the token used for auth
     * @param {ClientOptions} options
     */
    constructor(token: string, options: ClientOptions);
```this is the client constructor in my .d.ts file
#

and

earnest phoenix
#

OH god

#

Answer me pls

opal plank
#

is your file TS?

pure lion
opal plank
#

not the declarations, the actual file you trying to import that in

pure lion
#

yeah

opal plank
#

thats legit the same thing i was on about yesterday

pure lion
#

that pic is using the transpiled js

quartz kindle
#

more specifically, check "Example of using webhooks to receive vote updates" in the examples section

opal plank
#

that happens because require() is any, and your exported class is not expring all that

pure lion
opal plank
#

correct

#

you trying to import ts into js

#

ts can import jdocs and ts declarations

#

js can only import jdocs

earnest phoenix
#

@uneven bronze no

#

CAN SOMEONE TELL WHAT DO I DO NOW

#

HE JUST ANSWERED

quartz kindle
opal plank
#

@coral trellis ads

pure lion
#

because

#

and it connects and everything

opal plank
#

run that code

#

do //@ts-ignore and run it

earnest phoenix
#

@quartz kindle which one do i hab to read

opal plank
#

if it errors, your declaration is wrong, if not, use the constructor right away

pure lion
quartz kindle
opal plank
#
const client = new require('/websocket')();
console.log(client)
``` @pure lion
#

try that

#

that was the same mistake the other guy did yestrerday

quartz kindle
earnest phoenix
#

I installed that one?

quartz kindle
#

yes

#

now read it

opal plank
#

actually good thing you reminded me tim, i need to ask xetera if theres a need for a new declaration file for ts

#

cuz its not dlbapi anymore

honest perch
pure lion
#

i cant even test it because someone fucked something up

#

im going to cry

opal plank
#

rip

pure lion
#

@honest perch can you shout at starman

honest perch
#

@sinful belfry H

sinful belfry
#

zoomeyes what happened

pure lion
#

there's an error being thrown

honest perch
#

show the error you noob

opal plank
#

watch it be ur implementation

honest perch
#

ok good to know tim

pure lion
#

"cant read property cacheChannels of undefined"

#

i am going to kill you starman

#

un-push your files

quartz kindle
#

const inflateData = zlib("Inflate");

pure lion
#

or face the wrath of tired dice

pure lion
earnest phoenix
#

@quartz kindle i dont understand where do i put those codes

sinful belfry
#

from which file?

opal plank
#

in...your...files?

quartz kindle
#

also, im not sure if this will work import zlib from 'fast-zlib';

earnest phoenix
#

no

#

the webhooks

quartz kindle
#

what does ts do when you dont export an object?

opal plank
#

it will screech at you, import resolves on require if its es5 iirc

#

but just cuz of typings

quartz kindle
#

import X from Y would only work if you module.exports = { X } no?

#

if you do module.exports = X how do you import it?

#

import * as X from Y?

pure lion
#
if (!options) {
        this.config = {
        browser: 'ourcord (https://github.com/ourcord/ourcord)',
        device: 'ourcord (https://github.com/ourcord/ourcord)',
        status: 'dnd',
      };
      } else this.config = options;
      this.cache = new Cache(options);```
opal plank
#

thats why you use export syntax tim

pure lion
#

@sinful belfry

#

you are so smart

#

even smart than bobby

quartz kindle
#

export X is just an alias for module.exports.X = X

opal plank
#
let hello = 'hello World'
export hello as HelloWorld;




import HelloWorld from './file'
quartz kindle
#

exactly

opal plank
#

yeah, but named exports is a bliss

#

so it should work fine

#

lemme give it a try actually

quartz kindle
#

but if you are a js user, then you have to do let { X } = require("X") whicih is annoying

#

as a js user, you want to simply do let whatever = require("X")

#

thats why you replace module.exports entirely

earnest phoenix
#

@quartz kindle

#

bro I am dumb at webhooks

#

please tell me how to do

opal plank
quartz kindle
opal plank
earnest phoenix
#

nope...

opal plank
#

its a module exports

quartz kindle
#

yes but its an object

opal plank
#

without it being named it resolves as default

#

module.export.thing

import {thing} from module

quartz kindle
#

try doing module.exports = something that is not an object

earnest phoenix
#

ur telling to me?

opal plank
#

module.exports

import {default} from module

quartz kindle
#

no im talking to erwin

earnest phoenix
#

o

opal plank
#

lets see

earnest phoenix
#

wot i do tell pls

quartz kindle
#

the whole ting is that you cant do import X from Y if yoour module.exports is not an object, while in js you can

opal plank
earnest phoenix
#

halp pls

#

:c

opal plank
#

you want something like exports.test?

quartz kindle
#

so you have to do import default from Y?

opal plank
#

and try calling {test}

#

JUST exports is default

#

exports.thing
{thing} from module

earnest phoenix
#

imagine being ingored

opal plank
#

lemme just confirm, cuz i usually use exports, which is what should be used for export/import syntax

#

its weird to mix es5 and es6 syntax

quartz kindle
stark willow
#

Pubblic bot

#

Yes

#

Pls

earnest phoenix
#

just please tell

hollow sedge
quartz kindle
#

else i wont help

stark willow
#

My bot pubblic PLS psl

hollow sedge
#

You're just making people less likely to help you

earnest phoenix
#

Hmm

quartz kindle
opal plank
quartz kindle
#

if you dont have express installed, install it

earnest phoenix
#

Ok

opal plank
earnest phoenix
#

then?

opal plank
#

cant do that aparently

earnest phoenix
#

where do i put that webhook server code

quartz kindle
#

in your bot

#

or wherever you want

opal plank
#

or ts export foo as NamedFoo

quartz kindle
# opal plank

like for example, many js libs on npm are basically this: ```js
module.exports = () => { ... }
or
module.exports = class { ... }

#

how do you import those in ts usually?

opal plank
#

you should be able to do import default from 'module'

quartz kindle
#

ah

opal plank
#

or import *

#

actually

opal plank
#

you might need to do {default}

quartz kindle
opal plank
#

then yeah, thats the same issue dice and that other guy yesterday were having

#

require() returns any

pure lion
#

@opal plank what was the use ts thingy

opal plank
#

which is a pain in the ass to convert from js

pure lion
#

also it works

opal plank
#

lemme check something rq

earnest phoenix
#

Wait

#

Krista you got it working?

pure lion
#
//@ts-ignore

const { Client } = require("./websocket");

const client = new Client(process.env.TOKEN);
client.connect();

client.on("ready", () => {
    console.log("sdioghosdighiosh")
})```
#

no

#

it logged the string

green kestrel
#

I'm trying to help someone fix their bot, is it really the case that ytdl can't bind to an IP address?!

pure lion
#

is that an error

#

thefeckin

quartz kindle
green kestrel
#

It does

#

All internet requests have a source and destination ip

#

Usually a program picks an IP on your server itself

#

But if a server is multi homed eg it has 20 ips

honest perch
green kestrel
#

There should be a way to tell it which to bind to for making its request

#

That way you're less likely to be banned by YouTube

quartz kindle
#

ytdl just sends a request to whatever network interface the operating system gives it, it doesnt chose

#

if you want to avoid ip bans, look into proxying ytdl

#

they have an example for proxying their requests

green kestrel
#

I use this same thing against Google translate rate limits but it seems ytdl was made by someone who had no clue about tcp

honest perch
#

why not use lavalink

#

its made for playing music in bots

earnest phoenix
#

bloat

#

and it's java

opal plank
green kestrel
#

It's not my bot, I've suggested lavalink

earnest phoenix
#

you'll achieve better performance with ffmpeg and ytdl if you know how to use them properly

green kestrel
#

To be honest,.if it was my bot id have done it myself, it's trivial

earnest phoenix
#

also TIL ffmpeg outputs status updates through stderr 🤯

opal plank
#

classes are funkier, lemme get an example

quartz kindle
#

ts is weird af

#

its such a clusterfuck

green kestrel
#

C++ for life y'all

pure lion
#

erwin did you like

green kestrel
pure lion
#

a

opal plank
pure lion
#

what the hhhhhhh

opal plank
#

its not even ts, its es6 vs es5 syntax

#

import/exports are vanilla js

quartz kindle
#

so you have to do import default from Y?

#

to get the class directly

opal plank
quartz kindle
#

import default as MyClass from Y

opal plank
#

yes, cuz unnamed export

quartz kindle
#

something like that?

opal plank
#

unnamed export turns into default

quartz kindle
#

ok

misty sigil
#

ts is weir d

#

i know

opal plank
#

its vanilla js u cuck

#

es6 syntax

pure lion
#

erwin is there anything you need me to type in ooohhhhh

#

im crying right now

misty sigil
#

dont call me a cuck you cock

opal plank
#

didnt you have to wait for starman?

pure lion
#

nah i fixed it

opal plank
#

then whats up?

quartz kindle
#

im exporting the class directly in js, and also exporting it like this in d.ts ```js
declare module "mymodule" {
class MyClass { ... }
export = MyClass
}

pure lion
#

but the types still dont exist

#

the file runs

#

but i want intellisense

#

for my client options

opal plank
#

im not sure you need an export inside the module, i think if you declare it ontop it should work fine

quartz kindle
#

thats what several SO answers said to do

green kestrel
#

If anyone's interested this is what I mean by port binding. It's a great way to get around certain limits (not discord API) if you have many ips on your server
https://hastebin.com/wotemixeme.php

opal plank
#
import {MyClass} from 'interface'
declare module "mymodule" {
  class MyClass { ... }
}
#

actually

#

my bad, its cuz i do something different

#

i import the whole file alongside

opal plank
#

lemme grab an example

#

this probably wont be any good for this case now that i think about it since its ts

honest perch
#

dice and his stupidsense

quartz kindle
#

you can bind a server to a specific ip address in node, like express

#

but ytdl is not a server, not sure if you can bind outgoing requests to specific IPs

opal plank
#

that imports all the files and merges the ones with the same name

#

i simply import everything and it merges any interface called CLient

#

Client*

#

but thats already for typings and its ts, so it wont be much use here, cuz otherwise you could call it from the top of your file

#

lemme check for classes

pure lion
earnest phoenix
#

Its a music bot script

#

I don't undestand

misty sigil
#

hastebin

#

pls

earnest phoenix
#

wait

#

Where is the problem?

opal plank
#

@quartz kindle actually that way is right

earnest phoenix
#

Who uses rep.lit

#

me

#

@earnest phoenix const Discord = require('discord.js');
const { prefix, token } = require('./config.json');

const client = new Discord.Client();

client.once('ready', () => {
console.log('Ready!');
});

client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();

if (command === 'ping') {
    message.channel.send('Pong.');
} else if (command === 'beep') {
    message.channel.send('Boop.');
}
// other commands...

});

client.login(token);

#

what is this

#

May I have help with commands I found this script

pure lion
#

sits

solemn latch
#

you should really follow the djs guide.

earnest phoenix
opal plank
hollow sedge
#

The d.js guide is one of the easiest things to follow lol

earnest phoenix
#

@earnest phoenix do you have a script of commands I can use?

pure lion
#

sits harder

hollow sedge
#

Learn how to code instead of just copying code

#

@earnest phoenix

quartz kindle
#

what is the declare namespace for?

#

i have declare module instead

earnest phoenix
opal plank
#

it overrides the module iirc

#

so when you require it, it pulls from the declaration first

misty sigil
#

install ffmpeg

opal plank
#

not the exports

misty sigil
#

npm i ffmpeg-binaries

#

iirc

earnest phoenix
#

okay

opal plank
#

it pulls from this

quartz kindle
#

interfaces are not automatically exported right?

opal plank
#

no

#

you need to export interface

earnest phoenix
#

Who has a script of moderation I can use?

pure lion
#

erwin, do you want my entire .d.ts file?

opal plank
#

just add an export infront and you good to go

#

but you only need exports when you need it outside

quartz kindle
#

ye i only have one interface for an object, i dont want to export it

opal plank
#

if you declare everything in the file, you only need to export them on the final export

#

if its internal, and not needed outside of the file, keep it without export, it pulls from the parent

quartz kindle
#

i have a method that returns an object with 3 functions (cursor), its better to declare it as an interface or as an object?

earnest phoenix
#

Who has a script of moderation I can use?

opal plank
#

interface is an object

quartz kindle
#

ah ok

opal plank
#

type is for everything else

#

though you can do a type for objects too iirc

crimson vapor
#

was the issue Tim was having that he was exporting a class?

quartz kindle
#

im not having any issue, im just asking because i dont use ts

#

and i want my thing to work on ts too

#

but icba installing ts to test it

#

lmao

opal plank
crimson vapor
#

oh

#

I was having an issue trying to export a class and add typings for it

opal plank
#

tldr, use interfaces for multiple things, and types for one thing

quartz kindle
#

ok so interface to describe contents

#

type to describe the thing itself

pure lion
#

@opal plank should i export the things as types and not interfaces then :d

#

in my .d.ts

slender thistle
opal plank
#

@pure lion idk what you doing, but, maybe?

#

@slender thistle QT

pure lion
#

@opal plank just tried it, didnt work

opal plank
#

Like i said, i dont know what youre doing

slender thistle
#

@opal plank U

opal plank
#

@slender thistle U2

pure lion
#

trying to get types i wrote to work in transpiled js

opal plank
#

why though

#

i told you

#

it dont work like that

#

ts types only import on ts files

#

ts => jsdocs/ts types
js => just jsdocs

pure lion
#

so i cant have custom type "Pootis" on my client

#

aw man

#

then how does discord.js do it

opal plank
#

jsdocs

#

they dont have a ts file

pure lion
#

ah

#

well will it show me the

#

the the

#

uhh

opal plank
#

i asked them if they wanted to, they said they dont need it since most ts users know what they're doing so its pointless

earnest phoenix
#

lol

pure lion
#

its for a discord lib so it has to be idiot proof

earnest phoenix
#

there's a new lib i've seen in dapi specifically made for ts

opal plank
#

go to d.js official server and search by me in there, you'll get the chat we had

#

not new at all

pure lion
#

alrighty

opal plank
#

its detritus

#

and i hated it

#

their docs are shit

earnest phoenix
#

oh

pure lion
#

can i at least get it to show intellisense for the fields i want

earnest phoenix
#

i had hope

#

lol

opal plank
#

make jsdocs comments

pure lion
#

alrighty

opal plank
#

/**

  • @param string hello world
  • @private thingy private thingy
    */

you've seen ti before

pure lion
#

wait what's private?

opal plank
#

public/private

#

readonly

#

theres a bunch of shit in js

#

static

#

void

#

its more complicated js to put it bluntly

#

when you fuck with classes and returns, you'll get there

#

its the way lib devs say: dont touch this or it will break shit

crimson vapor
#

I thought private wasn't a thing in js

earnest phoenix
#

it has been a thing since es6, no?

opal plank
#

usually they start with _

#

though thats 100% preference

#

i usually use _ when i need a related variable , not speicfically for that

earnest phoenix
#

yeah that's inherited from c# i believe

#

we like to use underscores to declare class fields

opal plank
#

for (let _e of e) {}

#

i usually do that quite a bit

#

since its all under e

#

e, _e, __e, ___e

#

if it gets past 3 i change it

quartz kindle
#

fuck man

opal plank
quartz kindle
#

it takes me longer to write typings and jsdocs than to write the actual code

#

@_@

opal plank
#

ikr

#

thinking about backtracking to when you said nah when i asked ya if you wanted typings?

quartz kindle
#

lmao

opal plank
#

wink wink

quartz kindle
#

i mean, if you wanna do them sure

#

lmao

opal plank
#

what is it about though?

quartz kindle
#

its not even on github yet

#

lmao

#

im gonna publish it all at once when its finished

opal plank
#

rn im a lot busy so im short on time cuz irl, chick and lots of people asking me to work for them, but i can give it a help

quartz kindle
#

nah im good, just need to finish writing the jsdoc, no need to hurry haha

opal plank
#

theres a jsdocs generator btw

#

and the same for ts

#

wont do a flawless work, but will surely reduce 90% of the writing

quartz kindle
#

i'll give those a try sometime xD

opal plank
#

a friend is using that for their API and its working out great

#

no major hiccups with the ts one

quartz kindle
#

the thing im writing is pretty simple tho

opal plank
#

oh, i usually go a bit overboard

quartz kindle
#

im doing it in the .d.ts file because fuck it

opal plank
#

thats jsdocs though xD

quartz kindle
#

yes but it works, at least for vsc intellisense

#

lmao

opal plank
#

LMAO

quartz kindle
#

jsdoc + typings in one file

#

genius

opal plank
#

400iq

#

you legit dont need docs/website if you ship your module with this, take up time here, but dont need to fuck with vue/react to make something on a website

quartz kindle
#

jesus christ

#

i'll hire you for that in the future

opal plank
#

xetera liked it

sudden geyser
#

You can't just document a specific field?

opal plank
#

you can, jsdocs is for that

#

@param

#

boom, done

#

i usually integrate everything, sometimes it just says @returns object
but you dont know the shape of it, nor if it has custom types

quartz kindle
sudden geyser
#

then why state all the fields like that up there (* [Name | Type | Boolean | Description])

opal plank
#

WHAT DOES IT DO

EXAMPLE

WHAT DOES IT RETURN

WHAT DOES IT TAKE(PARAMS)

#

thats the format i follow when i make intellisense

sudden geyser
#

🤔

quartz kindle
#

why is the param showing before the description tho

opal plank
#

params first though

quartz kindle
#

i mean on mine

opal plank
#

oh

quartz kindle
#

the param is showing first

opal plank
#

i think thats meant to happen

quartz kindle
#

wait intellisense is full markdown

#

oh

opal plank
#

yup

quartz kindle
#

nice lmao

#

do you even use param tags?

opal plank
#

told ya, its powerful af

#

no need to, but yes

frigid schooner
#

ERROR: Could not find a version that satisfies the requirement dblpy (from versions: none)
ERROR: No matching distribution found for dblpy?

opal plank
pure lion
#

why wont it workkkk

#

sdgniklpo

quartz kindle
#

nice

opal plank
#

it pulls as query

#

neat af right?

pure lion
quartz kindle
#

now the param thing kinda ruins it

opal plank
pure lion
#

no i know that much

#

is that file ts

#

i meant the red circle

opal plank
#

thats sharex

pure lion
#

i mean

crimson vapor
#

how is the conversation going

pure lion
#

inside the red circle

opal plank
#

the WHOOOLE THING

pure lion
#

rust does that

opal plank
#

what about the thing inside the red circle?

pure lion
#

the thingy says DBLAPI in the params

opal plank
#

yes

#

cuz ts

pure lion
#

ah fair

opal plank
#

behold the powah of ts

pure lion
#

im still sad

#

i want my fecking intellisense

opal plank
#

use import reee

#

rather than require

#

get intellisnce from it

pure lion
#

wait

opal plank
#

ts can transpile that into vanilla js on the targeted version even if that syntax isnt native

crimson vapor
#

import > require?

opal plank
#

why write shit in js, hoping to work in ts, when you can do ts, and transpile to js in whichever version/flavour you like?

#

yes, named exports is a bliss

crimson vapor
#

I have a question about typings actually rn

opal plank
#

what about it?

crimson vapor
#

can you tell .d.ts that you are exporting your package as a class?

pure lion
#

i have intellisense directly behind the constructor but none at client.config

crimson vapor
#

like in module.exports you can just export a class

#

can you tell ts you are doing that?

opal plank
#

i was talking to tim about that just a moment ago

#

by a moment i mean like 30 minutes ago

crimson vapor
#

hmmm

opal plank
#

might be worth looking in chat, it was a long thing, kinda lazy to repeat all xD

quartz kindle
#

the at param kinda ruins the style

crimson vapor
#

you think so?

quartz kindle
#

but since its the official jsdoc syntax better leave it

pure lion
opal plank
#

frick official syntax, gimme my complete documentation shipped with the libs

quartz kindle
#

xD

opal plank
#

@returns - An Object containing properties mmulu

#

very discriptive

#

full marks, 5/7

crimson vapor
#

LOL

earnest phoenix
#

ship an electron app that renders a full blown page on hover 🧠

opal plank
#

YES

#

who needs a website when you can render shit on the client

#

brb, gonna do that

crimson vapor
#

who needs responsive css when you can just return json

pure lion
#

errrrwiiiiiin

#

i cant import it

#

with import

#

s

hollow sedge
#

true @crimson vapor

#

users are too spoiled nowadays

opal plank
crimson vapor
#

json is so much easier, there are no ads, no slow responses, no responsive css, no being confused when shit is cached and its not supposed to be

hollow sedge
#

no

opal plank
#

well yeah, you didnt make that a module

hollow sedge
#

you put an ad inside the json

opal plank
#

change the extension type to mjs

earnest phoenix
crimson vapor
#

they aren't KEKW

opal plank
#

@earnest phoenix @crimson vapor

earnest phoenix
#

LMFAO

quartz kindle
#

LOL

opal plank
#

ACTUALLY

#

ONE SEC

quartz kindle
earnest phoenix
#

bruh

misty sigil
#

??

crimson vapor
# opal plank

what the fuck why the fuck and how the fuck is that like that

opal plank
#

aaaw, i cant do this in vsc

crimson vapor
#

what do you use normally?

quartz kindle
#

inb4 you have a youtube video of raid shadow legends autoplayed when you hover a var in vsc

misty sigil
#

LMAOO

opal plank
#

aparently you cant put image sources in there

earnest phoenix
#

what about markdown syntax for images

opal plank
#

hmmm lets see

quartz kindle
#

also try base64 images

crimson vapor
#

change it to THIS PORTION OF THE DOCUMENTATION IS SPONSORED BY RAID SHADOW LEGENDS

opal plank
#

LMAO

quartz kindle
#

LMFAO

opal plank
#

I DIT IT

earnest phoenix
#

LOLO

crimson vapor
#

are you going to push that?

quartz kindle
#

yes pls

#

do it

crimson vapor
#

I agree with Tim

opal plank
#

xetera needs to pass the commit

quartz kindle
#

wait

crimson vapor
#

hmmm

quartz kindle
#

add an extra method to the class

#

that does nothing

#

but when you hover it in vsc

#

it shows that

#

LMFAO

opal plank
#

bruh im so doing that

quartz kindle
#

.raid()

crimson vapor
#

yes perfect

#

tim

#

can you add that do d.js-light?

quartz kindle
#

LMFAO

#

wait

#

is there any image url that gives you money for img loads?

crimson vapor
#

LOL

ancient dagger
#

How I make my bot send a message when it joins a server?

crimson vapor
#

making money off of raid shadow legends LMFAO

#

you're so smart Tim

slender thistle
#

.raid(invite: Invite, amountOfRaidingAccounts: integer)

quartz kindle
#

xDDDD

ancient dagger
slender thistle
#

but the only thing it does is return a raid shadow legends in a string X times

crimson vapor
ancient dagger
crimson vapor
#

why would you need to be in the server?

quartz kindle
crimson vapor
#

Tim I think my json db is just about done

crimson vapor
#

if it corrupts ima add atomic writes but im too lazy to do it rn

quartz kindle
ancient dagger
#
client.on("guildCreate", guild => {
  console.log("joined new guild: " + guild.name);
  if(guild.systemChannel) {
    guild.systemChannel.send("thank you for adding me pls do w!help if you need help")
  }
})
crimson vapor
#

that would work

ancient dagger
#

Ok

crimson vapor
#

what about if the bot doesn't have perms to talk in the channel Tim

pale vessel
#

Tim added a catch and they removed it

main trench
#

Lmao

quasi cape
#

main trench
#

.catch (e){
return;
}

#

My favorite code

pure lion
#

right so im using an import statement in my .mjs file but its throwing a require error. WHY

crimson vapor
#

I don't remember seeing that catch when he first wrote ut

pure lion
#
import { Client } from "../src/websocket";```
```cmd
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\cygwin64\home\james\coding\github\our.discord\dist\example.index.mjs```
honest perch
#

ok james

main trench
#

It may not be a module

pure lion
#

who's james oWo

#

i need to change that

#

goose, it should work

main trench
#

We still see your name KEKW

pure lion
#

no its not my name

pale vessel
#

Change user to krista smh

pure lion
#

smh

#

i will

#

thing is

#

my dad will get sus

#

and he does't do the support

pale vessel
#

oh well

main trench
#

Are you using python?

slender thistle
#

James more like who

honest perch
#

your parents dont know or?

pure lion
#

my dad doesnt support me

pure lion
opal plank
crimson vapor
#

omfg

slender thistle
#

Erwin

pale vessel
#

That looks nice af

crimson vapor
#

tysm

main trench
#

Why

slender thistle
#

You're an idiot

earnest phoenix
#

LMFAO

#

that's insane

opal plank
hollow sedge
#

wait

#

make your docs a video

#

so they have to wait

opal plank
#

omgf 7 stars instantly

crimson vapor
#

no don't

opal plank
#

wtf

pure lion
#

how the how do i do this

crimson vapor
#

how the how

pure lion
#

@Not Erwin#8753

paper cliff
#

lmaooooo

opal plank
main trench
paper cliff
#

that's genius

main trench
#

Try const instead

pure lion
#

it wont work

opal plank
#

time for a video, lets see if vsc supports embeds, 3 times in starboard?

crimson vapor
#

what

#

const !== import

#

yes

quartz kindle
#

@opal plank can you make a different jsdoc for method arguments? like if you highlight the param inside the method

pure lion
#

i am in pain polis help

main trench
#

Const { client } = "stuff";

pure lion
#

the intellisense works

#

but it wont run

crimson vapor
#

im backwards

#

my intellisense shit

#

but it runs

pure lion
#
import { Client } from "../src/websocket";

const client = new Client(process.env.TOKEN, {status:"online"});
client.connect()

client.on("ready", () => {
    console.log("h")
})```
main trench
#

Hmm

pure lion
#

this is a .mjs file

#

btw

opal plank
pure lion
#

erwin do you know da wae

quartz kindle
#

because like

opal plank
#

i do not

quartz kindle
#

vsc does show a slightly different jsdoc

pure lion
#

not da wae to fix my error?

quartz kindle
#

when you hover the params

main trench
#

Ohhh

opal plank
#

im not sure about that tim

main trench
#

const { Client } = require('../src/websocket');

opal plank
main trench
#

@pure lion

opal plank
#

mjs IS js

#

module js

pure lion
main trench
#

Hmm

#

Strange

opal plank
#

you could do it with a package

#

package.json and set its type to module

pure lion
#

ok hold on

opal plank
#

so, i have to paths infront of me

#

one is cursed, the other is more

crimson vapor
#

show?

opal plank
#

but imma keep it vanilla friendly

#

one sec

pure lion
#

i tried it

#

it did not work

#

module not found in case one

#

and import error in case two

#

ok when i install the published thingy and change the main path to the ts files

#

it throws the module error again

main trench
#

@blazing hill

#

Whats your code?

earnest phoenix
#

@here

opal plank
#

Ads in VSC, im fairly certain not even hell can be punishment enough for such sin

crimson vapor
#

@opal plank can you send code for how you did that?

blazing hill
#

like what is my code?

modern sable
#

@opal plank wait is that real lmao

crimson vapor
#

yes

opal plank
#

i simply added a gif onto the markdown, vsc doesnt support html tags for be to do it

#

not natively at least

crimson vapor
#

yeah ik how but like send

opal plank
#

thats why i was saying theres 2 paths i can do, one is add an extension to load embeds, the other was to convert into gif

crimson vapor
#

o

opal plank
crimson vapor
#

ty

hollow sedge
#

yess

opal plank
#

i had hopes to get into the starboard 3 times in 20 minutes, specially with the final product

pure lion
#

how do i use declare module

crimson vapor
#

well

#

who the hell didn't star it

pure lion
#

i did

crimson vapor
#

load please

quartz kindle
#

@opal plank so basically when you add the param tags, if you hover the function, it shows all params, if you start typing the function argument, it will highlight that specific argument and hide all other params

pure lion
#

does my declare module statement go in my .d.ts or main ts file

#

aaaaaaa

quartz kindle
#

but if you add comments and a lot of MD, those still show every time, so you cannot see anything about the parameter that is being highlighted

opal plank
timber fractal
#

why if i use this code ```js
const canva = require('canvacord');
const Discord = require('discord.js')

module.exports = {
name: "trash",
description: "Trash somebody",

async run (client, message, args) {
    const member =  message.mentions.members.first() || message.guild.members.cache.get(args[0]).user || message.author

    let avatar = member.displayAvatarURL()

    let image = await canva.Canvas.trash(avatar);

    let trashed = new Discord.MessageAttachment(image, "deleted.png")

    message.channel.send(trashed);
}

}``` it says "cannot read property of 'user' of undefined"

honest perch
#

@pure lion it like works in production

#

somehow

pure lion
#

@honest perch i know it works in prod

sand condor
pure lion
#

but no sense at client.options

quartz kindle
#

lmao

sand condor
#

also displayAvatarURL() is a user method

timber fractal
solemn latch
#

also, you getting members in one, then user in the other two

sand condor
#

check if there's an args[0] ?

solemn latch
#

which is a bad idea

timber fractal
sand condor
#

don't try to get the user property then

#

and like woo said, your defining that variable as 2 different things

opal plank
#

you want it to show if its valid regExp?

quartz kindle
#

@opal plank i want it to hide all the comments and focus only on the param when you higlight the specific param

#

and show all the comments only when you highlight the full function

timber fractal
#

but i want it so if there is no one mentioned it returns the avatar of the member with the ID and if there is no ID it returns it from the message.author @sand condor

opal plank
#

hmmm im not sure you can do that easily, lemme double check

timber fractal
quartz kindle
opal plank
#

you mean like this?

#

where it just shows the missing one and why its incorrect?

#

and not this?

quartz kindle
#

i mean, it wont show why its incorrect because i dont have ts

#

but yes

#

if you dont put comments in your jsdoc, it works, all other params are hidden, and only the focused param is shown

opal plank
#

hmmm im not sure if thats possible, its the same thing i was telling dice, js =< only dsdocs
ts => js docs and ts declarations

solemn latch
#

you could then get the user from cache not the member on the erroring attempt @timber fractal

quartz kindle
#

but when you add comments, they always show all the time

crimson vapor
lusty quest
#

did you release it as npm package?

crimson vapor
#

yes

opal plank
#

yeah i dont think you can do it the way you want @quartz kindle , at least as far as i know

lusty quest
#

ahh yes millions of stupid people installing a meme package

crimson vapor
#

lol

quartz kindle
#

@opal plank also, arent jsdoc typings supposed to show somewhere?

solemn latch
#

i hope that happens @lusty quest

opal plank
#

they do show when you hover

crimson vapor
#

so far I have not had any corruptions tho

#

so good so far

solemn latch
#

how many tests have you dont

#

done*

crimson vapor
#

0 KEKW

lusty quest
#

using Json as a Database is stupid in all possible ways.

solemn latch
#

ah, yes

quartz kindle
#

like ```

  • @param {string} query The string to search for.
    only shows
    @param query - The string to search for
#

when you hover

lusty quest
#

run a database benchmark and see how fast you fry it

crimson vapor
#

idk how

#

or what to do

solemn latch
#

lemme throw a script together and just destroy this lib ;p

crimson vapor
#

alright please do

opal plank
crimson vapor
#

once someone finds a way to corrupt it I have to add atomic writes

lusty quest
#

make a script that writes a shitton of data and instantly reads it again. repeat it a few million times

#

to spice it up add updates and delete calls.

solemn latch
#

i was going to use workers, that would do like 100k writes and then close and open a new one.

lusty quest
#

also works

crimson vapor
#

I think workers will corrupt it

solemn latch
#

do like 20 workers at once

opal plank
#

it shows the type you defined Tim, if you set it the param as type of Query, and query is extension of string, it should show query, not string

solemn latch
#

thats the point KEKW

crimson vapor
#

yeah but thats cheating imo

lusty quest
#

json easy corrupts if you have 2 instances trying to access it

hollow sedge
#

should i contribute to millions db

crimson vapor
#

yes

#

add good code

hollow sedge
#

ok

quartz kindle
hollow sedge
#

together we can make jason.db the best one yet

nova spire
#

türk varme

crimson vapor
#

yes

opal plank
#

type Query = string;
@param Query - comment

shows Query, not string

nova spire
#

türk varmı

crimson vapor
nova spire
#

he eyw

hollow sedge
#

oh god

#

theres docs

#

nvm i dont wanna help

crimson vapor
#

LOL

stark viper
#

hello Guys can someone tell me how i let the bot create an Invite to the channel ?

opal plank
#

well to be fair ts should be loaded in ts

hollow sedge
#

who wastes their time on this stuff

crimson vapor
#

I spent like 15 minutes on those docs

opal plank
#

i doubt it works properly in js, since its wrapper

hollow sedge
#

real devs look through the code

quartz kindle
crimson vapor
#

you can if you want