예제 #1
0
        /// <summary>
        /// Edit a mod team members details.
        /// </summary>
        public async Task Edit(uint member, TeamLevel level, string?position = null)
        {
            var parameters = new Parameters {
                { "level", level.ToString() },
            };

            if (position != null)
            {
                parameters.Add("position", position);
            }

            var(method, path) = Routes.EditTeamMember(GameId, ModId, member);
            var req = new Request(method, path, parameters.ToContent());

            await Connection.Send <ApiMessage>(req);
        }
예제 #2
0
        /// <summary>
        /// Add a user to a mod team.
        /// </summary>
        public async Task Add(string email, TeamLevel level, string?position = null)
        {
            Ensure.ArgumentNotNull(email, nameof(email));

            var parameters = new Parameters {
                { "email", email },
                { "level", level.ToString() },
            };

            if (position != null)
            {
                parameters.Add("position", position);
            }

            var(method, path) = Routes.AddTeamMember(GameId, ModId);
            var req = new Request(method, path, parameters.ToContent());

            await Connection.Send <ApiMessage>(req);
        }