Skip to content

ppagent / IDingRobotSourceOptions

Interface: IDingRobotSourceOptions

Defined in: src/source/ding.robot.source.ts:77

一个source可以有多个实例,比如不同的api地址,由用户配置

Extends

Properties

agentId

agentId: number

Defined in: src/source/ding.robot.source.ts:83


apiHost?

optional apiHost: string

Defined in: src/source/ding.robot.source.ts:81


autoReLogin?

optional autoReLogin: boolean

Defined in: src/source/source.ts:15

离线后是否自动重新请求登陆,默认false

Inherited from

ISourceOptions.autoReLogin


clientId

clientId: string

Defined in: src/source/ding.robot.source.ts:78


clientSecret

clientSecret: string

Defined in: src/source/ding.robot.source.ts:79


contactAutoloadOnStart?

optional contactAutoloadOnStart: boolean

Defined in: src/source/ding.robot.source.ts:127

是否在系统启动的时候就自动获取联系人。默认false。

如果员工较多,建议启动的时候获取,避免第一次使用的时候等待时间过长。


contactDepartId?

optional contactDepartId: number

Defined in: src/source/ding.robot.source.ts:121

联系人的列表ID,可以从钉钉api explorer里面相关接口获取(从根路径开始一层层获取)

默认1,表示根路径,如果只希望对部分部门的用户可被前端选取,可以这里设置上级部门ID

该配置仅影响前端选择联系人的数量,不影响消息监听


contactsCacheTime?

optional contactsCacheTime: number

Defined in: src/source/ding.robot.source.ts:113

联系人缓存时间,单位是秒,默认24小时


contactSleepMS?

optional contactSleepMS: number

Defined in: src/source/ding.robot.source.ts:131

由于递归调用获取用户接口可能触发限流,此时可以设置获取间隔,默认是30ms一次。


corpId

corpId: string

Defined in: src/source/ding.robot.source.ts:80


debug?

optional debug: boolean

Defined in: src/source/ding.robot.source.ts:88

如果不设置,则使用环境变量中的值,设置该值优先


instanceName?

optional instanceName: string

Defined in: src/instance.base.manager.ts:10

用来区分不同实例的全局唯一key

Inherited from

ISourceOptions.instanceName


markdownMsgTitle?

optional markdownMsgTitle: string

Defined in: src/source/ding.robot.source.ts:94

当发送文本类消息的时候,钉钉支持提供一个标题,标题会在列表中展示。默认是AI回复的前16个字。

如果配置这个参数,则会固定用这个标题


oldApiHost?

optional oldApiHost: string

Defined in: src/source/ding.robot.source.ts:82


robotCode

robotCode: string

Defined in: src/source/ding.robot.source.ts:84


sendAudioFormat?

optional sendAudioFormat: "wav" | "amr"

Defined in: src/source/ding.robot.source.ts:100

发送音频时的格式,默认amr,可选wav(部分wav可能手机会播放失败),amr文件尺寸小,效率略低于wav。

目前测试wav格式支持客户端播放,但是转文字会失败。


streamTemplateId?

optional streamTemplateId: string

Defined in: src/source/ding.robot.source.ts:109

如果配置为AI卡片,则开启了流式回复,则需要配置streamTemplateId,否则流式回复不会生效 可以参考着创建:https://open.dingtalk.com/document/orgapp/typewriter-effect-streaming-ai-card

此外还需要开放应用的卡片相关权限(后台应用权限搜索卡片全选批量开通即可)

使用卡片时候,因只支持markdown类型,即text类型,因此要关闭相关文字转语音技能对该source的使用,否则会出现卡片没有内容更新的情况。