Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.0.20 #22

Merged
merged 2 commits into from
Nov 24, 2023
Merged

Update to 1.0.20 #22

merged 2 commits into from
Nov 24, 2023

Conversation

luke-cha
Copy link
Contributor

@luke-cha luke-cha commented Nov 24, 2023

. Add a target_message_id to /v3/bots/{bot_userid}/send

Tested with

package org;

import org.openapitools.client.model.*;
import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.api.BotApi;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


class AppTest {
    public static void main(String[] args) throws ApiException {
        // Default Setup
        String apiToken = ""; //Your Api Token
        String appId = ""; //Your App ID
        String channelUrl = "";
        String botId = "";
        long messageId = -1L;

        ApiClient sbClient = Configuration.getDefaultApiClient().addDefaultHeader("Api-Token", apiToken);
        sbClient.setBasePath("https://api-"+ appId +".sendbird.com");

        BotApi botApi = new BotApi(sbClient);

        SendBotSMessageData request = new SendBotSMessageData();
        request.setChannelUrl(channelUrl);
        request.setMessage("test message");
        request.setTargetMessageId(messageId);

        // Extended Message Payload setup
        SendBotSMessageDataExtendedMessagePayload extendedMessagePayload = new SendBotSMessageDataExtendedMessagePayload();

        List<String> suggestedReplies = new ArrayList<>();
        suggestedReplies.add("Yes");
        suggestedReplies.add("No");

        Map<String, Object> customView = new HashMap<>();
        customView.put("title", "title");
        customView.put("image", "https://link.to/image.jpg");

        extendedMessagePayload.setCustomView(customView);
        extendedMessagePayload.setSuggestedReplies(suggestedReplies);

        request.setExtendedMessagePayload(extendedMessagePayload);

        SendBirdBotsMessageResponse response = botApi.sendBotsMessage(botId)
                .sendBotSMessageData(request)
                .execute();
        System.out.println(response.toString());

    }
}

 . Add a `target_message_id` to `/v3/bots/{bot_userid}/send`
Copy link
Contributor

@jerry-jeon-sb jerry-jeon-sb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jerry-jeon-sb jerry-jeon-sb merged commit 15e6221 into main Nov 24, 2023
1 check passed
@jerry-jeon-sb jerry-jeon-sb deleted the develop branch November 24, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants