问题标签 [rtm]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
272 浏览

node.js - Messaging a user a bot does not know

I am using the Slack RTM node client and having a bit of an issue with DM's. Say a user joins the channel who has never DM'ed the bot before, the user types a command in the channel that the bot usually will respond to and by default the bot responds in a private message to the user. However, the bot cannot do this because the dataStore does not contain any DM data for this user. Code sample below...

Is there a way around this? I can't seem to find anything in the docs or code to suggest there might be.

0 投票
1 回答
375 浏览

api - 如何在 slack API 上获取 im_marked 事件

我正在使用 slack RTM API 开发一个机器人。我想捕捉im_marked事件。

我的问题是,当用户使用机器人检查他的私人频道时,RTM API 没有收到任何事件,其中包含未读消息。我已经尝试过使用两个不同的库。

我想我看的不是正确的阶段,或者我没有正确的用例。RTM 在什么情况下接收 im_marked 事件?

0 投票
1 回答
279 浏览

asp.net - 从 Asp.net Rc1 切换到 Rtm 会引发我不理解的异常

我在 Rtm 中创建了一个新项目,然后将我的代码转移到该项目。到目前为止,我没有在 VS 中遇到任何错误。当我尝试启动 IIS 时,出现此错误:

它发生在为 IServiceCollection 创建 dbcontext 时。

知道是什么原因造成的吗?

抱歉,我没有发布任何代码,但我什至不知道从哪里开始,因为我不明白错误。如果您想查看任何代码,请询问。

0 投票
4 回答
32204 浏览

asp.net-mvc - How to get claim inside Asp.Net Core Razor View

I did it in my rc1 project like:

But after I switched to rtm it wouldn’t work anymore. When I debug the Razor view the object looks the same but User.Claims is just empty. Any idea what the reason could be.

0 投票
2 回答
1188 浏览

bots - 松弛和监控私人消息

我正在制作一个计划监控松弛消息的应用程序。使用 RTM,我已经在监控公共频道,但是有没有办法监控私人通信?

我看到有 Compliance Exports,但它与我想做的事情相去甚远,因为我想轻松实时地处理所有消息。

0 投票
3 回答
1029 浏览

slack-api - 使用 Slack RTM api 发布消息

我正在关注这里的教程https://slackapi.github.io/node-slack-sdk/bots#posting-a-message我很困惑为什么我不能让这部分教程代码工作。我复制并粘贴了本节中的代码,如下所示

由于教程代码的第一部分有效,因此问题肯定来自最后 3 行代码。大概是事件的问题。我的错误信息是

我真的很感激任何帮助。

0 投票
1 回答
388 浏览

node.js - slack RTM API 获取频道列表

我正在使用简单的 slack bot RTM API 模板,在https://github.com/slackapi/node-slack-sdk给出

问题是如何获取频道名称?

我发现我应该使用与 WEB API 兼容的channel.list 。

但是当我使用 RTM API 时如何调用 WEB API 呢?而且,总的来说,为什么所有这些都过于复杂?

0 投票
0 回答
285 浏览

events - slack bot RTM API 监控通道的活动

我正在使用简单的 slack bot RTM API 模板,在https://github.com/slackapi/node-slack-sdk给出

我想监控频道的活动,例如,频道是否显着(没有消息)几分钟,我想发送一些消息。

怎么做?是否可以干预乒乓球赛事?

0 投票
0 回答
65 浏览

node.js - Slack 与 Laravel 问题的集成

我正在尝试安装 slack 节点库,但无法成功。我使用 node js 在 laravel 5.4 上成功安装了这个库。我的 gulpfile 从 5.3 升级到 5.4 并附在下面。

npm install @slack/client --save (安装很好,但 gukp 导致问题)

但是当我在 shell 上运行 gulp 命令时,我收到以下错误:-

在 app.js 中添加此行后:-

gulpfile.js(手动编辑)

Gulp 命令错误

提前致谢

0 投票
1 回答
76 浏览

node.js - 来自给定用户名的 Slack RTM API 帖子

我已将 Slack RTM API 集成到我的程序中,并且我能够发布到 Slack 以及接收来自 Slack 的新消息。

我遇到的一个问题是在发布到 Slack 时,该帖子来自我的用户名。我知道可以通过设置“用户名”和“as_user”字段来更改 Web API 中的发布用户,所以我不确定为什么会有所不同。以下是我正在使用的消息。Comment.user.name 是一个字符串。

这可能与我这样做的方式,还是有更好的方法?谢谢。