#development

1 messages Β· Page 884 of 1

copper cradle
#

you'll get some gibberish but do it

heavy anchor
#

ok

copper cradle
#

and then show the output

#

also, what is bot, it looks like the property guilds doesn't exist in bot

jovial nexus
#

You abandoned me @copper cradle

#

: (

copper cradle
#

wdym

#

I told you to run the code and see what you get

#

did you do that @jovial nexus

jovial nexus
#

and the console.log(args) is there too, but i didnt take it on the screenshot

copper cradle
#

there's a null value somewhere in your code which is getting passed to a function that converts it into an int

#

also

#

use connection.playStream()

jovial nexus
#

does that work in v12?

copper cradle
#

...

heavy anchor
#

bot is client

copper cradle
#

If I'm telling you to do it

#

wdym bot is client

#

show me where you defined bot

jovial nexus
heavy anchor
#

Returns undefined

copper cradle
#

are you creating a new instance for that command?

#

show me where you defined bot

#

huh

#

lemme see something

heavy anchor
#

const bot = new Discord.Client();

jovial nexus
#

now it dont even log the console.log(args)

copper cradle
#

put it back to play

#

lemme see what happened to playStream

#

ok it was removed

#

@heavy anchor hmm

#

show your command file

#

I think I know what's happening

#

show the entire thing

copper cradle
#

what are you even trying to do

#

omg

#

that's the issue

#

that's not how exporting and importing works

#

show your bot.js file

heavy anchor
jovial nexus
#

@copper cradle Are you sure that playStream works in v12?

copper cradle
#

no it doesn't

#

I told you to change it back to play

jovial nexus
#

oh ok

copper cradle
#

@heavy anchor this is your problem

for exporting something you gotta use the exports object, so at the bottom of your bot.js file put the following exports.bot = bot;
THEN you can use bot in your other file, but import it like this
const { bot } = require('../bot.js');
earnest phoenix
#

don't use == always ALWAYS use ===
@copper cradle why?

copper cradle
#

add this flag to the node command you're running --trace-uncaught

#

== is used for comparison between two variables irrespective of the datatype of variable. === is used for comparision between two variables but this will check strict type, which means it will check datatype and compare two values

#

@earnest phoenix you should know this c'mon

late hill
#

So basically not always, use === where you want it to match the same type

#

Which will mostly be the case

copper cradle
#

yeah but I doubt anyone here will ever need that

#

doing this is ok 1 == '1';
but this isn't 1 === '1';

green marsh
#

I am having some trouble with discord OAuth, is there anyone that could help me?

I have implemented OAuth login for a web interface with discord a couple of times before, so I know how it's done, but I am stuck on a weird problem.

My setup as it is now works perfectly fine for the first user, however whenever a second user authorizes the OAuth request and I make a request to /users/@me with the access token of the second user the discord API returns the details of the first user.

I think this has something to do with caching on either my end, or discord's end. Has anyone ever had this problem before, or knows a potential cause?

copper cradle
#

@heavy anchor did you do it?

tulip bobcat
#

where do you store the access or refresh token?

copper cradle
#

?

tulip bobcat
#

to Stan

heavy anchor
#

trying it

copper cradle
#

ah

heavy anchor
#

TypeError: Cannot read property 'guilds' of undefined

copper cradle
#

show the code

#

in both files

#

in bot.js and in bugreport.js

green marsh
#

@tulip bobcat I don't store it, I am just using the OAuth for a login system to a web interface. So the flow of my login process is:

1. direct user to discord OAuth page, with only the 'identify' scope
2. redirect from discord comes in with the 'code' parameter
3. I make a request to /api/oauth2/token with the given 'code' value
4. I retrieve the access_token and make a request to /users/@me with the access token
5. I get the discord ID that's associated with the account and check it for values within my database to search a user to log in```
#

So this works fine for the first user.

#

But then the second user get's logged in as the first user because the /users/@me request returns the information for the first user.

tulip bobcat
#

3 and 4 are made from the browser right?

green marsh
#

No, from my server backend

jovial nexus
#

@copper cradle can we talk in md? about my error

copper cradle
#

here

#

why dms?

jovial nexus
#

because here is a conversation

copper cradle
#

it doesn't matter

jovial nexus
#

okok

copper cradle
#

they'll talk to each other

#

lemme check cedar's files first

tulip bobcat
#

I'm guessing it's a bug in your code then, @green marsh the chance of discord breaking is super low

jovial nexus
#

i changued it to args[1] and now it donest have any error, and it console.log the link, but it doesnt sound anything

copper cradle
#

I said

green marsh
#

I doubt that discord is broken aswell, however it also has not much to do with my code, if I make the same request from Postman or something similar it also happens.

copper cradle
#

put exports.bot = bot; at the bottom

#

you placed it inside a command

green marsh
#

It returns the wrong user for the access token.

copper cradle
#

so it'll only exist once you run that command

green marsh
#

It has to be something with caching probably.

copper cradle
#

@jovial nexus don't do that

#

do you even know what args[0] and args[1] mean?

jovial nexus
#

yes

copper cradle
#

what do they mean then

tulip bobcat
#

how do you store the users tokens then? I'm assuming in some sort of object right? @green marsh

copper cradle
#

if you know then you wouldn't even consider changing args[0] to args[1]

jovial nexus
green marsh
#

I literally just take it immediately of the response from the /oauth2/token request

copper cradle
#

@jovial nexus did you do what I told you

#

show the entire error log

#

pls

#

it isn't that hard

jovial nexus
#

thats the entire error log

copper cradle
#

let's do something

#

clear the console

#

run the bot and make the error happen

#

then copy everything

jovial nexus
#

okok

copper cradle
#

that's not the entire error

earnest phoenix
#

I want to do 2 shard on my discord bot, but how can I get the total number of servers in my bot?

#

(d.js)

copper cradle
#

and run the bot like this node --trace-uncaught <the file>

tulip bobcat
#

what language is that btw? @green marsh

green marsh
#

PHP

heavy anchor
#

I still get the same error:
TypeError: Cannot read property 'guilds' of undefined

jovial nexus
copper cradle
#

comment out that line and run the thing

#

why are you even doing 5 / 5???

earnest phoenix
#

volume command?

copper cradle
#

that'll always be 0

#

no

#

play command

earnest phoenix
#

oh ok

#

do 0 / 5

copper cradle
#

idk why they're doing that

#

why are they doing 5/5 if that'll always be 0

#

just remove the line

#

and see what happens

earnest phoenix
#

yh there would be no point if it's 5/5

jovial nexus
copper cradle
#

wait

#

did you make the bot?

#

or did you get it from github

jovial nexus
#

i made it

copper cradle
#

did you change your os at some point in development?

jovial nexus
#

nope

copper cradle
#

did you run it with the --trace-uncaught flag?

#

I told you to do it

jovial nexus
#

wait ill do it

green marsh
#

@tulip bobcat I'll make it more interesting.

#

One second

tulip bobcat
#

@green marsh yea idk php, and after looking around I can't find much odd (except you are using $response and $res)

#

hm sure

copper cradle
#

there's a problem with opusscript

slender thistle
#

Isn't 5 / 5 equal to 1

copper cradle
#

ah yes

#

I can't do math today

jovial nexus
#

it says me Welcome to Node.js v12.16.1. Type ".help" for more information.

copper cradle
#

bruh

#

what did you run

#

dude

green marsh
#

Okay, so all I am doing right now is taking the code paramater from the request and making the request to /oauth2/token with that

jovial nexus
#

that

green marsh
#

And look what I get

copper cradle
#

how

jovial nexus
#

node --trace-uncaught

copper cradle
#

πŸ€¦β€β™‚οΈ

#

add the file you want to run at the end of course

green marsh
jovial nexus
#

yes

copper cradle
#

u sure?

green marsh
#

the code does not matter at all, I can put whatever I want there and it will work

jovial nexus
#

yup

knotty steeple
#

u shouldve censored more

copper cradle
#

show your console

knotty steeple
#

like

#

the entire thing

copper cradle
#

take a pic of the entire window

#

yeah I could try and generate those last chars

green marsh
#

Nah I don't really care, the only scope it has is 'identify' haha

copper cradle
#

lol

knotty steeple
#

still

#

an access token to ur account

green marsh
#

You can get just as much information from that token as you can from being in this server with me

copper cradle
#

yeah

knotty steeple
#

ok

#

i dont know oauth stuff wew

green marsh
tulip bobcat
#

hm that's very odd, it shouldn't cache on your server either

copper cradle
#

ok Ender let's take this to dms

green marsh
#

not really interesting haha Β―_(ツ)_/Β―

#

Yeah I am honestly clueless right now

tulip bobcat
#

what you could try, cuz i can't help much more, is go to the discord-api server

jovial nexus
#

okok

green marsh
#

Thanks, I'll try

knotty steeple
#

do u have the invite

green marsh
#

Thanks for trying to help haha :)

