Skip to content

Commit

Permalink
feat(lark): support lark favored button attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Nov 25, 2024
1 parent 8550490 commit e8e76d7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion adapters/lark/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@satorijs/adapter-lark",
"description": "Lark (飞书) Adapter for Satorijs",
"version": "3.6.2",
"version": "3.7.1",
"type": "module",
"main": "lib/index.cjs",
"types": "lib/index.d.ts",
Expand Down
15 changes: 15 additions & 0 deletions adapters/lark/src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,21 @@ export class LarkMessageEncoder<C extends Context = Context> extends MessageEnco
},
disabled: attrs.disabled,
behaviors: this.createBehavior(attrs),
type: attrs['lark:type'],
size: attrs['lark:size'],
width: attrs['lark:width'],
icon: attrs['lark:icon'] && {
tag: 'standard_icon',
token: attrs['lark:icon'],
},
hover_tips: attrs['lark:hover-tips'] && {
tag: 'plain_text',
content: attrs['lark:hover-tips'],
},
disabled_tips: attrs['lark:disabled-tips'] && {
tag: 'plain_text',
content: attrs['lark:disabled-tips'],
},
})
this.textContent = ''
} else if (type === 'button-group') {
Expand Down
2 changes: 1 addition & 1 deletion adapters/lark/src/types/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class Internal {
throw new Error(`too many arguments for ${path}, received ${raw}`)
}
const response = await this.bot.http(method, url, config)
this.assertResponse(response.data)
this.assertResponse(response)
return extractData ? response.data.data : response.data
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"packages/*"
],
"scripts": {
"build": "yakumo esbuild && yakumo tsc",
"build": "yakumo build",
"bump": "yakumo version",
"dep": "yakumo upgrade",
"pub": "yakumo publish",
Expand Down
4 changes: 4 additions & 0 deletions yakumo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
name: yakumo-tsc
- id: qrzdog
name: yakumo/run
- id: g61i7p
name: yakumo/version
- id: 16co8h
name: yakumo/publish

0 comments on commit e8e76d7

Please sign in to comment.