fix clipboard functionality, add channel:read:polls intent

This commit is contained in:
2025-04-05 18:09:54 +02:00
parent 564ead12c6
commit d565945428

View File

@@ -35,10 +35,10 @@ async function firstAccess(main = true) {
if ((main && !OAUTH_CODE) || (!main && !BROADCASTER_OAUTH_CODE)) { if ((main && !OAUTH_CODE) || (!main && !BROADCASTER_OAUTH_CODE)) {
if (main) { if (main) {
console.error("No 'OAUTH_CODE' provided. To get the code, please visit this URL, authorize the bot and copy the 'code' from the return URL.") console.error("No 'OAUTH_CODE' provided. To get the code, please visit this URL, authorize the bot and copy the 'code' from the return URL.")
console.error(`https://id.twitch.tv/oauth2/authorize?client_id=${CLIENT_ID}&redirect_uri=${REDIRECT_URI}&response_type=code&scope=chat:read+chat:edit+moderator:manage:banned_users+moderation:read+channel:manage:polls`) console.error(`https://id.twitch.tv/oauth2/authorize?client_id=${CLIENT_ID}&redirect_uri=${REDIRECT_URI}&response_type=code&scope=chat:read+chat:edit+moderator:manage:banned_users+moderation:read+channel:manage:polls+channel:read:polls`)
} else { } else {
console.error("No 'BROADCASTER_OAUTH_CODE' provided. To get the code, please make the broadcaster visit the following URL, and get them to return the 'code' from the return URL.") console.error("No 'BROADCASTER_OAUTH_CODE' provided. To get the code, please make the broadcaster visit the following URL, and get them to return the 'code' from the return URL.")
console.error(`https://id.twitch.tv/oauth2/authorize?client_id=${CLIENT_ID}&redirect_uri=${REDIRECT_URI}&response_type=code&scope=moderator:manage:banned_users+moderation:read+channel:manage:moderators+channel:manage:polls`) console.error(`https://id.twitch.tv/oauth2/authorize?client_id=${CLIENT_ID}&redirect_uri=${REDIRECT_URI}&response_type=code&scope=moderator:manage:banned_users+moderation:read+channel:manage:moderators+channel:manage:polls+channel:read:polls`)
} }
process.exit(1) process.exit(1)
} }
@@ -69,7 +69,7 @@ await authProvider.addUserForToken({
refreshToken: auth.REFRESH_TOKEN, refreshToken: auth.REFRESH_TOKEN,
expiresIn: auth.EXPIRESIN, expiresIn: auth.EXPIRESIN,
obtainmentTimestamp: auth.OBTAINMENTTIMESTAMP obtainmentTimestamp: auth.OBTAINMENTTIMESTAMP
}, ['chat', 'moderator:manage:banned_users', 'channel:manage:polls', 'channel:manage:moderators']) }, ['chat', 'moderator:manage:banned_users', 'channel:manage:polls', 'channel:read:polls', 'channel:manage:moderators'])
authProvider.onRefresh(async (_id, newTokenData) => { authProvider.onRefresh(async (_id, newTokenData) => {
auth.ACCESS_TOKEN = newTokenData.accessToken auth.ACCESS_TOKEN = newTokenData.accessToken
@@ -95,7 +95,7 @@ const broadcasterAuthProvider = broadcasterAuthData === undefined ? undefined :
refreshToken: broadcasterAuthData.REFRESH_TOKEN, refreshToken: broadcasterAuthData.REFRESH_TOKEN,
expiresIn: broadcasterAuthData.EXPIRESIN, expiresIn: broadcasterAuthData.EXPIRESIN,
obtainmentTimestamp: broadcasterAuthData.OBTAINMENTTIMESTAMP obtainmentTimestamp: broadcasterAuthData.OBTAINMENTTIMESTAMP
}, ['moderator:manage:banned_users', 'moderation:read', 'channel:manage:moderators', 'channel:manage:polls']) }, ['moderator:manage:banned_users', 'moderation:read', 'channel:manage:moderators', 'channel:manage:polls', 'channel:read:polls'])
broadcasterAuthProvider.onRefresh(async (_id, newTokenData) => { broadcasterAuthProvider.onRefresh(async (_id, newTokenData) => {
broadcasterAuthData.ACCESS_TOKEN = newTokenData.accessToken broadcasterAuthData.ACCESS_TOKEN = newTokenData.accessToken