#

Yeah I do

heavy anchor
#

@copper cradle when your done helping him i am still having that issue...

copper cradle
#

okok

#

@heavy anchor dude

#

here I am

#

what error did you get now

copper cradle
#

lemme see

#

show your code

#

then instead of exports.bot = bot; do module.exports.bot = bot;

#

tht shouldn't make a diff

#

but may help

#

or even better

#

just do exports = bot

#

and then in your command just do const bot = require('../bot.js')

#

or even better

#

pass bot as an argument to your command

#

so you don't have to be exporting crap

#

dude

#

did you move exports to the very bottom of the file

#

@heavy anchor

heavy anchor
#

yes

copper cradle
#

show

copper cradle
#

ok pass bot as an argument to your commands

#

why wouldn't you

#

it's just easier

heavy marsh
#

Can some one help me with this. I am trying to get information from one of my files and send them like b!play <Number> and it plays it
https://pastebin.com/ZQj8xz7N - discord.js v12.2.0

heavy anchor
#

pass bot as an argument to your command
I don't know how to do that...

copper cradle
#

dude

earnest phoenix
#

.addField(`**Verification Level**`, `${verificationLevels[msg.guild.verificationLevel]}`)

copper cradle
earnest phoenix
#

this doesn't work for some reason

copper cradle
#

what's the err

#

do you get an err

earnest phoenix
#

undefined

copper cradle
#

well then guild has no property called verificationLevel

earnest phoenix
#

hmmmm

copper cradle
#

it does

#

did you check that the guild has a verification level set?

heavy anchor
#

now I get TypeError: Cannot read property 'send' of undefined

copper cradle
#

show code

#

just send it here

#

no pastebin

heavy anchor
#

kk

earnest phoenix
#

yep i have verificationLevel

#
        "None",
        "Low",
        "Medium",
        "(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻",
        "┻━┻ ミヽ(ΰ² η›Šΰ² )γƒŽε½‘β”»β”β”»"
      ];```
royal portal
#

how do I start bot verification?

#

my bot is at 75 servers

earnest phoenix
#

u should get an msg for discord

royal portal
#

I didn't

heavy marsh
royal portal
#

where?

copper cradle
#

atom dragon what are you trying to do

heavy marsh
#

This should say apply for verification

royal portal
#

it doesnt

heavy anchor
#
const Discord = require("discord.js");
bot = require('../bot.js')
const {
    PREFIX
} = require('../config.json');

module.exports = {
    name: 'bugreport',
    aliases: ['bugr', 'br'],
    description: `Users can report bugs useing this command. \`\`${PREFIX}bugreport [A detailed description of the bug you're experiencing and what causes it]\`\``,
