#development

1 messages Β· Page 1715 of 1

last tapir
#

lmao weebly is like, oof

obsidian plume
#

iidk how to coode

#

and my bot develop

#

lazy af

#

to do a site

#

so i did one

#

honestly looks good af

lyric mountain
last tapir
#

then learn

obsidian plume
#

for someone who cant code

lyric mountain
#

you're really calling a dev lazy?

umbral zealot
#

"in other languages" how do you change the language?

last tapir
#

learn basics of html

#

someone died then live lmao

obsidian plume
#

im lazy af to do site

#

u do it

quartz kindle
#

set a max width to the text

obsidian plume
#

where

#

i try use the spaces thing

#

but there is only horizontal

#

not vertical

last tapir
#

spaces wont help you due to mobile mode

quartz kindle
#

what options does weebly give you?

obsidian plume
#

NVM

quartz kindle
#

there has to be an option for setting the width of a block of text

obsidian plume
#

FOUND IT

#

i think

#

lemme try

#

IT WORKED

#

LETS GO

last tapir
#

tim

#

for spread operator, you cant put the first index into a variable right?

#

we should do rest parameter and use destructuring assignment instead, right?

obsidian plume
#

ty guys

umbral zealot
#

rest and spread are not linked in any way

#

except by the use of ... in their syntax

#

Spread will take an array or object and spread it, all of it.

#

rest takes the rest of the array elements not assigned during destructuring, and make an array out of them.

obsidian plume
#

ty

#

i fixed

#
#

only problem is google translate with other languages

umbral zealot
lyric mountain
#

you're using gtranslate to translate to japanese?

last tapir
#

oof

lyric mountain
#

if so, forget about it

#

unless you want someone who know japanese to read "let's harass a door and eat water"

quartz kindle
#

the original is japanese

#

hes using translate to other langs

lyric mountain
#

although why is the original written in jap?

vocal trellis
#

For some reason res corrupts in user.js

#

In premium.pug it works perfectly

prisma locust
#

test

ancient gulch
#

Hello, how can i make prototype in typescript please, my code:

import {Guild, Message} from "discord.js";

Message.prototype.createGuild = function () {
    return console.log('yes')
}
quartz kindle
#

use Structures.extend

#

and you probably need to extend the inteface in ts

still sky
quartz kindle
#

depends

#

discord.js's structures are made to be extensible, this is the "official" way to extend them

#
Discord.Structures.extend("Message", M => class extends M {
  createGuild() {
    console.log(this.content);
  }
})
ancient gulch
#

Tysm

#

I get that error

TS2339: Property 'createGuild' does not exist on type 'Message'.
quartz kindle
#

in ts you have to extend the interfaces as well

