#development

1 messages · Page 1763 of 1

earnest phoenix
#

If that's the case then there's a 99% chance that its a networking issue on your machine; I haven't seen anybody report these kinds of latency issues in the past few months

#

I think the only way you can debug this is to launch your bot's process on a different host machine with a different network than your current VPS or a dedi, and see if it still persists; I couldn't think of a better way to debug this since there's a really low chance its caused by the bot itself

twilit rapids
#

I don't own a machine myself powerful enough to run Chip, and I really don't want to buy a server just to debug this kek

earnest phoenix
#

KEKW Rip

#

well

quartz kindle
#

the issue persists even with a barebones bot?

#

like really barebones, not just disabling your intervals

twilit rapids
#

I suppose I can test that

#

Doesn't seem like it, I've got my Helper bot also running on the same machine and that seems unaffected

#

I suppose I could be Event Loop Lag

feral aspen
#

Is this a thing...

#
if (mbChance >= 1 && mbChance <= (premium === true ? 5 : 3)) received = true;
vivid fulcrum
#

is what a thing

feral aspen
#

If mbchance is great than 1 and less than (for premium 5 but normal 3) then received === true.

digital ibex
#

yo so i have: https://hastebin.com/onupohozaf.js and im wondering how i can like, make it so you can remove the million slice functions and just make it do it itself, any ideas?

#

if anyones used it and can guide me in the right direction, im using eris-pagination if that helps

cinder patio
#

for loop?

digital ibex
#

yeah im clever ik, ty

earnest phoenix
drifting wedge
#

how can i make if so if i hover on an element

#

if affects another?

#
  opacity: 1;
}```
#

this no worky

twilit rapids
#

@quartz kindle @earnest phoenix Update™️
Appearently, outgoing presence updates will block and backpressure that entire shard until the presence update finishes updating in all of that shard's guilds
I was sending those every 10 seconds (Don't ask why, I don't know why)

digital ibex
drifting wedge
#

yeah ig but this is easy

#

it should work

digital ibex
#

but im not the best guy to take client side advice from

drifting wedge
#

idk why its not worky

digital ibex
#

yeah idk man thats my only tip

#

gl

drifting wedge
#

ty

#

same to you

earnest phoenix
twilit rapids
#

No idea either

#

Probably me from way back

quartz kindle
#

if this is really whats going on, then discord is synchronously updating the guilds in their backend

#

which sounds very stupid

earnest phoenix
#

Blocking I/O moment

earnest phoenix
solemn leaf
#

Can I get some help vsc won't do anything for cshap

quartz kindle
#

lel

earnest phoenix
solemn leaf
#

both

#

not even starter templates for namespaces

earnest phoenix
#

You gotta install an extension for it

solemn leaf
#

I did

earnest phoenix
#

Did you enable it?

solemn leaf
#

wdym

slender thistle
placid iron
#

yeah lol

earnest phoenix
# solemn leaf wdym

You're supposed to enable the extensions from the settings or the extension panel; if it still doesn't work, try reloading VSC

digital ibex
# cinder patio for loop?

alr yeah, so im having trouble of what to put inside it. bc it works but how do i separate like, every 6 mod logs

#

if that makes sense

solemn leaf
#

Its enabled and I have reloaded vsc many times

earnest phoenix
solemn leaf
#

its prob in the dev logs if they did

earnest phoenix
earnest phoenix
#

What VSC version are you on?

solemn leaf
#

I just checked for updates

#

non

#

so newest public

digital ibex
#

anyone know how to resolve my issue btw?

solemn leaf
#

for loop that goes until var is 6

digital ibex
#

but then thats only going to show 6 logs

cinder patio
#

give us more context

solemn leaf
#

then refine your question

earnest phoenix
solemn leaf
#

recommend was the c# plugin by microsoft

earnest phoenix
#

is there a way to make the BOT reply that he's not in a Voice Channel if he gets asked to leave it?

earnest phoenix
solemn leaf
digital swan
digital ibex
#

like, lets say a user has 12 mod logs, i want to use eris-pagination so it shows 6 logs on one page, and the other 6 on another. i can get it to only show 6, but then how do i make it show the other 6 after without like, hardcoding, 6, 12, 18, 24 etc

#

im so bad at explaining things idk if this helped at all

earnest phoenix
earnest phoenix
# solemn leaf

The screen, the whole extension screen; not the small label

digital swan
solemn leaf
digital ibex
#

any idea, aki?

earnest phoenix
digital swan
solemn leaf
#

😦

digital ibex
#

i'll try that

#

luk how it goes

solemn leaf
#

volt any idea on how to fixx

earnest phoenix
#

nope, no idea how its not working for you

earnest phoenix
solemn leaf
#

discord.js

earnest phoenix
solemn leaf
#

im just guessing as you ssaid the runtime

earnest phoenix
#

yeah sorry, i ment discord.js

#

I'm trying to do something like the first one

#

but with the bot instead of the user

earnest phoenix
#

e.g. !message.guild.me.voice.channel

solemn leaf
#

volt i needs helps

earnest phoenix
earnest phoenix
#

Brb

solemn leaf
#

@earnest phoenix where do I get that version

earnest phoenix
solemn leaf
#

ah

#

idk whats it doin now

#

installin things

#

still nothin

#

still isntalling packages it says?

#

but I click on it and it says not found so

earnest phoenix
#

Then no idea

runic mason
#

Rip

digital ibex
#

alr so im back being stuck

#

can anyone help fix my problem, im so confused

proven lantern
#

const description = moderations.map((e) => e.reason.slice(0, 5)).join('\n')

#
            {
                title: `Viewing ${member.username}'s moderation history`,
                description
            },
            {
                title: `Viewing ${member.usernames}'s moderation history`,
                description
            }
        ];```
rocky hearth
#

is it possible to update an array element at an index in mongodb?

cinder patio
#

it is

rocky hearth
#

do we have to retrieve the entire array first? like in firestore?

rocky hearth
#

so how do mongodb handles when there are multiple updates happen to the array at the same time?

earnest phoenix
#

hi can i have to client.user.setActivity in my bot or not

cinder patio
#

it doesn't update everything at once

earnest phoenix
#

okey

rocky hearth
earnest phoenix
#

so 1 is help and 2 is in how mutch server is the bot

rocky hearth
cinder patio
#

Well you have to handle that, not your db

earnest phoenix
rocky hearth
#

but u can update it recursively in an interval

earnest phoenix
#

and how i do that?

rocky hearth
#

u can use, setInterval

earnest phoenix
#

okey

rocky hearth
#

keeping a timeout of 1min would be okay

drifting wedge
#

whyyy

#

my bot jsut keeps going offline

fair axle
#

How can I get the events of web socket as docs on discord.js

lyric mountain
#

"as docs"?

#

wdym?

fair axle
#

What does it mean chunk?

lyric mountain
#

a section of a whole

#

why would you use that tho?

lyric mountain
#

that ain't coming too soon tho

#

like, to libs

fair axle
solemn leaf
#

anyone think they can help m,e with vsc not working when trying to porgram c#

#

no formatting or intellisence

#

or templates

lyric mountain
#

c# on vsc...

solemn leaf
#

yeah?

lyric mountain
#

what are you? a masochist?

solemn leaf
#

wdym

lyric mountain
#

like, vsc is just a fancy text editor, nothing more

solemn leaf
#

cough cough

lyric mountain
#

its coding assistance is minimal (but enough for smaller langs like js or python)

solemn leaf
#

bruh

#

Did I ask

#

you have totally pushed away from my question

lyric mountain
#

asnwer is: vsc is too weak for c#

solemn leaf
#

No it isnt

lyric mountain
#

if you say so...

cinder patio
#

not true - vsc extensions are super powerful

#

have you tried the c++ one?

#

it's better than VS'

lyric mountain
#

vs is shit

#

also, I did say VSC (as in vanilla)

solemn leaf
#

Im using the csharp extension by microsoft

lyric mountain
#

it's like saying minecraft has tameable pokemons

solemn leaf
#

it does

#

rename wolfs to pokemon

lyric mountain
#

dot dot dot

#

you get my point

solemn leaf
#

I would rather you help me then just push everybody away from my question by saying whatIm using is trash thank you

lyric mountain
#

I'm not

solemn leaf
#

You just did

lyric mountain
#

I'm saying that vscode is not supposed to be used as a fully fledged IDE which it isnt

solemn leaf
#

Did I ask

lyric mountain
#

yes

solemn leaf
#

so your iq is negative too?

lyric mountain
#

so is your education

solemn leaf
#

mhm I have been an a and b student my whole life

lyric mountain
#

I see, so you only have that kind of education

#

anyway

#

don't want the truth then go search on google a solution for your issue

solemn leaf
#

dude

#

Idc about the truth

#

vsc can do all languages

lyric mountain
#

so can notepad.exe

solemn leaf
#

Might as well learn machine code

lyric mountain
#

¯_(ツ)_/¯

solemn leaf
#

well thats what you get someone who streams league of legends, and has been actively on reddit for 2 years

#

Ill just go ask somewhere else

lyric mountain
#

any issue with that?

#

it doesn't matter whether I stream league or use reddit

fringe badge
#

Is promoting services of bot owner banned by ToS?

lyric mountain
#

that's kinda a grey area

#

depends on what frequency we're talking about and what content

fringe badge
lyric mountain
#

just use common sense, if it'll be shoving ads to users then it's illegal

#

or promoting nsfw content

fringe badge
#

I wanna add command that will tell about service

lyric mountain
#

is it on-request?

fringe badge
#

y

lyric mountain
#

if so, then it's fine

#

you just can't do stuff like mass-dm ads or constant ad messages

lofty cedar
#

Hi, does anyone know if there is a way to make a dashboard website with a python bot?

umbral zealot
#

well yeah, probably using something like django or whatever web framework you have in python

slender thistle
#

There is. Just have a webserver that serves proper HTML, CSS, and JS

solemn leaf
#

anyway to communicate javascript with lua

copper cradle
#

a small server

#

then you can do get/post requests to it and share data

lofty cedar
#

from flask import Flask, render_template

app=Flask(__name__)

@app.route('/')
def home():
    app.route('/')
    return render_template("index.html")

@app.route('/commands/')
def about():
    return render_template("commands.html")

if __name__=="__main__":
    app.run(debug=True)```
