Search
Get Started
d-I❄
discord.js - Imagine ❄
•
3y ago
Waxer59
Get channel by id
Hi
, im trying to get a channel by it
's id but i get undefined
discord.js - Imagine ❄
Join
Support server for discord.js, a Node.js module to interact with Discord's apps API.
58,353
Members
View on Discord
Was this page helpful?
Yes
No
P
Parogo_72
•
1/21/23, 12:47 AM
Then either the id is wrong
, or you use that code outside an event
P
Parogo_72
•
1/21/23, 12:47 AM
Or missing Guilds intent
W
Waxer59
OP
•
1/21/23, 12:48 AM
Can
't you get a channel by its id outside an event
?
P
Parogo_72
•
1/21/23, 12:49 AM
If the bot isnt logged in the cache will be empty
W
Waxer59
OP
•
1/21/23, 12:52 AM
and what would be the way for the cache to be loaded using a function outside of an event
, if any
?
P
Parogo_72
•
1/21/23, 12:53 AM
As I said the bot needs to be logged in
P
Parogo_72
•
1/21/23, 12:53 AM
So you either call that function inside an event
, or somewhere where you know for sure that the bot already logged in
W
Waxer59
OP
•
1/21/23, 12:53 AM
ok ty