#development

1 messages · Page 658 of 1

gritty bolt
#

Im having an issue where I cant seem to send a request throw request.js to a site. I'm not sure how I'm supposed to catch the error either, can I have help please?

&format=json&from=EDT' + '&to=' + stuff+ '&time=' + stuff, function (error, response, body) {
console.log('body:', body);
      var jsondata = JSON.parse(body);
       var whatiwaslookingfor= new Date(jsondata.toTimestamp*1000)
       console.log(stuff)
       var hours = converteddate.getHours();
       var minutes = "0" + converteddate.getMinutes();
       var finishedproduct = hours + ':' + minutes.substr(-2);
        messagechannel.send(finishedproduct)
})}
module.exports.help = {
  name: "commandName"
}```
shy rose
#

whats the error it throws?

gritty bolt
#

I cant figurer out how to catch it

shy rose
#

whats it say in the console?

gritty bolt
#

So it throws ``` throw er; // Unhandled 'error' event
^

Error: socket hang up
at createHangUpError (_http_client.js:331:15)
at Socket.socketOnEnd (_http_client.js:423:23)
at emitNone (events.js:111:20)
at Socket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)```

shy rose
#

errors being useless as ever okeh

gritty bolt
#

I cant figure out how to catch and handle the error

#

So it doesnt display something useless like that

shy rose
#

at a guess put a try catch around the json.parse

#

also iirc request has an option for it to auto format the body to json

gritty bolt
#

the body comes as json

shy rose
#

yes so shouldnt have to parse an already json body

gritty bolt
#

well uh

shy rose
#

console.log(stuff) is that you covering btw?

#

assuming you hid the var names above then and not typo's then that code works

gritty bolt
#

weird

#

it just wont

#

yes

#

where stuff is

#

other random variables are that

#

i changed the name of

shy rose
#
request('http://api.timezonedb.com/v2.1/convert-time-zone?key=YEET&format=json&from=EDT&to=GMT', function (error, response, body) {
    var jsondata = JSON.parse(body);
    var converteddate= new Date(jsondata.toTimestamp*1000)
    console.log(converteddate)
    var hours = converteddate.getHours();
    var minutes = "0" + converteddate.getMinutes();
    var finishedproduct = hours + ':' + minutes.substr(-2);
    console.log(hours,minutes,finishedproduct)
    console.log(body);
});
amber fractal
#

is this

#

spoon feeling?

gritty bolt
#

it didnt work

#

and its almost the same code as mine lol

#

anyways though yeah if anyone knows how to fix my issue

#

Thatd be awesome

slim heart
#

did u use ur actual key

gritty bolt
#

yes

slim heart
#

did u console.log(error)

gritty bolt
#

hold on im trying one last thing

#

yes

#

yup same issue @slim heart

slim heart
#

did u console.log(error)

#

cuz i dont see it in ur code

gritty bolt
#

I added it

#

it doesnt pick up anything

#

I added it right below the request line

slim heart
#

can u use a normal node-fetch or something

#

to get a more acurate error message

gritty bolt
#

thats what I was using but it did the same thing

#

then this fixed it, then it did this

slim heart
#

what was the error

gritty bolt
#

It didnt show one,

#

It'd give me a socket hang error eventually

slim heart
#

that makes no sense

gritty bolt
#

posted it here a while ago and got told to switch to this

slim heart
#

u shouldnt get a socket hang up from node-fetch

gritty bolt
#

ill try it again

slim heart
#

not using request()

#

use node-fetch

inner jewel
#

socket hang up is a network error

#

it can happen with literally anything that uses the network

slim heart
#

oh i see

gritty bolt
#

Would I still be able to use my function from before so I dont have to rewrite it?

shy rose
#

that code sent above worked fine so its not that section of code being the issue

gritty bolt
#

well then what in the world is it then

slim heart
#

its a network issue apparently sbss

shy rose
#

^

gritty bolt
#

and how do I solve that

slim heart
#

get better internet

#

or internet at all

gritty bolt
#

this is running

#

in an aws warehouse lol

#

id hope it'd be connected to the internet

shy rose
#

oh actually are you on vultr?

gritty bolt
#

no im on ec2

shy rose
#

either way check out that thread its relevant your exact issue

the linked comment was one method

gritty bolt
#

t2.nano on a lunix

#

Cool

shy rose
#

k thats should be fine then

gritty bolt
#

Alright thanks guys

shy rose
#

ik vultr has some screwup somtimes on the default dns

gritty bolt
#

I also used to use that

#

Did the same thing

shy rose
#
http.get({
  hostname: 'localhost',
  port: 80,
  path: '/',
}, (res) => {
  // Do stuff with response
});
gritty bolt
#

And everyone here yelled at me lol

#

because request is supposed to be easier

shy rose
#

from cli can you ping the timezone domain from the machine?

#

maybe its just me prefering native cause it started getting stupid the amount of dep updating had to do so started converting everything to native

gritty bolt
#

and the timezone domain I can get from here

shy rose
#

but ping from the vm?

gritty bolt
#

not sure how I do it from the ubuntu machine

#

im still kinda getting used to it

shy rose
#

ping api.timezonedb.com

gritty bolt
#

oh its literally just ping?

shy rose
#

yeah 🙃

gritty bolt
#

30 ms

shy rose
#

so its replying at least

gritty bolt
#

yeah, but I dont know why its getting hung up now

shy rose
#

see if the url
https://crossorigin.me/http://api.timezonedb.com/v2.1/convert-time-zone?key=YEET&format=json&from=EDT&to=GMT
works

gritty bolt
#

with my own key of course

shy rose
#

cross origin should "middleman" the request

#

assuming that works then uh your getting into an odd one

#

it just adds CORS headers onto reqs

gritty bolt
#

unknown host when I ping their sample request

shy rose
#

ping the url above or what do you mean by sample?

gritty bolt
#

tried pinging both yours and the sample request they provide on their website

#

both returned unknown

shy rose
#

oh ok unknown host is better than socket drop

gritty bolt
#

but it still means it cant find the host

shy rose
#

can you ping google still?

gritty bolt
#

yup

#

17ms

#

steady

shy rose
#

weird

gritty bolt
#

hmm

shy rose
#

ok i found somthing
whats your current network setting

#

the aws ec2 network setting

#

it might be blocking some outbound rules

gritty bolt
#

my VPC?

shy rose
#

its around the vpc its been a while since looked at that area

#

iirc its in the side panel of the ec2 page

#

network rule groups or somthing

gritty bolt
#

inbound rules

#

dont allow anything but my ip

#

but then why cant my regular pc's version of this code run it?

shy rose
#

outbound should allow all

gritty bolt
#

mhm

shy rose
#

wait what you get domain not found on your local as well ;-;

gritty bolt
#

yup

#

it socket hung on the local

shy rose
#

but the ping works?

gritty bolt
#

yes

shy rose
gritty bolt
#

ping will ping the api gateway

#

and google

#

etc

#

but it cant find the exact url and my pc gets socket hung

#

its a headache and im pretty bad at this sort of stuff tbh im still learning it

shy rose
#

can you run the get in its own file to test it?

#

like isolate your bot out of the picture

#

jsut to test

gritty bolt
#

worked on my regular machine

#

so itll work on the other

#

its something in the bot then thats getting it hung up

#

@shy rose

shy rose
#

aye

#

guessing the messagechannel.send(finishedproduct) as thats the only line that interacts with the bot

gritty bolt
#

@shy rose it wont even print my url to the console

shy rose
#

?

#

context?

gritty bolt
#

I did a console.log(insert the url with the varibles here);

#

and it did absolutely nothing

#

It stopped after logging the unix its cinverting

#

converting*

shy rose
#

then threw its error?

gritty bolt
#

no

#

its before that

#

or well

#

it doesnt do that and then a few seconds after throws the error

shy rose
#

so the console logs print

then a few seconds later it errors?

gritty bolt
#

it logs the final unix

#

then stops

#

and then throws the error

#

a few seconds later

shy rose
#

the final unix is the last console log you have in the callback right?

gritty bolt
#

then I have a new variable with the url

shy rose
#

how bout screen cap the relevant code and draw a line where it stops

gritty bolt
shy rose
#

that to should have an equal after it

#

also whats clipped off the end?

gritty bolt
#

sorry we're having a likle

#

error epidemic here

#

this has been happening for the past 45 minutes

shy rose
#

that looks legal :/

#

as for url you need the = after the to

gritty bolt
#

why?

shy rose
#

&to=

gritty bolt
#

yeah theres an = after the to

shy rose
#

not in scrn cap above

gritty bolt
#

oh

#

thats the log one

shy rose
#

ah

gritty bolt
#

so thank goodness lol

shy rose
#

thats really odd

gritty bolt
#

ikr

shy rose
#

the latency would imply it made it past that line and the error was from a request resolving

gritty bolt
#

just to make sure

#

heres the error

#

one last time

shy rose
#

try wrapping that in a try catch and logging e

#

if didnt do that before

gritty bolt
#

wait

#

I might be wrapping the .catch wrong

#

thats something I do a lot

shy rose
#

.catch is on promise

gritty bolt
#
      throw er; // Unhandled 'error' event
      ^

Error: socket hang up
    at createHangUpError (_http_client.js:331:15)
    at Socket.socketOnEnd (_http_client.js:423:23)
    at emitNone (events.js:111:20)
    at Socket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
[nodemon] app crashed - waiting for file changes before starting...





#

wait but where would I wrap it, around the request?

shy rose
#

can you send your code as is again not changing the var names

#

or dm if youd rather keep the completed thing private

gritty bolt
#

@earnest phoenix could you send your code

#

have you tried using message.guild

#

is how I do it

#

hmm

#

what do you use to define the message sent?

#

ok

#

ohhhhhhhhhh

#

you're in python

#

sorry 😛

sick cloud
#

anybody know an api that can suggest the main colour used in an image?

earnest phoenix
#

wat

frank dust
earnest phoenix
#

Quick question, do you NEED to add cooldowns to commands?

inner jewel
#

no

earnest phoenix
#

really suggested to do so though

#

But like people in my discord like to use a lot of commands at once

#

In different channels

#

Should I worry about this?

inner jewel
#

no need

earnest phoenix
#

Alright thanks a lot

inner jewel
#

unless you want to force them to add a delay

earnest phoenix
#

Ah alright

abstract crow
#

What do you guys use for making a Discord Music Bot in Javascript?

amber fractal
#

opusscript

#

dont use garbagelink

abstract crow
#

Yeah but I mean like ytdl-core, or etc

amber fractal
#

oh ye ytdl-core pretty good

abstract crow
#

I heard though that you can only make searches via a URL?

amber fractal
#

you can use keywords too

abstract crow
#

Is that what most bots use?

#

Also I heard it didn't give the names and stuff of the song which was odd but idk

amber fractal
#

idk where you're getting this info from

#

I need to fix my cmd 1 sec

inner jewel
#

i'd use andesite if i ever made a bot in js

amber fractal
#

finally got it working

#

havent done music in forever

#

it gives a bunch of stuff with the video

#

I can give you an example of what it returns

sick cloud
#

ytdl-core has .getInfo(id)

scenic vapor
#

Heyo, anyone here that knows some about web development/passport-discord or passport in general? Thanks!

broken shale
#

@twilit rapids For ufw, what should 22/tcp be allowed from? (everywhere or my ip only)

maiden mauve
#

anyone got some heroku quick trouble shoots?

#

I appear to have deployed my project correctly

#

but it's saying it can't load anything from a folder "commands"

#

yet the heroku server has the folder and files

sick cloud
#

@scenic vapor what do you need?

scenic vapor
#

@sick cloud hey! I wanted to incorporate a way so that I don't have to keep authenticating everytime on login. I'm not sure how to approach it

sick cloud
#

what are you using to store the logged in user?

scenic vapor
#

I think it's currently session based

sick cloud
#

if you're using something like express and express-session, choose a store that isn't in-memory and set the expiry to 1 week

scenic vapor
#

Yeah I'm using express-session

sick cloud
#

alright hold up a second

#

do you use a database of sorts?

shy rose
#

make sure youve got a db backend

scenic vapor
#

how do I make sure the user is logged in?

sick cloud
#

depends on what you're using

#

as in, if you're sending it to the front end

#

i set my res.locals.user as the session

scenic vapor
#

Hm okay

#

That stores it on the clients side?

shy rose
amber fractal
#

couldnt you use local storage?

shy rose
#

yes but no

scenic vapor
#

It does give a demo and even a example but I don't think it works as not re-authenticating

shy rose
#

you can get them to keep a session token but wouldnt wouldnt want them holding the main body you would want a db for that

#

you only re authenticate once the session has expired

scenic vapor
#

yeah but a part in /login or whatever you have has to be set to make sure to send you to the callback not discord auth

#

that's the part I'm strugglin with

shy rose
#

this occurs when you decide to dump the main body from your db BUT you must hold onto the refresh token such that next time you can reauth without needing to make them go through the screen

scenic vapor
#

for some reason it keeps messing up although it should work

shy rose
#

you need to go through discord auth the first time in order to get the auth token

#

then future assuming you hold the session token and the refresh token then you can reconnect/refresh via that token

scenic vapor
#

Hmm okay

shy rose
#

the refresh is just so you dont need to store all the session data forever

after x amount of time eg a day or a week you can dump the bulk of the session data just holding onto users login session token and the refresh (that you got from the auth)

scenic vapor
#

and I'd do that in the back end?

shy rose
#

yup

#

all the user ever gets is a cookie with a session id

scenic vapor
#

I need to get back to my laptop to see the code again

#

On the GItHub, this is shown:

var DiscordStrategy = require('passport-discord').Strategy;
 
passport.use(new DiscordStrategy({
    clientID: 'id',
    clientSecret: 'secret',
    callbackURL: 'callbackURL'
},
function(accessToken, refreshToken, profile, cb) {
    if (err)
        return done(err);
 
    User.findOrCreate({ discordId: profile.id }, function(err, user) {
        return cb(err, user);
    });
}));

Is User.findOrCreate supposed to be the DB?

shy rose
#

only just realized what that was now tbh confused me months back

its its mongoose which is mongodb

#

you dont have to use mongo

scenic vapor
#

I usually use mongo

#

just wanted to make sure

#

Thank you

#

😃

shy rose
#

wish they made that clearer cause it really stumped me when i first was trying to use it

#

at the time had never used mongoose use it almost daily now

scenic vapor
#

ohhh rip lol

#

mongoose can be odd

#

my wifi is terrible jesus christ

#

hotel wifi trash spits

shy rose
#

mongoose takes some adjusting to for sure

scenic vapor
#

yeahh

#

Did you need to make models for this?

#

like a User's Model to go off?

#

discord send messages please?

#

that took a while

#

@shy rose I know this is far-fetched but would you mind talking in DM's and helping me with my code?

shy rose
#

i at the time went wtf is this is just used mysql

#

but yeah sure

scenic vapor
#

Thanks!

inner jewel
#

because embed.setFooter(Page${page} of Pages ${pages.length}) isn't valid js

#

also user.id = message.author.id; and user.od = message.author.id; are both wrong

stray garnet
#

Ok

pale marsh
#

Anyone got experience with PyQT here?

steady canopy
#

A tiny bit @pale marsh

#

What are you attempting to do?

pale marsh
#

@steady canopy just trying to decide whether to use pyqt4 or 5

#

Pros and cons, etc

steady canopy
#

Well 4 is no longer supported

#

So 5 would probably be the best option.

pale marsh
#

Alright sounds fair

steady canopy
#

Yeah, no new releases will be made and it's strongly recommended to use PyQT5 for all new development.

pale marsh
#

What worries me is that there's tons of articles on 4. Way more than 5

steady canopy
#

If you give it a bit of time, I'm sure 5 will catch up. But yeah, that tends to be the issue with newer releases. I remember when it was hard finding information on python3

pale marsh
#

Sounds fair

earnest phoenix
spare goblet
#

@earnest phoenix Just do permissions.has

earnest phoenix
#

Can you show me e.g ?

spare goblet
#

@earnest phoenix
<GuildMember>.permissions.has("READ_MESSAGES")

#

for example

earnest phoenix
#

uh

#

thanks xd

spare goblet
#

Np

robust quiver
#

Hello everyone i need help... Can someone help me ?

earnest phoenix
#

what problem?

robust quiver
#

I'm searching for a bot when someone tag me in my server he will send this message...
Sorry {@person who tagged me and his ID } @OMAR (ID:546674009077710868) is not available at the moment i will send him your message and he will answer as soon as possible

earnest phoenix
#

hm

halcyon nymph
#

@robust quiver that’s pretty easy to code in discord.py

earnest phoenix
#

@robust quiver py or js ?

robust quiver
#

@earnest phoenix what's that mean

earnest phoenix
#

JavaScript or python ?

robust quiver
#

I'm actually new on discord

earnest phoenix
#

hm

#

that's ok

robust quiver
#

I want to learn how to code but i don't know anyone to help me

earnest phoenix
#

I suppose i can help

robust quiver
#

Ow really ??

halcyon nymph
#

@robust quiver do you know python?

robust quiver
#

Nah

earnest phoenix
#

hello, can someone help me with a code? I want to make an order to have permission only the owner of the server, that is, if I go to several servers, only the owner has access, that is to move access, I think you understand what I mean

halcyon nymph
#

Because you need some basic programming knowledge to code a bot

earnest phoenix
#

Yes, do you expect me not knowing how to help, though saying this

#

@robust quiver Which programming language are you planning to use? And how much of it do you know?

halcyon nymph
#

@robust quiver id recommend learning python, it’s very beginners friendly

earnest phoenix
#

Or Ruby

halcyon nymph
#

And it has a good api for what you want

earnest phoenix
#

Ruby's even simpler

robust quiver
#

I just use turbo pascal and i think it doesn't help in that case @earnest phoenix

onyx summit
#

Python has a good api? blobconfused

halcyon nymph
#

@onyx summit it’s alright

robust quiver
#

@earnest phoenix can you invite me to discord js ?

onyx summit
#

@halcyon nymph what do you mean with that?

mossy vine
#

honestly, what language you use completely depends on your use case and preference

earnest phoenix
halcyon nymph
#

@onyx summit as In I like it

onyx summit
#

@halcyon nymph what fucking python api are you talking bout?

earnest phoenix
#

an example: .say (message), I do not want all members to be able, just the owner. The one who has the crown, the one who made the server, I think you understand

halcyon nymph
onyx summit
#

It's not an API lmao

#

@earnest phoenix yes, guilds have owners, but you still didn't mention what language and library

halcyon nymph
#

Well yeah, but the discord api for python I meant

earnest phoenix
#

@earnest phoenix
Romanian

#

-_-?

#

JS

robust quiver
#

I'm a little bit confusing right now take it easy guys xD

onyx summit
#

guild.owner is a thing

#

I think the user object, dunno tho

mossy vine
#

guild.owner is a User object

robust quiver
#

Okey guys forget about the id

earnest phoenix
#

so someone can help me?

robust quiver
#

Focus about the message without ID

onyx summit
#

Yes, we just told you to use guild.owner

halcyon nymph
#

@robust quiver You can pick literally any programming language, what you want is pretty easy to do

earnest phoenix
#

they meant programming language

onyx summit
#

You can read?

robust quiver
#

Sorry {@person who tagged me} @OMAR is not available at the moment i will send him your message and he will answer as soon as possible

onyx summit
#

Cool, got it

earnest phoenix
#

I do not want to put an id, and only that person has permission, if the robot is made public, I want every owner to have

#

Write that bot

#

?

robust quiver
#

Can i make it with pascal ?

halcyon nymph
#

@robust quiver have you created a bot account yet?

robust quiver
#

@halcyon nymph not yet

halcyon nymph
#

Do you know how?

earnest phoenix
#

No, OMAR, you can't

robust quiver
#

Guys please i don't know what are you talking about

#

I don't know anything bro 😂

#

I said i'm a new user on discord !

earnest phoenix
#

Can anyone help me

#

Please

#

yes

onyx summit
#

Ask the fucking question

earnest phoenix
#

@robust quiver maybe use botghost, idk

#

Who has database autrole command?

#

??

#

I need help

#

Why would you ping me?

mossy vine
#

noone will spoonfeed you

halcyon nymph
#

@robust quiver you could use DBM (discord bot maker)

onyx summit
#

No, you ask for spoonfeed

earnest phoenix
#

I don't want spoonfeed

#

I need help

#

@earnest phoenix
can you help me in private?

#

Who knows

#

I get error

#

Ty

mossy vine
#

your code has an error

earnest phoenix
#

Ja

#

I can't save it to db

#

Wait lemme send the code

#
const Discord = require('discord.js')
const db = require('quick.db');

exports.run = async (client, message, args) => {
     if (args[0] == 'close') {
      db.delete(`otorol_${message.guild.id}`)
      message.channel.send('Successfully Closed!')
  
let role = message.mentions.roles.first();
if(!role) return message.channel.send('You must specify a role :x: !')
       
db.set(`otorol_${message.guild.id}`, role)
       message.channel.send(`New server autorole is: <@${role.id}>`)
     }
  };
    
exports.conf = {
    enabled: true,
    guildOnly: true,
    aliases: ['auto-role'],
    permLevel: 0
};

exports.help = {
    name: 'autorole',
    description: 'Sets the autorole.',
    usage: 'autorole <@role>'
};
#

Where is the error

onyx summit
#

Do I look like an interpreter?

earnest phoenix
#

hmm

#

U look like toxic

#

wtf

onyx summit
#

No, I'm just annoyed

earnest phoenix
#

Ok be annoyed then

#

idc

onyx summit
#

Same

earnest phoenix
#

do you want help or not

#

I want help

#

I can help too though

#

ok np

#

i found the ereror

#

nvm i'm just retarded

onyx summit
#

I think I found it

#

You are saving role

#

I doubt that sqlite is able to save a complex object with functions

#

At least I never seen something like dat

earnest phoenix
#

It is quick.db, it only saves strings and numbers afaik

#

xD

#

I need to find a new autorole

#

command

onyx summit
#

Good luck with that if you are unable to modify the current code

earnest phoenix
#

Oh, wait, i forgot, quick.db can save objects

onyx summit
#

Yes, but not that

earnest phoenix
#

I missed autorole.json thing

#

But it messed up too

#

quick.db is hard for me

#

I can not understand easily

onyx summit
earnest phoenix
#

I still have a question, how can I make multiple files in a single project? I use glitch

onyx summit
#

But quick.db is not able to store a role, it uses JSON.stringify, and that destroys functions, as well as circular references

#

idk but on glitch you just create a new file?

earnest phoenix
#

I want to create more, I do not want everything in server.js, because after it's too full

#

each command has its file

onyx summit
#

you can easily use module.exports

earnest phoenix
#

make simple, with new, or I have to do in server.js one thing, let's say that in file X is that command

onyx summit
earnest phoenix
#

hi

#

I have a question

#

Array

wheat jolt
#

db.get('nots[0]')

#

Instead

#

If you wanna get an value

#

Element**

earnest phoenix
#

null :/

wheat jolt
#

Then the array is empty

earnest phoenix
#

let veri = { not: not, sahip: message.author.username };
await db.push(`nots.${msg.author.id}`, veri)

#

this false?

wheat jolt
#

Try to use db.set instead

#

So you won't get your json in an array element

earnest phoenix
#

ok

warm marsh
#

So I've got a quick question, Using pm2 is there a way to stop it watching sqlite-journal?

quartz kindle
#

--ignore-watch

#

Iirc

warm marsh
#

I've tried that but when I set something in sqlite it restarts.

quartz kindle
#

How did you set it?

#

You can also try using the pm2 environment file

#

You can set an ignore watch array in there

warm marsh
#

Yeah, But there doesn't actually seem to be a file called sqlite-journal anywhere

#

I guess once I've finished coding will disable watch so doesn't restart constantly.

quartz kindle
#

Journal files are only there while sqlite is running

#

After the connection is closed, it should be merged with the db and deleted afaik

warm marsh
#

Alright, Thanks!

copper crystal
#

Is it possible for a bot to verify whether an invite link is permanent?

earnest phoenix
#

yes

stray garnet
#

exports.run = (client, message, args, tools) => {
    
    const pages = ['Page1', 'Page2'];
    // Use const
    let page = 1;
    
    // It's common practice to tab over newlined properties.
    const embed = new Discord.RichEmbed()
        .setColor("RED")
        .setFooter(`Page ${page} of ${pages.length}`)
        .setDescription(pages[page-1]);
        // Last property should end with a semicolon (;)
    
    message.channel.send(embed).then (msg => {
        
        msg.react("◀").then(r => {
            msg.react("▶")
            
            // Emoji.name isn't going to be the ("⏩") but whatever the emoji is actually called.
            // Also, that emoji isn't built into discord, so use ▶ and ◀.
            const backwardsFilter = (reaction, user) => reaction.emoji.name === 'arrow_left' && user.id === message.author.id;
            const forwardsFilter = (reaction, user) => reaction.emoji.name  === 'arrow_right' && user.id === message.author.id;
            
            const backwards = msg.createReactionCollector(backwardsFilter ({ time: 6000 }));                                  
            const forwards = msg.createReactionCollector(forwardsFilter ({ time : 6000 }));
            
            backwards.on('collect', r => {
                if (page === 1) return;
                page--;
                embed.setDescription(pages[page-1]);
                embed.setFooter(`Page ${page} of ${pages.length}`);
                msg.edit(embed);
            });
            
            forwards.on('collect', r => {
                if (page === 1) return;
                page++;
                embed.setDescription(pages[page-1]);
                embed.setFooter(`Page ${page} of ${pages.length}`);
                msg.edit(embed);
            });
        });
    });
}

module.exports.help = {
    name: "testembed",
    aliases: []
}```


the pages dont change
copper crystal
#

Do you know how? @earnest phoenix

earnest phoenix
#

which library

copper crystal
#

discord.js

earnest phoenix
#

it returns an Invite object, check for expiresAt

#

i don't know how it's returned in d.js specifically

#

nevermind there's a temporary property

broken shale
#

anyone use ubuntu servers here

mossy vine
#

i do

late hill
#

@stray garnet 2 mistakes:

  • You're supposed to pass your filter and the additional options (time in your case) to the ReactionCollector like this createReactionCollector(filter, options) You're currently executing your filter and passing the options to the filter, which is not what you're looking for
  • You've initialized page as 1 and both of your collect events will do nothing if the page is 1
broken shale
#

Do you know how to configure the ufw firewall @woven sundial

#

Well I configured it just a bit not sure if I did it right

#

ssh

late hill
#

I'd also highly suggest not naming the bots reply msg as that's very similar to the users message which you called message.
You could just name it reply or something, would be easier for yourself and people reviewing your code to see the difference.
@stray garnet IrisWink

stray garnet
#

@late hill Ok thx

late hill
broken shale
#

so? @woven sundial

#

is the whitelisted ip the public ip or ipv4 one from console @woven sundial

#

I meant that

#

Is the IP my public one or the one I grab from console using ipconfig