#
interface Message extends Discord.Message {
  createGuild()
}
``` something like that idk ts
still sky
#

in the middle interface declared in global .d.ts file
Assignment may be somewhere

last tapir
#

Hi

#
// Only change code below this line
const bicycle = {
  gear: 2,
  setGear(newGear) {
    this.gear = newGear;
  }
};
// Only change code above this line
bicycle.setGear(3);
console.log(bicycle.gear);

// This doesn't work.
const { setGear, gear } = bicycle;
setGear(14);
console.log(gear);
still sky
last tapir
#
TypeError: Cannot set property 'gear' of undefined
still sky
#

if you extract method you should use setGear.call(bicycle, 14) or don't do it(extracting)

last tapir
#

ah

#

alrightt

still sky
opaque acorn
#

Fck

rare trail
#

hi guys, i was trying to set an <iframe> into my bot top.gg page, but it show an empty embed, someone know why?

<iframe src = "https://amidiscord.xyz/"></iframe>
tight nimbus
#

no spaces, I think

rare trail
still sky
rare trail
still sky
#

100% mb replace with pixels, relative units might not work

rare trail
still sky
#

Open dev tools (f12) and check it there

#

mb it even missing in markup

still sky
tight nimbus
#

in another site works? localhost for ex

rare trail
tight nimbus
still sky
tight nimbus
#

nvm

delicate rune
#

@quiet pawn

#

So yeah, u’ll need a db for the roles to give, which reactions, etc

quiet pawn
#
module.exports = {
    name: 'reactionrole',
    description: "Sets up a reaction role message!",
    async execute(message, args, Discord, client) {
        const channel = 'YOUR_CHANNEL';
        const yellowTeamRole = message.guild.roles.cache.find(role => role.name === "YOUR_ROLE");
        const blueTeamRole = message.guild.roles.cache.find(role => role.name === "YOUR_ROLE");
 
        const yellowTeamEmoji = 'YOUR_EMOJI';
        const blueTeamEmoji = 'YOUR_EMOJI';
 
        let embed = new Discord.MessageEmbed()
            .setColor('#e42643')
            .setTitle('Choose a team to play on!')
            .setDescription('Choosing a team will allow you to interact with your teammates!\n\n'
                + `${yellowTeamEmoji} for yellow team\n`
                + `${blueTeamEmoji} for blue team`);
 
        let messageEmbed = await message.channel.send(embed);
        messageEmbed.react(yellowTeamEmoji);
        messageEmbed.react(blueTeamEmoji);
 
        client.on('messageReactionAdd', async (reaction, user) => {
            if (reaction.message.partial) await reaction.message.fetch();
            if (reaction.partial) await reaction.fetch();
            if (user.bot) return;
            if (!reaction.message.guild) return;
 
            if (reaction.message.channel.id == channel) {
                if (reaction.emoji.name === yellowTeamEmoji) {
                    await reaction.message.guild.members.cache.get(user.id).roles.add(yellowTeamRole);
                }
                if (reaction.emoji.name === blueTeamEmoji) {
                    await reaction.message.guild.members.cache.get(user.id).roles.add(blueTeamRole);
                }
            } else {
                return;
            }
 
        });
#
        client.on('messageReactionRemove', async (reaction, user) => {
 
            if (reaction.message.partial) await reaction.message.fetch();
            if (reaction.partial) await reaction.fetch();
            if (user.bot) return;
            if (!reaction.message.guild) return;
 
 
            if (reaction.message.channel.id == channel) {
                if (reaction.emoji.name === yellowTeamEmoji) {
                    await reaction.message.guild.members.cache.get(user.id).roles.remove(yellowTeamRole);
                }
                if (reaction.emoji.name === blueTeamEmoji) {
                    await reaction.message.guild.members.cache.get(user.id).roles.remove(blueTeamRole);
                }
            } else {
                return;
            }
        });
    }
 
}   
#

no db

#

thats for single server

#

you probably use something like quick.db for more then one

still sky
quiet pawn
#

no

still sky
#

Wrong, i mean on each message reactionrole

quiet pawn
#

?

#

wdym

still sky
#

async execute(message, args, Discord, client) execute each time when anybody type reactionrole?

#

@quiet pawn

still sky
# quiet pawn yea

It just seems a little wrong for me to add event listener to client on each command
Mb better register 1 event listener, define Set<Channel> and add channel here, then check exisiting
Mb i'm wrong

quiet pawn
#

?

#

i use that code

#

lol

#

make sure your async execute(message, args, Discord, client) is in right order

earnest phoenix
#

hello

#

help

#

how to fix this problem

#

He Say Converter is not defind

still sky
earnest phoenix
#

@still sky

still sky
#

Do you import or define Converter? I see you only use it

earnest phoenix
#

He say Is Not Defined

snow urchin
sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

well you could fetch the messages first, filter them, then bulkdelete them

snow urchin
#

what would I filter it by?

quartz kindle
#

bot id and message content

snow urchin
#

Does the interaction response have the same ID as the bot? or...

quartz kindle
#

should be a regular message object yes

#

the author should be the id of the application that responds to it

#

if the application you're using is your bot application, then yes

still sky
#

.map(x => x) waitWhat

snow urchin
lyric mountain
#

Why?

still sky
#

Looks like when u use .shift() to const messages assigns first item in that array

#

cuz .shift() returns first item, not array

mental raven
#

I am thinking of making an Economy Bot type thing! Can I have some name and profile picture suggestions?

mortal kettle
#

pepeyikes Why are youtube tutorials being recommended in Get Started

mental raven
mortal kettle
dusky sundial
#

YouTube tutorials aren't horrible, they're just outdated and kinda slow for the most part

#

But some people prefer to learn by seeing

mortal kettle
#

Youtube tutorials teach you one specific thing

#

And that limits you, to that one specific thing

mental raven
#

But that can help too

dusky sundial
#

I got started in programming from YT, so I'd say they're okay. But yes, there are definitely better ways of learning

mortal kettle
#

It doesn't give you any knowledge of the library, or explain it well at all.

mental raven
#

Go watch brakeys and come back to see if it teaches you anything

mortal kettle
#

If you're looking at a tutorial for a Discord bot chances are you don't know the actual language enough, and have to read the basics of asyncio and what not.

mental raven
mortal kettle
#

Did you not try to read the documentation?

mental raven
#

not at all

#

The Documentation is too large and my brain too small

mortal kettle
#

Which probably means you don't understand a lot if you find the documentation hard to read.. no offence.

dusky sundial
#

You should definitely get used to reading docs, just copying from a YouTube tutorial won't get you far

mortal kettle
#

If you're actually planning to develop a bot and not just some.. on_message ping commands, you're much better off learning through the docs. If you don't understand the docs, learn the language.

mental raven
mortal kettle
#

What people tend to do is whizz through the tutorials and by the end of it not understand a single thing. This is because later tutorials have complex stuff which you would learn by learning the basics first.

mental raven
#

I understand some stuff

mortal kettle
#

A bot that copies you is very simplistic.

still sky
#

imho yt good for reviewing and point of entry
then inevitably you have to read docs

mental raven
#

Well I started like 2 days ago

mortal kettle
#

Have you had any prior experience with JS?

dusky sundial
#

The point is, YouTube tutorials won't teach you everything you need to know

mortal kettle
#

Yea ^

mental raven
mortal kettle
#

javascript

mental raven
mortal kettle
#

That's even better. I don't code in JS either, I code in Python.

#

I was just using JS as a reference, since that's the language that the videos were using.

mental raven
sage bobcat
mortal kettle
#

@mental raven I can provide you some good resources for learning, as well as a "what you should know" list if you're interested.

solemn latch
#

pins has a ton of resources too

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

mental raven
#

All I know is I cannot read the discord.py docs they are too much for my brain

sage bobcat
#

One message removed from a suspended account.

solemn latch
#

learning to read docs is a process.

sage bobcat
#

One message removed from a suspended account.

mortal kettle
#
- Primitive data types
- Operators
- Data structures
- Importing
- Variables, namespace and scope
- String formatting
- OOP
- Control flow
- Exception handling
- Function definitions
- Classes, objects, attributes and methods
- Console usage, interpreters and environments
- Decorators

Useful to know:
- Asyncio basics
- What is blocking?
- Logging
- knowing how to read docs properly
#

^ what you should know

#

and

#

https://docs.python.org/3/tutorial/ (official tutorial)
http://python.swaroopch.com/ (useful book)
https://automatetheboringstuff.com/ (for complete beginners to programming)
http://greenteapress.com/wp/think-python-2e/ (another decent book)
See also:
http://www.codeabbey.com/ (exercises for beginners)
https://realpython.com/ (good articles on specific topics)
https://learnxinyminutes.com/docs/python3/ (cheatsheet)

#

Good resources for learning Python.

#

(Sorry for the spam)

mental raven
#

Thats a lot of dmg

solemn latch
#

programming isnt supposed to be easy

mental raven
#

ik

#

I just switched from unity to python and my brain hurts

solemn latch
#

im years in and i still learn stuff daily

mortal kettle
#

It's actually really difficult lol. It took a very long time to get my head around class inheritance, polymorphism and overwriting methods.

mortal kettle
#

(I think Unity uses C#)

#

Either that or C++

solemn latch
#

its c# im 99% sure

mental raven
mortal kettle
#

Python is a lot more beginner friendly in terms of syntax

mental raven
#

But a little modified

torpid otter
#

I would like to say thank youguys for help me today

mortal kettle
#

C++ is just.. pain

vivid fulcrum
#

unity c# isn't really c#

near stratus
#

for Discord

mental raven
#

ik

#

I just want to learn new stuff

mortal kettle
#

I would suggest learning the basics first, especially everything in the list above before starting with bots.

near stratus
#

then let your brain keep hurting

solemn latch
#

isnt c# docs pretty much the same formatting as py docs?

mortal kettle
#

d.py pretty much expects you to have mastered basics

mental raven
near stratus
#

I suggest switching to JS since you know C# they have the same syntax
On the other hand python is from a hell different planet

mental raven
#

Unity C# is easy to learn beacuse there is a youtuber that explains everything you need to know its like the docs but instead of reading them you listen to them

solemn latch
#

maybe even TS might be easier.

mental raven
solemn latch
#

youtubes a really bad source tbh.

#

typescript

near stratus
mental raven
near stratus
solemn latch
#

its js, but with types.

mental raven
vivid fulcrum
#

well, proper learning

mental raven
vivid fulcrum
#

i've seen some unity tuts pop up in my recommended

dusky sundial
#

Brackeys unity tutorials are okay, but again, doesn't teach you everything you need to know

solemn latch
#

heck, ive used some for some quick dirty stuff.

mental raven
mortal kettle
#

Yeah I've heard typing on JS is dogshit

mental raven
#

Bruh I came here to get suggestions for the name of my bot and instead i am getting my head hurt by all the messages

mortal kettle
solemn latch
#

ah, suggestions for names isnt really a dev topic.

sage bobcat
#

One message removed from a suspended account.

near stratus
sage bobcat
#

One message removed from a suspended account.

mental raven
mortal kettle
#

How do y'all get this bot dev role πŸ‘€

sage bobcat
solemn latch
mortal kettle
#

Makes sense sunglas my bot is only in.. one server

crimson vapor
#

just use jsdoc and intellisense

#

then everything is typed

mental raven
#

Ok ill be going to bed bye

mortal kettle
#

Intellisense is pretty lazy

zenith terrace
opal plank
#

intellisense is pog

#

no need to go check docs and alt tab/goggle every 2 minutes

solemn latch
mortal kettle
#

You are expected to know all the basics of Python, including the ysk stuff although that's pretty lenient. Just know that if you don't show that you know enough they'll tell you to go away sunglas

opal plank
crimson vapor
#

bro

#

pogging

mortal kettle
wide trench
#

hello im looking for a bot coder, i can't code so i need help just dm me if you can code my bot

gilded plankBOT
#

@wide trench

You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.

wide trench
#

i dont got money

#

lol

mortal kettle
#

Well

#

lol

solemn latch
#

then your probably not going to find a developer

mortal kettle
#

Nobody is going to code you a bot for free

near stratus
wide trench
#

ima just keep looking

opal plank
#

out of topic, but how the heck were you expecting to hire someone without paying them?

wide trench
#

shi

solemn latch
wide trench
#

people needa stop being greedy for money

#

mk

mortal kettle
#

And you need to be more appreciative of people's time

solemn latch
#

you know its a job right? πŸ‘€

wide trench
#

;-;

solemn latch
#

"please fix my roof for free"

mortal kettle
#

It doesn't take 5 minutes to develop a bot

solemn latch
#

πŸ‘€

mortal kettle
#

Anyways, what were you looking for? What kind of bot?

earnest phoenix
#

i want to check if args[0] is egal has an command, but it’s not work (i have no error): if(args[0] === options.client.commands.get(args[0]))

mortal kettle
#

I'm curious

opal plank
earnest phoenix
#

ye

opal plank
#

oh

#

no its not that

#

get() will likely return an object

near stratus
#

oh

opal plank
#

if its what i assume, as a command handler

earnest phoenix
#

yes

opal plank
#

string !== object

#

you need to check with has()

#

if(options....has(args[0])) {do stuff}

#

remember to check if args[0] is a thing before

#

get() retrieves the object

#

has() checks if it exists

zenith terrace
earnest phoenix
#

if(args[0] === options.client.commands.get(x => x.help.name === args[0]))

#

still don’t work

opal plank
#

cuz thats not how it works

#

read what i said

#

if you want THAT< you must use filter() or find()

#

though its fairly uncommon to have the command name be different than the help.name

#

usually you map ur commands with name/object

solemn latch
wide trench
#

guys

#

nvm

near stratus
opal plank
opal plank
#

you map them by their name, usually

mortal kettle
opal plank
#

commands.set('command', command)

mortal kettle
#

Can't say that it's going to be good code though

opal plank
#

commands.has('command') //true

#

commands.has('something') //false

#

commands.get('command') // command object

mortal kettle
#

Oh boy

#

Okay don't use fiverr

#

lol

#

JSON files to store data sunglas

opal plank
#

json is fine as long as you arent constantly modifying it

crimson vapor
#

ehhh

#

its not really that good

mortal kettle
#

It's pretty dog

opal plank
#

i'll bite you million

mortal kettle
#

There's a tag on discord.py as to why let me find it

solemn latch
#

i mean, it says "something that required data storage" so it seems like its anything.

crimson vapor
mortal kettle
#

JSON is JavaScript Object Notation, a serialization format for data.
Advantages of JSON are:

  • It is a common data exchange format and has been around for a long time, so many languages will support JSON either in their standard library or with minimal dependencies.
  • It provides a common format that can be used to shift data between languages, programs or machines.
  • It has a lightweight syntax so minimal space is wasted.
  • The syntax can be pretty printed to be made more human-readable.

Disadvantages of JSON are:

  • Some languages do not have direct parallels to JSON objects, making them difficult to manage in said languages.
  • There may be considerable processing overhead serializing and deserializing to/from JSON.
opal plank
#

json is fine, as far as database goes, yeah, nah

vivid fulcrum
#
  • The syntax can be pretty printed to be made more human-readable.
    this should be a con lol
mortal kettle
#

It is a con

vivid fulcrum
#

your data should not be easily accessible and easily readable

mortal kettle
#

They don't use + or -

#

Refer to titles

opal plank
#

but its under advantages

mortal kettle
#

Oh

vivid fulcrum
#

lol

mortal kettle
#

I forgot what pro/con mean

opal plank
mortal kettle
mortal kettle
opal plank
#

Reminder to self: never again run a java program without a max ram option

mortal kettle
#

But yeah. 80% of the time it's people who don't have SQL knowledge

vivid fulcrum
#

Reminder to self: never again run a java program

mortal kettle
#

Or don't know enough about their programming language to implement database functionality

opal plank
#

Noted

vivid fulcrum
#

the bot developing community is extremely oversaturated

mortal kettle
vivid fulcrum
#

but it's oversaturated with underqualified developers

#

highly skilled devs are a rarity

opal plank
#

Cuz most of them are in actual companies

#

Not making bots

vivid fulcrum
#

faang

opal plank
#

Imagine getting paid 7$ to per day making a single bot

#

Oh, my bad

#

7.50$

zenith terrace
#

Β£7.50 *

mortal kettle
#

Chances are it's copied code

#

Or at least reused

zenith terrace
#

$ would be more

mortal kettle
#

Still really cheap

vivid fulcrum
#

hey i do fiverr :(

summer torrent
vivid fulcrum
#

it's a good enough side hustle

mortal kettle
#

Python is getting some really cool pattern recognition stuff πŸ‘€

earnest phoenix
#

Enmap [Map] {
  'help' => {
    help: {
      name: 'help',
      category: 'General',
      usage: 'help | help <command_name>',
      botPerms: '`Envoyer des messages` et `Envoyer des images',
      userPerms: '`Aucune permission(s) requise(s)',
      utilite: 'Affiche la liste des commandes disponibles'
    },
    run: [AsyncFunction]
  }
}```

how can i get the `category:` ? please, i can’t do it
crimson vapor
#

enmap

#

for A COMMAND

#

im sorry what

opal plank
vivid fulcrum
#

most of my clients come with similar ideas

#

so more times than not i have a boilerplate ready

#

i.e. a pokemeow selfbot

opal plank
#

Yeah thats what i mean

#

If u have something quick n dirty

#

Its fine

mortal kettle
#

Easy money at that point

earnest phoenix
opal plank
#

But its not really worth it otherwise

earnest phoenix
#

i juste use .filter

crimson vapor
#

are you using enmap?

#

rather than regular maps?

earnest phoenix
#

yes for load all commands

#

in my main.js

crimson vapor
#

you should not use enmap

earnest phoenix
#

uh

crimson vapor
#

for commands I mean

earnest phoenix
#

why?

vivid fulcrum
crimson vapor
#

double the memory usage

vivid fulcrum
#

i.e. a scenario where you're under 18

crimson vapor
earnest phoenix
#

which package i should use

crimson vapor
#

you can use either regular maps

#

or Collections

earnest phoenix
#

ok

crimson vapor
opal plank
# vivid fulcrum eh, i could argue with that

well, yeah, if you under 18, you could do it, but its still contractual work otherwise, usually if you want a stopgap (as in, you cant find a job) it should do, though i've worked as Uber Eats before on a bike and the paycheck is much bigger. BUT, if you working due to legal issues (as in, you cant work as a dev, or in general, without being 18) then it might backfire both at you and your clients

near stratus
#

Ain't you allowed to work part time when you're 15+ ?
||At least where I'm from||

mortal kettle
#

its 13+ here in the UK

near stratus
#

oh never been to UK

opal plank
#

but some might see becoming a developer as a backdoor to work

vivid fulcrum
#

i've found working at fiverr/other freelancing platforms heaven

#

i've been wanting to make my own money since i was 15 and discovered fiverr at 17 and honestly i enjoy it

#

i don't have to do physical work and i work from home

#

which is perfect when you're a high schooler

mortal kettle
#

a physical job gives you good experience

charred pumice
#

Hey y’all I quit JavaScript for like 7 months and I forgot how to make an http request, I don’t want to receive anything back just simply make the requests

#

Any help

near stratus
charred pumice
#

node

vivid fulcrum
#

ew

crimson vapor
#

don't use axios

vivid fulcrum
#

node-fetch

crimson vapor
#

its boat

opal plank
#

use fetch if you dont want deps

#

use axios if you want to be cool gang

crimson vapor
#

no erwin

opal plank
#

the rest are haters

crimson vapor
#

REST*

vivid fulcrum
#

node-fetch is all you need since it's the lowest level you can go for wrapping web requests

opal plank
#

ba0dum-ts

vivid fulcrum
#

everything else is bloat

tacit sequoia
near stratus
charred pumice
#

How would I do it though?

crimson vapor
vivid fulcrum
#

google node-fetch

charred pumice
#

I have both axios and node-fetch

vivid fulcrum
#

you'll see tons of docs

near stratus
still sky
#

XMLHttpRequest should help

crimson vapor
#

ewwww

near stratus
tacit sequoia
vivid fulcrum
#

node doesn't provide xhr api

crimson vapor
#

@opal plank do you have a cs degree or did you just learn shit over time?

vivid fulcrum
#

xhr is web js only (natively)

tacit sequoia
#

Thats for pure web js

crimson vapor
#

I assume over time

still sky
#

dam, it should be good joke

crimson vapor
#

latter means second, right?

umbral zealot
opal plank
#

matter means last

crimson vapor
#

ok

opal plank
#

lattewr*

#

former(first)

crimson vapor
umbral zealot
#

But I guess I'm too late lol.

opal plank
#

latter(later, final)

umbral zealot
#

Yea some tutorials use enmap instead of collections.

crimson vapor
#

why?????

umbral zealot
#

Because I used to.

#

And people copy old shit.

earnest phoenix
#

so in my case (evend if is enmap), how can i get category?


Enmap [Map] {
  'help' => {
    help: {
      name: 'help',
      category: 'General',
      usage: 'help | help <command_name>',
      botPerms: '`Envoyer des messages` et `Envoyer des images',
      userPerms: '`Aucune permission(s) requise(s)',
      utilite: 'Affiche la liste des commandes disponibles'
    },
    run: [AsyncFunction]
  }
}```
crimson vapor
#

map.get('help').help.category

mortal kettle
crimson vapor
#

ehh

#

tutorials are fine for a basis

#

as long as you understand

mortal kettle
#

Which 80% dont

crimson vapor
#

more like 90

mortal kettle
#

Yeah more like 90, they're using a tutorial for a reason

opal plank
#

:dissapointed*

crimson vapor
#

@opal plank today I got a new chair, you should too

near stratus
crimson vapor
opal plank
crimson vapor
#

if anything I should use assertions

crimson vapor
mortal kettle
#

Outdated tutorials exist, people use them and then helpers in help channels need to deal with it

opal plank
#

me neither, fuck chairs. Bed dev is the shit

charred pumice
#

So all node-fetch is is fetch(`url`)

opal plank
#

bad* dev

crimson vapor
#

yes

crimson vapor
opal plank
near stratus
opal plank
#

you asked for something to just make a request, so make sure you use method; POST

umbral zealot
opal plank
umbral zealot
#

Though they're right, you should not store commands in enmap

near stratus
crimson vapor
#

Erwin at least get a real pc

#

come on

#

start saving bonk

opal plank
crimson vapor
#

LOLLLLLLLLL

opal plank
#

i have 3 pcs near me

#

all online rn

crimson vapor
#

do any of them have a good gpu

near stratus
opal plank
#

1 is the server (monitor--less), and ontop of it theres my main monitor(for the laptop), the actual laptop is underneath it, on the other pc

charred pumice
#

Like that?

crimson vapor
#

whats the use of a server if your power is shit?

opal plank
crimson vapor
#

wont it just die

opal plank
#

not ;

eternal cradle
#

Pls support my bots music ???

opal plank
#

,

charred pumice
#

Alright

opal plank
#

use commas not seimicolons

still sky
near stratus
crimson vapor
#

that the wrong '

charred pumice
opal plank
crimson vapor
#

you used ’

charred pumice
#

I meant a , not a ;

opal plank
#

though i do have a branch locally for testing before i push to production

#

ads

near stratus
#

wtf

opal plank
#

@solemn latch free ban for u

earnest phoenix
#

hello

#
module.exports = {
  name: 'test',
  description: "this is a test command!",
  execute(msg, args){
   msg.channel.send('826859079162920961')
  }
}
solemn latch
#

@eternal cradle please dont post ads angeryBOYE

earnest phoenix
#

can anyone help here. im trying to make it link a channel in discord

eternal cradle
#

@solemn latch soory men

charred pumice
#

fetch(`url`, { method: 'POST'}).catch(error => {} is good right

near stratus
#
module.exports = {
  name: 'test',
  description: "this is a test command!",
  execute(msg, args){
   msg.channel.send('[#826859079162920961](/guild/264445053596991498/channel/826859079162920961/)')
  }
}β€Š
earnest phoenix
#

omg

opal plank
#

@eternal cradle Not gonna be verified with those perms mmulu

earnest phoenix
#

im so stupid

earnest phoenix
#

its been a long night

#

ty so much

crimson vapor
near stratus
crimson vapor
#

well not defaults

opal plank
#

you should commit /rm

eternal cradle
#

@opal plank support add server

crimson vapor
#

hmm

umbral zealot
#

Uhhhh that should give you the Category

charred pumice
#

And I can pass arguments in the url using like ${} right

umbral zealot
#

Unless the output you sent isn't exactly right.

opal plank
near stratus
charred pumice
#

God it’s been a while since I did js

opal plank
#

gUYs i NEeD HeLP WiTh JaVE

crimson vapor
#

ewwwww coffee

vivid fulcrum
#

that's why java's logo is a hot cup of coffee

near stratus
vivid fulcrum
#

your cpu will run at those temps KEKW

crimson vapor
#

@opal plank how do you feel knowing that my code is better than most of your bot's commands code?

opal plank
crimson vapor
#

you always threaten

#

never bite

#

im starting to wonder if its just an empty threat

earnest phoenix
# umbral zealot Uhhhh that should give you the Category

i have log and it’s returned :

  help: {
    name: 'help',
    category: 'General',
    usage: 'help | help <command_name>',
    botPerms: '`Envoyer des messages` et `Envoyer des images',
    userPerms: '`Aucune permission(s) requise(s)',
    utilite: 'Affiche la liste des commandes disponibles'
  },
  run: [AsyncFunction]
}```
umbral zealot
#

... with my EXACT code?

earnest phoenix
#

no

umbral zealot
#

So you did something different

#

And expected the same result?

#

Why not do exactly like I said? With the path as a second argument?

earnest phoenix
#

no

opal plank
#

why is botPerms and userPerms a string?

umbral zealot
#

No idea, lol

opal plank
#

lmao

zenith terrace
opal plank
zenith terrace
#

smh

#

no

opal plank
zenith terrace
#

bad erwin

earnest phoenix
#

When i log : const command = options.client.commands.filter((x) => x.help.name === args[0]); const a = args[0]; console.log(command.get(a, a.category))

he returned

  help: {
    name: 'help',
    category: 'General',
    usage: 'help | help <command_name>',
    botPerms: '`Envoyer des messages` et `Envoyer des images',
    userPerms: '`Aucune permission(s) requise(s)',
    utilite: 'Affiche la liste des commandes disponibles'
  },
  run: [AsyncFunction]
}```

but i want only category
earnest phoenix
opal plank
#

cuz usually you dont use strings for permissions

umbral zealot
#

Yeah ok

opal plank
#

either a bigInt or an array of strings

#

but its unrelated to ur problem

umbral zealot
#

So you did the wrong thing and got the wrong result

#

Now do the RIGHT thing

zenith terrace
#

left

umbral zealot
#

The path must be a string

#

It must point to the location in the object

#

In this case 'help.category'

earnest phoenix
#

yeah

#

im back

#
module.exports = {
  name: 'welcome',
  description: "this is a welcome command!",
  execute(msg, args){
   msg.channel.send("Welcome to the server! Thanks for joining! Please take our [#822136993878245416](/guild/264445053596991498/channel/822136993878245416/) We use this feedback to better the server for you. You must take the leap of faith in [#822292684193398854](/guild/264445053596991498/channel/822292684193398854/) to gain access to the rest of the server. If you need anything ping Freshy in [#834063761626366013](/guild/264445053596991498/channel/834063761626366013/) ")
  }
}
#

how can i space the text out into not so long a paragraaph

#

id like to add maybe some lines inbetween each few sentenaces nad have them display in a list format

vivid fulcrum
#

\n

#

you have to wrap your num in a BigInt

#

there should be a bitshift example somewhere in there

quartz kindle
#

bitwise on bigints is slow af tho

#

sadly

vivid fulcrum
#

i wonder if it's because bigint has a bunch of assertions for fool-proofing

tacit sequoia
#

Discord glitched tf out?

cosmic forum
#

I'm making an api, and i'd like to apply a rate limit system. Anyone know how I can limit the number of requests per minute to 10 using nodejs?

opal plank
tacit sequoia
#

Cool

opal plank
summer torrent
#

is your bot(s) offline too? it seems my bot randomly disconnected and became offline

crimson vapor
#

discord moment

#

mine broke as well

smoky herald
summer torrent
crimson vapor
#

LMAO

summer torrent
#

wtf

#

let me check mine

#

nah

smoky herald
crimson vapor
#

perhaps my library sends that for unavailables as well

summer torrent
#

discord-rose?

crimson vapor
#

ye

#

@slim heart confirm

slim heart
#

yes

#

GUILD_UNAVAILABLE

#

but also on GUILD_DELETE just do if (guild.unavailable) return

crimson vapor
#

I can implement that

#

what about guild create?

smoky herald
#

anyways, anybody knows what counts towards those requests?

Global Rate Limit
All bots can make up to 50 requests per second to our API.
is it like every single message/edit/reaction?

summer torrent
#

smh bad library

slim heart
#

ur gonna want to return if the guild was unavailable before

crimson vapor
summer torrent
#

nice log style bro

crimson vapor
#

ty it might be stolen from someone somewhere

opal plank
slim heart
#

lmao

crimson vapor
#

perhaps

slim heart
crimson vapor
#

ok shower time

slim heart
summer torrent
crimson vapor
#

need to fix it lmao

summer torrent
#

can i steal it

crimson vapor
#

ig ill do it after math homework

opal plank
#

a lot of my shards are still up

#

but some of them are dc'ing

crimson vapor
slim heart
#

i started getting ws ratelimited so i had to shut down my bots

crimson vapor
slim heart
#

and i got cloudflare banned anyways

#

what a moment

crimson vapor
#

LOL

#

thank you for being a good platform discord

summer torrent
opal plank
#

still up

slim heart
opal plank
slim heart
#

the gif wont play

#

weary

summer torrent
crimson vapor
#

lmao

tacit sequoia
slim heart
#

YouTube bot seems unaffected somehow

tacit sequoia
#

Now I'm not gonna make it delete entry from database on guild leave πŸ˜†πŸ˜†

#

Some are unaffected

summer torrent
opal plank
tacit sequoia
#

Cluster 4 is going crazy, apparently

slim heart
#

ngl

#

i smell bad lib

quartz kindle
#

lmao

slim heart
#

thats super easy to avoid

crimson vapor
#

detritus is actually really cool berry

tacit sequoia
#

I use Discord.js okeh

opal plank
#

seems like i stole a believer

tacit sequoia
#

For now

opal plank
crimson vapor
#

no I still prefer discord-rose

slim heart
#

okay but they cant do websockets correctly πŸ˜”

crimson vapor
#

discord-no-cache >>>>>> discord-rose > detritus > discord.js-light > eris > discord.js

slim heart
#

oml

#

im deleting discord-no-cache

crimson vapor
#

no

tacit sequoia
#

Discord-no-cache?

crimson vapor
#

don't

slim heart
#

its gone

tacit sequoia
#

Isnt that the same as discord.js-light

crimson vapor
#

REEEEEEE

#

nope its totally different

slim heart
#

im dmcaing your repo too

crimson vapor
#

its barebones as shit

crimson vapor
slim heart
#

i have the license to discord-no-cache

#

and im taking down ur repo

#

because i want it to stop existing

#

kek

quartz kindle
#

lmao

slim heart
#

singlehandely the worst code i've written that i still use

crimson vapor
#

but its pog

lament oxide
#

s

quartz kindle
#

i mean

#

if you want discord no cache, just make one yourself with only websocket and nothing else

lament oxide
#

i gay

crimson vapor
#

well thats what it is

slim heart
quartz kindle
#

then make your own

crimson vapor
#

I forked his to make my own

#

implemented caching

quartz kindle
#

i made my own too at some point

slim heart
#

there is also

crimson vapor
#

renamed it

slim heart
#

no ratelimiting

#

at all

crimson vapor
#

there was I thought

slim heart
#

nope

opal plank
#

--yolo

crimson vapor
#

it used your rest manager

slim heart
slim heart
#

i think

#

nope

crimson vapor
#

well I used your discord-rest

#

and that has ratelimits, right?

slim heart
quartz kindle
#

wait how many discord libs do you have

#

lmao

crimson vapor
#

too many

slim heart
#

i only maintain discord-rose lmao

quartz kindle
#

lmao

crimson vapor
#

discord-rose pretty pog

slim heart
#

discord-tag was kinda cool idk

#
const Client = require("discord-tag");
let client = new Client()
    // Add a prefix
    .addPrefix("!")
    // Set a log function
    .setLog(console.log)
    // Add a command
    .addCommand("commandname", "command response")
    // Add a command using a function
    .addCommand("commandname2", (message, send) => {
        send("Yada");
    })
    // Add a command that deletes the invoking message
    .addCommand("commandname3", "command response", true)
    // Log in and start the bot
    .login(YOUR_BOT_TOKEN);```
