Skip to content

CSteamGroup

Alex Corn edited this page Nov 8, 2019 · 14 revisions

A class which stands for a Steam group. This class cannot be instantiated directly; it must be received from a call to getSteamGroup.

Non-Object Methods

As of v3.5.0, if you don't want to bother with setting up a CSteamGroup object, methods on this page marked with a non-object method name can be called directly on your SteamCommunity instance, with the group's SteamID being the first parameter. For example:

var SteamCommunity = require('steamcommunity');
var community = new SteamCommunity();

community.getGroupMembers("103582791434202956", function(err, members) {
    /* do something... */
});

Properties

steamID

A SteamID object containing the group's SteamID. Visit a group at https://steamcommunity.com/gid/SteamID

name

The group's name (cannot be changed)

url

The group's URL (this can be changed). Visit a group at https://steamcommunity.com/groups/GROUPURL

headline

The group's headline (this can be changed)

summary

The group's summary content (this can be changed)

avatarHash

The hash of the group's avatar

members

How many members the group had when getSteamGroup was called

membersInChat

How many group members were in group chat when getSteamGroup was called

membersInGame

How many group members were in-game when getSteamGroup was called

membersOnline

How many group members were online on Steam when getSteamGroup was called

Methods

getAvatarURL([size, protocol])

  • size - What size to get the avatar at. Possible values are full, medium, or empty (small). Default empty.
  • protocol - The protocol to use. Possible values for protocol are http://, https://, or // (protocol aware). Default http://.

Returns a URL where you can download this group's avatar.

getMembers([addresses, ]callback)

  • addresses - Optional. An array of IP addresses (in x.x.x.x format) that will be rotated between when paging through the results. See below for details.
  • callback - Called when the member list is available
    • err - null on success, an Error object on failure
    • members - An array of SteamID objects

Non-object method name: getGroupMembers

v3.5.0 or later is required to use the addresses argument.

Retrieves a list of all users in this group. For large groups this could take around 30 seconds, possibly longer.

Steam returns at most 1000 users per page. Therefore, node-steamcommunity will need to make ceil(totalMembers / 1000) HTTP requests to fulfill this request. steamcommunity.com will start rate-limiting us after around 60 requests. If you supply an array of IP addresses which are accessible to this machine as the addresses argument, then node-steamcommunity will rotate between them for each request.

Important: If using non-object methods, then you'll need to use differently-named methods depending on whether or not you want to use addresses.

  • To not use addresses:
    • community.getGroupMembers(groupID, callback)
  • To use addresses:
    • community.getGroupMembersEx(groupID, addresses, callback)

join([callback])

  • callback - Called when the request completes
    • err - null on success, an Error object on failure

Non-object method name: joinGroup

Joins a group. If the group is restricted, requests to join.

leave([callback])

  • callback - Called when the request completes
    • err - null on success, an Error object on failure

Non-object method name: leaveGroup

Leaves a group.

postAnnouncement(headline, content[, hidden][, callback])

  • headline - The title of the announcement
  • content - What the announcement says
  • hidden - Optional. true to post this as a hidden announcement. Default false.
  • callback - Called when the request completes
    • err - null on success, an Error object on failure

Non-object method name: postGroupAnnouncement

Posts an announcement to a group, provided you have permission to do so.

scheduleEvent(name, type, description, time[, server, callback])

  • name - The event's name/headline
  • type - See below
  • description - A description for the event
  • time - null to start it immediately, otherwise a Date object representing a time in the future
  • server - If this is a game event (see below), this can be a string containing the game server's IP address or an object containing ip and password properties. If not a game event, this should be null or undefined.
  • callback - Called when the request completes
    • err - null on success, an Error object on failure

Non-object method name: scheduleGroupEvent

Schedules a new event for the group. type can be one of the strings shown below, or an AppID to schedule a game-specific event.

  • ChatEvent - Chat
  • OtherEvent - A lil somethin somethin
  • PartyEvent - Party!
  • MeetingEvent - Important meeting
  • SpecialCauseEvent - Special cause (charity ball?)
  • MusicAndArtsEvent - Music or Art type thing
  • SportsEvent - Sporting endeavor
  • TripEvent - Out of town excursion

editEvent(id, name, type, description, time[, server, callback])

  • id - The 64-bit numeric ID of the event you want to edit (as a string)
  • name - The event's name/headline
  • type - See below
  • description - A description for the event
  • time - null to start it immediately, otherwise a Date object representing a time in the future
  • server - If this is a game event (see below), this can be a string containing the game server's IP address or an object containing ip and password properties. If not a game event, this should be null or undefined.
  • callback - Called when the request completes
    • err - null on success, an Error object on failure

Non-object method name: editGroupEvent

v3.20.0 or later is required to use this method

Edits an existing Steam group event. Parameters are identical to those in scheduleEvent.

deleteEvent(id[, callback])

  • id - The 64-bit numeric ID of the event you want to delete (as a string)
  • callback - Optional. Called when the request completes
    • err - null on success, an Error object on failure

Non-object method name: deleteGroupEvent

v3.21.0 or later is required to use this method

Deletes an existing Steam group event.

setPlayerOfTheWeek(steamID[, callback])

  • steamID - A SteamID object representing the group's new Player of the Week
  • callback - Called when the request completes
    • err - null on success, an Error object on failure
    • oldPOTW - A SteamID representing the former Player of the Week
    • newPOTW - A SteamID representing the new Player of the Week

Non-object method name: setGroupPlayerOfTheWeek

Changes the group's current Player of the Week.

kick(steamID[, callback])

  • steamID - A SteamID object representing the player to kick from the group
  • callback - Called when the request completes
    • err - null on success, an Error object on failure

Non-object method name: kickGroupMember

Kicks a player from the group.

getHistory([page, ]callback)

  • page - The page of history that you're requesting, starting at 1
  • callback - Called when requested data is available
    • err - null on success, an Error object on failure
    • history - An object containing group history for this page
      • first - The index of the first history item on this page, starting at 1
      • last - The index of the last history item on this page
      • total - How many total history items there are
      • items - An array of group history objects
        • type - A string containing the item history type. This is the type displayed on the history page, without spaces. For example, NewMember, InviteSent, etc.
        • date - A Date object containing the date and time when this action took place. Since the history page doesn't display any years, the year could possibly be incorrect.
        • user - A SteamID object containing the SteamID of the user who either performed or received this action. For example, on NewMember this is the new group member, on InviteSent this is the invite recipient, on NewAnnouncement, this is the author
        • actor - Not present on all history types. This is the user who performed the action if user is the receipient of the action

Non-object method name: getGroupHistory

v3.5.0 or later is required to use this method.

Requests a page of group history (visible at https://steamcommunity.com/groups/yourgroup/history).

getAllAnnouncements([time, ]callback)

  • time - Optional. A Date object. If specified, only announcements posted after this time are returned.
  • callback - Called when requested data is available
    • err - null on success, or an Error object on failure
    • announcements - An array of announcement objects
      • headline - The announcement's title
      • content - The content of the announcement
      • date - A Date object for when this was posted
      • author - The Steam profile name of the author
      • aid - The ID of the announcement

**Non-object method name: getAllGroupAnnouncements

v3.18.0 or later is required to use this method.

Gets all announcements posted to the group.

editAnnouncement(announcementID, headline, content[, callback])

  • announcementID - The ID of the announcement, as a string
  • headline - The new title for the announcement
  • content - The new content for the announcement
  • callback - Optional. Called when the request completes.
    • err - null on success, or an Error object on failure

Non-object method name: editGroupAnnouncement

v3.18.0 or later is required to use this method.

Edits an announcement in the group.

deleteAnnouncement(announcementID[, callback])

  • announcementID - The ID of the announcement, as a string
  • callback - Optional. Called when the request completes.
    • err - null on success, or an Error object on failure

Non-object method name: editGroupAnnouncement

v3.18.1 or later is required to use this method.

Deletes an announcement in the group.

getJoinRequests(callback)

  • callback - Required. Called when the request completes.
    • err - null on success, or an Error object on failure
    • requests - An array of SteamID objects, where each object represents a user who has requested to join the group

Non-object method name: getGroupJoinRequests

v3.32.0 or later is required to use this method.

Gets a listing of everyone who has requested to join this group. Is useless for non-restricted (i.e., public or invite-only) groups.

respondToJoinRequests(steamIDs, approve[, callback])

  • steamIDs - An array of either SteamID objects or strings that can parse into SteamID objects
  • approve - Either true to approve joining the group for these users, or false to deny it
  • callback - Optional. Called when the request completes.
    • err - null on success, or an Error object on failure

Non-object method name: respondToGroupJoinRequests

v3.32.0 or later is required to use this method.

Approves or denies joining the group for specific users who have requested to join. Those users must have an outstanding group-join request, and the group must be restricted.

respondToAllJoinRequests(approve[, callback])

  • approve - Either true to approve joining the group for all who have requested it currently, or false to deny it
  • callback - Optional. Called when the request completes.
    • err - null on success, or an Error object on failure

Non-object method name: respondToAllGroupJoinRequests

v3.32.0 or later is required to use this method.

Approves or denies joining the group for all users who currently have outstanding join requests. Useless for non-restricted groups.

getAllComments(from, count, callback)

  • from - The offset where you want to start. 0 to start with the first (most recent) comment
  • count - The number of comments you want to retrieve
  • callback - Called when the request completes.
    • err - null on success, or an Error object on failure
    • comments - An array of comments. Each comment is an object containing these properties:
      • authorName - The comment author's persona name
      • authorId - Either the comment author's 64-bit Steam ID, or their vanity URL
      • date - A Date object of when this comment was submitted
      • commentId - The ID of this comment
      • text - The HTML content of this comment

**Non-object method name: getAllGroupComments

v3.34.0 or later is required to use this method

Gets a listing of comments in a Steam group.

deleteComment(commentID, callback)

  • commentID - The ID of the comment you want to delete
  • callback - Optional. Called when the request completes.
    • err - null on success, or an Error object on failure

**Non-object method name: deleteGroupComment

v3.34.0 or later is required to use this method

Deletes a comment in a Steam group, provided you have permission to do so (i.e. are the author or a group moderator/admin with the appropriate permission).