本文整理汇总了Java中com.ullink.slack.simpleslackapi.SlackSession.findChannelById方法的典型用法代码示例。如果您正苦于以下问题:Java SlackSession.findChannelById方法的具体用法?Java SlackSession.findChannelById怎么用?Java SlackSession.findChannelById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ullink.slack.simpleslackapi.SlackSession
的用法示例。
在下文中一共展示了SlackSession.findChannelById方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChannel
import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
private static SlackChannel getChannel(SlackSession slackSession, String channelId)
{
if (channelId != null)
{
if (channelId.startsWith("D"))
{
// direct messaging, on the fly channel creation
return new SlackChannelImpl(channelId, channelId, "", "", true);
}
else
{
return slackSession.findChannelById(channelId);
}
}
return null;
}
示例2: sendMessageToUser
import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
private void sendMessageToUser(String userEmail, SlackSession session, String channelId, String message) {
if (channelId != null && !channelId.trim().isEmpty()) {
SlackChannel channel = session.findChannelById(channelId);
session.sendMessage(channel, message);
} else {
if (userEmail != null && !userEmail.trim().isEmpty()) {
SlackUser slackUser = session.findUserByEmail(userEmail);
session.sendMessageToUser(slackUser, message, null);
}
}
}
示例3: extractReactionRemovedEvent
import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
private static ReactionRemoved extractReactionRemovedEvent(SlackSession slackSession, JSONObject obj) {
JSONObject message = (JSONObject) obj.get("item");
String emojiName = (String) obj.get("reaction");
String messageId = (String) message.get("ts");
String channelId = (String) message.get("channel");
return new ReactionRemovedImpl(emojiName, messageId, slackSession.findChannelById(channelId));
}
示例4: extractReactionAddedEvent
import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
private static ReactionAdded extractReactionAddedEvent(SlackSession slackSession, JSONObject obj) {
JSONObject message = (JSONObject) obj.get("item");
String emojiName = (String) obj.get("reaction");
String messageId = (String) message.get("ts");
String channelId = (String) message.get("channel");
return new ReactionAddedImpl(emojiName, messageId, slackSession.findChannelById(channelId));
}
示例5: buildSlackChannelReply
import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
private static SlackChannelReply buildSlackChannelReply(Boolean ok, JSONObject obj, SlackSession session)
{
String id = (String)obj.get("id");
if (id != null) {
return new SlackChannelReplyImpl(ok,obj, session.findChannelById(id));
}
JSONObject channelObj = (JSONObject) obj.get("channel");
id = (String)channelObj.get("id");
return new SlackChannelReplyImpl(ok,obj, session.findChannelById(id));
}
示例6: extractChannelRenamedEvent
import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
private static SlackChannelRenamed extractChannelRenamedEvent(SlackSession slackSession, JSONObject obj)
{
String channelId = (String) obj.get("channel");
String newName = (String) obj.get("name");
return new SlackChannelRenamedImpl(slackSession.findChannelById(channelId), newName);
}
示例7: extractChannelDeletedEvent
import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
private static SlackChannelDeleted extractChannelDeletedEvent(SlackSession slackSession, JSONObject obj)
{
String channelId = (String) obj.get("channel");
return new SlackChannelDeletedImpl(slackSession.findChannelById(channelId));
}
示例8: extractChannelUnarchiveEvent
import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
private static SlackChannelUnarchived extractChannelUnarchiveEvent(SlackSession slackSession, JSONObject obj)
{
String channelId = (String) obj.get("channel");
String userId = (String) obj.get("user");
return new SlackChannelUnarchivedImpl(slackSession.findChannelById(channelId), slackSession.findUserById(userId));
}
示例9: extractChannelArchiveEvent
import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
private static SlackChannelArchived extractChannelArchiveEvent(SlackSession slackSession, JSONObject obj)
{
String channelId = (String) obj.get("channel");
String userId = (String) obj.get("user");
return new SlackChannelArchivedImpl(slackSession.findChannelById(channelId), slackSession.findUserById(userId));
}