crimson vapor
#

ok I must go now

#

goobai

slim heart
#

gobi

crimson vapor
#

bai

quartz kindle
#

one of them was a "route" mode, similar do webservers

#

client.on("/mycommand", (...) => { ... })

slim heart
#

kinda how like interactions are now lmao?

summer torrent
#

discord tag Thonk

slim heart
#

were there like paramaters and stuff

#

like client.on("/mycommand/poop") = !mycommand poop

slim heart
quartz kindle
slim heart
#

ah

#

that'd be kinda cool

#

dont know

quartz kindle
#

lmao

#

then i also had this

slim heart
#

noice

quartz kindle
#

i had a bunch of weird shit

#

like pm2 cluster mode

slim heart
#

i didnt even know djsl had a built in command handler tbh lmao

quartz kindle
#

it doesnt

#

not anymore

slim heart
#

ah

quartz kindle
#

i removed all of that crap

slim heart
#

im working on a super easy to use kubernete integration on rose idk why but i thought it'd be cool

quartz kindle
#

im working on caching efficiency

#

not discord related (yet)

slim heart
#

gotta squeeze the ram out

#

kek

quartz kindle
#

yes

slim heart
#

when djs v13 comes out do you think djsl will just be done

quartz kindle
#

v13 will be out soon

#

