#development

1 messages · Page 1431 of 1

earnest phoenix
#

i wasnt speaking to u but that simple coding

leaden cliff
old cliff
#

My express server is hosted on a vps and I can't use 80 port or 443 port and so

tranquil drum
umbral zealot
#

you're trying to ask a very complex question in the midst of a noob that doesn't know programming and a noob that wants to use json as a database, you're going to have a bad time trying to get an answer at this moment I think.

opal plank
#

^^

#

i was about to step in but the chat is too crazy, theres already plenty of helpers here rn

leaden cliff
#

Why is coding so easy?

umbral zealot
#

It's not easy

old cliff
broken sentinel
leaden cliff
#

Is!

umbral zealot
#

What you're finding easy right now is copy/pasting code from online tutorials

lusty quest
broken sentinel
#

yep i saw

umbral zealot
#

Saying programming is easy because your copy/pasted code works is like saying painting is easy because you finished a puzzle.

lusty quest
#

the url returns a json

tranquil drum
rustic nova
umbral zealot
lusty quest
#

remove ; at line 7

old cliff
#

Let me research about aloudflare

umbral zealot
#

that breaks the chaining

leaden cliff
old cliff
#

^cloudflare workers

broken sentinel
lusty quest
tranquil drum
umbral zealot
rustic nova
opal plank
umbral zealot
#

"stuff" yes. 100% of the bot code, no.

rustic nova
#

Yeah no that's something i agree

tranquil drum
#

development is just copy pasting from your brain 😳

lusty quest
#

use ` to define the string

umbral zealot
#

please read

umbral zealot
opal plank
#

or just do string conactation

tranquil drum
#

why concat when you can interpolate

lusty quest
#

well you can use it to define a string but yea

opal plank
#

cuz we can

tranquil drum
#

me wishing java had template literals sad

earnest phoenix
#

ha

umbral zealot
#

no you can use it to define a template literal 😉

earnest phoenix
#

that's why c# is king mmLol

opal plank
#

bruh just 'a' + b + 'c'

tranquil drum
#

the strings are evald

opal plank
umbral zealot
#

A template literal is not technically a string, it's an evaluated template even if it's missing any placeholders.

#

Yes, I'm a sucker for precision.

lusty quest
#

i need to get some motivation to start recoding a bot written in js to c#

earnest phoenix
#

avoid d.net and the rest is easy

lusty quest
#

any recomendations for a "lib"

opal plank
#

assembly

earnest phoenix
#

dsharpplus or disqord

opal plank
#

def assembly

tranquil drum
#

jda clubpenguin

#

are you sure you're using it right

opal plank
#

code in jeve, tis gud langug

lusty quest
#

why dsharpplus over d.net?

umbral zealot
#

read the explanation page I sent you, it'll help.

opal plank
gusty quest
#

how can i remove users reaction?

opal plank
#

see?

#

reading bad

umbral zealot
#

you didn't read, and you didn't change the thing you had to change.

tranquil drum
#

pls read 😦

leaden cliff
#

Their is a language?

umbral zealot
#

so... like... listen to what we're saying maybe?

#

Then read

opal plank
#

then time to start

tranquil drum
#

pls try 😦

tulip ledge
#

then learn the basics first

opal plank
#

cuz coding is all THAT

#

reading docs

earnest phoenix
tranquil drum
#

i have 4 monitors so i can pull up 3 docs

gusty quest
#

just change from ' ' to ``

earnest phoenix
#

that and dnet isn't being maintained properly anymore

marble juniper
opal plank
#

is that client mods? 002_think

marble juniper
#

its glasscord

old cliff
#

Looks like I might have to myself code the reverse proxy workers

lusty quest
earnest phoenix
#

^^^

marble juniper
#

allows you to modify discord

opal plank
earnest phoenix
#

well

marble juniper
#

to make it transparent

earnest phoenix
#

any electron app

marble juniper
#

yeah

earnest phoenix
#

i made teams use it too lol

gusty quest
#

how can i remove users reaction from message?

marble juniper
#

but can be used for discord

tranquil drum
old cliff
#

Maybe

#

But I need to learn about the URL module

#

To get the requests after the root

opal plank
#

< axios

#

sorry

tranquil drum
#

you can supply a url as a string to Request

opal plank
#

i said it

tranquil drum
#

i don't think cloudflare workers support axios lmao

marble juniper
#

node-fetch >

opal plank
#

axios best, sorry

marble juniper
#

axios good

old cliff
#

Is there any free cloudflare app which does it for free ? 😜

restive furnace
#

http(s) > bloat ||like axios, sorry||

old cliff
#

Except portzilla

lusty quest
#

there is only portzilla

earnest phoenix
#

isn't node-fetch ultimate barebones wrapper around the native methods

tranquil drum
#

i believe in you @old cliff

tranquil drum
earnest phoenix
#

true

marble juniper
#

aren't all libs based on Another lib which is based on another

opal plank
#

< node-fetch < axios

#

have you tried learning js?

old cliff
#

Not me xD

earnest phoenix
tranquil drum
#

that's all package managers LOL

marble juniper
#

lol

earnest phoenix
#

not really

opal plank
#

just ship the whole libs inside then

earnest phoenix
#

.net's nuget for example

lusty quest
#

now i wonder if you could create a cascading npm package that just overflows node on install

opal plank
#

no need to install the dependencies if you ship the dependencies yourself
🧠

tranquil drum
#

ah I don't use .net

opal plank
#

then start there

earnest phoenix
#

in .net it's "do it yourself instead of relying on other packages"

marble juniper
earnest phoenix
#

except for really complex shit

#

7 PINGS

#

;-;

tranquil drum
#

if you ship deps then you're adding potentially unnecessary code

#

in libs anyway

lusty quest
marble juniper
#

Someone do a dev challenge where you use a package for everything possible

#

even vanilla js

opal plank
#

no. we already pointed you to docs and resources to fix your problem. If you arent going to put effort, why should we? Go find a tutor or somewhere else to ask for spoonfed code, here its against the rules. Vampires are not welcome

marble juniper
#

there are litterally npm packages for converting a string to lowercase

lusty quest
#

there are npm packages that just do Number < Number and Number> Number

marble juniper
#

oh and btw question

opal plank
#

theres a package called is-undefined

#

guess what it does

lusty quest
#

node is braindead in some aspects

tranquil drum
#

running js on a server

lusty quest
#

well js in general

earnest phoenix
#

"is THERE PACKAGE That DOES IT fOR ME??"

marble juniper
#

Im making a bot which does a lot of image processing and it uses an already trained model to determine if an image sent by a user is in the positive category or negative one

#

basically image classification

#

and im like

#

any way I could reduce cpu usage

opal plank
# lusty quest node is braindead in some aspects

its not node that is braindead, is half of the community that makes bloated and shit packages for lazy devs, who in turn also make their own shitty packages without a pint of knowledge of js

tranquil drum
#

tensorflow-gpu eyes

marble juniper
#

like idk process an image one by one or something

lusty quest
#

grab some money and get a Server with dedicated GPU

marble juniper
#

or just downscale the image itself

tranquil drum
#

downscale might be good

marble juniper
#

nah its already trained

sudden geyser
#

Packages are a good thing. It's that a lot of people use them in a way that's seen as a bad way.

marble juniper
#

im not training it

#

bruh

tranquil drum
#

you can run models on gpus

#

they're not just for training

marble juniper
#

ok

#

well

#

im using an npm package

#

and stuff

lusty quest
#

ri

#

p

marble juniper
#

so its gotta be cpu

lusty quest
#

get a better cpu

tranquil drum
#

there's npm packages for tensorflow-gpu i thought

marble juniper
#

no like

#

its not using high cpu usage atm

lusty quest
#

if you cant beat it brutefoce it

hollow sedge
#

Some of them have C bindings though, which is definitely beneficial. But yeah many packages are just unnecessary

marble juniper
#

im just planning to make it use less cpu power

earnest phoenix
#

if you ever used create-react-app you'd know what is truly bloat

old cliff
lusty quest
#

api will be limiting you at some point

old cliff
#

But its easier than training a custom tensorflow thingy

marble juniper
#

I thought about making a queue array for each discord channel and making the bot just go through the array of images 1 after 1

lusty quest
#

ive trained a ML model myself sure its for text clasification but its not that bad

old cliff
#

Idk how to use tensor 😩

lusty quest
old cliff
#

I'll use wit for the time being for my cursed dm ai-chat feature

lusty quest
#

had the idea to create a Moderation bot that uses AI to determine if a user should be warned, kicked or banned

old cliff
#

ME TOO

lusty quest
#

but i still suck at c# and collecting data for training the model is annoying

old cliff
#

I'll use Google perspective api for checking toxic messages

#

And flirting messages

#

And other type of shit messages

#

To make a kids robolox server secure yay lol

earnest phoenix
#

can someone help me build the command "ttt" dm me if yes

old cliff
#

Ttt ?

earnest phoenix
#

Nodejs discordjs v12

#

tic tac to

old cliff
#

Oh diy

heavy marsh
#

I am using D.js - v12

const got = require('got');
let streamlink = args[0];

try {
let audiotypes = ["audio/aac","audio/mpeg","audio/opus"]

let check;
    
try {
check = await got(streamlink,{method:"HEAD"});
} catch(e) {
message.channel.send(`![cross](https://cdn.discordapp.com/emojis/678626371110567973.webp?size=128 "cross") **Stream link unable to be played!**`);
return;
}

