No. You must use a user token
When the token expries you’ll need to use the refresh token to get a new token.
So .env might not be practical since the key will change periodicailly.
Sure use .env for ClientID and Secret (since you need the secret to run refreshs)
But the actual token/refresh token probably does work well in .env as it changes
This will give you a useless user token. As when the user token dies you’ll have to manually give it a new token
You should create your own oAuth flow using your own ClientID. And then seed the bot with a user token/refresh token.
I touched on that here. You really shouldn’t be using someone elses generator for your own tools. If that ClientID gets revoked all your stuff dies
I tryied to fetch programmatically my
access_tokenwith OAuth client credentials flow but for some reasons I didn’t managed to pass the token to my client yet because of some bugs.
This is the wrong kind of token for a chat bot.
As A Client Creds token does not represent a user.
Which scope allow me to ban some ppl if it’s not
channel:moderate(Perform moderation actions in a channel. The user requesting the scope must be a moderator in the channel)?
channel:moderate is the required scope, this lets this key be able to send /ban
However the account will also need to be a mod on the channel you are trying to perfrom moderation actions on.
I’m just having some trouble to the connection because I get a permission error when I try to ban someone:
[16:58] info: [#carbow] You don't have permission to perform that action. Error banning azehoss00313: no_permission
This indicates that your bot user account is not a mod on carbow
And/or the User Token used omits the channel:moderate scope.