public UserViewModel(PubSubWhisperEventRecipientModel whisperRecipient) { this.SetUserData(twitchID: whisperRecipient.id.ToString()); this.TwitchID = whisperRecipient.id.ToString(); this.TwitchUsername = whisperRecipient.username; this.TwitchDisplayName = (!string.IsNullOrEmpty(whisperRecipient.display_name)) ? whisperRecipient.display_name : this.TwitchUsername; this.TwitchAvatarLink = whisperRecipient.profile_image; this.SetTwitchRoles(); }
public static async Task <UserViewModel> Create(PubSubWhisperEventRecipientModel whisperRecipient) { UserViewModel user = await UserViewModel.Create(StreamingPlatformTypeEnum.Twitch, whisperRecipient.id.ToString()); user.TwitchID = whisperRecipient.id.ToString(); user.TwitchUsername = whisperRecipient.username; user.TwitchDisplayName = (!string.IsNullOrEmpty(whisperRecipient.display_name)) ? whisperRecipient.display_name : user.TwitchUsername; user.TwitchAvatarLink = whisperRecipient.profile_image; user.SetTwitchRoles(); ChannelSession.Settings.SetUserData(user.Data); return(user); }