Skip to content

Commit

Permalink
Added deleting events in CSteamGroup (#109)
Browse files Browse the repository at this point in the history
* Added deleteEvent()

* Added deleteGroupEvent()
  • Loading branch information
luop90 authored and DoctorMcKay committed Jun 22, 2016
1 parent beaf012 commit 17e5b94
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions classes/CSteamGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
24 changes: 24 additions & 0 deletions components/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 17e5b94

Please sign in to comment.