execute(msg, args, bot) {
const userAvatar = (msg.author.displayAvatarURL({
dynamic: true,
 format: "png"
        }));
let argsresult;


if (!args[0]) {
return msg.channel.send(`You did not describe the bug.`)
        }
argsresult = args.join(" ");
var myGuild = bot.guilds.cache.find(g => g.id === '694557723978891344');
var logChannel = myGuild.channels.cache.find(c => c.id === '701924697289523291')

const bugReport = new Discord.MessageEmbed()
.setTitle("Bug report")
.setDescription(`<@${msg.author.id}> reported\n${argsresult}`)
.setColor('#FF0000')
.setTimestamp()
.setFooter(msg.author.username, userAvatar)

logChannel.send(bugReport);
},
};```
earnest phoenix
heavy marsh
#

Then you might not be eligible yet

royal portal
#

oh

earnest phoenix
#

@copper cradle well get the server verification level

royal portal
#

because I just did

#

so yeah

#

@earnest phoenix I guess you're right

#

I just reached 75

#

but what if the bot is in some of the servers you own?

copper cradle
#

@heavy anchor remove bot from the top of the file too

royal portal
#

does it count?

earnest phoenix
#

yep

royal portal
#

like if you own 2 servers will it count

earnest phoenix
#

yes

copper cradle
#

atom dragon

earnest phoenix
#

yah

royal portal
#

or do servers you own and your bot is in dont count?

copper cradle
#

<Message>#<Guild>#verificationLevel returns a string

copper cradle
#

not a number

earnest phoenix
#

omg

heavy anchor
#

Yes I did, I get the same error

copper cradle
earnest phoenix
copper cradle
#

why did you define your own tho

earnest phoenix
#

to get the table flip

copper cradle
#

well the way you're doing it won't work

#

you can just modify that in the library tho

earnest phoenix
#

k thx

#

will do that

#

and do u know where its located

#

or i will just find it

copper cradle
#

discord.js/src/structures/Guild.js Line: 259

earnest phoenix
#

thx

royal portal
#

@earnest phoenix do I need any of these checked

copper cradle
#

you should know

earnest phoenix
#

no

heavy marsh
#

Only if you need them

heavy anchor
#

I tried that before I came here for help and I get error TypeError: Cannot read property 'send' of undefined

copper cradle
#

show code

#

show the code you put in bot.js

earnest phoenix
#

ahhhh mine is like this this.verificationLevel = VerificationLevels[data.verification_level]; no wonder its not working

copper cradle
#

nooo

#

it's working

#

just don't try to make your own

heavy anchor
#

Too long to send here

earnest phoenix
#

k

copper cradle
#

and that's not the line you should change

earnest phoenix
#

well that was line 259

copper cradle
#

then

#

wait

#

it was Constants

#

not guild lmao

#

in the constants file

earnest phoenix
#

ahhh

heavy anchor
copper cradle
#

src/util/Constants line 449

earnest phoenix
#

498 in js 12

copper cradle
#

I got the line from their github repo

surreal wind
#

I got a quick Question.
Why does he keep saying, that First() is not defined here?
let userToModify = message.mentions.members.first();
I looked at the discordjs-bot guide from GitHub and he says this should get me the member.

earnest phoenix
#

how i edit a message of my bot?

#

with fetchMessage

split hazel
#

fetchMessage returns a promise of a message

#

You resolve the promise and edit it like editing any other message by calling <message>.edit("content")

sudden geyser
#

@surreal wind what do you mean it's saying it's not defined? Can you show the actual error message and/or your code?

earnest phoenix
#

i want edit the message of my bot

#

like

surreal wind
#

How do i mark it as code?

earnest phoenix
#

!edit <messageid> <new message>

sudden geyser
#

like send the code here?

surreal wind
#

yeah+

sudden geyser
#

either markdown embed code or upload it to a site like hastebin.

```language
<code here>```

#

just the part that's failing

earnest phoenix
#

@split hazel

#

i want this
!edit <messageid> <new message>

surreal wind
#
        message.member.send('Thank you for signing up for the event - good luck to you..');
        // let role = message.members.roles.find("700849600973766667");
        //guild.member.addRole("700849600973766667");
        let userToModify = message.mentions.members.first();
        let roleToAdd = message.mentions.roles.first();
        //message.member.addRole(roleRoAdd);
        console.log(message.member.addRole());```
and the error is this
    let userToModify = message.mentions.member.first().displayName;
                                                   ^

TypeError: Cannot read property 'first' of undefined
sudden geyser
#

I think someone said this last time to you: member is not a property of MessageMentions.

#

If you want the member, use members instead.

royal portal
#

@surreal wind discord.js?

surreal wind
#

But i did in my code

#

@surreal wind discord.js?
@royal portal Yep

royal portal
#

are you using v12

surreal wind
#

Yeah 12.02 or something let me check

royal portal
#

alright

surreal wind
#

"discord.js": "^12.2.0" this one

royal portal
#

try message.members.cache.roles.find

surreal wind
#

Ty

royal portal
#

and message.mentions.cache.roles.first

#

I guess thats the problem

#

because in v12 or higher its cache

surreal wind
#

With or without the (), So the guide i use are on versiosn 10 and 11 and htose are some changes inv 12?

#

Ahh

royal portal
#

yea

#

did it work?

surreal wind
#

did it work?
@royal portal Sadly not says cache is undefined now

royal portal
#

which line

#

the role or mentions?

surreal wind
#

let userToModify = message.members.cache.roles.find()

royal portal
#

try it without cache

amber fractal
#

well it's not message.members

craggy cave
#

has anyone got an open github repo of sharding with discord.py?

split hazel
#

You put cache after roles

amber fractal
#

message.member.roles.cache

royal portal
#

oh yeah

surreal wind
#

That only changed it to roles now being undefined

earnest phoenix
#

is it that hard to look up the docs and follow the flow of the properties

royal portal
#

yes very hard

#

im also still waiting for discord to send me a system message

#

for verification

#

im at 75 servers

#

its been like an hour

surreal wind
#

Okay now i get something complete different, at a line, i don't even reached yet Oo

split hazel
royal portal
#

@split hazel wait am i not allowed to talk about verification

#

because I need help with it

split hazel
surreal wind
#

so i get this error now:
D:\Discord Bot\DiscordBot\Lumi\node_modules@discordjs\collection\dist\index.js:160
if (fn(val, key, this))
^
TypeError: fn is not a function
But i don't have a line 160 or does the 160 not mean the coding line?

mossy vine
#

update your node version to v12

#

160 does mean line 160 but in a different file, look at the path

vernal basin
#

Hi, I'm having some trouble with checking for the number of players with a role

#
return (message.guild.roles.find(r => r.id === shootRole).members.length > 0);```
#

I want this to return true if at least one player has the role that has id shootRole

earnest phoenix
#

This is so hard man

split hazel
#

@vernal basin collections do not have a length property

surreal wind
#

update your node version to v12
@mossy vine updated it to latest version, still got the same error

split hazel
#

However they do have size

vernal basin
#

ah it's size okay

split hazel
#

@surreal wind you most likely provided something invalid in some .find could we see some code?

vernal basin
#

yeah i couldn't find it in the docs anywhere notlikenoot

finite bough
#

length is the size of an object

#

size is the size of an array or collection

split hazel
#

@vernal basin and do note it will only show the cached members

vernal basin
#

?

finite bough
#

like

split hazel
#

If the server is big enough, not all members will be cached and counted

vernal basin
#

ah ok

#

i only have like 40 members rn

surreal wind
#

@surreal wind you most likely provided something invalid in some .find could we see some code?
@split hazel sure,

        message.member.send('Thank you for signing up for the event - good luck.');
        // let role = message.members.roles.find("700849600973766667");
        //guild.member.addRole("700849600973766667");
        let userToModify = message.member.roles.cache.find();
        let roleToAdd = message.mentions.cache.roles.first();
        //message.member.addRole(roleRoAdd);
        console.log(message.member.addRole());
    }```
finite bough
#

let prefix = "ushsjsj"
message.channel.send(prefix.length)