djsl will support v13

#

idk about djs-next tho

slim heart
#

sorry i mean next

#

i thought next was gonna be v13

quartz kindle
#

it was supposed to but too many new things coming before next is ready

slim heart
#

right

quartz kindle
#

possibly theres gonna be a v14 if next is not ready by then

#

idk how far along they've gone with it

#

i want to make my own lib eventually but i cant until i finish this crap im doing

slim heart
#

it doesnt even seem they've started yet

quartz kindle
#

i heard they're working on different repos or something idk

slim heart
#

i see prs

sage plank
#

Was wandering if someone new js and would fill me in on a way to fetch a github repo and read a specified file as a command

#

such as I make a repo with a file called update > make patchnotes > user send !patchnotes > gets file text > reads the patchnotes

#

Is that possible?

#

I understand someone will say use a link, but i would like it to be able to send the repo text contents as a discord embed/message

quartz kindle
#

possible yes

#

use an http library like node-fetch and request the raw url for that file

#

if you know which repo and file it is, you can hard code it so that you dont need to type the url in the command

solemn leaf
#

Hi tim

#

Tim is your version of djs good good

quartz kindle
#

idk you tell me lol

crimson vapor
#

I heard they were working on djs rewrite in another repo

#

or at least I think thats what I heard

earnest phoenix
crimson vapor
sage plank
#

