From dc32c8e5bf3822daab898e17ab19308983cfcd1b Mon Sep 17 00:00:00 2001 From: Luke Henke Date: Tue, 21 Jun 2016 07:50:36 -0600 Subject: [PATCH 1/2] Added deleteEvent() --- classes/CSteamGroup.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/CSteamGroup.js b/classes/CSteamGroup.js index 2e6f8ef5..ef130fc2 100644 --- a/classes/CSteamGroup.js +++ b/classes/CSteamGroup.js @@ -98,6 +98,10 @@ CSteamGroup.prototype.editEvent = function(id, name, type, description, time, se this._community.editGroupEvent(this.steamID, id, name, type, description, time, server, callback); }; +CSteamGroup.prototype.deleteEvent = function (id, callback) { + this._community.deleteGroupEvent(this.steamID, id, callback); +}; + CSteamGroup.prototype.setPlayerOfTheWeek = function(steamID, callback) { this._community.setGroupPlayerOfTheWeek(this.steamID, steamID, callback); }; From a4850e33316a9c530fa73d91b7c499f8d39e786b Mon Sep 17 00:00:00 2001 From: Luke Henke Date: Tue, 21 Jun 2016 07:50:53 -0600 Subject: [PATCH 2/2] Added deleteGroupEvent() --- components/groups.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/components/groups.js b/components/groups.js index e466ceb2..31af138f 100644 --- a/components/groups.js +++ b/components/groups.js @@ -344,6 +344,30 @@ SteamCommunity.prototype.editGroupEvent = function (gid, id, name, type, descrip }, "steamcommunity"); }; +SteamCommunity.prototype.deleteGroupEvent = function(gid, id, callback) { + if (typeof gid === 'string') { + gid = new SteamID(gid); + } + + var form = { + "sessionid": this.getSessionID(), + "action": "deleteEvent", + "eventID": id + }; + + var self = this; + this.httpRequestPost({ + "uri": "https://steamcommunity.com/gid/" + gid.toString() + "/eventEdit", + "form": form + }, function(err, response, body) { + if(!callback) { + return; + } + + callback(err || null); + }, "steamcommunity"); +}; + SteamCommunity.prototype.setGroupPlayerOfTheWeek = function(gid, steamID, callback) { if(typeof gid === 'string') { gid = new SteamID(gid);