I’ve made this as a tutorial says and I did all the files but it says that it can’t connect to the server
Tutorial link: https://pythonhow.com/source-code-simple-website-with-python-html-and-css/
torpid otter
#

Is anyone good at css and try to make my bot Description better

lyric mountain
#

we can give tips, but "better" is subjective

sudden geyser
#

most css bot descriptions look bad anyway

rocky hearth
#

this is my nextjs tsconfig file.
I'm trying to enable, strict mode
but it is not working for some reason.

#

I tried relaunching vsc, no luck still

snow urchin
digital ibex
#

yo guys, any idea why this.embed may be undefined?

#

line 10 btw

sudden geyser
#

I think the issue is the arrow function

#

Since it plays around with "this" differently than a standard function

stiff lynx
#

.attachFiles(attachment)

#

this could work, right?

sudden geyser
#

Try it out and see

stiff lynx
#

idk bcs it hives me err

#

but not for this

#

idk y

sudden geyser
#

Then it probably doesn't work

stiff lynx
#

But it is in docs

sudden geyser
#

What is the error you're receiving

stiff lynx
# sudden geyser What is the error you're receiving

let EMBED = new Discord.MessageEmbed()
.setColor('RANDOM')
.setTitle('Un membro si è unito a noi!')
.setDescription(Benvenuto in ${member.guild.name} a ${member}!, ora siamo in **${member.guild.memberCount}** in questa Community!🎉)
.setFooter('Bot ideato e creato da Cristian Grossano 💡')
.setThumbnail('https://cdn.discordapp.com/attachments/825743947158519808/839561168972414976/nova_bot.jpg')
.attachFiles(attachment)

channel.send(EMBED);
#

this is my code