I rlly want to make this cmd

#

With the actual ms

earnest phoenix
#

which command?

sage plank
#

The ping-pong thing

#

with the response time

earnest phoenix
#

my code for my bot is open source tho

sage plank
#

i use js

earnest phoenix
#

oh

#

discord.js ping command

sage plank
#

oh

#

its rlly simple

#

Im just dumb

#

Like 3 lines of code

#

LMFAO

crimson vapor
#

mine's not djs but the real ping part is only 3 lines

ancient gulch
sudden geyser
#

What do you mean? Do you want to create the invitation embed? Do you want to create an invite to a guild?

ancient gulch
#

when i click on it i can play youtube video on a voice chat

solemn latch
#

just putting an invite url in chat will make it

ancient gulch
#

directly on discord

#

and the channel icon is like a IconGame

solemn latch
#

so you want a bot that can play games?

#

what part are you asking for?

ancient gulch
craggy pine
#

That's likely a discord server invite link for the channel itself since you can do that. Like when they click "join" the first channel they see is that one.

#

and it was probably just the bots channel for the games they have from it.

ancient gulch
#

look

#

what is that

craggy pine
ancient gulch
#

new feature of discord?

sage plank
#

Was released in the latest update

craggy pine
#

Ah there you go.

ancient gulch
sage plank
#

