#development

1 messages · Page 1464 of 1

mellow kelp
#

me kinda

versed gulch
#

Aight so say I have a timestamp
1608258694140

delicate shore
#

ok

mellow kelp
#

k

versed gulch
#

So I need to add 12 hours to that timestamp

#

And then check what the time difference is from now to that 1608258694140 + 12 hours.

#

So say that timestamp was 2 hours ago

#

And I check it now

#

I want it to say I can do something again in 10 hours

buoyant plank
#

Heya, I'm working on a database for my bot and going through the tutorial, but Sequelize's format is kinda offputting to me. I used Django's ORM for a project before and find it much more clean - and how associations is set up in Sequelize kinda confuses me.

Is there any better recommendations out there?

delicate shore
#

can anyone help me ?

opal plank
sonic pike
#

ye

delicate shore
opal plank
#

you

#

array.artists is not a thing

sonic pike
#

i dont code in js

opal plank
#

its an array not an object

delicate shore
#

it works for me tho

sonic pike
#

no it doesnt

opal plank
#

clearly you dont know arrays

sonic pike
#

i think thats an array

opal plank
#

here

sonic pike
#

i thinks its like this:

opal plank
#

arrays are indexed with numbers, not with properties

delicate shore
delicate shore
#

than it's an object right?

#

lma

#

sorry

opal plank
#

it isnt

#

its an array

#

array.forEach()

#

you iterating through each item inside the array

delicate shore
#

oh

#

yes

#

I am

opal plank
#

and THEN inside each item you getting artist

sonic pike
#

<arrayname>[<index>]

delicate shore
#

But that artist

#

has a lot of properties

#

I wanna et the name

opal plank
sonic pike
#

oh let me say this one

delicate shore
#

I tried

#

it gives undefined

opal plank
#

then it doesnt have name in it

delicate shore
#

it does

opal plank
#

it doesnt

#

clearly

delicate shore
#
    "artists": [
      {
        "external_urls": {
          "spotify": "https://open.spotify.com/artist/5a2w2tgpLwv26BYJf2qYwu"
        },
        "href": "https://api.spotify.com/v1/artists/5a2w2tgpLwv26BYJf2qYwu",
        "id": "5a2w2tgpLwv26BYJf2qYwu",
        "name": "SOPHIE",
        "type": "artist",
        "uri": "spotify:artist:5a2w2tgpLwv26BYJf2qYwu"
      }
    ],```
opal plank
#

things dont magically be there

#

cuz artists is an array

#

not an object

delicate shore
#

oh

#

frick

opal plank
#

dude those are things you should know

#

arrays and objects are basic js

delicate shore
#

Sorry

opal plank
#

if you dont know these you wont be getting far

#

dont be sorry, just learn from the docs i sent you

#

its okay not to know

#

we all start somewhere

delicate shore
#

Thanks

#

I will learn as soon as my ongoing exam is finished

opal plank
earnest phoenix
#

imagine being a bot dev, couldnt be me

sonic pike
#

LOL so ironic ahahahhahahaha

silk condor
#

노래봇 추가하는법알려주세요

opal plank
#

imagine being a bot dev, a lib dev, a proficient dev, a hired dev and a API abuser

earnest phoenix
#

ah

sonic pike
#

oof

earnest phoenix
#

ima leave now

#

lol

sonic pike
#

yeesh

#

dang

earnest phoenix
#

not leave the server

#

leave this channel

sonic pike
#

ik

sudden geyser
#

Software engineer™️

sonic pike
#

nice

earnest phoenix
#

youtuber™️

opal plank
#

you only classify as utuber after 10k subs

earnest phoenix
#

now that hurts me and my 110 subs

sonic pike
#

12 year old that learned python in 7 months™️

earnest phoenix
#

wut

opal plank
#

wait you 12 rn void?

earnest phoenix
#

are you 12

sonic pike
#

ye

earnest phoenix
#

alert

#

set off the sirens guys

opal plank
#

@earnest phoenix

sonic pike
#

nooooooooooooooooooooooooooooooooo

opal plank
#

to the void u go

sonic pike
#

I AM THE VOID

earnest phoenix
#

probably shouldn'tve said that

#

i feel kinda bad ngl

delicate shore
#
var s = require("spotify-url-info")
s.getTracks(`https://open.spotify.com/playlist/3Q4cPwMHY95ZHXtmcU2xvH`).then(songs => {
for (i = 0; i < songs.length; i++) {                                                                                
     let finalboi = songs[1].name + " " + " By" + " " + songs[i].artists[0].name
     console.log(finalboi)
     }
})
#

I feel like I am doing wrong

#

something

#

It just logs it one time

mellow kelp
#

finalboi

#

yes

delicate shore
#

Saying - ""ELLE By SOPHIE""

opal plank
#

@delicate shore stop using var

delicate shore
#

Ok

#

if I do artist[i].name it logs undefined

#

cannot read property name of undefined

opal plank
#

cuz its not there

delicate shore
#

But the way is right?

opal plank
#

erm no?

sonic pike
earnest phoenix
#

no idea what you guys are talking about but i will pretend i do

opal plank
#

i have no idea what you trying to do

#

your scope is blocking that variable

delicate shore
#

Ok i will come back after exam

#

bye

opal plank
#

k

sonic pike
#

bye

hollow sedge
#

Void just say you meant that you were 12 feet tall 🧠

sonic pike
#

ye

earnest phoenix
#

