コード例 #1
0
        //[Obsolete("Guild subscription is deprecated in favor of lazy guilds.")]
        //public void SubscribeToGuildAsync(ulong[] channelIds)
        //{
        //    throw new NotImplementedException();
        //}

        public async Task UpdateStatusAsync(UserStatus status, int?idleSince = null, bool isAfk = false)
        {
            var payload = new StatusUpdate()
            {
                Status    = status.GetStringValue(),
                IdleSince = idleSince,
                IsAFK     = isAfk,
            };

            await UpdateStatusAsync(payload);
        }
コード例 #2
0
            /// <summary>
            /// Updates the user's online status.
            /// </summary>
            /// <param name="status">The new online status to set.</param>
            public async Task UpdateStatus(UserStatus status)
            {
                Guard.IsNotNull(_client.Gateway, nameof(_client.Gateway));
                Guard.IsNotNull(_client.UserService, nameof(_client.UserService));

                await _client.Gateway.UpdateStatusAsync(status);

                var settingsUpdate = new JsonModifyUserSettings()
                {
                    Status = status.GetStringValue(),
                };
                await _client.UserService.UpdateSettings(settingsUpdate);
            }