#

andd it says that cant read the property of MessageEmbed()

sudden geyser
#

What's the value of "Discord"

stiff lynx
#

const { MessageAttachment, Discord, guild } = require('discord.js');

sudden geyser
#

There's your issue

stiff lynx
#

y?

sudden geyser
#

Discord.JS doesn't export a Discord object/class/etc.

#

It's usually used to refer to the entire export

#

What you should do instead

#

Is replace it for MessageEmbed

#

So you get the MessageEmbed class

#

Replace Discord.MessageEmbed for MessageEmbed

stiff lynx
#

it doesnt work

sudden geyser
#

And should work if done correctly

stiff lynx
#

already did

sudden geyser
#

Then you're likely using it incorrectly

stiff lynx
#

I'll give a try

#

tysm

maiden dragon
#

Hello how can I add a toLowerCase to this function?

 const wordsreact = [
        "Hello",
        "Hi",
        "Hey",
        "Yo"
    ]

    if (wordsreact.includes(message.content)) {
        return message.react(":wave:");
    }```
sudden geyser
maiden dragon
sudden geyser
#

Can you show how you're using it

digital ibex
#

and it turns out eris-pagination is just broken

maiden dragon
digital ibex
#

anyone know any alternatives to eris-pagination?

sudden geyser
#

You're supposed to call .toLowerCase() on the .content

#

.includes(...) returns a boolean and wouldn't make sense given any context.

sudden geyser
digital ibex
#

cbfa too long

sudden geyser
#

Yes, but you still haven't updated the wordsreact array.

#

Each string should be lowercase

#

Hello to hello, Hi to hi, etc.

maiden dragon
#

OH OKEYYYYY

#

my bad

#

bro

sudden geyser
#

It's fine

maiden dragon
#

Thx its good

#

🙂

#

I did not know that it was necessary to put everything in lowercase x)

torpid marsh
#

Hello, can anyone who knows the Discord bot tell me if it is possible what I intend to do?

sudden geyser
#

Your question is ambiguous.

#

Do you own the Discord bot? Are you using someone else's Discord bot? What do you need help with?

torpid marsh
sudden geyser
#

It's possible, but what the actions are will determine how hard it'll be to implement.

#

What are you using to develop your bot?

torpid marsh
sudden geyser
#

May I ask how much experience you have writing JavaScript and Node.js applications?

sudden geyser
#

Then you may want to follow a guide or take more time to learn.

torpid marsh
torpid marsh
#

?

solemn latch
#

👀 pretty standard stuff

torpid marsh
solemn latch
#

no need, its standard stuff

earnest phoenix
#

What are the minimum requirements for listing your bot?

quartz kindle
#

that it works

#

and has a bare minimum of utility

#

ie, a help command and at least one or two working commands

earnest phoenix
quartz kindle
#

anything

earnest phoenix
#

So this may be enough?

quartz kindle
#

to be approved in top.gg likely yes

earnest phoenix
#

Hell yeah

#

Feared it wasn't

quartz kindle
#

but keep in mind, top.gg is a website to publish bots that are ready for public use

#

so you might wanna wait until your bot has stuff people are looking for

earnest phoenix
#

Oh i see

quartz kindle
#

testing and in-development bots are not really good for top.gg

earnest phoenix
#

AT least the commands work

earnest phoenix
#

hello

#

How can I make this property of changing the nickname of a user work?

#
user.setNickname(nickk)
             ^

TypeError: Cannot read property 'setNickname' of undefined
solemn latch
#

looks like the user variable is undefined.

#

cant read property "setNickname" OF undefined
meaning
undefined.setNickname()
isnt a property.

oblique shuttle
#

I have an image, I want to use it as an emoji temporarily, any other way except creating an emoji in guild?

umbral zealot
#

nope

earnest phoenix
#

how can i do for do a list with user permissions?

remote vessel
#

WHAT permission a bot need to use guild.fetchInvites
Please tell

#

can anyone help me

clear marlin
#

has to have the intents on?

earnest phoenix
#

how do i define library?

clear marlin
earnest phoenix
#

yea

#

Removed i think so

clear marlin
#

I think its depricated?

#

yeah its removed

earnest phoenix
#

ohh

clear marlin
#

bots before the update still have a library

earnest phoenix
#

why dont they remove the library thing

clear marlin
remote vessel
#

the presence intent is needed?

earnest phoenix
#

guild member intent

clear marlin
#

yeah, just keep both the intents on

remote vessel
#

discord suddenly disallowed my bot's presence intent

#

server member intents is on

#

and my bot has manage server perms too

#

but it's not able to fetch the guild invites

clear marlin
#

is it verified?

remote vessel
#

yeah

#

it got verified with both intents

#

but one day they took it

#

idk why

#

no mail nothing

clear marlin
#

hmm??

remote vessel
#

i mailed them

clear marlin
#

oh well, you've got to wait

#

i guess

remote vessel
#

and it has been 1 month

#

but how can i fetch the guild invites

#

can i do without presence intnet

clear marlin
#

you do need the guild member intents

remote vessel
#

that is there

#

but still it's not able to fetch

#

i have given the bot admin, audit log and manage server perms

clear marlin
#

well, as far as I know you need both intents on

remote vessel
#

same perms are there with my beta bot

#

it's able to fetch the invites

clear marlin
#

try the intents with the beta bot?

remote vessel
#

the both intents are one

#

let me turn the presence off

#

and try

clear marlin
#

yeah

remote vessel
#

nah still not

#

i dont know what the f is the prblm

earnest phoenix
#

you need to state it in your application

#

when you submitted to discord

#
``` i am right? 
i am confused about that
weary crypt
#

You would have to use the or statement.

prime mist
earnest phoenix
#

I want to ignore everyone except 3-5 guilds

wary flame
# earnest phoenix I want to ignore everyone except 3-5 guilds

either make an array with the guild ids you don't want to ignore

const guildIds = [id1, id2, id3]

{message handler}
if(!guildIds.includes(message.guild.id) return;

Or filter for every guild in a long if statement

{message handler}
if(message.guild.id !== id1 && message.guild.id !== id2 && message.guild.id !== id3) return;
gaunt stag
#

Any idea how to make filter commands like groovy? Like any package and i am a javascript developer

wary flame
#

@gaunt stag If you use lavalink with a library like Shoukaku you get relatively easy access to filters, else it should also be possible with ffmpeg using a library like prism-media

#

Lavalink is also better performace so you might as well switch now

earnest phoenix
#

how can i do for do a list with user permissions?

// !!!!!!!!!!!!!!!!!!!!!!!!!! P E R M I S S I O N S !!!!!!!!!!!!!!!!!!!

client.on("message", (message) => {
    const args = message.content.slice().trim().split(/ +/g );
    const command = args.shift().toLowerCase();
    let member = message.mentions.members.first()
    if(command === "-perms" || command === "-perm" || command === "-permisos") {
        if (!message.member.permissions.has('MANAGE_ROLES')) return message.channel.send(`No tienes permisos | \`"MANAGE_ROLES"\``)
    message.channel.send(`${member} Tiene estos permisos: **${member.permissions}**`)
}});
#

like: "ADMINISTRATOR", "MANAGE_GUILD", "MANAGE_ROLES" etc

pale vessel
#

member.permissions.toArray()

wary flame
#

you can pass an array to message.member.permissions.has

gaunt stag
earnest phoenix
#

I still do not understand that, could you give me an example if it is not a nuisance?

pale vessel
wary flame
#

wrapper*

wary flame
earnest phoenix
pale vessel
#

It's an array of permission strings

earnest phoenix
#

is there a way to order them to look more formal?

pale vessel
#

You can use array.join()

pale vessel
pale vessel
#

Use array.map()

earnest phoenix
#

ill try

#
message.channel.send(`${member} Tiene estos permisos: **${member.permissions.array.map()}**`)
                                                                                   ^

TypeError: Cannot read property 'map' of undefined
wary flame
#

member.permissions.toArray().map()

#

also map requires a callback function wich return the element to set at that permission

earnest phoenix
#

ShahahHah

earnest phoenix
pale vessel
#

You need to use array.map(), string.split() and array.join() inside the map

earnest phoenix
#

forgive me if I don't understand some things, my main language is Spanish

wary flame
#

read the mdn link

earnest phoenix
#

i've to do an array with permissions ?

wary flame
#

You need to .map on the array with permissions yes

earnest phoenix
#

I have never done a .map, could you give me some help with that? I'll do the array first

wary flame
#

I sen't you the mdn link of Array.map, have you read it?

#

It gives a pretty good explanation of how to use .map

earnest phoenix
#

Okay then when I have time I'll read it, I need a bit of a translator I still don't speak English well

wary flame
#

@earnest phoenix On the top of the page you can change language

earnest phoenix
#

á

#

cool

#

ok then tomorrow I'll take care of that myself, something else

#

How can I do to put the comparison of roles, (example) if a role is higher than mine, the bot cannot interact with the role highest

#

I am a moderator, and I want to give the administrator role with a command, the bot tells me that I do not have permission to do that because my role is lower than that

#

with this ¿? or .highest

mental wharf
#

could I get help setting up Auttaja

#

in my server please

#

can any one help please

earnest phoenix
#
message.guild.members.cache.get(args[0])```
How to get an "user" an not a "guildmember"
pale vessel
#

message.guild.members.cache.get(args[0]).user

lament rock
#

or access the UserManager cache

#

probably safer to do it that way in case some crazy race condition happens where the member is no longer available and is de-reffed from cache

#

Perhaps I sanity check too hard

lavish bramble
#
const fetch = require("node-fetch")
async function chat(text){
fetch(
        `https://api.monkedev.com/fun/chat?msg=${encodeURIComponent(
            text
        )}&uid=0101`
    )
        .then((res) => res.json())
        .then(async (json) => {
            return json.response
        })
}
module.exports = {chat}
```My module 
```js
if(message.content != ""){
			message.channel.send(chat(message.content))
}``` my command 
Error :- cannot send empty message
quartz kindle
#

youre not returning anything

#

and youre also not awaiting it

lavish bramble
#

Return json.response

quartz kindle
#

the chat function doesnt return anything

#

running chat() gives undefined

lavish bramble
#

So how can I fix this

quartz kindle
#

return the fetch function and then await chat()

#

or use async await

lavish bramble
#

My module is working good but I have an error

#

Code

client.on("message",  message => {
	if(message.content != ""){
		if(message.channel.type === "dm"){
		if(message.author.bot) return 
			chat(message, message.content)
	}}
})```
#

Error :- cannot read property 'id' of null

#

Ping me if you got it

trail abyss
#

@lavish bramble help me

#

i need you to help me cuz i dont need help 😊 🧠

#

@delicate zephyr or @spare badger how much it takes to review my bot?

spare badger
#

How much?

trail abyss
spare badger
#

The queue currently takes around 3 weeks.

trail abyss
#

i thought like 2-4 hours

spare badger
#

They keep an updated estimate in the pinned messages at #support

willow mirage
#

anyone know how I can replace this thing

<div>
   <SomethingA>
</div>

to

<div>
   <SomethingB>
</div>
#

btw React.js

torpid otter
#
const random = require("something-random-on-discord").Random
const discord = require("discord.js")
const client = require ("discord.js");


module.exports = {
 name:"joke",
 description: "random joke",
 
 run:("message",async message => {
    let data = await random.getRandomJoke()
    message.channel.send(data)

  })
}```
#

let data = await random.getRandomJoke()
^

TypeError: random.getRandomJoke is not a function

willow mirage
#

is better

#

ahh

#

sr

#

@torpid otter where did u get the package?

torpid otter
willow mirage
#

@torpid otter check what version is the package

torpid otter
#

Version
3.4.4

#

@willow mirage

willow mirage
#

ahh

willow mirage
torpid otter
#

is anyelse joke pack is good

prime mist
#

Depends if you are sharding or not.

woeful pike
#

do you really think someone asking this kind of question has a sharded bot

