Example #1
0
        public async Task <Group <TPublic, TPrivate> > WithMessaging()
        {
            _notifications = await _notificationsApi.Subscribe(AppId, "group", Id);

            _notifications.OnNotification += (notification) => notification.Log($"[Group-{Id}] [Notification]");
            return(this);
        }
Example #2
0
        public async Task <Profile> WithMessaging()
        {
            _notifications = await Owner.Notifications.Subscribe(AppId, "profile", Id);

            _notifications.OnNotification += (notification) => notification.Log("[Notification]");
            return(this);
        }
Example #3
0
        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);
        }