#

oh ok

#

Thanks

nocturne hazel
west spoke
#

Its literally a json.

#

Convert it into a json string and parse it

wheat jolt
#

JSON.parse(data)

west spoke
#

^

#

And for py: list(result)

wheat jolt
#

Yup

cursive dagger
#

@west spoke 'No,

import json
obj = json.loads(string)
west spoke
#

I use list()

#

And it works fine...?

earnest phoenix
#

will closing the MongoClient after the message event breaks the connection? I am using Node.js MongoDB.

topaz fjord
#

yes

earnest phoenix
#

May i ask, which C websocket library is considered the best?

#

Hey guys, just wondering if theirs a line of code for python to delete all messages in a specific channel automatically that don't contain an image?

sick cloud
#

you can't delete all messages in any library

#

just fetch the last 100 or so, filter by contains image or something and delete each

earnest phoenix
#

Oh yes I know, but like auto delete as they get posted

sick cloud
#

listen to the message event then?

earnest phoenix
#

It's for a community server I'm in, theirs image only channels (well we want them to be) but people always try add text there

halcyon nymph
#

How do you get previous messages in python?

#

for a server/channel

nocturne hazel
#

Alright, the command for this is working fine, but after the command is run it is returning an Unknown message error

#

Here is the code:

#
if(!message.member.hasPermission('MANAGE_MESSAGES') && !this.client.isOwner(message.author)) return message.reply('You must be at Moderator to use this command!')
if(!message.guild.me.hasPermission('MANAGE_MESSAGES')) return message.reply('**I don\'t have permission to use this command! Please give me the `MANAGE_MESSAGES` permission!**')


