# Interface MessageInterceptor

消息拦截监听

#### Version

25.11.0

interface MessageInterceptor {
messageWillSendAfterDB(message: Message): Promise<Message>;
messageDidReceiveBeforeDB(message: Message): Promise<Message>;
mediaMessageWillUpload(message: Message): Promise<Message>;
}

- Defined in message/listener/MessageInterceptor.ts:7

##### Index

### Methods

messageWillSendAfterDB
messageDidReceiveBeforeDB
mediaMessageWillUpload

## Methods

### messageWillSendAfterDB

- messageWillSendAfterDB(message: Message): Promise<Message>

  消息发送前入库后拦截

  #### Parameters

  - message: Message

    消息体

  #### Returns Promise<Message>

  - Defined in message/listener/MessageInterceptor.ts:12

### messageDidReceiveBeforeDB

- messageDidReceiveBeforeDB(message: Message): Promise<Message>

  消息接收后入库前拦截

  #### Parameters

  - message: Message

    消息体

  #### Returns Promise<Message>

  - Defined in message/listener/MessageInterceptor.ts:18

### mediaMessageWillUpload

- mediaMessageWillUpload(message: Message): Promise<Message>

  发送媒体消息上传前拦截

  #### Parameters

  - message: Message

    消息体

  #### Returns Promise<Message>

  - Defined in message/listener/MessageInterceptor.ts:24