this man could jump higher than a house then.

#

i mean

#

we all can

#

but

sonic pike
#

no u cant

earnest phoenix
#

yeah

hollow sedge
#

Yeah what

earnest phoenix
#

houses cant jump

hollow sedge
#

I can't jump higher than a house

#

Ok lol

sonic pike
#

yes you can right?

#

i saw you before

#

:/

crimson vapor
#

Houses can’t jump

#

You can

#

Therefore you can jump higher than a house

earnest phoenix
crimson vapor
#

Fun fact: when I go to GitHub e explore I almost always see some repo for a discord selfbot

hexed zinc
#

I am trying to embed a youtube video on my bots page but with this new layout its a huge boxand I cant re-size it to be the size of the actual video

lost hollow
#

how was it to show how much ram / memory the bot has?

pale vessel
#

Depends on what programming language you use

earnest phoenix
#

yo does learning html css js and node make me fool stak weeb dev

slender thistle
#

It does involve doing backend and frontend so technically yeah

delicate shore
#

Hey Erwin

#

I am here

earnest phoenix
#

yay im a weeb dev no i dont watch aneme i watch pookimon

pale vessel
#

br

earnest phoenix
sonic pike
#

i am weeb dev

#

not u

oak cliff
#

Please keep this channel on topic sure2

sonic pike
#

awwwww ok

earnest phoenix
#

@oak cliff lol isn't chatting about anything pogeyramming related allowed here

oak cliff
#

Weeb development is not pogeyramming

#

Web dev is tho ;)

sonic pike
#

IT IS

#

if i learn css html and python am i a web dev

earnest phoenix
#

python?

#

isn't that backend

#

we're talking about front end

kindred surge
#

I need someone who can help me design my bot

#

Please DM me

gilded olive
#

you know how to desgin

#

you

#

do it

craggy pine
#

@kindred surge This isn't the server to ask someone make a bot for you. Goto fiverr.

earnest phoenix
#

I'm writing ytdl-core@latest to make a music bot. Is there a way to bypass YouTube API quota excess?

deft birch
#

Guys...

#

I

#

FEEL

#

INVINCIBLE

earnest phoenix
#

nobody cares

earnest phoenix
earnest phoenix
deft birch
#

What?

earnest phoenix
#

what

#

simple-youtube-api I use this

#

you just said you were using ytdl core

#

i

deft birch
#

So we can't use our youtube channel names?

earnest phoenix
#

Ah... it's my little mistake

deft birch
#

Wait but I've been using my YouTube channel name

earnest phoenix
deft birch
#

Ok

earnest phoenix
#

i wasn't referring to you

deft birch
#

Oh ok sorry

earnest phoenix
#

Is there any way to bypass it?

#

they're limits for a reason

#

you can't bypass them

#

use the packages i sent

#

however with this approach there's a risk of getting ip banned

#

which means you need to ip shuffle, i.e. proxy your requests if you're going large scale

#

or just give up on implementing music in the first place because a million other bots already do it well enough

#

Um... I want to implement a music bot. Is IP shuffle difficult...?

#

difficulty is subjective

#

Packages ytsr?

#

what

earnest phoenix
old cliff
#

they have an application for that

earnest phoenix
#

Can I buy a quota?

#

Do you have money every month?

#

@old cliff

pale vessel
#

By the way ytsr is broken for now

old cliff
#

they give free quota extension but charge after 1million point usage daily

kindred surge
#

Please anyone suggest some features for my bot

earnest phoenix
#

How many dollars is 1 million?

pale vessel
#

what

earnest phoenix
#

100 points is how many dollars

old cliff
#

see their quota page

old cliff
#

no u

pale vessel
#

don't use their official API if you're planning on doing a lot of requests

earnest phoenix
#

Can you give me a link?

pale vessel
#

their quotas are low

old cliff
#

Music bots are good

earnest phoenix
#

and there's no point in making anymore lol

kindred surge
old cliff
#

I bet they have the youtube external link in many songs

earnest phoenix
#

nobody will want to use your bot when there's already perfectly good solutions like ayana, rythm & groovy which can handle youtube streaming very well, because, well, they can afford to

#

smaller music bots are always going to be shit if you don't have the budget for it

old cliff
#

aw

pale vessel
#

you can't get a youtube link from spotify api

#

what are you talking about

earnest phoenix
#

😊

#

that entire message felt like live laugh love

hollow sedge
#

Tbf if you're just doing it for fun and learning, then why not

#

Not that there is much to learn by making one

pale vessel
#

I had them but removed them after a while

#

No point in making them anymore

earnest phoenix
#

I would like to ask for an opinion on how to select multiple youtube apis through other acquaintances and replace one api key whenever the quota is full and recycle it again.

What do you think?

pale vessel
#

don't think that's a great idea

earnest phoenix
#

as if scraping is tos compliant lol

pale vessel
#

well this is their official api we're talking

#

if you scrape what can they do

earnest phoenix
#

Is it a "Tos" violation?

#

Humm...

pale vessel
#

clearly you haven't read the tos

earnest phoenix
#

you tell us

#

it's your code

summer torrent
#

we can't run your code in our mind. Show errors

tight forum
#

thats the problem

#

there is no error

earnest phoenix
#

are you sure the error isn't getting swallowed

#

you don't await or call .catch()

#

also confirm that the event is firing and is getting past the if check

#

debug it 🤷‍♂️

tight forum
#

brb