if(!args) return message.channel.send('Please specify the number of messages to delete.');
if(isNaN(args)) return message.channel.send(`**${message.author}, Please specify the number of messages you want to delete as a number.**`)
    message.delete();
message.channel.bulkDelete(args)
    .then(messages =>message.channel.send(`**${message.author}, Deleted \`${messages.size}\` messages!**`)).then(msg => msg.delete(2000));
#

How is the ?purge command an unkown message

#

:/

woven zealot
#

I would like to point you to the point in your code when you do message.delete() and then try and access it afterwards.

nocturne hazel
#

Ah

#

But if message.delete() is not included, the amount of messages to delete specified in the arguments would be incorrect

sick cloud
#

node-gyp is installed yet it errors

nocturne hazel
#

So where should the message.delete() go, or should I just remove it altogether?

swift topaz
#

I don't know what's wrong because, I don't get error messages in the console but it doesn't output in the channel

        const infoembed = new Discord.RichEmbed()
        .setTitle('Jigglypuff')
        .setColor(0xfca2dd)
        .setThumbnail(bot.user.avatarURL)
        .addField('Description', 'A music bot.')
        msg.channel.send(infoembed);
    break;```
nocturne hazel
#

Is this javascript?

swift topaz
#

yep

nocturne hazel
#

Ok

#

Why do you have the case: 'info' and the break;

sick cloud
#

because that's switch/case

#

it's an alternative to if/else

nocturne hazel
#

Ahh

swift topaz
#

yes I put it in a switch case

#

my other bot works

#

that above bot's case 'greet' works but 'info' doesn't

nocturne hazel
#

For your message event, are you using:

client.on('message', message => {
//code here
});
//OR
client.on('message', msg => {
//code here
});
swift topaz
#

yeah it's bot.on because const bot = new Discord.Client();

nocturne hazel
#

oh yeah

#

maybe try changing your colour to a hex value inside a string?

#

e.g #00FFFF (Aqua)

halcyon nymph
#

@swift topaz you need a ; at the end of your last add field

swift topaz
#

oh it works now. thanks!

halcyon nymph
#

Ok

swift topaz
#

it's actually weird

#

because my other bot doesn't need its .setColor to be string, nor the last field to have a semi-colon

nocturne hazel
#

Best to put it as a string tho

woven zealot
#

Sorry I just got back to this,

halcyon nymph
#

I know python doesn’t recquire a string

swift topaz
#
 case 'help':
            const embedcommands = new RichEmbed()
            .setTitle("*Bot Commands*")
            .setColor(0xf00000)
            .setThumbnail(bot.user.avatarURL)
            .addField('About', '`about` or `ab`')
            .addField('Info', '`info` or `in`')
            .addField('Officers', '`officers` **|** Type: `a!help officers` for more info.')
            .addField('Bot Information', '`botinfo`')
            .addField('Clear Message History', '`delete <number of lines to delete>` **|** Requires certain roles to use this command.')
            .addField('Note', '`note <phrase or sentence>`')
            msg.channel.send(embedcommands);

this is my other bot's

woven zealot
#

The secret is

swift topaz
#

the hex color isn't string and the last field doesn't have semi colon

woven zealot
#

bulkDelete(args + 1)

nocturne hazel
#

You should really try to make a command handler

#

It will make your bot faster, and you won't have a several thousand line index.js file

#

Starts to get annoying to edit code with so many lines :/

#

IDE's stuff up and crap

swift topaz
#

i removed the ' ' from the hex and it worked fine now since it has two fields now

#

command handler how? functions?

halcyon nymph
#

@swift topaz (I’m not a js programmer), but couldn’t you save the embed as a constant and then whenever someone uses the help command send them the embed rather than creating a new one from scratch

swift topaz
#

ohhhh you're right I'll do that thanks!

earnest phoenix
#

Hey guys, can you let me know what I'm doing wrong?

if (message.channel = "X") if message.content.attachments > 0: message.delete()

#

I want it so if the message in the channel was sent and it's text and not an image to be deleted

nocturne hazel
#

aight

#

Quite a few things wrong with this code.

#

First of all, if you're comparing with a string use === and not =

earnest phoenix
#

I think I was referencing code that potentially is older than rewrite

#

In addition to that I'm still finding my grounds and learning

nocturne hazel
#

And whether or the content of a message is not determined by a number

#

That's a boolean

sick cloud
#

checking .channel will give you a false always because it's an object/class

nocturne hazel
#

Instead, find the channel

sick cloud
#

why not check the id

nocturne hazel
#
let i = message.guild.channels.find(ch => ch.name === "x")
if(message.channel === i){
}
#

you can do that as well

sick cloud
#

channel.id === '272764566411149314'

nocturne hazel
#

wait a minute

sick cloud
#

far easier and less resource intensive

nocturne hazel
#

no you would have to get the channel

earnest phoenix
#

Yes I can do the ID I use X as a fill

nocturne hazel
#

A channels name can't include a capital letter

sick cloud
#

what's your point

nocturne hazel
#

just saying

sick cloud
#
if (message.channel.id === '272764566411149314' && message.attachments.size >= 1) message.delete();```
condensed into one line, fixed and nice :^)
earnest phoenix
#

