本文整理汇总了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();
}
}
示例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();
}
}
示例3: createSlackRealTimeMessagingClient
import allbegray.slack.rtm.SlackRealTimeMessagingClient; //导入依赖的package包/类
public static SlackRealTimeMessagingClient createSlackRealTimeMessagingClient(String token) {
return createSlackRealTimeMessagingClient(token, null, null);
}
示例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());
}