Make your server a community server

#

...

#

Shhh

earnest phoenix
#

haha

craggy pine
ancient gulch
#

that's not stage channel feature

#

i can play youtube video on discord??

opal plank
#

they need a minimum amount of people to be available iirc

#

only servers with 800 members can use it or something along those lines

#

though i think thats cuz of the requirement for community server

ancient gulch
#

but i get 100k and i don't found

opal plank
#

hmmmm

ancient gulch
#

@opal plank can i dm you?

opal plank
#

what for?

ancient gulch
#

to see what the link do

opal plank
#

eh sure

#

hmmm i see

#

since it asks for stuff inside discord i assume thats SDK

earnest phoenix
#

How I can edit a webhook message? πŸ˜”

opal plank
ancient gulch
#

okay ty

onyx hare
#

what IOS is needed to view slash commands from bots, this one person i talk to says he cant see any slash commands on the iphone 6 on IOS 14.4

cedar crow
#

hey can someone tell me what i did wrong

earnest phoenix
#

Try to log it and see what it returns

cedar crow
#

oh nvm fixed it like a boss

earnest phoenix
#

Alright

sage plank
cedar crow
sage plank
#

Yu have dms off

#

Thats why i asked

sage plank
cedar crow
sage plank
#

I did

cedar crow
#

