claude-api-slack
Advanced tools
Comparing version 1.0.15 to 1.0.16
@@ -32,4 +32,4 @@ "use strict"; | ||
const uuid_1 = require("uuid"); | ||
const p_timeout_1 = __importDefault(require("p-timeout")); | ||
// const pTimeout = require('p-timeout') | ||
// import pTimeout from 'p-timeout' | ||
const pTimeout = require('p-timeout'); | ||
const types = __importStar(require("./types")); | ||
@@ -183,3 +183,3 @@ const DAY_MS = 1000 * 60 * 60 * 24; | ||
if (timeoutMs) { | ||
return (0, p_timeout_1.default)(responseP, { | ||
return pTimeout(responseP, { | ||
milliseconds: timeoutMs, | ||
@@ -186,0 +186,0 @@ message: 'ClaudeAI timed out waiting for response: ' + timeoutMs + "'ms." |
{ | ||
"name": "claude-api-slack", | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"description": "slack Authentication Library for ClaudeAI.", | ||
"main": "./build/index.js", | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json" | ||
"build": "tsc -p tsconfig.json", | ||
"test": "node demos/demo.ts", | ||
"pub": "npm publish --access public" | ||
}, | ||
@@ -18,2 +20,3 @@ "author": "nightwhite", | ||
}, | ||
"type": "module", | ||
"files": [ | ||
@@ -20,0 +23,0 @@ "build" |
@@ -5,4 +5,2 @@ ### ClaudeAI for Node.js | ||
### Usage | ||
@@ -14,3 +12,3 @@ | ||
let | ||
// user-token | ||
// user-token | ||
token = 'xoxp-xxxxx', | ||
@@ -22,3 +20,3 @@ // claude appid | ||
const authenticator = new Authenticator(token, bot) | ||
// 创建一个频道,已存在则直接返回频道ID | ||
// 创建一个频道,已存在则直接返回频道 ID | ||
const channel = await authenticator.newChannel('chat-7890') | ||
@@ -42,32 +40,26 @@ let result: ChatResponse = await authenticator.sendMessage({ | ||
### 授权以及获取 user-token | ||
网页登录后[登录](https://app.slack.com), 进入 api 配置页面[点我跳转]([Claude - chat - Slack](https://api.slack.com/))。 | ||
### 授权以及获取user-token | ||
〉》点击【Create an app】 | ||
网页登录后[登录](https://app.slack.com), 进入api配置页面[点我跳转]([Claude - chat - Slack](https://api.slack.com/))。 | ||
〉》主页看见 Your Apps 并弹出窗口【Create an app】 〉》点击【From scratch】 | ||
〉》点击 【Create an app】 | ||
〉》填写 app 名称以及选择工作空间(例:name: Bot, workspace: chat) 〉》点击【Create App】 | ||
〉》主页看见Your Apps并弹出窗口【Create an app】 〉》 点击【From scratch】 | ||
〉》点击左侧边栏上的【OAuth & Permissions】 〉》下拉至【Scopes】卡片,在【User Token Scopes】项下添加权限,如下: | ||
〉》填写app名称以及选择工作空间(例:name: Bot, workspace: chat) 〉》 点击【Create App】 | ||
channels:history, channels:read, channels:write, groups:history, groups:read, groups:write, | ||
〉》点击左侧边栏上的【OAuth & Permissions】 〉》 下拉至【Scopes】卡片,在 【User Token Scopes】 项下添加权限,如下: | ||
chat:write, im:history, im:write, mpim:history, mpim:write | ||
channels:history, channels:read, channels:write, groups:history, groups:read, groups:write, | ||
〉》回到顶部【OAuth Tokens for Your Workspace】栏,点击【Install to Workspace】,然后确认授权即可 | ||
chat:write, im:history, im:write, mpim:history, mpim:write | ||
至此,获得拥有一定权限的 user-token | ||
〉》回到顶部【OAuth Tokens for Your Workspace】栏,点击【Install to Workspace】,然后确认授权即可 | ||
至此,获得拥有一定权限的user-token | ||
<img src="static/截屏2023-04-18 09.10.56.png" alt="截屏2023-04-18 09.10.56" style="zoom:50%;" /> | ||
<img src="static/截屏2023-04-18 09.14.41.png" alt="截屏2023-04-18 09.14.41" style="zoom:50%;" /> | ||
### 获取 claude appid | ||
@@ -77,8 +69,5 @@ | ||
Credits | ||
Thank you to: | ||
- https://github.com/ikechan8370/chatgpt-plugin original NodeJS implementation | ||
- <https://github.com/ikechan8370/chatgpt-plugin> original NodeJS implementation |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13814
Yes
69