CSharpTradeOffers.Community.CommunityHandler.GroupEvent C# (CSharp) Метод

GroupEvent() публичный Метод

Posts an event to the specified group.
public GroupEvent ( string groupName, string eventName, string eventNotes, string eventType, System.DateTime startDateAndTime, string timeChoice = "quick", string serverPassword = "", IPAddress serverAddress = null, int appId = -1, int timezoneOffset = -18000 ) : IResponse
groupName string Groupname of the steam group.
eventName string The name of the event.
eventNotes string The notes of the event.
eventType string
startDateAndTime System.DateTime
timeChoice string "quick" which means now, or "specific" which means will start at the given date/time.
serverPassword string Password to the server.
serverAddress System.Net.IPAddress
appId int
timezoneOffset int
Результат IResponse
        public IResponse GroupEvent(string groupName, string eventName, string eventNotes, string eventType, DateTime startDateAndTime,
                               string timeChoice = "quick", string serverPassword = "", IPAddress serverAddress = null, int appId = -1, int timezoneOffset = -18000)
        {
            string url = "http://steamcommunity.com/groups/" + groupName + "/eventEdit";

            string sessionid =
                (from Cookie cookie in _account.AuthContainer.GetCookies(new Uri("https://steamcommunity.com"))
                 where cookie.Name == "sessionid"
                 select cookie.Value).FirstOrDefault();

            var data = new Dictionary<string, string>
            {
                {"sessionid", sessionid},
                {"tzOffset", timezoneOffset.ToString()},
                {"type", eventType}, // What type of event? BroadcastEvent, Chat, etc
                {"timeChoice", timeChoice}, // "quick" which means now, or "specific" which means will start at the given date/time
                {"startMinute", startDateAndTime.TimeOfDay.Minutes.ToString()},
                {"startHour", startDateAndTime.TimeOfDay.Hours.ToString()},
                {"startDate", startDateAndTime.ToString("MM/DD/YY")},
                {"startAMPM", startDateAndTime.TimeOfDay.Hours >= 12 ? "PM" : "AM" },
                {"serverPassword", serverPassword},
                {"serverIP", serverAddress?.ToString() ?? ""},
                {"name", eventName}, // Title of the event
                {"notes", eventNotes}, // Notes of the event
                {"eventQuickTime", "now"},
                {"appID", appId == -1 ? "" : appId.ToString()}, // The game you want the event associated with
                {"action", "newEvent"}
            };

            return _web.Fetch(url, "POST", data, _account.AuthContainer, true, url);
        }