message me now

solemn latch
#

ia_sad_cry_shy would have been 10x easier to discuss it here

glacial trench
#

someone rate my website and report bugs to me
https://legend-js.ml

earnest phoenix
#

I want image attachment link to through link

#

Like : https://cdn.discordapp.com/attachments/201745454147305473/445755758051721217/The_Camping_Episode_024.jpg

#

When i send this type link to run cmd

#

Message.attachment.first() is only for uploading attachments

ancient gulch
#

how can i know how many members does my vc have
i tried message.guild.members.cache.filter(g => g.voiceChannelID === channel.id).size but it doesn't work

earnest phoenix
#

Like i send specific channel this https://cdn.discordapp.com/attachments/201745454147305473/445755758051721217/The_Camping_Episode_024.jpg to run my cmd

ancient gulch
#

Message.attachment.first().url

#

?

#

@earnest phoenix that's what you search?

earnest phoenix
#

Url is undefined

cedar crow
#

the when

#

halp

stark abyss
#

By any chance does anyone know anything about base 64

#

I don't know how I should decode it first time working with it

crimson vapor
#

either 12 or 14 iirc

cedar crow
#

can't believe i took 1hr and 20 mins just to get this right

crimson vapor
#

you can use (X || {}) as a ?. iirc

#

yea