if(audiotypes.includes(check.headers["content-type"])) {
//Do Stuff

I am trying to get if the audio link is playable, but some times this method is not 100% effective.
Does anyone else have any other ways to do it?

old cliff
#

Or copy code from any github repo and convert it to be usable in discord.js

old cliff
#

(not recommended)

#

But for learing u can

tranquil drum
heavy marsh
#
[ Command used ] xxx (xxx) - dx!stream http://stream.coronafm.nl:8002/live
PCancelable [Promise] {
  _cancelHandlers: [ [Function (anonymous)], [Function (anonymous)] ],
  _isPending: true,
  _isCanceled: false,
  _rejectOnCancel: false,
  _reject: [Function (anonymous)],
  _promise: Promise { <pending> },
  on: [Function (anonymous)],
  json: [Function (anonymous)],
  buffer: [Function (anonymous)],
  text: [Function (anonymous)]
}
(node:40) UnhandledPromiseRejectionWarning: RequestError: Parse Error: Expected HTTP/
#

Just did a console.log

leaden cliff
#

Egg!

gusty quest
#

How tooo remove reaction from embed please help??

lusty quest
#

atleast its a possible issue since its pending

heavy marsh
umbral zealot
tranquil drum
#

it already is await

lusty quest
#

ohh

heavy marsh
#

I mean IDK sometimes it work some times it tells me error

umbral zealot
gusty quest
#

that doesnt help to men

#

i readed that

#

mulitple times

umbral zealot
#

Ok so what are you missing?

tranquil drum
#

although idk why got would be giving you problems

heavy marsh
#

What is the best

#

Should I send in my full code

umbral zealot
tranquil drum
#

i mean you're only using it to check if the content-type is audio right?

heavy marsh
#

hold on

heavy marsh
# tranquil drum i mean you're only using it to check if the content-type is audio right?
let streamlink = args[0];

try {
let audiotypes = ["audio/aac","audio/mpeg","audio/opus"]

let check;
    
try {
check = await got(streamlink,{method:"HEAD"});
} catch(e) {
message.channel.send(`![cross](https://cdn.discordapp.com/emojis/678626371110567973.webp?size=128 "cross") **Stream link unable to be played!**`);
return;
}

if(audiotypes.includes(check.headers["content-type"])) {

let connection;
tranquil drum
#

oh wait

#

it's cause you're using HEAD

#

http://stream.coronafm.nl:8002/live this specific endpoint doesn't handle HEAD

heavy marsh
#

ooh

old cliff
#

You guys know any nice api or place from where I could get music to play on my bot since YouTube banned my server ip.

tranquil drum
#

you might have to do a GET and close it after you get headers

old cliff
#

It banned my server ip

heavy marsh
lusty quest
old cliff
#

The whole network is banned from yt

opal plank
#

buy an ipv6 block and route it

lusty quest
#

buy into the query for a ipv4 and use it

opal plank
#

you can scale music bots without that

tranquil drum
#

I don't use got

lusty quest
#

but this could take a year

opal plank
#

thats one of the main reasons why music bots are a nightmare.
small bots are fine, but scaling it isnt something that can be done easily

old cliff
#

Oh wait I could directly play audio without ytdl cause I can use yt api v3 to get direct link to audio / video files

tranquil drum
opal plank
#

you'll need to route traffic and ratelimit it yourself

lusty quest
#

the Google API is horrendous to work with

old cliff
#

How tf are groovy and rythm built ?

opal plank
#

the only google api i've struggled with was the gmail one for subscriptions

old cliff
#

Like from where do they get music ?

opal plank
lusty quest
#

they use the YT and Spotify API

old cliff
#

Spotify doesn't give audio links

#

It just provides data about song

lusty quest
#

gg sending invite urls

#

without the developer role all invite urls are nuked

opal plank
#

i wonder how many invites this server has

old cliff
#

I'll consider using Spotify api to get yt links of songs to play music from using external links data

lusty quest
#

i make a large circle around Music bots, they are a pain in the ass to work with

old cliff
#

Yeah

#

But they do nice stuff

#

So imma make a different bot dedicated to only music and not use that in my main

lusty quest
#

i dont need them. got spotify premium and if i want someone else to listen to the song im listen to ive got Discord nitro

old cliff
#

That made me lose my 99% will to make a music boat

earnest phoenix
#

well yeah

#

other millions of bots have music

#

and yet nobody's using them

#

because monopoly bots like rythm, ayana and groovy kill your recognition

old cliff
#

Like plasma kills my main bots

grizzled raven
#

how would i get this to work? Settings is never used and guild.settings is always classified as any, Settings is a typedef

tranquil drum
#

what's the problem?

#

it says Settings is not declared but not used?

grizzled raven
tranquil drum
#

wait have you tried

@typedef {import('./src/managers/SettingsManager').Settings} Settings
grizzled raven
#

yes

tranquil drum
#

is it a different error?

grizzled raven
#

its just any now

#

i dont think typedefs work in index.d.ts files

tranquil drum
#

it's cause you can remove the import

#

at the top

grizzled raven
#

already did

tranquil drum
#

oh

#

unlucky

grizzled raven
#

yeah they dont work at all

#

might have to create an actual ts object or whatever

silent cloud
#

Guya

#

Guys

#

Help

#

My code

#
const activities_list = [
    "*help ✨ ", 
    "${bot.users.cache.size} человек на  Shard",
   "${bot.guilds.cache.size} + серверов на shard", 
     "Mashiro"
    ];

bot.on('ready', () => {
    setInterval(() => {
        const index = Math.floor(Math.random() * (activities_list.length - 1) + 1); 
        bot.user.setActivity(activities_list[index], { type: 'WATCHING' });
    }, 10000); 
});```
tranquil drum
#

inb4 template litearls

silent cloud
#

Why i have status Watching ${bot.users.cache.size} ......

tranquil drum
#

your strings aren't defined with `

lusty quest
#

^

silent cloud
#

Ohhhhhhhh

#

Xd

#

Ty

#

So

#

Why i have 0?

#

Now i have Watching 0 .....

rustic nova
#

You probably don't have the intent for the guild count i think

#

I might be completely wrong though

silent cloud
#

Users too 0

restive furnace
#

ok no intent

slender thistle
#

Well no shit

#

You are filling the string when the gateway isn't even connected yet

silent cloud
#

?

slender thistle
#

Really

silent cloud
#

How i can fix it so?

tranquil drum
#

your strings are evaluated before the bot gets the ready event

silent cloud
#

I understood

slender thistle
#

Create the strings in the ready event

silent cloud
#

I have it

slender thistle
#

If you understood that, you'd figure out the solution easily

#

No

silent cloud
#

bot.on('ready', () => {

slender thistle
#

ACTUALLY create the array in your ready event

silent cloud
#

Ohhhhhh

#

Understood

#

Ty

tranquil drum
#

it won't update if your server count changes though

silent cloud
#

How i can do every users and other update?

#

New event or what?

slender thistle
#

Create the array in the interval

tranquil drum
#

re-evaluate the strings every time you change your status

drifting wedge
#

How can I have flask show a div in html?

silent cloud
#

Now it looks like this?

#
bot.on('ready', () => {
    setInterval(() => {
        
    const activities_list = [
    "*help ✨ ", 
    `${bot.users.cache.size} человек на  Shard`,
   `${bot.guilds.cache.size} серверов на shard`, 
     "Mashiro"
    ];
    
        const index = Math.floor(Math.random() * (activities_list.length - 1) + 1); 
        bot.user.setActivity(activities_list[index], { type: 'WATCHING' });
    }, 10000); 
});```
drifting wedge
#

Like you click a button, send post to flask, flask sends back to show div

earnest phoenix
#

LOL @lusty quest

prisma wren
#

So I was following a tutorial for making an economy bot and did exactly as they said but when I did the node . and then ran the ping command in my server it came back false. If you want me to send the client.js and ping.js files i can.

earnest phoenix
#

hey i need a windows/freedos expert to dm me

heavy marsh
tranquil drum
#

you need the headers

#

but once you get them you can just close the connection

heavy marsh
tranquil drum
#

try to find an event that's fired at some point after you get the headers and close the connection when you get that event

dim wadi
#

How do i add a background to my bots homepage on the website?

rustic nova
#

If you're referring to your bot page

dim wadi
#

thank you

broken sentinel
#

does somebody have made snipe command with slappey ?

sudden geyser
#

noop

broken sentinel
#

I am trying to make it but its note working

#

-_-

earnest phoenix
tranquil drum
#

f

sonic lodge
#

that's an a

heavy marsh
tranquil drum
#

it's awaiting for the server to finish the connection

#

which it never will cause it's a stream

heavy marsh
#

so remove await?

#

or use got.stream(...)

tranquil drum
tranquil drum
sonic lodge
#

what clef is that

tranquil drum
#

lol i mean you can make it whatever note you want just by changing the clef

pure mesa
#
const dbl = new DBL('my bot dbl token', { webhookPort: 5000, webhookAuth: 'My authorization' });
dbl.webhook.on('ready', hook => { 
console.log(`Webhook on`); 
}); 
dbl.webhook.on('vote', vote => { 
console.log(`User with ID ${vote.user} just voted!`); 
});```
#

help

#

this isn't working

tranquil drum
hasty lotus
#

hey guys, when trying to install canvas with

npm i canvas```
I've got this error :

canvas@2.6.1 install /home/paul/Téléchargements/it-hub-bot/node_modules/canvas
node-pre-gyp install --fallback-to-build

sh: 1: node-pre-gyp: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! canvas@2.6.1 install: node-pre-gyp install --fallback-to-build
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the canvas@2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.```I had it installed a few minutes ago, i just deleted the node_modules folders, and now it doesn't install anymore :/

lyric mountain
#

just deleted the node_modules
I cry

hasty lotus
#

x)

#

but if you have an idea how i could remove this error please ping me

lyric mountain
#

have you tried npm install?

hasty lotus
#

note : i don't have any issue reinstalling my other packages

hasty lotus
lyric mountain
#

try using yarn then

tranquil drum
#

try deleting package-lock.json as well

#

then npm i

lyric mountain
#

yeah, that too

hasty lotus
tranquil drum
#

weird

#

has anything else changed between being able to install it and now?

slender wagon
#
if (bot.user.presence.status === 'idle' 
``` i am trying to get my own bot status cuz i need it for a command but it doesn't seem to work.
the console log says the bot is offline but it isn't
#

this isn't V12

summer torrent
#

you have to enable intents

real quiver
#

Hello, I'm trying to revoke the OAuth2 token with Postman, but it gives me this error every time. But the content type is x-www-form-urlencoded and the token is correct. Could you help me please?

hasty lotus
#

and also

#

i had it installed on my vps

#

and when i tried to use it

#

it returned me this error

#
(node:10798) UnhandledPromiseRejectionWarning: Error: Server responded with 404
#

so, maybe the error comes from canvas ? Meybe they have a server issue and will be fixed in some times, I'll try later

tranquil drum
#

the package should be on npm unless the canvas package has some install script that uses their own servers

proven lantern
#

is it possible for my bot to get the ping lag for members in a voice channel?

summer torrent
#

no

proven lantern
#

shucks

summer torrent
#

it is not same for everyone by the way

proven lantern
#

i wanted to get it by member

polar glacier
#

its how long your internet takes too reach the server

#

you cant

summer torrent
#

it is not possible

polar glacier
#

@verbal sequoia i made it for you

proven lantern
#

that's what i thought. thanks @summer torrent

summer torrent
#

:+1:

amber badge
#

i have a bot with three commands. Could someone quick code in that only people with an ID can execute these commands?
you know?

proven lantern
#

it can be done

polar glacier
#

or anything other

amber badge
#

js

polar glacier
#

okay sound

summer torrent
#

just compare ids

polar glacier
#
let ids = ["406765477910544405"]
if(!ids.includes(message.author.id)) return;
proven lantern
#

are the people going to pass the ID as part of the command?

#

like a secret code

amber badge
#

well

#

canh i just send the code in?

#

that someone of you could take a look on it

polar glacier
#

send it and ill tweak it by what you want if you want

amber badge
#

here

proven lantern
#

danger

polar glacier
#

kk

summer torrent
#

use hastebin

#

No one wants to download your files

amber badge
#

oaky

#

yea

polar glacier
#

i downloaded it

#

ill have a look

#

which file is it in

amber badge
polar glacier
#

index.js

amber badge
#

that´s the index.js

#

yeah

polar glacier
#

sound

#

what do you want doing too it

amber badge
#

pls just, that all the commands: !add, !edit and !delete can just execute people with the roleID: 274660717305790465

summer torrent
#

just compare ids. No one will give you code

polar glacier
#

okay

#

do you want a message too show saying they cant or for it too ignore it

amber badge
#

pls say "You can´t execute that command"

summer torrent
#

@polar glacier don't spoonfeed mad

polar glacier
#

im bored

#

ive gotta do somot lmao

summer torrent
#

dont do it

#

It is against to rules

ancient nova
#

can I somehow make it to send as much as it can in one message and then send a new one if there's more guilds?

var count = 0;
<client>.guilds.cache.forEach(g=>message.channel.send(${++count}. ${g.name} - ${g.memberCount}))
rose nimbus
tranquil drum
quiet cosmos
#

not probably, will

tranquil drum
#

you should iterate and put them into an array or something

#

or use .map

tranquil drum
#

you'll probably need keyframes

rose nimbus
#

ok

rose nimbus
#

that's what I was really looking for

tranquil drum
#

inside discord?

rose nimbus
tranquil drum
#

you'll need css animations then

rose nimbus
#

it has nothing to do with animation

tranquil drum
#

you want a different pfp than what your bot has on discord?

rose nimbus
#

yea

sonic lodge
#

i don't think you can do that

rose nimbus
#

well then can you add animation to it?

sonic lodge
#

probably

tranquil drum
#

as long as the new profile pic also follows the rules on top.gg

rose nimbus
#

how would you go about that then

tranquil drum
#

you'll have to use css to hide the old pfp then add a new element for the new one

wicked sapphire
#

How do you customize the element on your bot's top.gg page?

rose nimbus
#

yea that's what im confused about

rustic nova
#

short documentation on how you can do it

rugged cobalt
#

If you're looping over a large array and you're doing things with each element, when you're finished with an element would it be smart to remove it from the array or is there any point

silent cloud
#

Hey guys

#

who can give a good guide on how to find and fix memory leaks on Discord.js code

silver lintel
#
const { channel } = message.member.voice;
        if (!channel) return message.channel.send('I\'m sorry but you need to be in a voice channel to play music!');
        const serverQueue = message.client.queue.get(message.guild.id);
        if (!serverQueue || serverQueue.songs.length === 0) return message.channel.send('There is nothing playing');
        serverQueue.songs.slice(1);
    if (serverQueue[0]) message.channel.send(new $().setDescription(`🎶 Now playing: **[${serverQueue.songs[0].title}](${serverQueue.songs[0].url})**`));
    else message.client.queue.delete(message.guild.id);
``` i have this skip command, but serverQueue just becomes undefinef
eternal osprey
#

pushing to heroku gives me this error:

#
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno 126
remote:        npm ERR! node-cron@2.0.3 postinstall: `opencollective-postinstall`
remote:        npm ERR! Exit status 126
remote:        npm ERR!
remote:        npm ERR! Failed at the node-cron@2.0.3 postinstall script.
remote:        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:```
#

how do i fix this?

sterile ridge
#

thanks for this

compact olive
#

@silver lintel evo ?

sterile ridge
compact olive
#

@sterile ridge how to gg role bot developer ?

sterile ridge
compact olive
#

how ok

#

thx

rustic nova
eternal osprey
#

anyone that knows the answer?

#

i would appreciate it

earnest phoenix
#

dont use shitty free hosting

#

ezpz

sterile ridge
eternal osprey
#

it has to do with opencollective

#

idk why

earnest phoenix
#

it cant run its post install script, it doesn't have permissions to because heroku restricts that

#

because heroku doesn't give you an actual server

earnest phoenix
eternal osprey
#

damn that's tuff

#

thanks for the help!

snow urchin
#

how can I cache all members with discord.js, so my bot isnt showing 12 users when there is over 100 thousand 😄

earnest phoenix
#

maybe reconsider that decision if you're using node

earnest phoenix
#

node is horrible with garbage management and your ram is going to explode

#

callum

snow urchin
#

Ye, I am aware, just need a proper guild and members cache because the new changes has my api showing all sort of numbers that are off, I need the true numbers lol

earnest phoenix
#

cant you use the new properties that got introduced with intents

#

idk if djs implements them

snow urchin
#

reee idk lol

#

you able to direct me to something that helps me out with these new properties?

earnest phoenix
#

yeah give me a sec

sharp rock
#

why my bot not a run

earnest phoenix
snow urchin
#

great

#

ty

sharp rock
#

I have coded it, but once in terminal I typed node . Bot not running

earnest phoenix
#

debug it 🤷‍♂️

misty sigil
#

can we see code.

umbral zealot
#

Or, alternatively, as I said last time you ask, take the logical first step of learning javascript before trying to write a bot.

misty sigil
#

and any errors

misty sigil
#

i cannot stress this enough

sharp rock
misty sigil
#

show it then

sharp rock
#

but, I won't give you a token

#

wait

misty sigil
#

i dont want your token.

sharp rock
silver lintel
#
const { channel } = message.member.voice;
        if (!channel) return message.channel.send('I\'m sorry but you need to be in a voice channel to play music!');
        const serverQueue = message.client.queue.get(message.guild.id);
        if (!serverQueue || serverQueue.songs.length === 0) return message.channel.send('There is nothing playing');
        serverQueue.songs.slice(1);
    if (serverQueue[0]) message.channel.send(new $().setDescription(`🎶 Now playing: **[${serverQueue.songs[0].title}](${serverQueue.songs[0].url})**`));
    else message.client.queue.delete(message.guild.id);
``` i have this skip command, but serverQueue just becomes undefinef
sharp rock
#

i first time use a visual studio code

earnest phoenix
#

you never login

old latch
#

you have to login

#

with your token

sharp rock
#

below it is a token

earnest phoenix
#

you tell your code
"hey create a bot, subscribe to this event, ok bye now"

old latch
woeful pike
#

discord bot devs be like alright guys I've never taken a biology class before but I'm gonna try to cure cancer now

umbral zealot
#

Guys they are smart enough to not show the token, because we said we don't want to see token. smh

old latch
#

bot.login('token')

old latch
#

did yo do that?

sharp rock
#

I've written it bot.login ('my token')

old latch
#

hmm k

sharp rock
#

where a bug?

silver lintel
#

theres a space, its supposed to be bot.login('token')

umbral zealot
#

The space isn't relevant.

#

Javascript doesn't give a single flying fuck about extra spaces in code 😄

hollow sedge
#

what does javascript care about 🤔

earnest phoenix
#

good question

umbral zealot
#

Proper order of things.

#

And, above everything else: capitalisation 😄

earnest phoenix
#

typescript ❤️

crimson crow
#

Hello, I want to ask a question

earnest phoenix
#

Bru

crimson crow
#

hi

earnest phoenix
#

Hey

crimson crow
#

sora can I have a question

wheat jolt
#

🤦

earnest phoenix
#

sometimes i wonder how people managed to create a bot

wheat jolt
#

lol

crimson crow
#

I've got a question

old latch
#

wow cool

umbral zealot
earnest phoenix
#

client.on('guildCreate', guild => {
let prefix = await db.get(prefix_${message.guild.id});
if(prefix === null) prefix = default_prefix;
const channel = guild.channels.cache.find(channel => channel.type === 'text' && channel.permissionsFor(guild.me).has('SEND_MESSAGES'))
const embedpro = new Discord.MessageEmbed()
.setTitle('Thanks For Adding Axira!')
.setDescription('Note : The Bot Is Still In Development So It May Have Bugs')
.addField(Current Prefix : \${prefix}`, Change It With `${prefix}setprefix`) .addField(To See List Of Commands Type : `${prefix}help``, 'Support Server : Join')
channel.send(embedpro)

})
I'm getting the error : await is only valid in async function
So I add async before guild and I get an error : message is not defined
Help I'm bad at js

wheat jolt
#

imagine having a question

#

wait I do have one

old latch
#
  let prefix = await db.get(prefix_${message.guild.id});
if(prefix === null) prefix = default_prefix;
const channel = guild.channels.cache.find(channel => channel.type === 'text' && channel.permissionsFor(guild.me).has('SEND_MESSAGES'))
const embedpro = new Discord.MessageEmbed()
.setTitle('Thanks For Adding Axira!')
.setDescription('Note : The Bot Is Still In Development So It May Have Bugs')
.addField(Current Prefix : \${prefix}`, Change It With `${prefix}setprefix`)
.addField(To See List Of Commands Type : `${prefix}help``, 'Support Server : [Join]()')
    channel.send(embedpro)

})```
umbral zealot
#

client.on('guildCreate', async guild => {

old latch
#

okay

#

looks better now

#

ah

#

yes lol

umbral zealot
#

Function must be async.

old latch
#

you have to async your function

#

it's basically what the error tells you but ok

earnest phoenix
#

I added async before guild and I got error : message is not defined

#

well a message can't appear out of thin air

umbral zealot
earnest phoenix
#

A

umbral zealot
#

Which clearly they don't.

real quiver
#

Hello, I'm trying to revoke the OAuth2 token with Postman, but it gives me this error every time. But the content type is x-www-form-urlencoded and the token is correct. Could you help me please?

wheat jolt
#

wait no

umbral zealot
#

I don't see any mention of message in this code though

#

must be somewhere else.

old latch
umbral zealot
#

oh wait. yes I See it

old latch
#

I guess

umbral zealot
#

yeah

#

or just

#

y'know

crimson crow
#

@umbral zealot how can I link voting using my own server's webhook ?

earnest phoenix
old latch
umbral zealot
old latch
#

this should help you

sharp rock
#

but i dont know in visual studio code

earnest phoenix
#

what does that matter

sharp rock
#

code for avatar display

#
// Create an event listener for messages
client.on('message', message => {
  // If the message is "what is my avatar"
  if (message.content === 'what is my avatar') {
    // Send the user's avatar URL
    message.reply(message.author.displayAvatarURL());
  }
});```
earnest phoenix
#

code is irrelevant to tools you're using

sharp rock
#

visual studio code is a editor code

hollow sedge
sharp rock
#

no hosting app

wheat jolt
#

lol

hollow sedge
#

Discord bots aren't web apps though

earnest phoenix
#

i need to stop helping people who use heroku because 9/10 they turn out to be morons lol

#

i wish more people had complicated and proper questions

hollow sedge
#

True

sharp rock
#

what code?

earnest phoenix
#

Hyperlink

#

Lol

sharp rock
#

yea

wheat jolt
#

no

hollow sedge
#

That's not even code

sharp rock
#

lul

hollow sedge
#

You just need to know the formatting

wheat jolt
#

or ()[]

earnest phoenix
#

Yeh

#

It's

sharp rock
#

oh i know

wheat jolt
#

well

hollow sedge
#

(link_text)[URL]

#

Hold up

wheat jolt
#

no

sharp rock
#

(click here)[URL]

hollow sedge
#

You're using Bot designer

wheat jolt
sharp rock
#

?

sharp rock
earnest phoenix
#

@hollow sedge isn't it reversed? I usually put in [Text](Link)

hollow sedge
#

big sigh

wheat jolt
hollow sedge
#

Maybe

earnest phoenix
#

Ah

#

I'm blind

sharp rock
#

I'm dizzy using Visual Studio Code

hollow sedge
#

I'm dumb

earnest phoenix
#

Bruh

wheat jolt
#

lol

sharp rock
#

lol

hollow sedge
#

Basic idea though

earnest phoenix
#

What do u use for hosting? Vps?

#

Lol

sharp rock
#

hmm wait

wheat jolt
#

he uses glitch

#

because vsc isn't a hosting app

sharp rock
#

yeah visual studio is a editor code

hollow sedge
#

VSC can still run your bot

earnest phoenix
#

Glitch is so bad

sharp rock
#

wait

earnest phoenix
sharp rock
#

a

earnest phoenix
#

It depends

hollow sedge
#

Also it's code editor not editor code

wheat jolt
#

text editor even better

earnest phoenix
hollow sedge
#

I mean for testing

earnest phoenix
#

vsc just runs a terminal process

copper cradle
#

I lost like 3 braincells just reading above holy fuck

earnest phoenix
#

it isn't anything special lol

hollow sedge
#

Yeah

copper cradle
#

glhf cry

sharp rock
#

why i type node . in terminal,bot is not running

earnest phoenix
#

Bruh

#

we told you about three times now to debug it

#

it's your code

copper cradle
#

I bet they're not even in the same folder as the bot

earnest phoenix
#

He probably didn't even download folder

#

Or open ita

wheat jolt
#

lol

#

anyone knows how I can make a link not disappear? if it leads to an image file?

fathom nymph
#

How do i disable something on quick.db?

earnest phoenix
#

Wdym? Like delete?

wheat jolt
earnest phoenix
#

what to both of these questions

fathom nymph
#

Like

#

!disable levels

#

Like that

wheat jolt
#

lol

hollow sedge
#

idk what that is

fathom nymph
#

Like disable ecobomy

earnest phoenix
#

-_-

hollow sedge
#

can you explain the wall of text

wheat jolt
#

No like the screenshot's url disappears

earnest phoenix
#

just send something alongside the url @earnest phoenix i.e. just a dot

#

discord automatically hides the link

wheat jolt
copper cradle
#

what are you even trying to show with that image

wheat jolt
#

It is just a random screenshot

#

ignore the contents

hollow sedge
#

i am confused on what you're trying to do but it looks like cry understands

earnest phoenix
#

Bru

copper cradle
#

alright imma head out now

earnest phoenix
#

@earnest phoenix u pinged wrong person

#

oh

#

my bad lol

#

Lmao

#

you both have white avys

copper cradle
#

tbh I would've done the same

wheat jolt
#

not always

earnest phoenix
#

because you sent that link before the change that hides it

#

so, yes always

#

i hate when people try to be smart

hollow sedge
#

why do people have their own sites just to store random images

hollow sedge
wheat jolt
#

Who cares

copper cradle
#

wrong place to ask

hollow sedge
#

lol the urls are hilarious

earnest phoenix
#

that url is in discord's cache

#

so

#

it won't hide it

#

images from links behave as embeds

#

if they're in cache, they're going to use old behaviour

wheat jolt
#

idk why I've put the arrow on the link

earnest phoenix
#

Bruh

#

Ok

#

I still didn't understand what u want

hollow sedge
#

same lol

wheat jolt
#

what causes a link to not disappear

#

maybe a header

#

idk

earnest phoenix
#

If u want to make it so it doesn't hide link just add a dot or some text

#

Next to it

#

you're either using client mods or you're not on desktop

hollow sedge
#

you mean like create an embed or not?

earnest phoenix
#

because it disappears from me

#

even from your CDN

wheat jolt
earnest phoenix
#

do you have embed permissions

wheat jolt
#

I do

earnest phoenix
#

Aight I'm confused

#

Bye

wheat jolt
#

👋

earnest phoenix
#

what is your end goal again

#

to make the url not disappear?

wheat jolt
wheat jolt
earnest phoenix
#

hm

#

send the url of the pic that's in the screenshot

#

but in ``

#

so i don't cache it

wheat jolt
#

wait

#

https://alex.is-bad.com/ATyckwu.png

umbral zealot
#

Man that's a lotta headers

sharp rock
#

aa

umbral zealot
#

But, I guess, #blamecloudflare

wheat jolt
#

lol

umbral zealot
#

Mine embed fine

earnest phoenix
#

it might be the amount of bytes

#

in the screenshot

umbral zealot
#

Nah I don't think so

wheat jolt
umbral zealot
#

unless it's the missing content-length

#

now that would be a good theory

wheat jolt
#

nope

earnest phoenix
#

both of them have content-length

wheat jolt
#

well whatever

#

it would be nice if Discord would let us prevent the link from hiding

earnest phoenix
#

if you want it to stay persistent

#

just send something alongside the url

#

a dot

#

or a zero width space

wheat jolt
#

that makes sense

umbral zealot
#

Oh got this entire time I was the one who misunderstood the question MarioFP

#

The one that was answered like 25 minutes ago lol

wheat jolt
#

well

wheat jolt
hollow sedge
#

why not

tight scaffold
prisma pilot
#

@tight scaffold what is that

tight scaffold
#

a cheat sheet for html stuff, used for bot description, etc

errant hornet
#

So the following code is suppose to check if anyone in the server gets a role updated but it only checks when the bot itself gets their roles updated. How would I make it so he can see when anyone gets a role change? (Yes, he can see a channel with everyone in the server.)

client.on('guildMemberUpdate', (oldMember, newMember) => {
    // If the role(s) are present on the old member object but no longer on the new one (i.e role(s) were removed)
    const removedRoles = oldMember.roles.cache.filter(role => !newMember.roles.cache.has(role.id));
    if (removedRoles.size > 0) console.log(`The roles ${removedRoles.map(r => r.name)} were removed from ${oldMember.displayName}.`);
    // If the role(s) are present on the new member object but are not on the old one (i.e role(s) were added)
    const addedRoles = newMember.roles.cache.filter(role => !oldMember.roles.cache.has(role.id));
    if (addedRoles.size > 0) console.log(`The roles ${addedRoles.map(r => r.name)} were added to ${oldMember.displayName}.`);
});```

Yes this is from discord.js docs.
sharp rock
#

aaaa i need help

#

how do i create an embed without a command handler?

umbral zealot
sharp rock
#

ok thx

errant hornet
#

not to anyone else

sharp rock
#

wait wait

umbral zealot
#

Then it means you don't have the MEMBER_UPDATE intents enabled, or requested when you define the bot.

errant hornet
#

The bot has every permission enabled.

umbral zealot
#

I didn't say permissions.

#

I said intents.

errant hornet
#

Ohhh let me check that rq

umbral zealot
errant hornet
#

Oh there we go.

#

Thank you.

umbral zealot
#

👍

outer perch
#

how do I fetch a certain guild with the ID

earnest phoenix
#

discord.js?

outer perch
#

yeah

sharp rock
#

hmm

sudden geyser
#

Use <Client>.guilds.cache.get(...)

limpid bear
#

how can i make a command that only people with the manager server permission can use

sudden geyser
#

What library are you using?

fierce ether
#

is there a way of checking if mongo db array.length = 2?

hollow sedge
#

you mean query for an array of length over 2?

#

@fierce ether

fierce ether
#

well, players react to a embed, adds to a queue in the db, if that db =2, i want to grab two players @hollow sedge

hollow sedge
#

just get the array then and check it in whatever language you're using

fierce ether
#

const queue1Config = await QueueConfig.findOneAndUpdate({guildId: reaction.message.guild.id}, {"$push": {"playerqueue": user}})

#

well that pushes them

#

how do i grab two users then?

hollow sedge
#

use Math.random()?

fierce ether
#

didnt know you could with db?

hollow sedge
#

im confused on what you're asking

fierce ether
#

can you give me the code to grab two users from playerqueue?

hollow sedge
#

I told you

#

Get the queue from MongoDB

#

Work with it in whatever language you're using

fierce ether
#

but how do u get it?

stark abyss
#
function getValues(nameKey, myArray, findValue){
  if(!myArray[0]) return;
  for (var i=0; i < myArray.length; i++) {
    if (myArray[i].id === nameKey) {
      return myArray[i].findValue
    }
  }
}```
#

it works if I actually do myArray[i].gold

hollow sedge
#

Use .findOne()

stark abyss
#

ohhh

#

dammit man been spending like 2 hours on this i suck at coding

hollow sedge
#

Wait what

#

I wasn't talking to you

stark abyss
#

oh

#

lmao

hollow sedge
#

Lol

stark abyss
#

anyway so how do I pass in parameter

#

return myArray[i].findValue
findValue is a parameter but it doesn't work unless i have the actual name there

hollow sedge
#

You just call the function .findValue(param)

#

A parameter or a method?

stark abyss
#

idek

hollow sedge
#

What even is myArray

stark abyss
#

an array with nested objects

hollow sedge
#

findValue is not a JS method

stark abyss
#

findValue is a parameter

hollow sedge
#

like a property?

#

Wdym by parameter

stark abyss
#

function's parameter?

hollow sedge
#

OH

#

I see

#

Ok so what is findValue

stark abyss
#
function getValues(nameKey, myArray, findValue){
  if(!myArray[0]) return;
  for (var i=0; i < myArray.length; i++) {
    if (myArray[i].id === nameKey) {
      return myArray[i].findValue
    }
  }
}
//lottery stats
[{"id":"249803675143241728","gold":"0","common":"0","uncommon":"0","sr"","ur":"2","raidpasses":"5","exp":"4","stamina":"2","rar:"0","ur":"0","raidpasses":"0","exp":"0","stamina":"0","rare":"0"}]
let value = "gold"
console.log(getValues(message.author.id, lotteryStats, value)
hollow sedge
#

Ok I see

stark abyss
#

so now if I do
return myArray[i].findValue ==> undefined return myArray[i].gold --> 0

hollow sedge
#

So instead of .

#

Just do [findValue]

stark abyss
#

oh

hollow sedge
#

Works like a dict instead of an object in that sense

#

Don't really know if that's the proper explanation

stark abyss
#

it worked

#

man I suck at coding PepeCryHands

hollow sedge
#

Nah

tribal vessel
#

lol

#

waiting for someone to ask for help because im bored

hollow sedge
#

Help me

tribal vessel
#

ey

hollow sedge
#

How do I make a machine learning script that gets better and better at making discord bots

tribal vessel
#

oh

#

Haru has left the chat

hollow sedge
#

:(

tribal vessel
#

im not that good lmaao

#

i usually just help people with simple bot problems

hollow sedge
#

Is this not simple

tribal vessel
#

no?

#

coding something to make it code something is not simple xd

hollow sedge
#

I thought you were good

#

Guess I was wrong

tribal vessel
#

xd

#

ye i suk

#

but enough to help

hollow sedge
#
import tensorflow
data = {}
tensorflow.makeDiscordBot(data)

Should be something like that

tribal vessel
#

tensorflow?

hollow sedge
#

TensorFlow was originally developed by researchers and engineers working on the Google Brain team within Google's Machine Intelligence Research organization

tribal vessel
#

nice

stable nimbus
#

I'm currently having issues with a return function, and I have no idea why when I put return; it doesn't return and stop doing what was requested. This is happening mainly in my blacklist check:

//Server Blacklist
        await botdb.queryPromise(`SELECT * FROM server WHERE serverid = ${message.guild.id}`).then(async function(results){
            if(results[0].delmessages === 1) { await message.delete().catch(() => {}); };
            if(results[0].blacklist === 1) {
                return await message.channel.send(`Hey <@${message.author.id}>! This server is blacklisted from using my commands! Visit my support server to get an appeal done! \nLink: `);
                return;
            }
            else {
                //
            };
            return;
        }).catch(console.error);
        //User Blacklist Check
         await botdb.queryPromise(`SELECT * FROM users WHERE userid = ${message.author.id}`).then(async function(results){
            if(results[0].delmessages === 1) { await message.delete().catch(() => {}); };
            if(results[0].blacklist === 1) {
                return await message.channel.send(`Hey <@${message.author.id}>! You're blacklisted from using my commands! Please visit my support server to get an appeal done!\nLink: `);
                return;
            }
            else {
                //
            };
        }).catch(console.error);

I added a return everywhere I could that wouldn't cause an error and even doubled down.

#

It continues to run a command, it does send both messages, but it doesn't stop anything from happening.

rocky hearth
#

What mongoose is for mongodb, is there anything similiar for firestore?

sick cloud
#

if i have a value between 0 and 1, such as 1, 0.863 or 0.4, how can i turn that into a % value in js
i don't do math

earnest phoenix
#

how do you still not know this

#

i literally remember this from a few months ago lol

sick cloud
#

¯_(ツ)_/¯

#

i dont use it enough to learn it

#

stuff doesn't stick in my head unless i use it a lot

earnest phoenix
#

neither do i but come on

#

that's common sense

#

even if you don't know there's still a ton of resources online for you to learn about it

sick cloud
#

fair enough then

near stratus
#

Can anyone tell me what's wrong

oak cliff
#

your bot is missing permissions to do what its trying to do

near stratus
#

It's just sending message

oak cliff
#

then it doesnt have permissions to send a message

near stratus
#

Ok I enforced unhandled promise and it was fixed

#

No errors but no message is being sent

rocky hearth
#

@sick cloud Just multiply it by 100

#

Fairly simple 5th standard maths.

rocky hearth
#

U need to send a message, that ur bot dont have permission to do the stuff

near stratus
rocky hearth
#

u can dm the user, or react a thumbs down

earnest phoenix
#

or just don't do anything at all if you're missing message perms

#

you save yourself a request

#

i mean you can do what curiousbasant said but you'd need to check for reaction perms and there's about a 50% chance a dm will fail

sick cloud
#

@rocky hearth kind of rude thanks, i didn't get taught it in school

rocky hearth
#

LOL, I dont mean that

near stratus
#

I just used a catch block and did nothing.
Not even consoled the error

earnest phoenix
#

you should maybe reconsider that

#

do i need to remind you of api bans

lusty quest
earnest phoenix
#

the person you gave the example to copypasted, -1+1 is there lol

lusty quest
#

yea ik

earnest phoenix
#

so it's really not a smart decision to ignore permission errors

#

a big weeb bot did that and got api banned within minutes of that change

lusty quest
#

api bans are annoying. got my bot locked out for 24 Hours bcs i reconnected automaticly if the Bot crashed, but without any delay and max attempts to reconnect. this where a Big mistake

magic vigil
#

my frnd sent me this
and i cant run it
can anyone help
?

marble juniper
#

I think

lusty quest
#

i know, but i solved it within my code. i just give PM2 a max amount of restarts.

magic vigil
lusty quest
#

i dont know py but it looks like now is defined twice

#

nvm datetime is not defined

near stratus
#

Can we add something similar to <hr> in embeds

#

I tried ~~- -~~ but it takes hell lot characters

#

All I want is something like this
- -

reef mantle
#

How to make a welcome code for a bot?

#

I mean what functions and stuff to use?

near stratus
#

I got it on StackOverFlow

lusty quest
slender thistle
# magic vigil

That hurts more than the time I rewrote my code written 2 years ago did

#
  1. Are you importing datetime itself it or from datetime import datetime?
  2. What's Fore?
  3. Can't you just use one print or format one big f-string?
magic vigil
#

idk my frnd sent me this code

pure mesa
lusty quest
#

@drowsy sentinel i guess the guy above is promoting his server

quaint peak
#

does anyone know python selenium here?

graceful dock
quaint peak
graceful dock
#

Yes?

quaint peak
#

extracting certain contents from current url

graceful dock
#

like a div?

quaint peak
#

uhh

#

one sec

graceful dock
#

like an html element

#

From the website

quaint peak
#

like that

#

i don't feel like typing again

idle furnace
#

Should i just try hosting it on my website? :/

graceful dock
quaint peak
#

ok

graceful dock
#

Oh wait

#

You're trying to retrieve content from the url itself

#

And not the html

#

You don't need selenium for that 🤔

#

It's just simple string manipulation

#

You can use regex for that @quaint peak

#

Or some libs that extracts the parameters from an url

quaint peak
old cliff
#

are let variables declared in a case statement also accessable in the next case statement ? cause I am getting an error that variable fields has already been defined.

pale vessel
#

no

old cliff
#

then why am I getting that error ?

pale vessel
#

let me test something