prime mist
willow mirage
#

well it happens something :)))

slender thistle
#

LMFAO

torpid otter
#

my slap command not working

#

error = new Error(error);
^

Error: Unsupported MIME type: image/webp

#
const Discord = require('discord.js');
const DIG = require('discord-image-generation');
const { MessageEmbed } = require('discord.js');
module.exports = {
 name: "slap",
 description: "ask qustion ",
 async run (client, message, args){
  let user = args[0] || message.member;
        if (typeof user == 'string') {
            user = user
                .replace(/</gi, '')
                .replace(/@/gi, '')
                .replace(/>/gi, '')
                .replace(/!/gi, '');
            user = message.guild.members.cache.get(user);

            if (!user) return message.channel.send('User doesn\'t exist');

      
        }
       
        let avatar = user.user.displayAvatarURL({ dynamic: true});
        let avatar2 = message.author.displayAvatarURL({
          dynamic:true
        })
        
        let img = await new DIG.Batslap().getImage(avatar2, avatar);

        
        let attach7 = new Discord.MessageAttachment(img, "slap.png");;
        message.channel.send(attach7)
    
    }
 }```
vivid fulcrum
#

get the avatars in png format

torpid otter
#

what sorry

torpid otter
vivid fulcrum
#

did you copypaste that code

torpid otter
#

nope

prime mist
vivid fulcrum
#

how do you not know how to get avatars in a format then lol, you're using the method for it

earnest phoenix
copper cradle
torpid otter
#

i am dumb

trail abyss
slender thistle
#

There are no such exceptions

earnest phoenix
#

i've got a react question too
if i have a component that renders another with similar props how can i pass all of them at once?

function GreenButton(props) {
  return <button class="green-button"></button>
}
slender thistle
#

Your bot is reviewed when it's its turn

copper cradle
#

that's not how things work

earnest phoenix
#

ty

trail abyss
#

guys

#

i need help

earnest phoenix
#

now i can finally make my children.map function 200+ characters long

trail abyss
#

does anyone know how to make like dank memer spank png i am using dsicord.js and i am a beginer

#

does anyone have the code for it?

earnest phoenix
#

there is no "code for this thing" there is only explanations

cinder patio
#

you should learn how to do it, not ask for code right away. Take a look at node canvas

trail abyss
#

so can anyone explain it

cinder patio
#

The discord.js guide has a guide on how to use it

trail abyss
#

ok ima go learn and get back in 10 mins

#

ill ping u both

copper cradle
#

shouldn't you pay attention in class?

cinder patio
#

The tutorial is for creating a welcome image but it can be applied to anything

trail abyss
#

lol

copper cradle
trail abyss
#

i got reading compreehiehiehiehention for final

#

lol

slender thistle
#

Comprehension

trail abyss
#

i like to be dumb

copper cradle
#

how old are u

trail abyss
#

act*

trail abyss
delicate shore
#

How to arrange codes in different file

#

in express

#

like diff routes in diff file

earnest phoenix
#

make a handler that reads all the files and attaches the listeners accordingly

#

similar to a command handler

trail abyss
#

ima leave that class and see what happens

cinder patio
#

have a separate folder for each path and it's sub-paths

trail abyss
#

lol i left the class

#

jk i just turned off the presence

cinder patio
#

does google meet actually have a custom presence

#

or did you do it yourself

trail abyss
#

"PreMiD"

trail abyss
#
    const channel = member.guild.channels.cache.get('channel-id-here');
    if (!channel) return;

    channel.send("text-here!")
});``` my code ^^
@cinder patio @earnest phoenix it says unexcpected token (bot)
#

@late iris help me

#

or @earnest phoenix help me

#

or anyone help me

cinder patio
#

you might want to learn the basics of javascript first before trying to make a bot

slender thistle
#

Stop pinging everyone lol

trail abyss
late iris
trail abyss
#

i just need help

trail abyss
#

TO HELP ME

summer torrent
#

Dont ping random people

trail abyss
#

since u got the bot dev badge

late iris
summer torrent
#

Do you know basic javascript

trail abyss
#

i know a bit*

summer torrent
#

You have to learn before making a bot

trail abyss
#

but its 24/7

summer torrent
#

So?

trail abyss
#

can u help

summer torrent
#

did you read my message

trail abyss
#

lol

#

bye

#

i guess

torpid otter
#

TypeError: Cannot read property 'members' of undefined

vivid fulcrum
#

are you sure you've actually got a message object

#

also

#

you're recreating a static array every command invocation

#

don't do that

delicate shore
#

dude I am done

#

I have been trying this for hours

#

it's not wokring

#

Help me jesus christ abpiagsbpuasfb

lusty quest
#

sounds about right

boreal iron
delicate shore
#
let betaAI = require("./routes/v4/ai")
app.use("/beta/ai", betaAI)

my index.js file

lusty quest
#

where is the issue?

delicate shore
#
Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.```
#

no issue

#

no error

#

just this when fetching

kind garnet
#

Anyone know BDScript here?

#

;-;

delicate shore
#

Bruh, It's illegal

kind garnet
delicate shore
#

yes

kind garnet
#

How? Ugh

prime mist
#

I'm seeing this error in the syntax

delicate shore
old cliff
#

djs13 is pog

delicate shore
#

😢

#

I am tired

#

help me I am going to die

delicate shore
#

CORS is fine
It works fine on other endpoints

#

just this stupid

#

endpoint

#

because I am first time doing codes in diff file

#

other wise earlier all were in one file

prime mist
#

Your server is broken?

#

If other endpoints are working...

delicate shore
#

bruh

#

it's not

delicate shore
prime mist
#

Yeah, node-fetch doesn't implement credentials AFAIK

delicate shore
#

what

#

what r u tryna say

#

why is nodefetch related here

prime mist
#

That it isn't cors.

delicate shore
#

but

#

OMFG I AM GONNA DIE

trail finch
#

Lawl

earnest phoenix
#

uh may i ask what this does?
asyncio.WindowsSelectorEventLoopPolicy()

sudden geyser
#

It's a policy for asyncio.

earnest phoenix
#

i know but it had error otherwise if i didnt do thart

leaden lake
#

what are the 6 letters / digits after a .png in a css file ?
because I want to modify a webpage using css, replacing the .png to put mine, but the end of the .png file is "wiki.png?XXXXXX"

lunar patio
#
(node:11220) [INSPECTOR_ASYNC_STACK_TRACES_NOT_AVAILABLE] Warning: Warning: Async stack traces in debugger are not available on 32bit platforms. The feature is disabled.
(Use `node --trace-warnings ...` to show where the warning was created)```I'm facing this problem!
vivid fulcrum
#