earnest phoenix
#

Can Anyone Help?

#

when i write a command in the bot it says this in the terminal

#

💬General Commands " is not a function at Client.<anonymous> (C:\Users\Hello\Documents\G5X.XYZ\index.js:31:2) at Client.emit (events.js:315:20) at MessageCreateAction.handle (C:\Users\Hello\Documents\G5X.XYZ\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14) at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Hello\Documents\G5X.XYZ\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32) at WebSocketManager.handlePacket (C:\Users\Hello\Documents\G5X.XYZ\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31) at WebSocketShard.onPacket (C:\Users\Hello\Documents\G5X.XYZ\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22) at WebSocketShard.onMessage (C:\Users\Hello\Documents\G5X.XYZ\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10) at WebSocket.onMessage (C:\Users\Hello\Documents\G5X.XYZ\node_modules\ws\lib\event-target.js:132:16) at WebSocket.emit (events.js:315:20) at Receiver.receiverOnMessage (C:\Users\Hello\Documents\G5X.XYZ\node_modules\ws\lib\websocket.js:825:20

#

andd no code pandasad

pale vessel
#

Escape your backticks

#

use \​ `

#

damn it discord

earnest phoenix
#

\

#

ffs

#

\\

pale vessel
#

lol

#

\ `

#

without the space

acoustic slate
#

Hey 🙋🏻‍♂️

summer acorn
tight plinth
#

ads above

summer acorn
#

I am just trying to help : (

tight plinth
#

ik

acoustic slate
#

I have a question

#

If y’all don’t mind

tight plinth
#

@acoustic slate ask it

acoustic slate
#

How do you guys make your name green?

#

Sorry I’m new 😅

summer acorn
#

a lot of people doesn't know to do api calls so I wanted to help out doing that stuff easier for them

#

we are bot devs

tight plinth
#

by having an approved bit in the site

summer acorn
#

a bit yes

acoustic slate
#

Ohhh

#

Thanks

summer acorn
#

you need to own an approved bit

acoustic slate
#

How do I do that?

tight plinth
#

smh autocorrzct

summer acorn
#

kekw

tight plinth
#

ghfhvc

summer acorn
acoustic slate
#

Sorry, I’m new

tight plinth
acoustic slate
#

Y’all are smart people

#

Thanks

past needle
#

is it possible to create a channel directly in a category and not have to create it THEN use channel.setParent ?

earnest phoenix
#

in which library

past needle
#

discord.js v12

eternal osprey
deft birch
#

How do you do that

eternal osprey
#
exports.run = async (client, message, args) => {

    if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - Sadly, you're not in a voice channel !`);

    if (!args[0]) return message.channel.send(`${client.emotes.error} - Please indicate the title of a song (or a link)!`);

    client.player.play(message, args.join(" "));

};
```as you see when using !play .... it will send this list and you would have to click a song. However, i want the song to automatically be chosen and played.
#

how would i do that?

#
module.exports = (client, message, query, tracks) => {

    message.channel.send({
        embed: {
            color: 'RANDOM',
            author: { name: `Here are your search results for ${query}` },
            footer: { text: 'This bot has been hosted for your community needs!' },
            timestamp: new Date(),
            description: `${tracks.map((t, i) => `**${i + 1}** - ${t.title}`).join('\n')}`,
        },
    });

};```
earnest phoenix
eternal osprey
#

how if i may ask?

earnest phoenix
#

index it

#

second sample is indexing

eternal osprey
#

[tracks.length - 0]

#

so it would be like this

earnest phoenix
#

that index would be out of array's bounds

slender thistle
#

1 - 0 = 1

earnest phoenix
#

remember that arrays are zero-indexed

#

except lua

#

lua is retarded

slender thistle
#

Pascal strings

#

Indexing starts with 1, dynamic array indexing starts with 0

earnest phoenix
#

witchery

slender thistle
#

lmfao

eternal osprey
#

let first = fruits[0], so i would have to use tracks.length[0]

earnest phoenix
#

correct

#

no

#

not correct

eternal osprey
#

what

quartz kindle
#

Lmao

earnest phoenix
#

take a good look at what they have vs what you have

eternal osprey
#

an array starts with 0?

earnest phoenix
#

yes

#

however you're not indexing an array

#

node_modules/discord.js/src/client/Client.js:42
} catch {
hellp

earnest phoenix
slender thistle
#

Well, it caught

eternal osprey
#
let first = fruits[0]
// Apple

let last = fruits[fruits.length - 1]```these are both examples of indexing right?
earnest phoenix
#

correct

#

the former will get the first item in the array, the latter will get the last item

eternal osprey
#

so i would have to use tracks[0]

earnest phoenix
#

correct

fluid saddle
eternal osprey
summer torrent
eternal osprey
earnest phoenix
quartz kindle
#

Shaking my head my head?

summer torrent
#

lol

earnest phoenix
#

yes

#

i am two people

eternal osprey
earnest phoenix
#

i'm a gemini after all

quartz kindle
#

Nice

#

Thats why youre so smart

earnest phoenix
summer torrent
#

run node -v on console

earnest phoenix
#

ight

summer torrent
#

yes

#

this is your node.js version

thick ledge
#

Hi

earnest phoenix
#

oh ok

thick ledge
#

Can someone send me a github link for a working bot

summer torrent
#

what

thick ledge
#

Or something like that

quartz kindle
#

There are hundreds of open source bots on github

earnest phoenix
quartz kindle
#

Just search for discord bot using the search tool

summer torrent
earnest phoenix
summer torrent
#

and

eternal osprey
#

@earnest phoenix so now know i have to use tracks[0] to get the first song in line, but i don't know where to put it tbh.

earnest phoenix
#

what do you mean

eternal osprey
#
exports.run = async (client, message, args) => {

    if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - Sadly, you're not in a voice channel !`);

    if (!args[0]) return message.channel.send(`${client.emotes.error} - Please indicate the title of a song (or a link)!`);

    client.player.play(message, args.join(" "));

}; ``` this is the play command
#

but i ofcourse cannot add client.player.play(tracks[0]) to it

#

@earnest phoenix

carmine summit
#

So if noQ is not defined, it will not push it into the array. If i'm wrong, please correct me.

args.push(`amount=${noQ}` || "");
analog tinsel
#

my bot page look this how i can fix 😄

prime glacier
#

Cannot load default config file
Error: Error parsing info: Unable to retrieve video metadata

eternal osprey
#

i need that too

analog tinsel
#

wait

eternal osprey
#

thanks

analog tinsel
#

np

eternal osprey
#

do you by chance know how to change the color block text?

analog tinsel
#

i need too

#

its look ugly

eternal osprey
#

@analog tinsel

analog tinsel
#

xd

#

discord light mode

earnest phoenix
#
  • { display: none; }
#

fixed

eternal osprey
earnest phoenix
#

yeah?

distant bramble
#

Hmmm

eternal osprey
earnest phoenix
#

well play it how you would play it normally

#

🤔

#

just pass the track url

#

i have no idea how your infrastructure is set up

twin swift
#

anyone help me?

eternal osprey
#

yeah it's like really strange

#

i use !play ...

#

it ggives me a long list

#

and then i have to input a number

#

and it plays the song on that position

earnest phoenix
#

i- are you using a package that does everything for you

eternal osprey
#

no

twin swift
#

anyone help me

eternal osprey
earnest phoenix
#

sure

#

hastebin it

analog tinsel
#

how change bot page to dark mode?

#

i change background but

eternal osprey
analog tinsel
#

other elements white

eternal osprey
#

at the bottom of your page

analog tinsel
#

oo okey

#

i think you need css to set it but

#

it now work

distant bramble
earnest phoenix
#

you tell us

#

it's your code

summer torrent
#

use hastebin. No one wants to download your file

twin swift
summer torrent
#

what is error

eternal osprey
earnest phoenix
earnest phoenix
#

you're using a package that handles most of audio for you 🤷‍♂️

#

find docs on that package

distant bramble
#

But wait what are u trying to do?

eternal osprey
#

it is awaiting the response

earnest phoenix
#

how are we supposed to understand then lol

#

you have no control over the actual important part of the code

carmine summit
#

So I have a variable, it is either an array or a string. How can I make it that if its an array, it doesnt do anything. but if it is string, it will convert into an array

#

I know the solution to this, I just need a cleaner one.

crimson vapor
#

what language?

prime glacier
crimson vapor
#

if js I would use js if (strArr instanceof Array) str = strArr.join('join char')

carmine summit
#

if would be best if there is no if statement

cinder patio
#

The clearest solution would be that one

crimson vapor
#

how can you do it without an if statement?

carmine summit
#

okay

crimson vapor
#

well

#
str = strArr instanceof Array ? strArr.join('join char') : strArr```
#