split hazel
#

You'd need to fetch all members beforehand

vernal basin
#

ok

finite bough
#

it's the size of a single object

split hazel
#

.find expects a function

#

Not a string

finite bough
#

.get

split hazel
#

And what's the point of userToModify

#

Unless you're planning to use it for something else later

surreal wind
#

I'm going by a guide how to find the member, I'm totally new to this so I'm using the Guide i got recommended here, that's what they say i should do

#

All i want to do, is to give the Member who send this !player a specific role within the server

finite bough
#

and usertomodify is finding roles not user

#

@surreal wind ok so

#

1st tell me what did u understand from the guide

#

it's ok if it's only a little

earnest phoenix
#

i have the milliseconds elapsed since January 1970
how do i convert that back to a date?
essentially the reverse of new Date() (in node js)

finite bough
#

hmm I am not a very "pro" in node.js but ig math flooring the same number again and again

surreal wind
#

Well i understood the whole concept of how to send out the messages and what the change between, as example, Channel or member means. But apparently the code example there is made for an older version so i didn't know about the cache in there. As for my original Problem, I don't get, why a message.members.addRole(RoleId) wont work.

split hazel
#

You have to fetch the role first

finite bough
#

why fetch role?

split hazel
#

addRole does not accept an ID

#

It accepts a role object

surreal wind
#

would that be the name, as example?

finite bough
#

and who said that?

split hazel
#

You can get a role object in your case by message.guild.roles.get(ID)

#

I tested it myself

finite bough
#

@surreal wind it should work, can I see ur whole code?

#

and maybe specify ur discord.js version

split hazel
#

My apologies, I was testing on master

finite bough
#

its ok

split hazel
#

On master you need to provide a role object, on v11 you may provide either

finite bough
#

never tried so I will not disagree

surreal wind
#

@surreal wind it should work, can I see ur whole code?
@finite bough Sure, but a lot what i tried i just commented it out for now in case one of them worked so i didn't have to rewrite.

        message.member.send('Thank you for signing up for the event - good luck.');
        // let role = message.members.roles.find("700849600973766667");
        //guild.member.addRole("700849600973766667");
        //let userToModify = message.member.roles.cache.get();
        //let roleToAdd = message.mentions.roles.cache.first();
        message.member.addRole('700849600973766667');
        console.log(message.member.addRole());
    }```
So that's the part i want to add, but i get the message 
        message.member.addRole('700849600973766667');
                       ^

TypeError: message.member.addRole is not a function
as for my ``` "discord.js": "^12.2.0"```
finite bough
#

yup

#

12.2

#

in 12.2

#

its add.role

#

1st

split hazel
surreal wind
#

okay but even then he keeps saying role is undefined.

#

that's what i don't understand. i give him the ID but it keeps saying its undefined

finite bough
#

try finding the role by its id

#

try going to that link speedy sent

split hazel
#

And could we get what discord.js version you have?

#

On v12 addRole doesn't exist

surreal wind
#

"discord.js": "^12.2.0"

#

and i changed it to add.role(roleId)

#

But tells me role is undefined

finite bough
#

yea

#

scroll up and check what speedg said earlier

#

You can get a role object in your case by message.guild.roles.get(ID)

#

tho

#

as its 12.2

surreal wind
#

Ah so now i got to fetch the role first

#

okay

finite bough
#

guild.roles.cache.get(...)

surreal wind
#

Oh but i remember now, within the Message I'm in i cant use guild so can i got with members instead?

split hazel
#

member.guild

finite bough
#

like inside

#

client.on('message'... event?

#

or bot.on

surreal wind
#

Yep

#

client.on

split hazel
#

well message contains guild object

finite bough
#

as u said u want to give someone who says !text

#

so message.member

#

agreed with speedy

surreal wind
#

Ah okay, sorry earlier today someone said guild isn't part of it

finite bough
#

like

#

message.guild.blabla

split hazel
surreal wind
#

Okay one step further. The get works now, as it seems. now the message.member.add.role() doesn't work. he keeps saying its undefined

summer torrent
#

roles.add()

finite bough
#

what is undefined

#

the role?

surreal wind
#

roles.add()
@summer torrent OH My God Thank you all

#

It works xD finally. Thank you all now ill look deeper into it how and why xD

finite bough
#

I rlly need to get a look on 12v docs ngl

summer torrent
surreal wind
#

Still thank you all @split hazel @finite bough and @summer torrent ^^

summer torrent
#

np

earnest phoenix
#

anyone good with PayPal/Stripe subscriptions and assigning Discord roles?

split hazel
#

I mean anyone can be good if you can read the docs and able to make an api request

#

But I have dealt with paypal requests before

earnest phoenix
#

true haha, Just not really my area of expertise. I was hoping to post in #434058442764714002 but can't seem to get anyone to message me back about it 😦

split hazel
#

I'll forward it on for you

earnest phoenix
#

that'd be quite awesome, thank you. I assume it'll be a quick little project if someone's familiar with PayPal or Stripe's API

flat pelican
#

You can DM Tonkku about it (as Oliy's DMs are disabled as far as I know)

spare goblet
#

@earnest phoenix if you have something you'd like to post in verified jobs you'll have to contact Oliy directly with a request

#

If not then poke Tonkku

flat pelican
#

Yes

earnest phoenix
#

@spare goblet I contacted Tonkku directly, never heard back, and Oliy doesn't accept messages from people who aren't his friend on Discord 😦

spare goblet
#

@earnest phoenix what did you send to Tonkku? :,)
Try not to ask to ask or something, just get right to the point that you'd like to post in verified jobs

#

And you'll most likely get a response

earnest phoenix
sonic lodge
#

hi is it possible to tell what text channels a user can or can't see based on their permissions?

spare goblet
#

@earnest phoenix you'll have to poke again, if he still forgets to respond let me know in Dms

earnest phoenix
#

kk, thank you πŸ™‚

spare goblet
#

@sonic lodge yes you can, what language

sonic lodge
#

discordjs

spare goblet
#

Check all the cached channels in the guild and check the member permissions of a channel

#

And filter it

sonic lodge
#

uhm would you mind giving me a start

#

say the role "jeb" gives the user access to a channel called "jeb-only"

#

owo would this work

bot.guilds.cache.forEach(function(guild) {
    if (guild.members.includes(user) { // user is of type GuildMember
        // they see it yey
    }
});```
finite bough
#

u can do it manually also

wooden sable
#

this has been going for a while, but no idea of someone ever told about. When in dark theme, the vote is still white

daring wharf
#

