mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 08:41:39 +01:00
fix clipboard functionality, add channel:read:polls intent
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user