update refactor
This commit is contained in:
parent
01abc7e446
commit
55ad0607f3
39 changed files with 4304 additions and 584 deletions
22
src/services/messageService.ts
Normal file
22
src/services/messageService.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { Client } from '@larksuiteoapi/node-sdk';
|
||||
|
||||
export async function sendLarkMessage(receiveId: string, message: string): Promise<any> {
|
||||
console.log(process.env.LARK_APP_ID!, process.env.LARK_APP_SECRET!);
|
||||
const lark = new Client({
|
||||
appId: process.env.LARK_APP_ID!,
|
||||
appSecret: process.env.LARK_APP_SECRET!
|
||||
});
|
||||
|
||||
const res = await lark.im.message.create({
|
||||
params: {
|
||||
receive_id_type: 'chat_id',
|
||||
},
|
||||
data: {
|
||||
receive_id: receiveId,
|
||||
content: JSON.stringify({text: message}),
|
||||
msg_type: 'text'
|
||||
}
|
||||
});
|
||||
|
||||
return { success: true, data: res.data };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue