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


Java SlackSession.findChannelByName方法代码示例

本文整理汇总了Java中com.ullink.slack.simpleslackapi.SlackSession.findChannelByName方法的典型用法代码示例。如果您正苦于以下问题:Java SlackSession.findChannelByName方法的具体用法?Java SlackSession.findChannelByName怎么用?Java SlackSession.findChannelByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ullink.slack.simpleslackapi.SlackSession的用法示例。


在下文中一共展示了SlackSession.findChannelByName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLastWeeksMessages

import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
private List<SlackMessagePosted> getLastWeeksMessages() {
    SlackSession slackSession = getSlackSession();

    SlackChannel slackChannel = slackSession.findChannelByName("publicaties");

    ChannelHistoryModule channelHistoryModule = ChannelHistoryModuleFactory.createChannelHistoryModule(slackSession);

    List<SlackMessagePosted> lastWeeksMesages = IntStream.of(7, 6, 5, 4, 3, 2, 1)
            .mapToObj(daysAgo -> LocalDate.now().minus(daysAgo, ChronoUnit.DAYS))
            .flatMap(date -> getMessagesOfDay(slackChannel, channelHistoryModule, date))
            .collect(toList());

    try {
        slackSession.disconnect();
    } catch (Exception ex) {
        throw new RuntimeException(ex);
    }

    return lastWeeksMesages;
}
 
开发者ID:bobvandenberge,项目名称:publicaties-generator,代码行数:21,代码来源:SlackAPI.java

示例2: process

import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
@Override
public boolean process(String command, SlackMessagePosted event, SlackSession session)
{
    Matcher matcher = PUBLISH_REVIEW_PATTERN.matcher(command);
    if (matcher.matches())
    {
        String channelNameToPublish = matcher.group(1);
        String changeId = matcher.group(2);
        String comment = matcher.group(3);
        SlackChannel channel = session.findChannelByName(channelNameToPublish);
        if (channel != null)
        {
            executor.execute(new PublishMessageJob(channelNameToPublish, event.getChannel(), changeId.trim(), comment, session, reviewRequestService, subscriptionService, gerritChangeInfoService, changeInfoDecorator));
        }
        return true;
    }
    return false;
}
 
开发者ID:Ullink,项目名称:slack4gerrit,代码行数:19,代码来源:PublishReviewCommandProcessor.java

示例3: triggerFinalized

import com.ullink.slack.simpleslackapi.SlackSession; //导入方法依赖的package包/类
@Override
public void triggerFinalized(Trigger trigger) {

    SlackSession session = SlackSessionFactory.createWebSocketSlackSession(token);
    try {
        session.connect();
    } catch (IOException e) {
        LOG.error(e.getMessage());
    }
    SlackChannel channel = session.findChannelByName(this.channel);
    session.sendMessage(channel, "Data Provider has finished.");
}
 
开发者ID:visp-streaming,项目名称:dataProvider,代码行数:13,代码来源:SlackSchedulerListener.java


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