no if statement but still does the same thing in the same time

carmine summit
#

well, you done the opposite of what I wanted to do

crimson vapor
#

I don't understand

#

oh

#

I see

carmine summit
#

if array, return
if string, convert to array

crimson vapor
#

how do you want to convert it?

#

.split('')?

carmine summit
#

simple as [str]

crimson vapor
#

hmm

#

ok

#
strArr = str instanceof Array ? str : [str]```
carmine summit
#

oh cool

#

thanks

#

how about ...

#

how does it work?

crimson vapor
#

honestly I was told to learn more about it by Erwin

earnest phoenix
crimson vapor
#

so I can't tell you

earnest phoenix
#

oops

crimson vapor
#

but I can link you to the page

earnest phoenix
#

meant that for general

crimson vapor
distant bramble
# prime glacier yeah

Update ur ytdl version. Latest is 4.2.0 , and next time ask in ytdl support server for ytdl related stuff

crimson vapor
#

basically takes an array and destructures it from what I can tell

carmine summit
#

but I think,

let first = ["a", "b"]
[...first, "c", "d"]
//["a", "b", "c", "d"]
#

but does it work on string

#

if first is a string, will it work?

#

it makes my life so much easier

crimson vapor
#

umm

#

what

#

why

carmine summit
#

because

#

yes

crimson vapor
#

can't you just use first not ...first?

carmine summit
#

because

#

that

#

and

#

this

crimson vapor
#

so you're adding it to an array

#

I see

tardy hornet
#

how to see how many hours i have left in my heroku?

carmine summit
#

4 months of coding

#

let's gooo

cinder patio
#

@carmine summit Now try with the string being "abc",..

crimson vapor
#

yikes

crimson vapor
carmine summit
#

alright nvm

#

back to .concat

#

lmao

crimson vapor
#

is that for strings or arrays?

sand walrus
#

i have a question. When my bot have a verified check?

carmine summit
crimson vapor
carmine summit
#

WHY DOES SPREAD WORK LIKE THAT?

#

WHYY

crimson vapor
#

do you know what concat means?

carmine summit
crimson vapor
#

lol

carmine summit
crimson vapor
#

wait concat works well doesn't it

carmine summit
#

yep

#

I didn't even realize concatenate is a word

crimson vapor
cinder patio
#

Can't you use push? What exactly are you doing again Cwickks

crimson vapor
#

why did you ask if there was a way to check if it was a string or an array if you were essentially doing this

carmine summit
#

what I want is a result of []

cinder patio
#

uh push returns the new length of the array

#

and you can push anything

crimson vapor
#

yes

#

but pushing an array in an array results in an array in an array

carmine summit
#

yes I know that I can push anything

crimson vapor
#

which he only wants 1 array

#

not a nested one

carmine summit
#

but it results in an array in an array

cinder patio
#

.push(...array)

carmine summit
#

I want it to merge, not to stack

crimson vapor
carmine summit
#

... sucks

crimson vapor
#

... is so great

carmine summit
crimson vapor
#

spread operator

#

does its job

cinder patio
#

Then concat is the right function to use

crimson vapor
#

I think so yes

carmine summit
#

ye

sand walrus
#

link for discord bot guides?

carmine summit
#

hmm

#

I making a trivia bot btw

#

Hopefully I can get my 6th streak

tranquil knoll
#

Is there any way to get the TopGG analytics charts on my bot's private website? (Something similar to the widget)

tranquil knoll
#

I m hosting it currently on my github

#

just made it today

carmine summit
#

Can I take a look?

tranquil knoll
#

yes sure

analog tinsel
#

how i can find html template

#

without js

carmine summit
#

You already done it

tranquil knoll
#

No i m talking about the Charts of things like Votes and invites

#

not the widgets

#

the growth charts

crimson vapor
carmine summit
#

api magic?

cinder patio
#

But you would have to draw the charts yourself

tranquil knoll
#

@crimson vapor can u please tell me how to get those charts on my own website?

tribal siren
#

why does member.user.presence.game is not working? :(

pale vessel
#

Use chart.js for example

tribal siren
#

what is wrong?

pale vessel
cinder patio
#

you need em to get presence data

pale vessel
#

if you mean your bot's charts, maybe you can embed a widget from dblstatistics

tribal siren
#

yes

#

i do

crimson vapor
#

and you can use it as a widget

earnest phoenix
#

hi

crimson vapor
#

@pale vessel turns out I accidentally uploaded 300mb worth of files to my git repo

pale vessel
#

you said that

crimson vapor
#

ye

#

so I deleted the repo

tranquil knoll
#

ok thanks very much.

crimson vapor
#

not loggers

pale vessel
#

t nologgers

crimson vapor
#

ye

#

Luke is nearing in at 100 commits today and the max ive ever done is 19

tribal siren
pale vessel
#

Any idea why?

crimson vapor
#

wait can emojis be placed in links?

earnest phoenix
pure lion
#

right so im writing a lib in ts and i want to make native slash support

crimson vapor
#

whats your gh name again?

pure lion
#
/* eslint-disable */
import * as utils from "../utils";
import fetch from "node-fetch";
import Client from "../websocket";
import {inspect} from "util"

export interface OptionsProps {
  name: string;
  description: string;
  type:
    | number
    | "SUB_COMMAND"
    | "SUB_COMMAND_GROUP"
    | "STRING"
    | "INTEGER"
    | "BOOLEAN"
    | "USER"
    | "CHANNEL"
    | "ROLE";
  required: boolean;
  choices: Array<{ name: string; value: string }>;
}

export interface SlashConfig {
  name: string;
  description: string;
  options: Array<OptionsProps>;
}

export default class SlashCommand {
  applicationID: string;
  config: SlashConfig;
  constructor(client: Client, clientID: string, config: SlashConfig) {
    const postUrl = utils.v8BaseURl + `/applications/${clientID}/commands`;
    console.log(`${postUrl}`)
    getSlash(client, postUrl, config);
  }
}

async function getSlash(client: Client, postUrl: string, config: SlashConfig)/*: Promise<SlashCommand>*/ {
  console.log(JSON.stringify(config));
  let res = await fetch(postUrl, {
    method: "POST",
    headers: {
      'Authorization': `Bot ${client.token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(config),
  });
  console.log(inspect(await res.json(), true, null, true));
  // return res.json();
}
#