sudden geyser
#

It's Node 14 and above.

earnest phoenix
#

id is not defined

#

pls help

last tapir
#

show us the code

ember lodge
#

I am changing to discord.js v12 and i don't remember this new function

#

Someone knows how is it?

cinder patio
#

fetch returns a promise

#

you need to await it

ember lodge
#

thanks :)

earnest phoenix
#

Cannot Read Property Of 'id'

copper cradle
#

channel is not defined

#

also that's repl.it's console isn't it

potent cobalt
glacial trench
earnest phoenix
#

discord js not supporting stage vc?

long crow
#

In Master, in stable nope

vocal trellis
#

Anyone experience with chargebee?

ornate geode
#

?

vocal trellis
#

Anyone experience with chargebee?

eternal osprey
orchid lodge
#

Can someone tell me why this isn't working

waxen bough
#

whats the error

orchid lodge
#

Doesn't show an error just doesn't work

earnest phoenix
#

hey i added a new bot to top.gg. now what?

waxen bough
#

wait?

orchid lodge
#

How do i check if it's being registered?

hazy sparrow
#

@orchid lodge console.log a message whenever that message is sent

earnest phoenix
#

thanks. how do i know once it is reviewed?

earnest phoenix
waxen bough
#

should b message.channel.send(LoveEmbed)

earnest phoenix
#

ty

cedar crow
cinder patio
#

It's not defined wrong, they have a typo

hazy sparrow
#

@orchid lodge it's LoveEmbed not loveEmbed

orchid lodge
#

i fixed that

torn mesa
#

Some bots redirect to their site and do nice, eye-pleasing things with their animated click patterns, I don't know how to do this. How can I help you?

earnest phoenix
#

Cannot Read Property Of 'id'

#

pls help

#

Update discord.js

earnest phoenix
waxen bough
#

npm -i discord.js

#

but i don't think that's the case

#

it's in your code

vivid fulcrum
#

it isn't

#

look at the stacktrace

waxen bough
#

ohh it's in discord.js

vivid fulcrum
#

they're running djs v11 which has been deprecated for a long time

#

and finally broke with stage channels

earnest phoenix
#
        const imageUrl = message.content.split(' ').slice(1);
        const embed = new Discord.MessageEmbed()
        .setImage(imageUrl)
        .setColor(0xFF8AFF)
        .setDescription("test")
        .setThumbnail(message.author.avatarURL)
        .setFooter('test', client.user.avatarURL);
        message.channel.send(embed);
    }```
```DiscordAPIError: Invalid Form Body```
cinder patio
#

color is a hex string afaik

vivid fulcrum
#

can be anything that represents a color

#

the actual api takes in an int

waxen bough
#

avatarURL() is a function isn't it

earnest phoenix
#

read this line ```const imageUrl = message.content.split(' ').slice(1);

cinder patio
#

what about it

earnest phoenix
#

imageUrl

#

!test link

#

For example - If someone types !image http://imgur.com/xxxxxx.jpg

then the bot should reply back with the image without link. Any help? Thank you.

#

embed reply

waxen bough
modest maple
#

In js, is there anyway to essentially create a timeout but be able to cancel it?

#

Without becoming a race condition nightmare

waxen bough
#

you talking about setTimeout?

lavish bramble
waxen bough
#

setTimeout returns a number which can be used to cancel its respective timeout clearTimeout

#

const timeoutid = setTimeout()
clearTimeout(timeoutid)

modest maple
#

Oh hot

#

Ty

earnest phoenix
#
embed.image.url: Could not interpret "['https://media.discordapp.net/attachments/815951481823297569/834345130353360916/Capture.PNG?width=400&height=188']" as string.
lavish bramble
#

What is the latest version of djs

earnest phoenix
#

12.5.2