using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Sandbox
{
public struct StreamUser
{
public string Id { get; internal set; }
public string Login { get; internal set; }
public string DisplayName { get; internal set; }
public string UserType { get; internal set; }
public string BroadcasterType { get; internal set; }
public string Description { get; internal set; }
public string ProfileImageUrl { get; internal set; }
public string OfflineImageUrl { get; internal set; }
public int ViewCount { get; internal set; }
public string Email { get; internal set; }
public DateTimeOffset CreatedAt { get; internal set; }
///
/// Get following "Who is following us"
///
public Task> Following
{
get => Engine.Streamer.CurrentService?.GetUserFollowing( Id );
}
///
/// Get followers "Who are we following"
///
public Task> Followers
{
get => Engine.Streamer.CurrentService?.GetUserFollowers( Id );
}
///
/// Ban user from your chat, the user will no longer be able to chat.
/// Optionally specify the duration, a duration of zero means perm ban
/// (Note: You have to be in your chat for this to work)
///
public void Ban( string reason, int duration = 0 )
{
if ( duration == 0 )
{
Engine.Streamer.CurrentService?.BanUser( Login, reason );
}
else
{
Engine.Streamer.CurrentService?.TimeoutUser( Login, duration, reason );
}
}
///
/// Unban user from your chat, this allows them to chat again
/// (Note: You have to be in your chat for this to work)
///
public void Unban()
{
Engine.Streamer.CurrentService?.UnbanUser( Login );
}
///
/// Create a clip of our stream, if we're streaming
///
public Task CreateClip( bool hasDelay = false )
{
return Engine.Streamer.CurrentService?.CreateClip( Id, hasDelay );
}
///
/// Start a poll on our channel with multiple choices, save the poll so you can end it later on
///
public Task CreatePoll( string title, int duration, string[] choices )
{
return Engine.Streamer.CurrentService?.CreatePoll( Id, title, duration, choices );
}
///
/// Create a prediction on our channel to bet with channel points
///
public Task CreatePrediction( string title, int duration, string firstOutcome, string secondOutcome )
{
return Engine.Streamer.CurrentService?.CreatePrediction( Id, title, duration, firstOutcome, secondOutcome );
}
}
}