guys how can I make a discord web panel ?

#

for js

turbid bough
#

use nodejs and add some js code

#

add a button

earnest phoenix
#

you should get experienced with web developing first

turbid bough
#

make button make request

earnest phoenix
turbid bough
#

jesus that diagram

mossy vine
#

cuz node aint strictly related to web??

turbid bough
#

unless its not a webserver

mossy vine
#

bro why would nodejs be there

#

its not a fuckin webserver

turbid bough
#

express.js?

mossy vine
#

sure lets just express, fastify, flask, django, every shitty framework there

earnest phoenix
#

thats a web framework

knotty steeple
#

just say what u want

earnest phoenix
#

webservers are often used in combination with web frameworks to accomplish load balancing and reverse proxying

#

they're often the ones actually carrying the SSL certs too

topaz fjord
#

caddy offers ssl right?

#

I'm assuming it just uses letsencrypt

quartz kindle
#

what are those gray/red checkmarks on nginx?

knotty steeple
#

purple

turbid bough
quartz kindle
#

i have f.lux on, i cant see colors

turbid bough
#

what color is this? 🟣 ?

quartz kindle
#

gray

#

lmao

topaz fjord
#

@quartz kindle no

#

it's purple

turbid bough
#

dude its gray

quartz kindle
#

its gay

#

anyways, i can see the colors if i disable f.lux

#

otherwise im functionally colorblind

topaz fjord
#

it's purple

turbid bough
#

πŸ”΅ this is purple

topaz fjord
#

no

#

it isn't

#

i think you're a bit colorblind

turbid bough
#

no, this is blue 🟒

earnest phoenix
#

What is the possible reason that a bot could go offline without an error? I’m using discord.js

#

hi

#

Hello does anyone know how to DM a person with a bot when a person says+help ???

glad charm
#

What library?

earnest phoenix
#

discord.js

glad charm
earnest phoenix
#

ok

#

i looked at this before

#

it doesnt have dming the user through a bot

copper cradle
#

this thaun dude sayin' node.js is a web server

earnest phoenix
#

umm sorry?

copper cradle
#

not you

#

don't worry lol

earnest phoenix
#

oh

bitter rivet
#

Does anyone know if it possible to make a GUI with python or java?

lyric mountain
#

@bitter rivet with java you have Swing library

#

It's included in default java jdk

bitter rivet
#

oh

#

well with py?

lyric mountain
#

There's also AWT, but it's a bit more confuse than swing

#

With py idk

#

Probably there's some lib

bitter rivet
#

ok

#

Wait so it will do it by a pop-up?

lyric mountain
#

Well, kinda

bitter rivet
#

oh ok

#

i have an idea on GUI so idk

lyric mountain
#

Awt/swing works by creating windows

#

So it'd be like making UI with delphi for example

#

I'd recommend IDEs with a gui builder for that, like intellij/netbeans

dusky marsh
#

Im not a python dev, so i cant speak for the quality of these libraries, but the ones i always see from my python dev friends are kivy and tkinter

scenic kelp
#

I've built a ui with pyqt5 before, it's always an option

craggy cave
#

I can't see anywhere on the discord.py docs how to get specific shard info?
Like the guilds in shard 2 out of the rest
is it not something like?
self.bot.Shard_id[2].guilds
This is discord.py btw ^ If hopefully someone knows the answer.

scenic kelp
#

although for commercial use QT costs loads of money to license

dusky marsh
#

which is unfortunate

scenic kelp
#

very much so, it's amazing to work with

#

especially since there's the qt designer

#

makes designing windows a breeze

dusky marsh
#

yeah qt itself is great, but as all great things fall, the licensing thing sucks

earnest phoenix
#

Hello

#

I Need Help With The Donation Bot

split hazel
#

-donatebot @earnest phoenix

gilded plankBOT
#

@earnest phoenix

This is not the support server for Donate Bot. If you require assistance with Donate Bot, click here to join their support server.

split hazel
earnest phoenix
slender thistle
#

CSS

earnest phoenix
#

You can change the code of your top.gg page?

slender thistle
#

HTML/CSS/Markdown are supported in the long description to play around with your bot page

earnest phoenix
#

Oh, alright, thanks! :0

#

But the widgets are red?

#

i want edit a message of my bot, but this dont work.

if(command === "probando"){
  message.channel.send("1, 2, 3 probando");
  let canal = client.channels.get("645463565813284868");
  canal.fetchMessage(args[0]).then(msg => {
  canal.edit(args.slice(0).join(" "))
});
}
marsh rover
#

How do I say when this user gets offline send a webhook or to a channel a message

sudden geyser
#

You're trying to edit the channel instead of the message?

earnest phoenix
#

You're trying to edit the channel instead of the message?
@sudden geyser me?

#

i'm trying edit a message of the bot

sudden geyser
#

yeah well how are you sure the bot was the one who sent that message? also cancel is a guild channel.

earnest phoenix
#

i want edit a message for a suggest command

#

accept/no accept

#

@sudden geyser

queen violet
#

youre calling edit on the channel

earnest phoenix
#

so?

valid holly
#

Is this a proper way to await for 2 reactions but only pass 1 of the 2 ?

        const filter = (reaction, user) => {
            return reaction.emoji.id == "701801368490475521" && user.id !== client.user.id || reaction.emoji.id == "701801396181139527" && user.id !== client.user.id;
        }
        m.createReactionCollector(filter, {
            time: 5 * 60 * 1000,
            max: 1,
            maxUsers: 1
        })
        .on("collect", r => {
            console.log(r)
        })
queen violet
#

also identation pls

#

wdym so?

#

youre trying to edit the message?

#

and youre calling edit on the channel?

earnest phoenix
#

yeah

#

oh :v

sudden geyser
#

you fetchd the message yet you're not even doing anything with it

valid holly
#

@earnest phoenix
replace canal.edit with msg.edit

earnest phoenix
#

thx @queen violet @valid holly

queen violet
#

np

earnest phoenix
#

@queen violet i can remove the channel id?

knotty steeple
#

wow dep knows js /s

queen violet
#

wdym

earnest phoenix
#

what is wdym?

lyric mountain
#

What do you mean

earnest phoenix
#

oh

#

i'm spanish xd, srry

sinful garden
#

Hi

earnest phoenix
#

how to add the custom background in my bot page

lyric mountain
#

Css injection

split hazel
#

In long description

lyric mountain
#

Just add a <styles> tag in your long desc

#

And put css inside it

sick cloud
#

@knotty steeple so wanna help me

knotty steeple
#

will tryℒ️

sick cloud
#