Thankyou alot for that, I'll give that a go

When looking at attachments you added size? Is that so if it has an attachment of any size to keep and if not to delete?

nocturne hazel
#

no...

sick cloud
#

no, that's to see if the amount of attachments is >=

#

greater than or equal to 1

nocturne hazel
#

^

earnest phoenix
#

Oh I see, I'm doing the opposite haha

sick cloud
#

attachments is a collection and collections have a size

#

just like arrays have a length

earnest phoenix
#

If attachment, keep, if not attachment, delete

nocturne hazel
#

The devs of discord.js could easily make that so instead of comparing with a number it can be with a boolean - like detecting if the message includes an attachment.
Or is that already a thing and I haven't seen it on the docs somehow

sick cloud
#

but that's just a useless addition

nocturne hazel
#

xd

sick cloud
#

why have something like hasAttachments when you can literally just check the size..

earnest phoenix
#

Did I mention I am using python? 😂

#

And not js

nocturne hazel
#

what

sick cloud
#

maybe you should of said that

earnest phoenix
#

I apologize 😂

#

I thought I did

nocturne hazel
#

the code doesn't look very different to js code xd

sick cloud
#
if channel.id == 272764566411149314:
    if somethingtocheckforattachments == True:
        delete()

i don't use discord.py or know much about it

#

but that should work i guess lol

nocturne hazel
#

xd

#

the only python i have every done is like hello world really

#

Is it just my bot or does .playOpusStream sound like it is being played at 10 million ms

#

like my bot ping is 23ms

sick cloud
#

what's your rest ping

#

it's most likely your code

nocturne hazel
#

maybe

#

because .playStream outputs 0 sound

#

or I have installed a package incorrectly

twilit rapids
#

Did you provide options, like volume

nocturne hazel
#

just filter: 'audioonly'

twilit rapids
#

ytdl-core?

nocturne hazel
#

YEP

#

sorry caps

twilit rapids
#

The audioonly filter is bugged, use "quality": "highestaudio" instead

nocturne hazel
#

Thanks

twilit rapids
#

Also add volume, set that to 0.5

#

"volume": 0.5

nocturne hazel
#

Added with another comma?

twilit rapids
#

Yes

nocturne hazel
#

Ok

twilit rapids
#

{"quality": "highestaudio", "volume": 0.5}

sick cloud
#

what are some okay ideas for economy commands relating to items
like i have an inventory system that allows you to get/store/sell items but what kind of commands should i add to earn them

nocturne hazel
#

Hmm

#

What type of items are they

#

And what is the currency?

sick cloud
#

just all different kinds of items, food, tools, dumb items, whatever i can come up with and whatever has an emoji

#

and the currency is $

nocturne hazel
#

@twilit rapids Still no audio :/

twilit rapids
#

Is your bot here?

nocturne hazel
#

Yeah

twilit rapids
nocturne hazel
#

Ok

swift topaz
#

I'm having this problem UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'user' of undefined from msg.bot.user

sudden geyser
#

The message instance does not have that property, look in the docs for the message properties

swift topaz
#

Ohh I see

#

what's the difference between Discord.js and Discord.js-Commando?

#

Oh so it's command specific

#

but whenever I instantiate a Commando.Client it gives this ReferenceError: Commando is not defined

sudden geyser
#

The error tells the problem

swift topaz
#

oh nvm

#

I got it

swift topaz
#

UnhandledPromiseRejectionWarning: TypeError: this.inputMedia.pipe is not a function I'm getting this error with my FFMpeg dependency (?)

stray garnet
#

Any alternative for createReactionCollector?

amber fractal
#

messageReactionAdd event

#

but

#

that's most likely not what you want

#

unless you want it to persist

wheat jolt
#

Help, how I can install discord.js@v12.0.0-dev

#

:/

pale marsh
#

Isn't there steps you should follow in the docs or something?

swift topaz
#

any alternatives for ytdl? I'm having problems with that dependency, also FFMpeg

wheat jolt
#

what do you mean

#

@swift topaz did you installed through npm?

swift topaz
#

I mean alternative libraries that I can use

#

yes I did

#

UnhandledPromiseRejectionWarning: TypeError: this.inputMedia.pipe is not a function I get this from FFMpeg

#

and ytdl.getInfo is not a function

wheat jolt
#

what system do you have?

#

ubuntu?

swift topaz
#

Windows @wheat jolt

cursive gale
#

hey

#

how do i get the id of an emote?

swift topaz
#

@cursive gale try doing \<:what_emote_you're_looking_for:>

cursive gale
#

kk

swift topaz
#

wait no there's a backslash

cursive gale
#

kk

swift topaz
#

Well anyway I'm having a problem making a Music Bot in general (tutorials don't help me because most of them are deprecated)

cursive gale
swift topaz
#

@Viciou

#

hmm

#

wait

cursive gale
#

ok

swift topaz
#

@swift topaz

#

should be something like that but that's for usernames

cursive gale
#

i tried <:emote:> and <:emote:>

#

wow \ dissapered

cursive dagger
#

Use \ :emote:

#

without the space

cursive gale
#

yeah

#

i had to go through reddit

#

ty tho

#

:))

earnest phoenix
#

Bot is using 52% of available memeroy

#

Why would that be the case?

#

what?

#

Spawn enomem

#

Error

#

Wth is enomem

#

Oh ffmpeg

#

Yea

#

There is like 50 running

quartz kindle
#

are you using child_process.exec() or child_process.spawn()?

chrome olive
#

anyone can help me?

quartz kindle
#

the font changed?

halcyon nymph
#

@chrome olive what do you need help with?

chrome olive
#

and the footer

amber fractal
#

did the footer change?

mossy vine
#

import the font in your css and add !important

chrome olive
#

how I can import the font in css

mossy vine
chrome olive
#

oh done

#

thanks

#

@mossy vine & if I want to put the footer text to center

#