this is the code i have so far

tribal siren
pure lion
#

but it throws that a string didnt match regex

tribal siren
#

stop asking

earnest phoenix
#

are you using it in your code

tribal siren
#

yes

#

presence status works

pale vessel
#

pretty sure it's enabled since they got the status working

tribal siren
#

game doesn't

pure lion
#

hm

pale vessel
#

check your code

earnest phoenix
#

did you disable displaying games in your settings

pale vessel
tribal siren
pale vessel
#

can you show your code for that section

pure lion
#

anyway so

tribal siren
#

ok excuse me im back

#

here

tardy hornet
#

how to see how many hours i have left in my heroku?

pure lion
#

ah

#

step 1: stop using heroku

tribal siren
#

it's not heroku

#

lol

pure lion
#

not you

#

toof™️

tribal siren
#

oh

carmine summit
#

lmao

earnest phoenix
tardy hornet
#

lol

tribal siren
pure lion
#

thats even worse

tribal siren
#

oh

carmine summit
#

Step 2: buy a vps

pure lion
#

PAY. FOR. YOUR. HOSTING.

earnest phoenix
#

I am not able to open pins.

earnest phoenix
tribal siren
#

so

#

how else to write it

pure lion
#

name

pure lion
#

most probably

carmine summit
#

Building a bot isn't about earning the badge, it about wasting your time and money.

