本文整理匯總了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());
}