if i console log channel/guild in the constructor, it's fine

#

but when i do this in the constructor

        this.guild = oguild;
        this.channel = ochannel;
#

doesnt save?

knotty steeple
sick cloud
#

it makes no sense

#

:\

knotty steeple
#

it

#

really doesnt

#

maybe for some dum reason u have to exclusively define it on this

#

idk my brain doesnt work either mmLol

sick cloud
#

it makes no sense

#

i said

#

fix it tbh or be banned

knotty steeple
#

lul idk

#

also if ur doing messages make it send first

sick cloud
#

it is sending

#

thats not the issue smfh

#

wait

#

i found the issue

knotty steeple
#

oh what is it

sick cloud
#

i didn't parse in the user, guild or channel

knotty steeple
#

smfh

earnest phoenix
#

how i can record audio?

lyric mountain
#

With software?

earnest phoenix
#

read every user's voice stream

#

you need to send audio to receive though

lyric mountain
#

Or just record output sound with some software like obs

topaz fjord
#

isn't that like

#

against tos or smth

#

or not allowed without user consent

lyric mountain
#

Only if you use a bot for that

#

But he didn't specify it

grizzled raven
#

@sick cloud log this.guild after you assign it

sturdy wyvern
#

hello

sick cloud
#

i already fixed it

grizzled raven
#

ok

#

xd

#

oh wait i read that wrong

#

im bigbbrain

grizzled raven
#

say if i want to store objects like this, ```js
{
required: 3,
requiredremove: 2,
blacklisted: ["171823917291871929", "89191029380108273819", "..."],
whitelisted: ["829199192837371819", "99281928101818372891", "..."],
roles: [
{id: "19292891901038191", stars: 25},
[Object],
//...
],
filterbots: false,
starself: false,
prefix: "star ",
linked: false,
clean: false,
downvote: false,
botsonlb: false,
imagesonly: false,
visible: true,
emoji: "⭐",
stars: {
first: "⭐",
second: "🌟",
third: "πŸ’«",
fourth: "✨"
},
lbdata: {
//...
"738817387173727738": {
stars: 237,
downvotes: 7,
global: 21,
starboarded: 79
},
"828271873871738830": [Object],
"372636191038371910": [Object],
//...
}
}

...for every guild, what database would best suit or would it even matter?
earnest phoenix
#

consider replacing those booleans with enum flags

#

that way you can flatten every single bool property into one

dense drift
#

Does anyone know how I can take an array like this

{ dummy: 'yes', '177188299943837696': 'yes' }```

And do something like,

```js
array.forEach(u => {
msg.channel.send('hi')
})

in js?

grizzled raven
#

@dense drift Object.keys(obj)

#

and

#

huh

dense drift
#

So could I do

Object.keys(u => {
msg.channel.send(`${obj} - hi`)
})```
#

Or is it a different setup?

#

I also pull the 'array' with client.userss.get('1')

grizzled raven
#

cry is it like how discord permissions are bit integers?

#

i mean

earnest phoenix
#

yup

grizzled raven
#

oh okay that would make more sense seeing as they can pnly be true or false

#

lets say i do do that, then what would be the answer to my initial question?

dense drift
#

tyvm Noob man

#

That's exactly what I needed

queen needle
#
if(message.content.startsWith(PREFIX + 'red')){
    var role= member.guild.roles.cache.find(role => role.name === "role name");
member.roles.add(role).then(message.channel.send("Role was added"))
  }``` why doesnt this add the role?
vestal crystal
#

@queen needle discord.js version?

queen needle
#

11.5.1

vestal crystal
#

message.member.addRole

knotty steeple
#

u dont use managers (.cache stuff) in v11

queen needle
#

oh okay

vestal crystal
#

remove .cache from your var. Then, insert a real role name in "role name"

queen needle
#
 
  if(message.content.startsWith(PREFIX + 'red')){
    var role= member.guild.roles.find(role => role.name === "role name");
    if(!role) return message.reply("Role does not exist")
member.roles.add(role).then(message.channel.send("Role was added"))
  }
#

so that

vestal crystal
#

@queen needle var role = message.guild.roles.find

#

not member

grizzled raven
#

same thing

#

unless member is undefined

vestal crystal
#

better be safe than sorry πŸ€·β€β™‚οΈ

queen needle
#

still doesnt work

vestal crystal
#

@queen needle show us the error

grizzled raven
#

ok is there an actual reason why this error occurrs? ```js
Error: Client network socket disconnected before secure TLS connection was established

vestal crystal
#

Okay, idk that

#

@grizzled raven try doing node . again?

high bough
#

ok is there an actual reason why this error occurrs?

Error: Client network socket disconnected before secure TLS connection was established

@grizzled raven Possibly because an error occured before the client was ready?

grizzled raven
#

bruh

lyric mountain
#

@grizzled raven that's discord api fluctuation

grizzled raven
#

well i know its not any of those

queen needle
#

find is not a function

lyric mountain
#

Happens sometimes

grizzled raven
#

yall gotta ping me 3 times

#

3 times

#

πŸ˜”

queen needle
#

@vestal crystal find is not a function

lyric mountain
#

Just ignore it, it's just you bot losing connection to discord then reconnecting again

grizzled raven
#

okay

#

just thought it had like a usefull meaning

earnest phoenix
#

How can I show the number of servers on the top.gg?

lyric mountain
#

-servercount

#

Damn

#

@ember atlas gimme a hand here

earnest phoenix
high bough
#

How can I show the number of servers on the top.gg?
@earnest phoenix You need to post it to top.gg

#

Using webhook or API

#

I did it before

earnest phoenix
#

how?

high bough
#

Here, a sec

lyric mountain
#

Search "discord bots list api"

vestal crystal
#

lol

lyric mountain
#

Servercount has the link to it

#

But normal peps can't use it

queen needle
#

anyone know why it says find is not a function

lyric mountain
#

Because it's not

queen needle
#

true

vestal crystal
#

@queen needle try message.guild.roles.find()

high bough
#
const DBL = require('dblapi.js');
const dbl = new DBL("<dbltoken>", { webhookPort: 5000, webhookAuth: '<password>' });

try {
  setInterval(() => {
    dbl.postStats(client.guilds.cache.size);
  }, 900000); //I recommend once per 30 mins
} catch (error) {
  console.log(error.stack) //check this if error
}
#

replace the dlbtoken and password with the actual token and password

earnest phoenix
#

ohh thank you

high bough
#

You can check in the edit page

vestal crystal
#

oh wow

queen needle
#

thats what im using

high bough
#

Do it on your client's on ready