I have to add !important to align?

mossy vine
#

if its aligned in your css, yes

chrome olive
#

text-align: center !important;

#

but it same

mossy vine
chrome olive
#

oh not that

#

i mean it's too high

mossy vine
#

you want to align it vertically right?

chrome olive
#

ye

#

how can I fix that?

mossy vine
#

vertical-align: middle !important;

#

i think

chrome olive
#

nope

#

vertical-align: 50% !important;

mossy vine
#

yeah that would work

maiden mauve
#

Anyone know the threshold of error that terminates a bot?

mossy vine
#

depends on the library

maiden mauve
#

It seems like after 2-3 catch errors it stops responding

mossy vine
#

eris just yeets the bot on any error

#

discord.js is like ok whatever

maiden mauve
#

I put my bot in a new server where it doesnt have embed perms

#

And after 3 API errors logged in catch it just quits

slender thistle
maiden mauve
#

I don't understand why it would crash with a handled error

slender thistle
#

Unless you blocked the entire bot loop somehow for too long

maiden mauve
#

Well it's sparking off a send message promise

#

The failed permission causes the error catch

#

I guess I could move the permission validation ahead of a caught error

chrome olive
mossy vine
#

lol

#

apply it to that one as well

chrome olive
#

the problem is

#

it's already applied

#

@mossy vine ....

mossy vine
#

i have no idea

#

sorry

chrome olive
#

ok, thanks for help btw

slim heart
#

Why could my random bots with only about 100 guilds be taking up close to or even in some cases over a gigabyte of ram? I can't seem to figure it out
its only after a long amount of time, is it like some sort of cache issue or what?

amber fractal
#

memory 👏 leak 👏

slim heart
#

but how prevent sad

smoky spire
#

Sweep cached

slim heart
#

hUw

topaz fjord
#

sweep cache

slim heart
#

im asking how

unique nimbus
lyric hawk
#

Running into a problem with wait_for()

#
final_string = message.author.mention + " " + reply
await message.channel.send(final_string)
def check(m):
     return "342395822589214721" in "".join([str(x.id) for x in message.mentions])
 reponse = await self.wait_for("message", check=check)
#

So, in my reponse variable goes a message that does not meet the requirements

#

Actually in it goes the first message the bot reads

#

As if he was ignoring check=check

maiden mauve
#

Is = an assignment or comparison

mossy vine
#

in what language

#

in python its assignment

amber fractal
#

in js it's also an assignment

#

== and === are comparison

somber verge
#

is in python is comparison too

earnest phoenix
#

@fossil oxide, Please send me a DM

amber fractal
#

why dont you send him a dm?

opaque eagle
#

Mute: pinging mods for no reason

amber fractal
#

Oliy isnt a mod

opaque eagle
#

Well his list of roles says otherwise

sudden geyser
#

pinging web admins for

tidal relic
#

Oliy isn't a mod

#

He's a god

amber fractal
#

oh shit, he doesnt have mod rip

nocturne hazel
#

Some help would be much appreciated!

gray epoch
#

here i wanna my bot response when someone tag me when i m offline i stopped here i didn't know how to set it
TypeError: Cannot read property 'presence' of null

sick cloud
#

oid doesn't have a presence

#

its a user not a guild member

#

get the user from a guild

#
// oid now has presence.status```
gray epoch
#

i try it it says
guild is not defined i change it to

message.guild.members.fetch(userID)

but it says
TypeError: message.guild.members.fetch is not a function

hollow saddle
#

What you had was fine

#

But

#

You’re comparing a tag to an id

#

m => m.user.tag === botSettings.ownerID

#

This will return undefined everytime

inner jewel
#

false*

#

unless ownerID is name#discrim

#

which is not recommended

hollow saddle
#

Ah true

inner jewel
#

perm checks should be IDs, not tags

gray epoch
#

ownerid is an id

loud salmon
#

i set ownerID as Spider is that wrong thinking_derp

hollow saddle
inner jewel
#

yes

scenic vapor
#

ofcourse not your SPidor

inner jewel
#

it should be 'Natan#1337'

gray epoch
#

okey what should i do now

scenic vapor
#

live

hollow saddle
#

Use m.user.id since it’s an id that you want to find

#

Given botSettings.ownerID is an id bloblul

gray epoch
#

message.guild.members.fetch(m => m.user.id === botSettings.ownerID)
like this

hollow saddle
#

I don’t believe fetch requires a function

#

Just use your id

#

message.guild.members.fetch(botSettings.ownerID)

#

Then use oid.presence.status

sick cloud
#

if you wanna use a function, use find

hollow saddle
#

^

sick cloud
#

.find(m => m.user.id === botSettings.ownerID)

gray epoch
#

i fix it thank u guys
its message.guild.members.find(m => m.user.id === botSerrings.ownerID)

sick cloud
#

👏

gray epoch
#

yes thank you

hollow saddle
#

Yes

gray epoch
#

i have another question its the last
how can i check if someone tag me in his message

west spoke
#

If content is (whatever your Id is)

#

I'm too tired to do actual code rn so you will have to deal with psuedocode

amber fractal
#

well that isnt the best way

#

because you can post an id without mentioning

west spoke
#

Like, actually about to fall asleep

amber fractal
#

check if the collection contains your id

gray epoch
#

@amber fractal yes i m asking for a code please

amber fractal
gray epoch
#

okey @amber fractal

amber fractal
#

Maps are a basic javascript thing

gray epoch
#

i m a beginner and i m new here

maiden mauve
#

hm

#

so a bot with skeleton permissions can edit its own message, but cannot delete without manage messages

#

but editting to "" would be a delete

#

right?

#

almost...

inner jewel
#

you can always delete your own messages

maiden mauve
#

lack of permission error might have been from an undefined object

#

yeah, now it works

wheat jolt
#

I have a problem with .playStream(ytdl(livestream-link))

#

It plays the music for less than 2 seconds

#

And then it ends

#

I am on the lastest discord.js version

#

And when I tried to update to 12.0.0 and I've changed .playStream to .play , I got an error with prism

#

Or something like that

#

Ping me if you can help me blobnomcookie

proud widget
#

!wimpus

dark dust
#

someone know how to do not allow people from running a command if he is in use already?

#

in python

cursive dagger
#

@dark dust multiple ways
The one I do: have a global var to check

valid frigate
#

yall

#

how do i get data about how many guilds/users a WebSocketShard has in js

#

