当前位置: 首页>>代码示例>>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;未经允许,请勿转载。