Query collaboration capabilities
This commit is contained in:
@@ -149,6 +149,7 @@
|
|||||||
let collaboratorSearchTimer: number | undefined;
|
let collaboratorSearchTimer: number | undefined;
|
||||||
let sharedChatSession: { session_id: string; host_broadcaster_id: string; participants: Array<{ broadcaster_id: string }> } | null = null;
|
let sharedChatSession: { session_id: string; host_broadcaster_id: string; participants: Array<{ broadcaster_id: string }> } | null = null;
|
||||||
let collaborationSettings: { is_moderator_send_live_enabled: boolean; slot_count: number; is_browser_source_audio_enabled: boolean; group_layout: string; browser_source_token: string } | null = null;
|
let collaborationSettings: { is_moderator_send_live_enabled: boolean; slot_count: number; is_browser_source_audio_enabled: boolean; group_layout: string; browser_source_token: string } | null = null;
|
||||||
|
let collaborationCapabilities: { guest_star_available: boolean; guest_star_reason?: string | null; shared_chat_available: boolean; shared_chat_reason?: string | null } | null = null;
|
||||||
let oauthLink = '';
|
let oauthLink = '';
|
||||||
let oauthIdentity: 'streamer' | 'bot' = 'streamer';
|
let oauthIdentity: 'streamer' | 'bot' = 'streamer';
|
||||||
let oauthBusy = false;
|
let oauthBusy = false;
|
||||||
@@ -492,6 +493,8 @@
|
|||||||
|
|
||||||
async function loadCollaboration() {
|
async function loadCollaboration() {
|
||||||
try {
|
try {
|
||||||
|
const capabilities = await fetch(`${serverAddress}/api/v1/twitch/collaboration/capabilities`, { headers: { authorization: `Bearer ${sessionToken}` } });
|
||||||
|
if (capabilities.ok) collaborationCapabilities = await capabilities.json();
|
||||||
const response = await fetch(`${serverAddress}/api/v1/twitch/collaboration/session`, { headers: { authorization: `Bearer ${sessionToken}` } });
|
const response = await fetch(`${serverAddress}/api/v1/twitch/collaboration/session`, { headers: { authorization: `Bearer ${sessionToken}` } });
|
||||||
if (!response.ok) return;
|
if (!response.ok) return;
|
||||||
collaborationSession = await response.json();
|
collaborationSession = await response.json();
|
||||||
@@ -507,6 +510,7 @@
|
|||||||
collaborationSession = null;
|
collaborationSession = null;
|
||||||
sharedChatSession = null;
|
sharedChatSession = null;
|
||||||
collaborationSettings = null;
|
collaborationSettings = null;
|
||||||
|
collaborationCapabilities = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user