mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-01-31 11:30:11 +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.prototype.postGroupAnnouncement = function(gid, headline, content, callback) {
|
||||
SteamCommunity.prototype.postGroupAnnouncement = function(gid, headline, content, hidden, callback) {
|
||||
if(typeof gid === 'string') {
|
||||
gid = new SteamID(gid);
|
||||
}
|
||||
|
||||
if(typeof hidden === 'function') {
|
||||
callback = hidden;
|
||||
hidden = false;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
var form = {
|
||||
"sessionID": this.getSessionID(),
|
||||
"action": "post",
|
||||
"headline": headline,
|
||||
"body": content,
|
||||
"languages[0][headline]": headline,
|
||||
"languages[0][body]": content
|
||||
};
|
||||
|
||||
if(hidden) {
|
||||
form.is_hidden = "is_hidden"
|
||||
}
|
||||
|
||||
this.httpRequestPost({
|
||||
"uri": "https://steamcommunity.com/gid/" + gid.getSteamID64() + "/announcements",
|
||||
"form": {
|
||||
"sessionID": this.getSessionID(),
|
||||
"action": "post",
|
||||
"headline": headline,
|
||||
"body": content,
|
||||
"languages[0][headline]": headline,
|
||||
"languages[0][body]": content
|
||||
}
|
||||
form
|
||||
}, function(err, response, body) {
|
||||
if(!callback) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user