Ejemplo n.º 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);
        }
Ejemplo n.º 2
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);
        }