literally nothing i can find in master docs >:(

#

or to better word it what's the alternative to broadcastEval for internal sharding

quartz kindle
#

guilds have shard and shardID properties

#

loop over them and arrange them by shard id

earnest phoenix
#

how can I make it so the MongoClient checks if the user has an data in the database. I tried the one below but it didn’t work.

if(!mongo.db(“main”).collection(“users”).find({“_id”: message.author.id})){
mongo.db(“main”).collection(“users”).insert({“_id”: message.author.id, “hello”:”world”});
}
mossy vine
#

isnt _id assigned by mongodb?

#

huh you can overwrite that

#

oh, theres a syntax error in there

#

@earnest phoenix you forgot a ( after .find

earnest phoenix
#

oh that is not there is the original code i rewrote it

#

it still doesn’t work tho

mossy vine
#

whats your current code then

earnest phoenix
#

now it is

#

i pasted it

mossy vine
#

try not using _id

#

also what library are you using for mongodb

earnest phoenix
#

mongodb

#

not mongoose

mossy vine
#

are you getting any errors?

#

also are there any documents being added to the collection

earnest phoenix
#
  1. No
  2. No
mossy vine
#

are you sure you are connected to the database

earnest phoenix
#

yes

#

it even shows on the site

#

nvm i figured it out

mossy vine
#

what was the issue?

earnest phoenix
#

The “s

#

they shouldn’t be there

mossy vine
#

oh

earnest phoenix
#
mongo.db(“main”).collection(“users”).findOne({_id: {$eq: message.author.id}},{holding: 1});

I am trying to make it display the holding variable of the user’s data. The only error I got is unexpected token and I don’t know how to fix it.

topaz fjord
#

Why are you searching by _id

#

That's an object id which mongo creates on document insertion

mossy vine
#

^

topaz fjord
#

search by something else

#

Like a userID

slender thistle
#

_id is overridable

earnest phoenix
#

how to get amount of channels in all guilds that bot in?

topaz fjord
#

@slender thistle I don't see a point in doing that

slender thistle
#

I started doing it only when I need only small data /shrug

opaque eagle
#

What language and library @earnest phoenix

tidal oar
#

Who is known about mongoose?

#

Oh i see theres already a mongoose topic

#

So i was editing my data, which is inside of a array

database.array[1].changethis = 100

Datatype is number
Anyways whenever i change it i can see its changed i tested everythinf but when it comes to saving

database.save()

It doesnt works. Basically no errors, nothing but it doesnt saves the change i made. I check the database and its the same. Data is still the same and not changed.
Can someone help me out?

swift topaz
#

how do I add a thumbnail: bot.user.avatarURL parameter in the module.exports.run

opaque eagle
#

Whattt

swift topaz
#

uhhh

#
    msg.channel.send({embed:{
        title: 'Jigglypuff!',
        description: 'Puff!',
        color: 0xfca2dd,
        thumbnail: 'bot.user.avatarURL'
    }})
}```
#

the thumbnail part won't work

hollow saddle
#

Define won’t work

#

Errors?

swift topaz
#

no errors

#

the thumbnail just won't pop up in the embed that is sent

hollow saddle
#

Oh wait

#

Cause you have it as a string

#

Remove the '

#

Around it

west spoke
#

^

#

That's literally like saying bot.AvatarUrl

swift topaz
#

nahh still

west spoke
#

In chat

swift topaz
#

no thumbnail

#

that was what I first did

#

the stringless

west spoke
#

Bot.avatarurl?

#

Without user?

hollow saddle
#

No it has to be on the user object

#

It should work

#

Try displayAvatarURL instead

#

Cause avatarURL sometimes returns null

swift topaz
#

(node:13516) UnhandledPromiseRejectionWarning: ReferenceError: displayAvatarURL is not defined

#

without the string

hollow saddle
#

What exactly did you put when I suggested that

#

Like show me your updated code

swift topaz
#
    msg.channel.send({embed:{
        title: 'Jigglypuff!',
        description: 'Puff!',
        color: 0xfca2dd,
        thumbnail: displayAvatarURL
    }});
}```
#

or is it displayAvatarURL: true?

hollow saddle
#

No, you have to use bot.user.displayAvatarURL

#

displayAvatarURL is a property of the user object

#

Not a standalone thing

swift topaz
#

still doesn't work

hollow saddle
#

Oh wait

#

It’s cause you’re setting it up wrong

woven zealot
#

thumbnail: { url: url }

hollow saddle
#

Yeah ^

swift topaz
#

what're the exact parameter that should be in url?

woven zealot
#

still the same

swift topaz
#

{url : bot.user.avatarURL} ?

woven zealot
#

thumbnail: { url: bot.user.displayAvatarURL }

#

Yep

hollow saddle
#

^

swift topaz
#

holy damn it works thanks guys!

little mural
#

hi, i've just submitted a bot for approval. i'm not 100% sure if i need to do anything in my code to allow the bot to be invited to another server. i'm just using JDA as usual.

swift topaz
#

Still having a hard time making a Music Bot, I don't know which guide to follow. They all look the same but I always have problems with each tutorial I follow

little mural
#

coding is hard... @swift topaz

swift topaz
#

Yeah. I'm ashamed I graduated Computer Science and still has problems coding

little mural
#

i bet everyone does

#

using APIs is especially hard often

swift topaz
#

I joined the Plexi Discord server to ask questions I had with their tutorial videos but the support channel is dead

topaz fjord
#

plexi itself is a shit guide

swift topaz
#

I can't find a good guide for Music Bot development, almost all are outdated

warm marsh
#

Then code without one, Just use the docs.

unique nimbus
#

@swift topaz if you are in js you can use lavalink

#

It's also supported in python

swift topaz
#

Does the library also support Youtube links for audio downloading?

unique nimbus
#

Yes

#

You can also use youtube-dl

swift topaz
#

which would be better to use? the standalone lavalink or the discord.js-lavalink?

unique nimbus
#

Lavalink is originally based in js I think

swift topaz
#

so importing either one is fine then?

unique nimbus
mossy vine
#

discord.js-lavalink is specifically for d.js afaik

unique nimbus
#

Yes

warm marsh
#

Can I ask why use lavalink over ytdl?

#

Or is it just personal preference?

unique nimbus
#

It's preferance I think

quartz kindle
#

i've never used any of them since none of my bots use audio, but from what i understood, lavalink acts as a server broadcasting audio streams, which means it will run in a separate process than djs, thus not influencing the discord connection, using less memory/cpu because it has less overhead, and it can run on a different machine

#

those are big deals for big bots

warm marsh
#

Alright, If I add audio with my bot I guess I'll give it a try.

unique nimbus
#

Good luck

warm marsh
#

my brain on mad one lmao.

swift topaz
#

Thanks guys! I'll try it

#

But I'm really reliant on tutorials since I get confused by documentations themselves

oblique token
#

Can someone be my developer

wheat jolt
#

No one will spoon feed you @oblique token

oblique token
#

@wheat jolt can you please help me you can be my developer I want to make a bot