pure lion
#

no badge anyway

earnest phoenix
#

haha

pure lion
#

@crimson vapor typescript pwease hep

earnest phoenix
#

users can have mutiple activities in their presence, so it's an array now

pure lion
#

so thats why my activity thingy wasnt working

carmine summit
#

Wha?

crimson vapor
#

idfk ts

earnest phoenix
#

This is my bot

crimson vapor
#

am learning

pure lion
#

it all makes sense now

#

aW

carmine summit
#

The version

#

How?

#

How can you

#

Get the version

earnest phoenix
#

it's exposed under presence

carmine summit
#

The guy is in?

#

Oh cool

earnest phoenix
#

presence gives you the platform the user is on

#

It's stable without any bugs

carmine summit
#

🙂

torn basin
#

In top.gg, some bots have a server count, how do i add it

crimson vapor
#

post to the api

torn basin
#

wdym

#

@crimson vapor

crimson vapor
eternal osprey
#

how do i make the text background colored?

#

that white needs to be gone

pale vessel
#

Use inspect element in your browser and find the selector

#

That looks nice though imo

mellow kelp
#

italics gang

clever vector
#

Anybody can make the help like mee6 bot? i want to learn

carmine summit
#

@clever vector basic usage of args

pale vessel
#

no one wants to help you create a piece of trash

clever vector
#

. . .

earnest phoenix
#

here's a general rule of the thumb:
if you want to make a bot like another one, don't

rocky hearth
#

What is the difference in both these??

import * as XX from 'yy' and import XX from 'yy'

clever vector
#

atleast its a command

carmine summit
#

Instead of XX

#

Iirc

#

I'm not Python

earnest phoenix
#

that's es6

pale vessel
earnest phoenix
#

lol

rocky hearth
#

Does that everything also include the default?

earnest phoenix
#

yes

#

it wouldn't be everything if it didn't

mellow kelp
#

yea

#

i don't like to use * that much

#

but does it really affect performance?

earnest phoenix
#

yes

#

look up tree shaking

pale vessel
#

what the fuck was that

mellow kelp
#

oh well guess ill keep not using it

earnest phoenix
#

croatian letter lmfao

rocky hearth
#

so how the default will be accessed?
Like this: XX.default or XX.thatProperty?

mellow kelp
#

if you import like *, you will have to access XX.default

#

thats why you can't name a variable default

rocky hearth
#

Hmmm, that's where I got confused. Thanks bro

mellow kelp
#

no problem

rocky hearth
#

Also how do I import something and export it at the same time?

mellow kelp
#

export { something } from './something'

#

thats useful for library index files

rocky hearth
#

and for the defaults?

mellow kelp
#

same

#

export { default } from './something'

#

you can also export it as not-default

#

export { default as somethingNotDefault } from './something'

rocky hearth
#

Ok!
If I import the file.js in two different files, say aa.js and bb.js.
Does that file.js is being imported twice (and using double system resources) or the same file is referenced to both files (a and b)

#

Do I need to explain more? 😅

earnest phoenix
#

Mee6 help cmd is almost easy, but ye i know you need help

pure lion
#

@mellow kelp yo

#

TS lad

mellow kelp
#

a

#

nani

pure lion
#

Can yeh

#

Ts

#

Me

#

Please

#

Wait I'll resend the code

#

Ke kw

mellow kelp
#

kk

vale garden
#

anyone needs help

#

?

#

lol

#

im bored af

earnest phoenix
#

My friend need help

#

But to late

#

He feel disappointed

mellow kelp
#

o

#

dang

earnest phoenix
#

Pog

#

Moment

pure lion
#
/* eslint-disable */
import * as utils from "../utils";
import fetch from "node-fetch";
import Client from "../websocket";
import {inspect} from "util"

export interface OptionsProps {
  name: string;
  description: string;
  type:
    | number
    | "SUB_COMMAND"
    | "SUB_COMMAND_GROUP"
    | "STRING"
    | "INTEGER"
    | "BOOLEAN"
    | "USER"
    | "CHANNEL"
    | "ROLE";
  required: boolean;
  choices: Array<{ name: string; value: string }>;
}

export interface SlashConfig {
  name: string;
  description: string;
  options: Array<OptionsProps>;
}

export default class SlashCommand {
  applicationID: string;
  config: SlashConfig;
  constructor(client: Client, clientID: string, config: SlashConfig) {
    const postUrl = utils.v8BaseURl + `/applications/${clientID}/commands`;
    console.log(`${postUrl}`)
    getSlash(client, postUrl, config);
  }
}