why are you running a 32 bit installation of your os

#

microsoft is completely dropping support for 32bit soon

earnest phoenix
#

how do you make stuff like this

cinder patio
#

what exactly?

crimson vapor
#

I think he means the offline screen

cinder patio
#

maybe that appears when the page fails to make a http request

earnest phoenix
crimson vapor
#

it probably has to do with how replit works, idk if they use http requests or a ws

#

if they use a ws its super easy

#

ig it would also be easy with http

earnest phoenix
#

imagine opening a ws or sending an http request when there's no internet

#

i just typed replit.com in the address bar when my wifi was off

cinder patio
#

The html can be cached

#

the browser will still try to make the http request, and it'll fail

gaunt stag
#

Any idea how to make music command with lavalink? Javascript

fringe badge
#

@wary swan yo

#

puppeteer.launch().then(async browser => {
    const page = await browser.newPage()
    await page.goto('URL)
    await page.evaluate( () => {
        let elements = document.getElementsByClassName('iva-item-root-G3n7v');
        console.log(elements + 'test')
    });
    // browser.close();
});```
#

doesnt work and i dunno why

#

console.log logs nothing

wary swan
#

it is console logging in the site 🤔 did you check there

fringe badge
#

well ok i got it

wary swan
#

hmm it should work maybe it was giving undefined because you are logging a variable out of scope

fringe badge
#
let elements;
puppeteer.launch().then(async browser => {
    const page = await browser.newPage()
    await page.goto('')
    await page.evaluate(async () => {
        elements = await document.getElementsByClassName('iva-item-root-G3n7v');
    });
});
console.log(elements + 'test')
solemn latch
#

Console log is happening before any of the awaited stuff runs

tacit sequoia
#

Ya

fringe badge
#

uhh

tacit sequoia
#

await it

solemn latch
#

.then means come back to this later, when the promise resolves.
You'll want to await, or move the console.log inside the .then callback

cinder patio
#

you're doing it wrong

fringe badge
#

put console.log in .then

#

still undefined

cinder patio
#
 const elements = await page.evaluate(async () => {
        return document.getElementsByClassName('iva-item-root-G3n7v');
    });```
#

The function you provide to evaluate actually gets turned to a string and executed on the browser

#

And the browser and your node app do not share memory

cinder patio
#

show your new code

fringe badge
#
puppeteer.launch().then(async browser => {
    const page = await browser.newPage()
    await page.goto('URL HERE')
    const elements = await page.evaluate(async () => {
        return document.getElementsByClassName('iva-item-root-G3n7v ');
    });
    console.log(elements + 'test')
});```
cinder patio
#

try [...document.getElementsByClassName('iva-item-root-G3n7v ')]

#

and make sure iva-item-root-G3n7v is actually exists - parts of it look randomly generated

#

And that empty space likely has to be deleted

fringe badge
#

yeah its here

cinder patio
#

remove the empty space at the end

fringe badge
cinder patio
#

probably because puppeteer cannot return HTML objects then

wary swan
#

it can

cinder patio
#

try document.getElementsByClassName('iva-item-root-G3n7v').length

#

I'm 99% sure it can't

wary swan
#

i dont know much dom so i cant help to much

cinder patio
#

It can only return data which can be turned to json

#

and class instances cannot

#

try document.getElementsByClassName('iva-item-root-G3n7v').length to see if it's getting the right elements

#

@fringe badge ^

wary swan
graceful cedar
#

hey guys any iranian developers here
plz notify me by sending massage to me or by simply replying to me in here
i would appreciate it
its about a job request (we need a dev)

wary swan
cinder patio
#

there you go

fringe badge
#

thx guys

#

i found a good article that should help with that

lavish bramble
#

Can anyone suggest me any reaction gif api

orchid cave
#

giphy?

lavish bramble
#

Its not working in embed

orchid cave
#

ohh you want to generate gifs?

lavish bramble
#

Yup

#

Like cry sad

#

Etc

lyric mountain
#

you're probably grabbing the site url not the image's

graceful cedar
#

is here have any part to hire people??

lavish bramble
lyric mountain
#

what url u tried?

woeful pike
earnest phoenix
#
const exampleEmbed = {
    title: 'Some title',
    image: {
        url: 'attachment://https://i.imgur.com/wSTFkRM.png',
    },
};
message.channel.send({  embed: exampleEmbed });```
How do i upload an url as image attachment.The actual Code is not working :C
lyric mountain
#

that won't work bruh

#

your url is wrong

#

attachment://something.ext refers to sent files

#

you can't simply use attachment://https://...

lavish bramble
lyric mountain
#

that's wrong

#

that the site's url not the image's

lavish bramble
#

How can I get right one?

lyric mountain
lavish bramble
#

So how can I get direct URL

lyric mountain
#

right click -> open image in new tab

#

or copy image url

lavish bramble
#

But then I have to paste a lot of urls

#

Bcz I want random gif

lyric mountain
#

well, nobody said it'd be this easy

#

welcome to "The Hunt for Reliable GIF APIs"

lavish bramble
#

Can I get the url from giphy?

lyric mountain
#

you can, but you'll need to find out how

earnest phoenix
#
let commandfile = client.commands.get(cmd.slice(prefix.length));

// Cooldown
if(commandfile && commandfile.help.cooldown){
    console.log(cooldown)
    const getCooldown = commandfile.help.cooldown * 1000;
    if(cooldown[commandfile][message.author.id] === undefined){
        cooldown[commandfile][message.author.id] = true
        setTimeout(async () => {
            delete cooldown[commandfile][message.author.id];
        }, getCooldown);
    } else {
        cooldown[commandfile][message.author.id] = true;
        return message.react("⏰");
    }
};```

Why i have this error: `TypeError: Cannot read property '605371484046884865' of undefined`
earnest phoenix
lyric mountain
#

dot dot dot

#

bruh

lyric mountain
#

attachment://
https://
http://
^ those are protocols

earnest phoenix
#

if(cooldown[commandfile][message.author.id] === undefined){ < here

lyric mountain
#

you CANT have more than one in the same url

#

did you spot the issue?

earnest phoenix
#

That with protocol is understandable, but I am really confused :C
So if I have the url https://i.imgur.com/wSTFkRM.png
How do I upload it as an attachment inside an embed,do i have to download it or use the Buffer instead?

lyric mountain
#

use that url

earnest phoenix
#

nvm

lyric mountain
#

there are ways to hide the token

gritty lintel
#

ah how to host bot 24/7??

#

okay

lyric mountain
#

you're never supposed to put it directly into code

gritty lintel
#

but that .env is not working now

lyric mountain
#

why?

gritty lintel
#

idk

#

it is saying you can't make more .env

lyric mountain
#

then figure out why

gritty lintel
#

and i have create a alt account

#

in there also

#

it is saying that you cant make .env more

lyric mountain
#

what else are you putting in env?

gritty lintel
#

nothing

#

just .env

#

.env

#

like this i am putting

lyric mountain
#

I mean, inside it

gritty lintel
#

the file is only not opening

#

it is now allowing me to make .env file

lyric mountain
#

just delete it then

#

I never heard of replit preventing env creation

gritty lintel
#

ya i have done all the things possible

#

i am saying my friend to try that

#

he hosted my 1 bot

#

ah thanks for helping me

slender thistle
#

I think replit moved from .env to environment variables aka secrets

earnest phoenix
#

yeah

lyric mountain
#

@gritty lintel ^

woeful pike
lyric mountain
#

ads maybe?

woeful pike
#

their free tier customers will never upgrade to paid tier

lyric mountain
#

or info selling

slender thistle
#

No ads on their pages so I'm curious myself

woeful pike
#

so many children who literally cannot upgrade to a paid tier even if they wanted

earnest phoenix
#

they deprecated .env files and switched to a glitch ripoff tab under the settings button to set envireonment variables

lyric mountain
#

well, when something is free then you're the product

lyric mountain
#

they gotta make money somehow

earnest phoenix
#

replit is used in schools

slender thistle
#

Merger, Sale, or Other Asset Transfers. We may disclose and transfer your information to service providers, advisors, potential transactional partners, or other third parties in connection with the consideration, negotiation, or completion of a corporate transaction in which we are acquired by or merged with another company or we sell, liquidate, or transfer all or a portion of our business or assets.

lyric mountain
#

info selling then

woeful pike
#

that's about asset transfers

slender thistle
gaunt stag
#

Can we change the pfp of a bot? I asked cause i cant change the name of the bot

umbral zealot
#

yes you can change its avatar

ionic sage
#

i'm making a giveaway command with role requirements. I'm not able to figure out a way to remove the reaction of the users who do not have that role, can anybody please help?

smoky kelp
#

One question

Is there any way for mute a user only for you in discord.js???

Like if i mute a user manually, like the photo

cinder patio
#

you're probably on the wrong tab in the developers page

#

Go to the "Bot" tab

lyric mountain
#

the bot can't hear users anyway unless you make it

lyric mountain
gaunt stag
cinder patio
#

can you post a screenshot of the developer page where you changed the name

smoky kelp
ionic sage
royal island
#

umm which region is best to host the bot!?

trail abyss
#

hi

#

does anyone know how to make my bot welcome people? with their pfp in a pic
DIscord.js only

solemn latch
#

what part? the picture part, or the event?

trail abyss
#

like a picture of something

#

and the pfp of people is in the middle

solemn latch
#

i would use canvas.

trail abyss
#

how?

solemn latch
trail abyss
#

ok

placid iron
#

okay i know this is not any real language

trail abyss
#

lol

placid iron
#

but why doesnt that work
these two both give 4 as teh output

#

also 1 is the first index and 0 means the end of a string or the start (end in this case)

solemn latch
#

👀 fake scratch smh

placid iron
#

mmm

solemn latch
#

no idea why it would show both as 4 👀 weird

placid iron
#

ikr,the first part (which generates the number) always gives the right value and i verified the 2nd part gives the correct substring but apparently combining them recursively just kills it

#

i did the same thing in python and it works

#

istg

sudden geyser
#

Eyes hurt reading

placid iron
#

nah just my own project

slender thistle
#

Cuz otherwise you can just do int('00101', base=2), can't you?

placid iron
#

yeah i could do that easy, but i cant do that in scratch ripoff

slender thistle
#

You masochist

placid iron
slender thistle
#

😔

placid iron
#

converting this to scratch

slender thistle
#

Oh God

sudden geyser
#

What's below a masochist

placid iron
#

i made sure to use only stuff i can use in scratch but for some reason it doesnt work

slender thistle
#

A person who merely gave up on themself

lyric mountain
#

you either mute the user for everyone or don't mute at all

quartz kindle
#

converting my help command to buttons

#

pain

#

no idea why discord limits buttons to 5 per row, makes it look really bad in certain screen sizes and amount of buttons

lyric mountain
#

I'm waiting for it to come to JDA

#

then I'll add an option to use them with my lib

slender thistle
#

Because Discord

quartz kindle
#

im implementing them using the raw event and node-fetch lul

#

because djs is slow

cinder patio
#

Erwin

opal plank
#

slow, trash, inefficeint, unperformant, ram hungry, traash, bad, trash, slow devs, trash, oversimplified, trash

cinder patio
#

does deiweiej3eir have buttons

opal plank
#

it do

#

a long while now

#

cuz guess what

#

even the idiots at d.js had been playing with us for buttons for over a month now

#

but their 214 devs cant keep up with cake

quartz kindle
#

before:

#

after:

cinder patio
#

fuck guess I'm rewriting my bot in dewjededeferf

opal plank
#

the one thing i would've liked is permission to add our own color to the buttons label

quartz kindle
#

ye that would be like super easy to implement

#

no idea why they wouldnt allow it

cinder patio
#

This feature can be implemented in a day or two, what are d.js devs doing

quartz kindle
#

smoking weed

cinder patio
#

Waiting for features to pile up so they can release a major version

#

Instead of releasing minor versions with new features

vivid fulcrum
#

they're surprisingly easy to implement

opal plank
quartz kindle
#

stage channels are still not supported in discord.js stable

opal plank
#

superbrain is also coding in detritus

quartz kindle
#

a lot of shit is not supported on djs stable

vivid fulcrum
#

i forked disqord and implemented them in like two hours (including interactions)

opal plank
#

im about to adapt my reaction handler to use reactions instead

#

buttons*

#

so i dont have to change the code in any form

vivid fulcrum
#

buttons can't be used in dms 😔

cinder patio
#

v13 WiLl bE rElEaSeD wHeN iT's rEaDy

quartz kindle
opal plank
vivid fulcrum
#

yeah

cinder patio
#

that's weird

#

maybe not implemented yet?

vivid fulcrum
#

discord straight up ignores the components field

quartz kindle
#

my bot uses dms wtf

vivid fulcrum
#

i think they dun fucked up

#

interactions were built to be guild only

quartz kindle
#

holy shit, my bot doesnt even respond to dms now

opal plank
quartz kindle
#

fucking hell

opal plank
#

discord™️

vivid fulcrum
#

i have this

#

it would be more organized if it was in a dm

#

but unfortunately

#

the components field is just ignored in dms

quartz kindle
#

its not just the components field

clear marlin
#

discord's api is getting cooler updates pepe_hmm

quartz kindle
#

the entire message object is ignored

#

if it has components

vivid fulcrum
#

uh

#

i don't think so

#

my messages came through

quartz kindle
#

at least thats whats happening to me

vivid fulcrum
#

just without buttons

quartz kindle
#

mine didnt?

#

dafuq

opal plank
#

tis what u get for voiding ur .catch

#

u dork

cinder patio
#

maybe it's discord.js' fault?

vivid fulcrum
#

so right now im stuck with mixing reaction handlers and interaction handlers
for dms i'm using reactions and if a dm fails it falls back to a guild channel where it uses interactions (buttons)

opal plank
#

whispers barely audible
use detritusjs

quartz kindle
#

fuck i dont want to support both buttons and reactions

#

i already removed all the reactions code

opal plank
#

tim, move ur botum to detritus

#

begone from that cursed lib

quartz kindle
#

can detritus use buttons in dms?

opal plank
#

lets try it

#

prob not

#

but lets see

quartz kindle
#

then fek off

#

lmao

cinder patio
#

no but you'll still receive the messages lmao

quartz kindle
#

oh wait i set my bot to not respond to dms in dev mode

vivid fulcrum
#

no response as per usual

cyan lintel
#

Hello, can you help me, why does it appear that the bot is disconnected?

vivid fulcrum
#

because it's disconnected

#

thank you for coming to my ted talk

clear marlin
#

try asking the support server not here

cinder patio
#

it makes sense that buttons aren't can't be sent in DMs cause they are part of the interactions API like you said, but I think limiting the interactions APIs to guild-only is kinda stupid

opal plank
#

about that

opal plank
cinder patio
#

make only slash commands guild-only

vivid fulcrum
clear marlin
opal plank
cinder patio
#

they do? Oh then it's either a bug or not implemented

clear marlin
opal plank
clear marlin
#

no

#

u

opal plank
#

@vivid fulcrum@cinder patio@quartz kindle calm ur tiddies

vivid fulcrum
#

😩 but i need the buttons nowwwwwww

#

god knows when they'll fix it

#

i love how bots are what drives discord and is keeping the platform alive but yet discord says a big fuck you to bot devs lmfao

quartz kindle
#

lel

quartz kindle
#

im gonna hold off until then

#

keep using reactions on prod

opal plank
#

we all know is furries and horny teens, thats truly what moves discord

quartz kindle
#

i need to rewrite my help command eitherway

#

its such a clusterfuck atm

opal plank
#

said every new discord feature, ever

#

remember slash commands?

quartz kindle
#

everything is hardcoded lul

opal plank
quartz kindle
opal plank
#

011

quartz kindle
#

yes

#

its my index

opal plank
#

imagine indexing with 0 prepended

vivid fulcrum
#

wish version of lady gaga's 911

quartz kindle
#

lmao

#

0 is the start page / root

#

then 1st option loads page 01

opal plank
#

im gonna pretend i understood that

quartz kindle
#

page 02 is second page. page 011 is the first option inside first page

slender thistle
quartz kindle
#

page 011121

#

:^)

slender thistle
#

lmfao what

opal plank
#

im concerned for tim's mental health now

quartz kindle
#

how else would you do it?

#

lmao

opal plank
#

a very big chain of if's nested

#

duh

quartz kindle
#

i mean sure, you could just make objects inside objects

#

but then the entire thing goes too much to the >>>

vivid fulcrum
#

discord docs are so fucking inconsistent

slender thistle
#

They're confusing lol

opal plank
#

better than twitch's

quartz kindle
vivid fulcrum
#

everything follows snake_case and then the slash command docs follow CamelCase

#

lol

opal plank
#

most of it is skids trying to get free internet points

#

not actual errors

#

like indentation error

#

misppelled words

quartz kindle
#

ye lul

opal plank
#

shit like that

#

"Hey mom, look at me, im a discord dev now!"

slender thistle
#

camel case?

#

Where? k3llyhmm

vivid fulcrum
slender thistle
#

Oh, Pascal Case

quartz kindle
#

GuildApplicationCommandPermissionsTypesInterfaceBecauseTypingsLookAmazingWhenNamedLikeThisBecauseWhyNot