当前位置: 首页>>代码示例>>Java>>正文


Java SlackSession.findChannelById方法代码示例

本文整理汇总了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;
}
 
开发者ID:JujaLabs,项目名称:microservices,代码行数:17,代码来源:SlackJSONMessageParser.java

示例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);
        }
    }
}
 
开发者ID:sjsucohort6,项目名称:amigo-chatbot,代码行数:13,代码来源:MessageProcessorJob.java

示例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));
}
 
开发者ID:JujaLabs,项目名称:microservices,代码行数:8,代码来源:SlackJSONMessageParser.java

示例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));
}
 
开发者ID:JujaLabs,项目名称:microservices,代码行数:8,代码来源:SlackJSONMessageParser.java

示例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));
}
 
开发者ID:JujaLabs,项目名称:microservices,代码行数:11,代码来源:SlackJSONReplyParser.java

示例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);
}
 
开发者ID:JujaLabs,项目名称:microservices,代码行数:7,代码来源:SlackJSONMessageParser.java

示例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));
}
 
开发者ID:JujaLabs,项目名称:microservices,代码行数:6,代码来源:SlackJSONMessageParser.java

示例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));
}
 
开发者ID:JujaLabs,项目名称:microservices,代码行数:7,代码来源:SlackJSONMessageParser.java

示例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));
}
 
开发者ID:JujaLabs,项目名称:microservices,代码行数:7,代码来源:SlackJSONMessageParser.java


注:本文中的com.ullink.slack.simpleslackapi.SlackSession.findChannelById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。