diff --git a/README.md b/README.md new file mode 100644 index 0000000..c7f484b --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# OpenMandooBot + + +## Configuration + +VARIABLE|DEFAULT|FUNCTION +-|-|- +`BOT_NAME`|None|Set the name of the bot user for Authentification +`CHANNEL`|None| Set the name of the twitch channel to join +`CLIENT_ID`|None|Set the CLIENT_ID to authenticate the bot (ignored after setup) +`CLIENT_SECRET`|None|Set the CLIENT_SECRET to authenticate the bot (ignored after setup) +`REDIRECT_URI`|`https://qweri0p.github.io/url-params/`|The REDIRECT_URI set in the twitch dev console (optional after setup) +`OAUTH_CODE`|None|Authorization code for OAuth (ignored after setup) +`DIFFERENT_BROADCASTER`|`false`|Set this to true when `BOT_NAME` and `CHANNEL` are different. +`BROADCASER_OAUTH_CODE`|None|OAuth authorization code for the broadcaster (ignored if `DIFFERENT_BROADCASTER` is false) (optional after setup) +`PBURL`|`http://pocketbase:8090`|Where the pocketbase database is found +`EMAIL`|`test@example.com`|Pocketbase Admin UI email used for login (ignored after setup) +`PASSWORD`|`1234567890`|Pocketbase Admin UI password used for login (ignored after setup) diff --git a/src/bot.ts b/src/bot.ts index d9eafa7..bb9eb70 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -13,7 +13,6 @@ const bot = new Bot({ }) bot.onConnect(async () => { - // await authProvider.refreshAccessTokenForUser(238377856) const name = await api.users.getUserByName(process.env.BOT_NAME!) await authProvider.refreshAccessTokenForUser(name?.id!) if (broadcasterAuthProvider) { diff --git a/src/lib/pocketbase.ts b/src/lib/pocketbase.ts index bbb608b..3ceec0e 100644 --- a/src/lib/pocketbase.ts +++ b/src/lib/pocketbase.ts @@ -1,3 +1,4 @@ import PocketBase from 'pocketbase' -const pb = new PocketBase('http://pocketbase:8090') -export default pb \ No newline at end of file +const PBURL = process.env.PBURL ?? 'http://pocketbase:8090' +const pb = new PocketBase(PBURL) +export default pb