コンテンツにスキップ

チャンネル

チャンネル作成

新しい会話チャンネルを作成するには、CreateChannelParamsオブジェクトを作成し、次にChatクラスのcreateChannel()メソッドを呼び出します。

チャンネルパラメータを作成

フィールド名 説明 タイプ 必須
channelId チャンネルID
(英字、数字、および一部の特殊文字(-, ., _, ~, :)が許可され、最大100文字)
string Y
password パスワード(PRIVATE チャンネルのみ必要)
(最大50文字)
string N
channelName チャンネル名
(最大50文字)
string Y
maxMemberCount チャンネル参加者の最大数
(最小2から最大5,000)
integer Y
type チャンネルタイプ(PRIVATE, PUBLIC, GROUP enum Y
chatHistoryAllowed チャット履歴の取得が許可されているか enum N

新しい会話チャンネルを作成するための例のコードです。

using hive;

CreateChannelParams createChannelParams = new CreateChannelParams();
createChannelParams.channelId = "CHANNEL_ID";
createChannelParams.password = "";
createChannelParams.channelName = "CHANNEL_NAME";
createChannelParams.maxMemberCount = 8;
createChannelParams.type = ChannelType.PUBLIC;

Chat.createChannel(createChannelParams, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API Call Success
    }
});
#include "HiveChat.h"

FHiveCreateChannelParams CreateChannelParams = FHiveCreateChannelParams();
CreateChannelParams.ChannelId = TEXT("CHANNEL_ID");
CreateChannelParams.Password = TEXT("");
CreateChannelParams.ChannelName = TEXT("CHANNEL_NAME");
CreateChannelParams.MaxMemberCount = 8;
CreateChannelParams.Type = EHiveChannelType::Public;