async function getSlash(client: Client, postUrl: string, config: SlashConfig)/*: Promise<SlashCommand>*/ {
  const body = JSON.stringify(config)
  let res = await fetch(postUrl, {
    method: "POST",
    headers: {
      'Authorization': `Bot ${client.token}`,
      'Content-Type': 'application/json'
    },
    body: body
  });
  console.log(inspect(await res.json(), true, null, true));
  // return res.json();
}```h
mellow kelp
#

h

#

so whats the error

pure lion
#

uhh

#

invalid form bodey

#

but im following the docs

#

and posting with the right headers

mellow kelp
#

um

#

im gonna check the docs

#

brb

pure lion
#

It should literally work

#

Wait

#

There's a space in name

#

Haha I'm so smart

#

Brb

mellow kelp
analog tinsel
earnest phoenix
#

damn i haven't seen anyone use n++ since 2010

mellow kelp
analog tinsel
mellow kelp
#

well i mean, you're adding content to the page

analog tinsel
mellow kelp
#

probably happens because of combined padding/margin

analog tinsel
#

and this without text

mellow kelp
#

you got a p, a div, and a section

#

those margins and paddings add up

analog tinsel
#

which code i should delete

#

im trash in it

mellow kelp
#

use inspect

#

hover over the elements

analog tinsel
#

okey

#

@mellow kelp

mellow kelp
#

well as you can see its mostly because of the section's margin

analog tinsel
#

i delete it from css?

drifting wedge
#

font = ImageFont.truetype('./cogs/PTSansCaption-Bold.ttf', 37)``````OSError: cannot open resource PILLOW trying to open font

#

(python)

earnest phoenix
#

are you sure it exists

drifting wedge
#

yes

#

i mean i tried even putting it in mail file

#

main*

#

like and it still didint

#

uhh i have an idea

#

gimme a min

tribal siren
waxen sigil
#

Are you hosting your bot on a server at home, or are you using a third-party VPS? If at home, what OS are you running? If on a VPS, who's your hosting provider? And, how do you secure access to that hosting?

tribal siren
#

oh

#

ok thanks

waxen sigil
#

np

tribal siren
#

for example, if i use SomethingHost (i don't), should I say that I host my bot on SomethingHost?

waxen sigil
#

yes

#

if your bot is hosted there

tribal siren
#

ok thank you!

waxen sigil
#

im pretty sure you also have to say what language you use but, if they need more information they will send an email

tribal siren
#

does this want to ask me if i have another host rather than SomethingHost?

mellow kelp
#

i guess its stuff like APIs and top.gg

waxen sigil
#

i think i just wrote about the database i use

mellow kelp
#

for example if you use the reddit api for memes

#

that would be a 3rd party service

drifting wedge
#

nope still didnt work

tribal siren
#

oh

#

ok thanks

drifting wedge
#

its giving error

#

when getting the file

tribal siren
#

if i want to mention making my own memes (change my mind, distort, ferbtv), how do i describe it properly?

slate oyster
tired panther
#

How do u get the lenght of a map?

crimson vapor
#

map.size iirc

#

yep

tired panther
#

okay just wanted to be sure

#

How to get the last output of a map?

earnest phoenix
#

@tired panther discord.js collections have that built in but you have to develop your own way to get that from a map

tired panther
#

I used this xD

earnest phoenix
#

i only use discord.js collections

tired panther
#

how to fetch console.log() ?

crimson vapor
tired panther
#

its another question

crimson vapor
tired panther
#

some error are throwing out with console.log("") And I want to fetch them

rocky hearth
earnest phoenix
#

@tired panther bruh console log can't throw errors u dumb

crimson vapor
#

do you mean throw new Error("")?

earnest phoenix
#

you have a huge misconception, meister

tired panther
#

console.log(error)

#

that can throw errors

crimson vapor
#

console.log() is only used for your own code

#

people use throw for the most part

tired panther
crimson vapor
#

you should use throw as it actually errors

mellow kelp
#

it just came to my mind

#

how is stdout different from stderr?

crimson vapor
#

umm

#

idk never used them KEKW

mellow kelp
#

Apparently stdout is for console.log

earnest phoenix
#

they're just different

#

lol

mellow kelp
#

and stderr is for console.error

earnest phoenix
#

the same way stdin is different from stdout

#

they're pipes

#

when the process is run and the first file requires file.js for the first time in the code, the file data is saved in require.cache so any other files don't have to re read the file using fs

(the cache is deleted when the node process exits)

mellow kelp
#

yea makes sense

earnest phoenix
#

a standard

#

hence why std

mellow kelp
#

oo

crimson vapor
#

thats what it means?

#

lmfao I ddn't even know what it meant

mellow kelp
#

lmao

earnest phoenix
#

yes, it's not a sexually transmitted disease

mellow kelp
crimson vapor
#

you sure about that?

earnest phoenix
#

stdin is ReadableStream right

mellow kelp
#

unreadablestream

earnest phoenix
#

varies from language to language

#

in node at least

rocky hearth
#

Thanks.
So now suppose, I import a package (AB), which have two sub-packages (a and b)
I'm importing the two sub-packages in two different files.
.
So if I do import the main package in both files, will it affect any performance/resource?

umbral zealot
#

Nope

earnest phoenix
#

@rocky hearth yes

mellow kelp
#

i think imports also have a cache like require?

umbral zealot
#

any require() is cached.

#

imports are the same

earnest phoenix
#

oh

umbral zealot
#

(we are talking about JS, right?)

mellow kelp
#

yea

earnest phoenix
#

no were talking about evieisqtscript

umbral zealot
#

Yeah so anything you require is cached, which means not only you can require the same thing 100x and not impact memory, it's also cached in the sense that values set within that module (local variables, etc) are "shared" between imports.

earnest phoenix
#

i thought that if he imported the main package twice it would take double space (since a + b is big and he's importing twice) than importing them individually

#

OMG CHAT DEAD NOBODY TALKED FOR FIVE SECONDS AAAA

umbral zealot
#

what do you guys mean by "the main package" though

rocky hearth
#

Then that means, if I know that I'm going to use the whole package (AB) throughout my project.
I need not to do import a from 'AB/a' or AB/b individually in different files.
Instead I could just import the whole main package

umbral zealot
#

Oh so you mean something like import get from 'lodash/get' ?

crimson vapor
#

you should just const global.requires = require('*')

umbral zealot
#

or import { useState } from 'react'; ?

earnest phoenix
#

@rocky hearth tho if you only need a subpackage in the file why download the big main package with other stuff

earnest phoenix
rocky hearth
#

Yeah I know, but I also know that I'm going to use every sub-package throughout my project

earnest phoenix
#

🤯

mellow kelp
#

bad thing is it doesn't work for most packages with typescript

#

cuz you need typings for the file you're importing

rocky hearth
crimson vapor
#

most packages should

#

hover over the line and screenshot it

mellow kelp
#

since isLowerCase doesn't exist in String

crimson vapor
#

right

mellow kelp
#

so you can add something like enviroment.d.ts

#
interface String {
  isLowerCase(): boolean;
  // etc
}
rocky hearth
#

but Thats what i hv did

crimson vapor
mellow kelp
#

use try/catch

crimson vapor
mellow kelp
#

or async/await so that the user can add .catch

crimson vapor
#

it is async

#

right?

rocky hearth
#

nope

mellow kelp
#

nevermind lmao

#

i think its okay like that

crimson vapor
#

and I don't think I can use try/catch because there is no way for me to say im returning an error

mellow kelp
#

yea

#

well the user should add their own catch

rocky hearth
#

I want the ts to know that these functions exist. But that error..... 😦

mellow kelp
#

try moving interface String out of global

rocky hearth
#

No LUCK!

crimson vapor
#

hmm

#

could you extend instead of interface?

mellow kelp
#

well, by extending string i mean creating that interface

#

so that part should work

crimson vapor
#

hmm

rocky hearth
#

interface String extends WHAT

crimson vapor
#

String

mellow kelp
#

nono

#

its alright like that

crimson vapor
#

no?

mellow kelp
#

it works for me that way

crimson vapor
#

hmm

earnest phoenix
#

imma try making botums in tahpscript

crimson vapor
#

don't

earnest phoenix
#

i can change the file extension of my current js files to ts and be fine right

crimson vapor
#

yes

mellow kelp
#

for the most part yes

crimson vapor
#

all good

mellow kelp
#

unless you got untyped function params and stuff

crimson vapor
#

just gotta enable any on it

#

and get yelled at by Erwin

#

but thats all yes

rocky hearth
#

I tried to remove the module keyword. and BOOOM!!
It works!
.
But not when I tried the same in the morning.
Thats so weird

earnest phoenix
#

and a tsconfig.json telling it to compile to es6 (what does repl support yet)

earnest phoenix
mellow kelp
#

k then

pure lion
#

can github pages route names have _s

earnest phoenix
#

@pure lion hi dice

#

finally found out that you're real dice

pure lion
#

@earnest phoenix hey fake code

#

real code was a whitename

#

imposter

crimson vapor
#

hmm

mellow kelp
#

hmm

pure lion
mellow kelp
#

.    。    •   ゚  。   .

.      .     。   。 .

.   。      ඞ 。 .    •     •

゚   @earnest phoenix was An Impostor.  。 .

'    0 Impostors remain     。

゚   .   . ,    .  .

earnest phoenix
#

puts on elytra and flies back to ship

rocky hearth
#

SystemError: Elytra won't work due to lack of drag.

earnest phoenix
#

haha noobs forgot that elytras work in the end

unreal canopy
#

kok

restive furnace
#

BoostingWarning: Boosting too much code913's speed.

feral aspen
#

Hello

#

How can I send hyper text code in those ```

