當前位置: 首頁>>代碼示例>>Java>>正文


Java SlackRealTimeMessagingClient類代碼示例

本文整理匯總了Java中allbegray.slack.rtm.SlackRealTimeMessagingClient的典型用法代碼示例。如果您正苦於以下問題:Java SlackRealTimeMessagingClient類的具體用法?Java SlackRealTimeMessagingClient怎麽用?Java SlackRealTimeMessagingClient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SlackRealTimeMessagingClient類屬於allbegray.slack.rtm包,在下文中一共展示了SlackRealTimeMessagingClient類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import allbegray.slack.rtm.SlackRealTimeMessagingClient; //導入依賴的package包/類
public static void main(String args[]) {
    String protocol = "https";
    String proxyHost = "xxx.xxx.xxx.xxx";
    int proxyPort = 1234;

    ProxyServerInfo proxyServerInfo = new ProxyServerInfo(protocol, proxyHost, proxyPort);

    SlackRealTimeMessagingClient realTimeMessagingClient = SlackClientFactory.createSlackRealTimeMessagingClient(token, proxyServerInfo);
    realTimeMessagingClient.addListener("hello", new HelloEventListener());
    realTimeMessagingClient.connect();

    try {
        Thread.sleep(60 * 1000);
        realTimeMessagingClient.close();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
 
開發者ID:allbegray,項目名稱:slack-api,代碼行數:19,代碼來源:SlackRealTimeMessagingClientProxyTest.java

示例2: main

import allbegray.slack.rtm.SlackRealTimeMessagingClient; //導入依賴的package包/類
public static void main(String args[]) {
    SlackRealTimeMessagingClient realTimeMessagingClient = SlackClientFactory.createSlackRealTimeMessagingClient(token);
    realTimeMessagingClient.addListener("hello", new HelloEventListener());
    realTimeMessagingClient.addListener("message", new MessageEventListener());
    realTimeMessagingClient.addListener(Event.MESSAGE, new EventListener() {
        @Override
        public void onMessage(JsonNode message) {
            // todo
        }
    });
    realTimeMessagingClient.connect();

    try {
        Thread.sleep(60 * 1000);
        realTimeMessagingClient.close();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
 
開發者ID:allbegray,項目名稱:slack-api,代碼行數:20,代碼來源:SlackRealTimeMessagingClientTest.java

示例3: createSlackRealTimeMessagingClient

import allbegray.slack.rtm.SlackRealTimeMessagingClient; //導入依賴的package包/類
public static SlackRealTimeMessagingClient createSlackRealTimeMessagingClient(String token) {
	return createSlackRealTimeMessagingClient(token, null, null);
}
 
開發者ID:allbegray,項目名稱:slack-api,代碼行數:4,代碼來源:SlackClientFactory.java

示例4: rtmClient

import allbegray.slack.rtm.SlackRealTimeMessagingClient; //導入依賴的package包/類
/**
 * Convenience method to create an authorized RTM client.
 *
 * @return Slack RTM client
 */
private SlackRealTimeMessagingClient rtmClient() {
    return SlackClientFactory.createSlackRealTimeMessagingClient(
            ConfigurationHolder.get().getSlackConfig().getBotToken());
}
 
開發者ID:PaperCutSoftware,項目名稱:dust-api,代碼行數:10,代碼來源:SlackIntegration.java


注:本文中的allbegray.slack.rtm.SlackRealTimeMessagingClient類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。