earnest phoenix
#

password?

high bough
#

But you need to do npm i -s dblapi.js first

#

password?
@earnest phoenix Set it in the DBL Bot's edit page

#

You can check

#

use the webhook feature

earnest phoenix
#

Where is page?

#

oh sorry

high bough
earnest phoenix
#

yeap

high bough
#

At the very bottom of it

earnest phoenix
#

password where?

high bough
#

At the very bottom of it, read the webhooks section

earnest phoenix
#

yeaap

high bough
#

the authorization, fill it with some random numbers and texts, then paste is as <password>

#

The URL, just put your bot's IP adress

earnest phoenix
#

My bot ip adress?

high bough
#

yes

lyric mountain
#

The authorization field is quite important tho

high bough
#

Yup^^

lyric mountain
#

I'd not use random numbers

#

In my case I generated a 32 bit token

high bough
#

But if you want it easy, just fill in a random string

#

Like, sdbgaoiw984tvnw984ytq98w4tvwtmg or something

lyric mountain
#

Just make sure to never leak it

earnest phoenix
#

my bot is glitch

#

glitch url = bot ip?

high bough
#

LMAO glitch project

#

I think so

lyric mountain
#

@earnest phoenix you'll need a webhook server

#

If you're not sure what's your url then you most likely don't have one

high bough
lyric mountain
#

Google vm, stinky

high bough
#

lmao

#

Google vm, stinky
@lyric mountain It's $24 a month lol 3.75 RAM and 10GB storage
But I got the $300 free tier
And I'm using my parent's CC, 5 of them

lyric mountain
#

That's....quite expensive

#

Contabo is $4 a month

#

$5 for ssd

high bough
#

Lmao, bannable

lyric mountain
#

?

#

Like, I'm just advising cheaper VPSs

queen needle
#

is it possible to give a role a permision that displays it differently from users or no

earnest phoenix
#

How do I make sure that my bot can be online 24/7 without downtimes that doesn't even have errors?

#

My bot just sometimes goes offline and there's no errors

queen needle
#

what are you using

west raptor
#

no errors sounds unlikely if you're running it on a machine that's running 24/7

earnest phoenix
#

discord.js

#

no im running on a digitalocean droplet

west raptor
#

what are you using to host it

#

uh

#

yeah no errors sounds unlikely

earnest phoenix
#

what

#

but theres nothing

#

only missing permission errors

west raptor
#

your bot doesn't just die like that mate

#

there has to be some point of failure

earnest phoenix
#

but it does?

#

could it be rate limits?

west raptor
#

being ratelimited in d.js isn't fatal

earnest phoenix
#

hmm

#

all i see are missing permission errors

west raptor
#

those aren't fatal either (althoufhr you should have checks and try catches)

earnest phoenix
#

i have an error catcher for all commands

west raptor
#

is there any sort of pattern that it just shirts off?

#

shuts"

#

I can type

earnest phoenix
#

randomly

west raptor
#

huh

earnest phoenix
#

sometimes its fine and is online the entire day and sometimes it goes offline like every 10 minutes

west raptor
#

seems like it could be a certain command or event?

earnest phoenix
#

great now my ftp freezed

queen needle
#

is it possible to create a role with the permison that it displays differently from users

      .createRole({
        name: "Special Muffin Role",
        color: "#8cecd8",
           permissions: ['DISPLAY_ROLE_MEMBERS_SEPARATELY_FROM_ONLINE_MEMBERS']
      })```
earnest phoenix
#

its not a permission

#

what lib?

queen needle
#

discord.js is it possible to add that though

earnest phoenix
#

yes there is

#

just add an option hoist: true

#

How do I handle Discord API errors?

pale vessel
#

catch

earnest phoenix
#

no

lapis stirrup
#

There are plenty of tutorials online πŸ˜„

wheat jolt
#

Why

#

Also, I issued the certificate using certonly

#

I tried to chmod 755 /etc/letsencrypt/live/..............ro/ but no luck

queen needle
#
let PREFIX = "^";
client.on("message", message =>{
  
  let args = message.content.substring(PREFIX.length).split(" ");
  switch (args[0]) {
    case "react":
      message.channel.send("").then(message.react(args[1]));
      break;
  }
})```why does this react to anything that is before react ex sreact 😒 works
#

but it should

#

shouldny

earnest phoenix
#

How to use animated pfp in dbl Website and color bg

meager cobalt
#

Cinniamon try hard defining the emoji fisrt then work on getting it so it works with a user input

queen needle
#

i got it

meager cobalt
#

cool

tight plinth
#

so I have a sharex upload server hosted on glitch.com, and I need to find an algorithm who can :
-check the number of files with the same extension
-if there is more than 100, delete the oldest one
but I cant find any way of doing this. I use php

pale vessel
#

why don't you use php itself and check the files

tight plinth
#

the problematic part is about
-deleting the oldest one
-be sure that the algorithm executes once per upload

#

I do

pale vessel
#

use filectime() to check the date maybe

tight plinth
#

hmm

main jacinth
#

why my bot is not on the list? My friend does not see it.

tight plinth
#

its not accepted

pale vessel
#

because it's not approved yet

#

that's even worse

tight plinth
pale vessel
#

why did you close the foreach early?

#

you messed the glob up

main jacinth
#

what have to be approved with who?

tight plinth
#

after

pale vessel
#

add a semicolon

#

it's php

#

why would you have an empty else

main jacinth
#

i have to paste my code to the bigger description?

tight plinth
#

@main jacinth no

main jacinth
#

my friend told me about it.

#

thx

tight plinth
#

line 24 now

pale vessel
#

add a semicolon
@pale vessel

#

do you know php?

tight plinth
#

a little bit

#

not my favorite language tho

#

I misunderstood the word "semi-colon"

pale vessel
#

why not? it's like learning js

tight plinth
#

I was thinking about something else

pale vessel
#

i know js because i use php

#

ah ok makes sense

tight plinth
#

that was my problem

#

thx for help

main jacinth
#

approve my @arctic oracle please.

glad charm
#

@main jacinth this is not the place for that kind of discussion. Also you're going to have to wait just like everyone else does. Take any other convo to #memes-and-media

main jacinth
#

what i will do when they will decline my bot?

tight plinth
#

check reason, fix it, resubmit

warm maple
#

i made mute/ban/kick commands and only kick and ban work

pale vessel
#

read docs

warm maple
#

mute gives me this

pale vessel
#

that is not how you find roles

robust moth
#

How can I stop running setInterval in same command ????

pale vessel
#

clearInterval()

robust moth
#

Ok

