Oauth2 bot reply
Im stuck if somebody can help:
I got the info from the Oauth2, but now im lost as to how to send back a dm to the user
the above is fine, im getting the info.
this the function that supposed to put the bot instance on
the function is firing, the client doesnt go on
7 Replies
I mean, OAuth2 and a bot are really completely different things
What client? Where is it logged in? What makes it ready?
whenever I use client.whatever, Ineed to be inside a
in this file I have many listeners
all the client.user, cache methods have to be used inside those client.on main function listeners
in this same file i have the backend express routes that handle the auth2
i cannot use client.user or whatever inside an express endpoint, unless inside a .then() i make a new instance of the bot online, but that sounds weird
the bot logins at the bottom of this file `client.login(token)
I know Oauth2 and bot are 2 different things (that is why i put the backend and the bot in the same file)
@yinoguns which scope do you mean
JavaScript scope
anywhere in the module?
Basic JS.
If the client is in scope, then it is usable.
Events are mearly the expected cause of needing to envoke the client in some way.
all the client.user, cache methods have to be used inside those client.on main function listenersThis is technically true but that doesn't mean your ready event is going to fire again just because an OAuth2 endpoint called a function Assuming you do have a client in scope, it's probably already fired
ready
at this point
you would just need to check that its ready, then use itholy crap is working
i thought i needed to be insice a client scope
thanks guys