Skip to main content

Templates

Overview

Channels can be created for different types of in-game events and activities. By default, channels can only be managed by the developer. To enable players to manage a channel, it is necessary for each channel to create a template. For example, a group can have a group channel template of 4 people, a guild can have a group channel template of 20 people, and so on.

caution

The player cannot create a channel without a pre-made template. This is necessary for the developer to control the rights of the player

Templates make it easy to create channels of the same type. Based on channels, you can implement an extremely wide functionality of chats, guilds, a list of friends, activity feeds, gifts, turn-based battles, lobbies, rooms, groups, and so on. For each type of such a channel, it is convenient to have a pre-configured standard template.

tip

Create templates of channels for the main game events and activities

Create a Template

To create a template, select Channels - Add Template in the control panel:

When creating a channel template, you can edit the following fields:

info

Leaving the default settings will create a template for player chat

Field nameComments
📝 Channel template tagThe tag is used to make it easier for the player to find the in-game event for which the template has been created
📝 Channel tagsFor example, a dungeon party might have a template with the dungeon tag. For details, see Channel and Message Tags
📝 Messages tagsMessage tags allow you to display logs or specified types of messages in a chat. For example, all messages with log tags can return information about completing a level. For details, see Channel and Message Tags
📝 NameClicking on the Edit translations button opens the entire list of languages available for translation
📝 DescriptionClicking on the Edit translations button opens the entire list of languages available for translation
📝 Maximum number of channel membersInteger, maximum number of channel members is unlimited
📝 PasswordBy default, the channel is created without a password
🔘 PrivateAllows you to join the channel only through a request or invite
🔘 Keep historyAllows you to store your message history (only available on subscription plans). By default, messages are stored for 24 hours
🔘 Visible in searchShows the channel in the search results
🔘 Visible only in test version 💡The channel is not visible to players in the production version
🔘 Leave the channel when he leaves the game
🔘 Delete channel when last member leaves
🔘 Permissions for the player - owner to edit channel optionsBy default, channel owner can edit: title, description, tags, change owner, channel capacity, privacy, visibility, owner ACL, guest ACL
🔘 Owner, member, guest accessFor a complete list of permissions and their default values, see table
tip

💡 The purpose of the Visible in Test Only property is to hide new channels that are in development from players. For example, a developer adds a new location to the game, and so that it does not appear in the list of players, he marks it as visible only in the test version. While development is underway, this channel can be viewed on behalf of a test player

Template Usage Example

Often developers implement a joint battle of players in groups. Consider an example of creating and using a template for a group of players.

tip

Creating templates for groups, raids or guilds is done according to the same principle

As an example, let's create a channel template for a group of five players. To do this, in the GamePush control panel, go to Channels - Add template. On the template editing page, fill in the basic information about the template:

  • Channel template tag: party5
  • Channel tags: members, party
  • Message tags: log
  • Name: party_5
  • Description: group for hikes and raids
  • Maximum number of channel members: 5
  • Other settings leave the default:

info

The created template can be edited at any time

Below is an example of creating a channel on behalf of a player using the template template: 'party_5'. Potential members are invited to the channel gp.channels.sendInvite:

const channel = await gp.channels.createChannel({ template: 'party_5' });

gp.channels.sendInvite({ channelId: channel.id, playerId: 123456 });
gp.channels.sendInvite({ channelId: channel.id, playerId: 123457 });
gp.channels.sendInvite({ channelId: channel.id, playerId: 123458 });
gp.channels.sendInvite({ channelId: channel.id, playerId: 123459 });

gp.channels.sendMessage({ channelId: channel.id, text: 'Waiting 5 min and go' });
tip

To get player IDs, see the Members section

Stay in Touch

Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.

GamePush Community Telegram: @gs_community.

For your suggestions e-mail: [email protected]

We Wish you Success!