#

For like .htaccess

#

Anyone?

blazing vapor
#

What are you coding in maybe i can help

feral aspen
#

.htaccess

#

thing, I want to know how I can do the color in the ```

blazing vapor
#

idk

feral aspen
#

Like when you do ```js, there is also for .htaccess, how?

blazing vapor
#

im coding in python so i cant really help

restive furnace
#

```.htaccess``\

#
yes```
#

ok htaccess does not exist

#

u cant format it

feral aspen
#

.. that's unfortunate.

blazing vapor
#

How do you add indents like

this
To messages bots send in python

mellow kelp
#

I guess \n?

blazing vapor
#

ok

delicate shore
#

Ok so I want to ask one thing

#

if one does /episode one

#

leave it

#

nvm

mellow kelp
#

k so

#

i have several questions

#

i wanna switch from heroku to repl.it

#

what were the advantages?

quartz kindle
#

Not many

#

Easier to use than heroku probably

mellow kelp
#

could it be worth it?

#

like, those $5

quartz kindle
#

Do you pay for heroku? Do you plan to pay for replit?

mellow kelp
#

no | probably yes

quartz kindle
#

Then pay for a vps

#

Even google's free vps is better than heroku/glitch

mellow kelp
#

pog

#

you mean google cloud?

sand walrus
#

how i post a image with custom command?

crimson vapor
quartz kindle
mellow kelp
#

oh cool

#

gotta try that

earnest phoenix
#

But they require a credit card dont they

quartz kindle
#

Yes

mellow kelp
#

yea probably

#

but i guess as long as i dont spend too much ram it wont matter?

earnest phoenix
#

well i dont even have a credit card