public async Task <Group <TPublic, TPrivate> > WithMessaging() { _notifications = await _notificationsApi.Subscribe(AppId, "group", Id); _notifications.OnNotification += (notification) => notification.Log($"[Group-{Id}] [Notification]"); return(this); }
public async Task <Profile> WithMessaging() { _notifications = await Owner.Notifications.Subscribe(AppId, "profile", Id); _notifications.OnNotification += (notification) => notification.Log("[Notification]"); return(this); }
public async Task <Player> WithMessaging() { if (string.IsNullOrEmpty(Token)) { throw new Exception("Can't invoke Player.WithMessaging() without being connected"); } _messaging = new MessagingApi(Token); await _messaging.Connect(); // Subscribe to player channel Notifications = new NotificationsApi(_api.GetHttp(), _messaging); _playerNotifications = await Notifications.Subscribe(AppId, "player", Id); return(this); }