earnest phoenix
#

is member.system to get the users device

quartz kindle
#

there is no member.system in discord.js

earnest phoenix
#

ok is there an way to get it then

summer torrent
#

<User>.presence.clientStatus

earnest phoenix
#

kk thx

robust moth
iron steeple
#

Tried .equals?

sullen patrol
#

i made mute/ban/kick commands and only kick and ban work
@NikXSimulations#5617 switch role and find around

sick cloud
#

incredibly confusing πŸ˜”

pale vessel
#

what's inside Heartbeat.js?

sick cloud
#

just a function

#

do you want to see the files

pale vessel
#

sure

#

that one file only

pale vessel
#

require('./Gateway')(client, true);

#

ah and await

sick cloud
#

i'll give that a go and hope it works

#

gotta wait a fair while to test it as its the resume func

#

but ty

#

if i don't come back screaming in a couple hours, assume it worked

quartz kindle
#

could also be a require loop

feral gazelle
#

F@#k

#

Bitch

#

Benchod

quartz kindle
#

as gateway requires heartbeat which requires gateway which requires heartbeat...

feral gazelle
#

Ma ke lora

#

Mother fucker

pale vessel
#

@drowsy sentinel

sick cloud
#

i'm not really sure how to solve it then @quartz kindle tbh

feral gazelle
#

@sick cloud fuck

torpid juniper
#

@sick cloud are you requiring gateway in heartbeat

sick cloud
#

heartbeat has to close the gateway then rerun it to resume

#

um ye

#

it's a bad system i guess

#

but i don't know how else to redo it

torpid juniper
#

youre requiring heartbeat in gateway

#

you have a circular dependency

quartz kindle
#

you should initialize the gateway and pass it as an instance to everything else i guess

sick cloud
#

oh ok

#

so that circular dep is killing it when it tries to run it

torpid juniper
#

p much

sick cloud
#

because heartbeat needs to re run gateway with true to do the resume gateway and all

torpid juniper
#

make a shared module

#

that deals with it

#

to prevent circular

sick cloud
#

how should i do that, just a class?

torpid juniper
#

yeah

sick cloud
#

alright will do

quartz kindle
#

speaking of websocket, is there any benefit on running ETF encoding in node?

storm bluff
#
at /app/commands/anti/antlinks.js:81:22
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4849:16
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4849:16
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/helpers/promiseOrCallback.js:24:16
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4872:21
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/query.js:4379:11
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/kareem/2.3.1/node_modules/kareem/index.js:135:16
    at processTicksAndRejections (internal/process/task_queues.js:81:9)
(node:12740) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12740) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
help :\
quartz kindle
#

since you'd need to convert it to json anyway

sick cloud
#

i don't use it myself

torpid juniper
#

@storm bluff a stack is useless

#

show code

quartz kindle
#

im experimenting with zlib-stream

storm bluff
#
          let msg = args[1];

          if (!msg) return message.channel.send("Please select a link");
          let msg2 = guild.antilinks.links;
          wlcm.links.push(msg);

          model.updateOne(
            { guild: message.guild.id },
            { antilinks: { status: guild.antilinks.status, links: msg2 } },
            (err, res) => {
              if (err) console.log(err);
            }
          );

          message.channel.send(`Successfully add ${msg} to denylinks list`);
        }```
quartz kindle
#

maybe i'll test ETF later

torpid juniper
#

whats wlcm

storm bluff
#

wlcm = guild.antlinks

#

guild = mongodb

torpid juniper
#

and what is that

#

antilinks

#

a collection?

quartz kindle
#

well, your wlcm.links is null

#

you have to find out why

torpid juniper
#

or its not an array

#

@quartz kindle

#

oh no it is null

#

nvm

storm bluff
#
(node:12936) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'push' of null
at /app/commands/anti/antlinks.js:81:33
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4849:16
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4849:16
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/helpers/promiseOrCallback.js:24:16
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/model.js:4872:21
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/mongoose/5.9.9/node_modules/mongoose/lib/query.js:4379:11
    at /rbd/pnpm-volume/e1e08311-0371-408e-970f-c27ce79f1865/node_modules/.registry.npmjs.org/kareem/2.3.1/node_modules/kareem/index.js:135:16
    at processTicksAndRejections (internal/process/task_queues.js:81:9)
(node:12936) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12936) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
@torpid juniper @quartz kindle
quartz kindle
#

i told you

#

your wlcm.links is null

earnest phoenix
#

How to use animated pfp in dbl Website and color bg
@earnest phoenix

#

Anyone

storm bluff
#

i delete the wlcm

torpid juniper
#

you cant

#

use an animated pfp

storm bluff
#

now guild.antilinks.links.push(msg);

torpid juniper
#

and use css to style

quartz kindle
#

its still null

#

guild.antilinks.links is null

storm bluff
#

how ?

quartz kindle
#

i dont know, its your database

#

i dont know how you structured it

storm bluff
#

oke thanks

earnest phoenix
#

@earnest phoenix it just puts your bot's avatar in the dbl website and it only shows the first frame of the gif avatar if it's avatar is a gif

quartz kindle
#

can bots even have animated avatars?

earnest phoenix
#

Hmm can't they?

quartz kindle
#

dont think so

earnest phoenix
#

(I remember seeing a bot with an animated avatar idk)

torpid juniper
#

that was a bug

#

using apngs

#

its been fixed

robust moth
#

If statement not working

  if (args[0] == "stop") {
    clearInterval(m);
    return message.channel.send("interval stop");
  }
  
  m = setInterval(async () => {
    let embed = new discord.MessageEmbed()
      .setColor("RANDOM")
      .setAuthor(
        "Coronavirus Global Stats",
        "https://media.giphy.com/media/UUsOy6IWmzw6mmeOpQ/giphy.gif"
      )
      .setDescription(
        "Latest info about the novel coronavirus\nUse cov!regioninfo to get more specific information."
      )
      .addField("🌍 Total Infected", `βž™ \`${data.confirmed.value}\``)
      .addField("🌍 Total Recovered", `βž™ \`${data.recovered.value}\``)
      .addField("🌍 Total Dead", `βž™ \`${data.deaths.value}\``)
      .setFooter("[!] Data might be from yesterday");
    message.channel.send(embed);
  }, 5000);```
torpid juniper
#

thats api abuse

quartz kindle
#

you need to define m outside of your function

#

else you will just create a new m and a new iterval everytime the command is run

#

the interval has to be stored somewhere outside, that you can access from other instances of the command

clever arch
#

it's not working on discord.js 12

#

but it was working on discord.js 11 😦