FHiveChat::CreateChannel(CreateChannelParams, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result) {
    if (Result.IsSuccess()) {
        // API Call Success
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

CreateChannelParams param;
param.channelId = "CHANNEL_ID";
param.channelName = "CHANNEL_NAME";
param.password = "";
param.maxMemberCount = 8;
param.type = ChannelType::PUBLIC;

Chat::createChannel(param, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val params = Chat.CreateChannelParams(
    channelId = "CHANNEL_ID",
    password = "",
    channelName = "CHANNEL_NAME",
    maxMemberCount = 8,
    type = Chat.ChannelType.PUBLIC
)

Chat.createChannel(params, object: Chat.CreateChannelListener{
    override fun onResult(result: ResultAPI) {
        if (result.isSuccess) {
            // API呼び出し成功
        }
    }
})
import com.hive.Chat;

Chat.CreateChannelParams params = new Chat.CreateChannelParams(
    "CHANNEL_ID",
    "",
    "CHANNEL_NAME",
    8,
    Chat.ChannelType.PUBLIC
);

Chat.createChannel(params, result -> {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import HIVEService

let params = Chat.CreateChannelParams(
    channelId: "CHANNEL_ID",
    password: "",
    channelName: "CHANNEL_NAME",
    maxMemberCount: 8,
    type: .public
)
ChatInterface.createChannel(params) { result in
    if result.isSuccess {
        // API Call Success
    }
}
#import "HIVEService.h"

HiveChatCreateChannelParams* params = [[HiveChatCreateChannelParams alloc] init];
params.channelId = @"CHANNEL_ID";
params.password = @"";
params.channelName = @"CHANNEL_NAME";
params.maxMemberCount = 8;
params.type = Chat::ChannelType::PUBLIC;

[HiveChat createChannelWithCreateParams:params handler:^(HIVEResultAPI * result) {
    if (result.isSuccess) {
        // API Call Success
    }
}];

チャンネル削除

既存の会話チャンネルを削除するには、ChatクラスのdeleteChannel()メソッドを呼び出します。

会話チャンネルを削除するための例のコードはこちらです。

using hive;

String channelId = "CHANNEL_ID";

Chat.deleteChannel(channelId, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API Call Success
    }
});
#include "HiveChat.h"

FString ChannelId = TEXT("CHANNEL_ID");

FHiveChat::DeleteChannel(ChannelId, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result) {
    if (Result.IsSuccess()) {
        // API Call Success
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

std::string channelId = "CHANNEL_ID";

hat::deleteChannel(commonChannelId, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val channelId = "CHANNEL_ID"

Chat.deleteChannel(channelId, object: Chat.DeleteChannelListener{
    override fun onResult(result: ResultAPI) {
        if (result.isSuccess) {
            // API Call Success
        }
    }
})
import com.hive.Chat;

String channelId = "CHANNEL_ID";

Chat.deleteChannel(channelId, result -> {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import HIVEService

let channelId = "CHANNEL_ID"
ChatInterface.deleteChannel(channelId: channelId) { result in
    if result.isSuccess {
        // API Call Success
    }
}
#import "HIVEService.h"

NSString *channelId = @"CHANNEL_ID";
[HiveChat deleteChannelWithChannelId:channelId handler:^(HIVEResultAPI * result) {
    if (result.isSuccess) {
        // API Call Success
    }
}];

チャンネルエントリー

既存の会話チャンネルに入るには、EnterChannelParamsオブジェクトを作成し、次にChatクラスのenterChannel()メソッドを呼び出します。

チャンネルパラメータを入力

フィールド名 説明 タイプ 必須
channelId チャンネルID 文字列 Y
password パスワード(PRIVATE チャンネルに必要) 文字列 N

会話チャンネルに入るための例のコードはこちらです。

using hive;

EnterChannelParams enterChannelParams = new EnterChannelParams();
enterChannelParams.channelId = "CHANNEL_ID";
enterChannelParams.password = "";

Chat.enterChannel(enterChannelParams, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API Call Success
    }
});
#include "HiveChat.h"

FHiveEnterChannelParams EnterChannelParams = FHiveEnterChannelParams();

EnterChannelParams.ChannelId = TEXT("CHANNEL_ID");
EnterChannelParams.Password = TEXT("");

FHiveChat::EnterChannel(EnterChannelParams, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result) {
    if (Result.IsSuccess()) {
        // API Call Success
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

EnterChannelParams param;
param.channelId = "CHANNEL_ID";
param.password = "";

Chat::enterChannel(param, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val params = Chat.EnterChannelParams(
    channelId = "CHANNEL_ID",
    password = ""
)

Chat.enterChannel(params, object: Chat.EnterChannelListener{
    override fun onResult(result: ResultAPI) {
        if (result.isSuccess) {
            // API Call Success
        }
    }
})
import com.hive.Chat;

Chat.EnterChannelParams params = new Chat.EnterChannelParams(
    "CHANNEL_ID",
    ""
);

Chat.enterChannel(params, result -> {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import HIVEService

let params = HiveChatParams.EnterChannelParams(
    channelId: "CHANNEL_ID",
    password: ""
)

ChatInterface.enterChannel(enterChannelParams: params) { result in
    if result.isSuccess {
        // API Call Success
    }
}
#import "HIVEService.h"

HiveChatEnterChannelParams* params = [[HiveChatEnterChannelParams alloc] init];
params.channelId = @"CHANNEL_ID";
params.password = @"";

[HiveChat enterChannelWithEnterChannelParams:params handler:^(HIVEResultAPI * result) {
    if (result.isSuccess) {
        // API Call Success
    }
}];

チャンネルの終了

参加したチャットチャンネルを退出するには、ChatクラスのexitChannel()メソッドを呼び出してください。

これは、参加した会話チャンネルから退出するための例のコードです。

using hive;

String channelId = "CHANNEL_ID";

Chat.exitChannel(channelId, (ResultAPI result) => {
    if (result.isSuccess()) {
        // API Call Success
    }
});
#include "HiveChat.h"

FString ChannelId = TEXT("CHANNEL_ID");

FHiveChat::ExitChannel(ChannelId, FHiveChatOnResultDelegate::CreateLambda([this](const FHiveResultAPI& Result) {
    if (Result.IsSuccess()) {
        // API Call Success
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

std::string channelId = "CHANNEL_ID";

Chat::exitChannel(channelId, [=](ResultAPI const & result) {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val channelId = "CHANNEL_ID"

Chat.exitChannel(channelId, object: Chat.ExitChannelListener {
    override fun onResult(result: ResultAPI) {
        if (result.isSuccess) {
            // API Call Success
        }
    }
})
import com.hive.Chat;

String channelId = "CHANNEL_ID";

Chat.exitChannel(channelId, result -> {
    if (result.isSuccess()) {
        // API Call Success
    }
});
import HIVEService

let channelId = "CHANNEL_ID"
ChatInterface.exitChannel(channelId: channelId) { result in
    if result.isSuccess {
        // API Call Success
    }
}
#import "HIVEService.h"

NSString *channelId = @"CHANNEL_ID";
[HiveChat exitChannelWithChannelId:channelId handler:^(HIVEResultAPI * result) {
    if (result.isSuccess) {
        // API Call Success
    }
}];

すべてのチャンネルリストを表示

すべての現在存在するチャンネルのリストを取得するには、GetChannelsParamsオブジェクトを作成し、その後ChatクラスのgetChannels()メソッドを呼び出します。

Note

GetChannelsParamsオブジェクトを渡さない場合(オブジェクトが提供されていない場合はnullを渡す)、フィルタリングなしで現在存在するチャンネルの全リストが返されます。

チャンネルパラメータを取得する

フィールド名 説明 必須
type チャンネルタイプ(PRIVATE, PUBLIC, GROUP enum Y
channelId 特定のチャンネルIDで始まるチャンネルを取得 string N
channelName 特定のチャンネル名を含むチャンネルを取得 string N
sort チャンネルのソート基準(ChannelId, ChannelName, RegTime enum N
pageOrder ソート方法(ASC, DESC
(デフォルトはDESC)
string N
pageSize ページごとに取得するチャンネルの数
(最小10〜最大100、デフォルト10)
integer N
pageNumber 取得するページ番号
(1から始まり、デフォルトは1)
integer N

ChannelオブジェクトとChannelPageオブジェクトがレスポンスとして提供され、その構造は以下の通りです。

チャンネル

フィールド名 説明 タイプ
channelId チャンネルID string
type チャンネルタイプ(PRIVATE, PUBLIC, GROUP enum
owner チャンネル所有者のHive PlayerID string
channelName チャンネル名 string
memberCount 現在の参加メンバー数 integer
maxMemberCount チャンネルの最大参加者数 integer
regTime チャンネル作成日時(UTC+0に基づく、フォーマットyyyy-MM-dd'T'HH:mm:ss.SSSZ string
regTimeMillis チャンネル作成日時(Unixタイムスタンプ) long
chatHistoryAllowed チャンネル履歴の取得が許可されているかどうか bool
query チャンネルメッセージ履歴を取得するためのメソッド method

チャンネルページ

フィールド名 説明 タイプ
size ページあたりのアイテム数 整数
currentPage 現在のページ番号 整数
totalElements アイテムの総数 整数
totalPages ページの総数 整数

以下は、すべての既存のPUBLICタイプのチャンネルのリストを取得するための例コードです。

using hive;

GetChannelsParams getChannelsParams = new GetChannelsParams();
getChannelsParams.type = ChannelType.PUBLIC;

Chat.getChannels(getChannelsParams, (ResultAPI result, List<Channel> channels, ChannelPage channelPage) => {
    if (result.isSuccess()) {
        // API Call Success

        foreach (Channel channel in channels) {
            // Retrieve Channel
        }

        if (channelPage != null) {
            // Retrieve ChannelPage
        }

    }
});
#include "HiveChat.h"

TOptional<FHiveGetChannelsParams> GetChannelsParams = FHiveGetChannelsParams();
GetChannelsParams->Type = EHiveChannelType::Public;

FHiveChat::GetChannels(GetChannelsParams, FHiveChatOnGetChannelsDelegate::CreateLambda([this](const FHiveResultAPI& Result, const TArray<FHiveChannel>& channels, FHiveChannelPage const & channelPage) {
    if (Result.IsSuccess()) {
        // API Call Success

        for (const FHiveChannel& Channel : Channels) {
            // Retrieve Channel
        }

        if (ChannelPage != nullptr) {
            // Retrieve ChannelPage
        }
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

Chat::GetChannelsParams params = Chat::GetChannelsParams();
params.type = Chat::ChannelType::PUBLIC;

Chat::getChannels(param, [=](ResultAPI const & result, std::vector<Channel> const & channels, ChannelPage const & pageInfo) {
    if (result.isSuccess()) {
        // API呼び出し成功

        for (Chat::Channel channel : channels) {
            // Retrieve Channel
        }

        if (channelPage != null) {
            // Retrieve ChannelPage
        }
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val params = Chat.GetChannelsParams(type = Chat.ChannelType.PUBLIC)

Chat.getChannels(params, object: Chat.GetChannelsListener{
    override fun onResult(
        result: ResultAPI,
        channels: ArrayList<Chat.Channel>,
        channelPage: Chat.ChannelPage?
    ) {
        if (result.isSuccess) {
            // APIコール成功

            channels.forEach {
                // Retrieve Channel
            }
            channelPage?.let {
                // Retrieve ChannelPage
            }    
        }
    }
})
import com.hive.Chat;

Chat.GetChannelsParams params = new Chat.GetChannelsParams(Chat.ChannelType.PUBLIC, null, null, null, null, null);
Chat.getChannels(params, (result, channels, channelPage) -> {
    if (result.isSuccess()) {
        // API Call Success
        for (Chat.Channel channel : channels) {
            // Retrieve Channel
        }
        if (channelPage != null) {
            // Retrieve ChannelPage
        }
    }
});
import HIVEService

let params = HiveChatParams.GetChannelsParams(type: .public, null, null, null, null, null)
ChatInterface.getChannels(getChannelsParams: params) { result, channels, pageInfo  in
    if result.isSuccess {
        channels.forEach {
            // チャンネルを取得
        }

        channelPage?.let {
            // チャンネルページを取得する
        }
    }
}
#import "HIVEService.h"

HiveChatGetChannelsParams* params = [[HiveChatGetChannelsParams alloc] init];
params.type = Chat::ChannelType::PUBLIC;

[HiveChat getChannelsWithGetChannelsParams:params handler:^(HIVEResultAPI * result, NSArray<HiveChatChannelContent *> * channels, HiveChatPageInfo * pageInfo) {
    if (result.isSuccess) {
        // APIコール成功

        for (Chat::Channel *channel : channels) {
            // Retrieve Channel
        }

        if (channelPage != null) {
            // Retrieve ChannelPage
        }
    }
}];

チャンネル情報の取得

特定のチャネルに関する詳細情報を取得するには、ChatクラスのgetChannelInfo()メソッドを呼び出します。

レスポンスにはChannelオブジェクトとMemberオブジェクトが含まれており、構造は次のとおりです。

チャンネル

フィールド名 説明 タイプ
channelId チャンネルID string
type チャンネルタイプ (PRIVATE, PUBLIC, GROUP) enum
owner チャンネル所有者のHive PlayerID string
channelName チャンネル名 string
memberCount 現在の参加メンバー数 integer
maxMemberCount チャンネル参加者の最大数 integer
regTime チャンネル作成日時(UTC+0に基づく、フォーマットyyyy-MM-dd'T'HH:mm:ss.SSSZ string
regTimeMillis チャンネル作成日時(Unixタイムスタンプ) long
chatHistoryAllowed チャンネルの履歴をクエリできるかどうか bool
query チャンネルメッセージ履歴をクエリするためのメソッド method

メンバー

フィールド名 説明 タイプ
playerId Hive プレイヤーID long
connectedTime 接続時間(UTC+0に基づく、フォーマットyyyy-MM-dd'T'HH:mm:ss.SSSZ string
connectedTimeeMillis 接続時間(Unix タイムスタンプ) long

特定のチャンネルに関する詳細情報を取得するためのサンプルコードは以下の通りです。

using hive;

String channelId = "CHANNEL_ID";

Chat.getChannelInfo(channelId, (ResultAPI result, Channel channel, List<Member> members) => {
    if (result.isSuccess()) {
        if (channel != null) {
            // チャンネルを取得
        }

        foreach (Member member in members) {
            // Retrieve Member
        }
    }
});
#include "HiveChat.h"

FString ChannelId = TEXT("CHANNEL_ID");

FHiveChat::GetChannelInfo(ChannelId, FHiveChatOnGetChannelInfoDelegate::CreateLambda([this](const FHiveResultAPI& Result, const FHiveChannel& channel, const TArray<FHiveMember>& members) {
    if (Result.IsSuccess()) {
        // API Call Success

        if (channel != nullptr) {
            // チャンネルを取得
        }

        for (const FHiveMember& Member : Members) {
            // メンバーを取得
        }
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

std::string channelId = "CHANNEL_ID";

Chat::getChannelInfo(channelId, [=](ResultAPI const & result, Channel const & channel, std::vector<Member> const & members) {
    if (result.isSuccess()) {
        if (channel != null) {
            // チャンネルを取得
        }

        for (Chat::Member member : members) {
            // メンバーを取得
        }
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val channelId = "CHANNEL_ID"

Chat.getChannelInfo(channelId, object: Chat.GetChannelInfoListener {
    override fun onResult(
        result: ResultAPI,
        channel: Chat.Channel?,
        members: ArrayList<Chat.Member>
    ) {
        if (result.isSuccess) {
            channel?.let {
                // Retrieve Channel
            }
            members.forEach {
                // Retrieve Member
            }
        }
    }
})
import com.hive.Chat;

String channelId = "CHANNEL_ID";

Chat.getChannelInfo(channelId, (result, channel, members) -> {
    if(result.isSuccess()) {
        if (channel != null) {
            // Retrieve Channel
        }
        for (Chat.Member member : members) {
            // Retrieve Member
        }
    }
});
import HIVEService

let channelId = "CHANNEL_ID"
ChatInterface.getChannelInfo(channelId: channelId) { result, channel, members  in
    if result.isSuccess {
        channel?.let {
            // Retrieve Channel
        }
        members.forEach {
            // Retrieve Member
        }
    }
}
#import "HIVEService.h"

NSString *channelId = @"CHANNEL_ID";
[HiveChat getChannelInfoWithChannelId:channelId handler:^(HIVEResultAPI * result, HiveChatChannelContent * channel, NSArray<HiveChatMember *> * members) {
    if (result.isSuccess) {
        if (channel != null) {
            // Retrieve Channel
        }
        for (Chat::Member *member : members) {
            // Retrieve Member
        }
    }
}];

チャンネルメンバー問い合わせ

チャンネル参加者メンバーを表示するには、ChatクラスのgetChannelMembers()メソッドを呼び出します。

Note

応答値はgetChannelInfo()から渡されたMemberオブジェクトと同じです。

using hive;

String channelId = "CHANNEL_ID";

Chat.getChannelMembers(channelId, (ResultAPI result, List<Member> members) => {
    if (result.isSuccess()) {
        foreach (Member member in members) {
            // Retrieve Member
        }
    }
});
#include "HiveChat.h"

FString ChannelId = TEXT("CHANNEL_ID");

FHiveChat::GetChannelMembers(ChannelId, FHiveChatOnGetChannelMembersDelegate::CreateLambda([this](const FHiveResultAPI& Result, const TArray<FHiveMember>& members) {
    if (Result.IsSuccess()) {
        for (const FHiveMember& Member : members) {
            // Retrieve Member
        }
    }
}));
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

std::string channelId = "CHANNEL_ID";

Chat::getChannelMembers(channelId, [=](ResultAPI const & result, std::vector<Member> const & members) {
    if (result.isSuccess()) {
        for (Chat::Member member : members) {
            // Retrieve Member
        }
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val channelId = "CHANNEL_ID"

Chat.getChannelMembers(channelId, object: Chat.GetChannelMembersListener{
    override fun onResult(result: ResultAPI, members: ArrayList<Chat.Member>) {
        if (result.isSuccess) {
            members.forEach { 
                // Retrieve Member
            }
        }
    }
})
import com.hive.Chat;

String channelId = "CHANNEL_ID";

Chat.getChannelMembers(channelId, (result, members) -> {
    if (result.isSuccess()) {
        for (Chat.Member member : members) {
            // Retrieve Member
        }
    }
});
import HIVEService

let channelId = "CHANNEL_ID"
ChatInterface.getChannelMembers(channelId: channelId) { result, members in
    if result.isSuccess {
        members.forEach {
            // Retrieve Member
        }
    }
}
#import "HIVEService.h"

NSString *channelId = @"CHANNEL_ID";
[HiveChat getChannelMembersWithChannelId:channelId handler:^(HIVEResultAPI * result, NSArray<HiveChatMember *> * members) {
    if (result.isSuccess) {
        for (Chat::Member *member : members) {
            // Retrieve Member
        }
    }
}];

チャンネルメッセージ履歴の照会

channel.query(ChannelMessageListQueryParams, ChannelMessageListQueryListener) メソッドを呼び出して、以前のチャット履歴を取得します。

chatHistoryAllowed プロパティが true に設定されているチャンネルのみが履歴を取得できます。

チャンネルメッセージリストクエリパラメータ

フィールド名 説明 タイプ 必須
size 受信するメッセージのサイズ(最小1〜最大50) 整数 Y
index 追加のクエリに必要なインデックス文字列。最初のクエリの場合は空白のままにしてください 文字列 Y

チャンネルメッセージリストクエリリスナー

フィールド名 説明
hasNext 追加のクエリが可能かどうかを示すフラグ long
nextIndex 追加のクエリに必要なインデックス文字列 string
content 取得されたChannelMessageオブジェクトの配列 ChannelMessage
using hive;

ChannelMessageListQueryParams queryParams = new ChannelMessageListQueryParams(10, "");
channel.query(queryParams, (ResultAPI result, ChannelMessageListQueryResponse response) => {
    if (result.isSuccess() && response != null) {
        foreach (ChannelMessage message in response.content) {
            // channel message list
        }
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

ChannelMessageListQueryParams queryParams;
params.size = 10;
params.queryIndex = "";

channel.query(queryParams, [=](ResultAPI const & result, ChannelMessageListQueryResponse const & response) {
    if (result.isSuccess()) {
        for (auto message : response.message) {
            // channel message list
        }
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val queryParams = Chat.ChannelMessageListQueryParams(size = 50)

channel.query(queryParams, object : Chat.ChannelMessageListQueryListener {
            override fun onResult(
                result: ResultAPI,
                response: Chat.ChannelMessageListQueryResponse?
            ) {
                if(result.isSuccess && response != null) {
                    response.content.forEach {
                        // channel message list
                    }
                }
            }
})
import com.hive.Chat;

Chat.ChannelMessageListQueryParams queryParams = new Chat.ChannelMessageListQueryParams(50);

channel.query(queryParams, (result, response) -> {
    if (result.isSuccess() && response != null) {
        for (HiveChatChannelMessage message : response.getContent()) {
            // channel message list
        }
    }
});
import HIVEService

let queryParams = HiveChatParams.ChannelMessageListQueryParams(size: 10, index: "")

channel.query(queryParams) { result, response in
    if result.isSuccess(),
       let contents = response.content {
        for (let message in contents) {
            // channel message list
        }
    }
}
#import "HIVEService.h"

HiveChatChannelMessageListQueryParams *queryParams = [[HiveChatChannelMessageListQueryParams alloc] initWithSize:10 index:@""];

[channel queryWithParams:queryParams listener:^(HIVEResultAPI * result, HiveChatChannelMessageListQueryResponse* response) {
    if (result.isSuccess() && response.content) {
        for (HiveChatChannelMessage *message in response.content) {
            // channel message list
        }
    }
}];

チャンネル自動翻訳受信設定

このチャンネルからのメッセージの自動翻訳を受け取るかどうかを設定できます。
翻訳されたメッセージは、受信したChannelMessageオブジェクトで確認できます。

using hive;

bool translateEnabled = true;

channel.setTranslationEnabled(translateEnabled, (ResultAPI result) => {
    if(result.isSuccess()) {
        // Channel Message Translate set completed.
    }
});
#include <HIVE_SDK_Plugin/HIVE_CPP.h>
using namespace hive;

bool translateEnabled = true;

channel.setTranslationEnabled(translateEnabled, [=](ResultAPI const & result) {
    if(result.isSuccess()) {
        // チャンネルメッセージの翻訳設定が完了しました。
    }
});
import com.hive.Chat;
import com.hive.ResultAPI;

val translateEnabled = true;

channel.setTranslationEnabled(translateEnabled, object : Chat.SetTranslationEnabledListener {
    override fun onResult(result: ResultAPI) {
        if(result.isSuccess) {
            // チャンネルメッセージの翻訳設定が完了しました。
        }
    }
})
import com.hive.Chat;

boolean translateEnabled = true;

channel.setTransationEnabled(translateEnabled, (result) -> {
    if (result.isSuccess()) {
        // Channel Message Translate set completed.
    }
});
import HIVEService

let translateEnabled = true;

channel.setTranslationEnabled(translateEnabled) { result in
    if result.isSuccess() {
        // チャンネルメッセージの翻訳設定が完了しました。
    }
}
#import "HIVEService.h"

BOOL translateEnabled = YES;

[channel setTranslationEnabled: translateEnabled handler:^(HIVEResultAPI * result) {
    if (result.isSuccess()) {
        // チャンネルメッセージ翻訳の設定が完了しました。
    }
}];

チャンネルイベント管理

Hive チャットソケットサーバーは接続状況を検出し、アプリユーザーとチャンネル間で発生するステータス変更イベントをアプリに継続的に配信します。詳細なイベント処理方法については、イベント管理 > チャンネルイベント ドキュメントを参照してください。