mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-03-30 02:10:09 +08:00
Merge pull request #233 from Revadike/patch-1
Optional hidden parameter to postGroupAnnouncement
This commit is contained in:
commit
59bf4f1e92
@ -156,22 +156,33 @@ SteamCommunity.prototype.getAllGroupAnnouncements = function(gid, time, callback
|
|||||||
}, "steamcommunity");
|
}, "steamcommunity");
|
||||||
};
|
};
|
||||||
|
|
||||||
SteamCommunity.prototype.postGroupAnnouncement = function(gid, headline, content, callback) {
|
SteamCommunity.prototype.postGroupAnnouncement = function(gid, headline, content, hidden, callback) {
|
||||||
if(typeof gid === 'string') {
|
if(typeof gid === 'string') {
|
||||||
gid = new SteamID(gid);
|
gid = new SteamID(gid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(typeof hidden === 'function') {
|
||||||
|
callback = hidden;
|
||||||
|
hidden = false;
|
||||||
|
}
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
this.httpRequestPost({
|
var form = {
|
||||||
"uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/announcements",
|
|
||||||
"form": {
|
|
||||||
"sessionID": this.getSessionID(),
|
"sessionID": this.getSessionID(),
|
||||||
"action": "post",
|
"action": "post",
|
||||||
"headline": headline,
|
"headline": headline,
|
||||||
"body": content,
|
"body": content,
|
||||||
"languages[0][headline]": headline,
|
"languages[0][headline]": headline,
|
||||||
"languages[0][body]": content
|
"languages[0][body]": content
|
||||||
|
};
|
||||||
|
|
||||||
|
if(hidden) {
|
||||||
|
form.is_hidden = "is_hidden"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.httpRequestPost({
|
||||||
|
"uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/announcements",
|
||||||
|
form
|
||||||
}, function(err, response, body) {
|
}, function(err, response, body) {
|
||||||
if(!callback) {
|
if(!callback) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user