#monitor_endpoints.js

1 messages · Page 1 of 1 (latest)

dark vale
#

Yes, im just running the individual file right now for testing.

fringe ore
#

looks really strange..

#

try to search for message

#

@dark vale please send messages about this issue here:)

dark vale
#

Dont have any message apart from whats in the text on line 10

#

@fringe ore ^

fringe ore
dark vale
#

(IDK if you get auto pinged)

#

So do I need to define a channel?

fringe ore
#

you are, but.. error says that message is not defined, isn't it?

dark vale
#

correct

#

so I guess it isnt defined what channel to send it in, which is why the error occurs?

fringe ore
#

show FULL error again

dark vale
fringe ore
#

ok, lets start from defining channel

#

where you want to send it?

dark vale
#

doesnt matter, lets say a #general type channel. Private server

#

I can give a specific ID as well

#

1054470144442769539

fringe ore
#

would suggest to pass channel as argument to the checkIPIsOnline function

#

to get channel by id you can use <Client>.channels.cache.get(id)

dark vale
#

even if its a static channel?

#

There isnt a user initiating a check here, the nodeJS script pings an IP and on status change will send a message

fringe ore
#

wdym

dark vale
#

Something like this?

fringe ore
dark vale
fringe ore
#

did you pass second argument to this function?

dark vale
#

Yes

fringe ore
#

show

dark vale
#

Should it be text not a number?

#

do I just need to define channel.send?

fringe ore
#

it must be instance of BaseGuildTextChannel

fringe ore
dark vale
#

let me give that a shot

queen berryBOT
#

property Client#channels
All of the [BaseChannel](<https://discord.js.org/#/docs/discord.js/main/class/BaseChannel>)s that the client is currently handling, mapped by their ids - as long as sharding isn't being used, this will be every channel in every guild the bot is a member of. Note that DM channels will not be initially cached, and thus not be present in the Manager without their explicit fetching or use.

fringe ore
#

here is docs

dark vale
fringe ore
#

show how you do

dark vale
#

Just sending undefined

fringe ore
#

is client ready?

dark vale
#

Let me doubel check

fringe ore
#

where are you using it

#

outside of any functions?

dark vale
#

Yeah I was, client wasnt ready, fixed it

#

Output

fringe ore
#

solved?

#

or fixed only client?

dark vale
#

Fixed only client

#

Still getting channel.send is not a function.

fringe ore
fringe ore
dark vale
fringe ore
#

Thonk you still passing string and not channel

dark vale
#

2nd arg was us testing now, 1st arg works fine and checks fine, just cant send the message to a channel

fringe ore
dark vale
#

Ah I see

#

There we go! Thanks for the help