Skip to content

Send message in channel via a function #8609

Closed Answered by almostSouji
AymenBerb asked this question in Q&A
Discussion options

You must be logged in to vote

For the same reason as I outlined before:
The channel you are trying to get is not cached at the point this code runs.

Looking at your code, that is further confirmed by it running before the client is even logged in and ready
Which means it runs before it has gotten any information about the guilds (servers) it is in
Which in turn means it runs before there is any channel cached to begin with

Execute that only in a scope that happens after the client is logged in (which is why your comments state that the send does in fact work in those contexts)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AymenBerb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants