feat(client): Message#textWithEntities
This commit is contained in:
parent
8249bd2ea4
commit
1dcbf277ef
1 changed files with 10 additions and 0 deletions
|
@ -11,6 +11,7 @@ import { assertTypeIsNot } from '@mtcute/core/utils.js'
|
||||||
import { makeInspectable } from '../../utils/index.js'
|
import { makeInspectable } from '../../utils/index.js'
|
||||||
import { memoizeGetters } from '../../utils/memoize.js'
|
import { memoizeGetters } from '../../utils/memoize.js'
|
||||||
import { BotKeyboard, ReplyMarkup } from '../bots/keyboards.js'
|
import { BotKeyboard, ReplyMarkup } from '../bots/keyboards.js'
|
||||||
|
import { TextWithEntities } from '../misc/index.js'
|
||||||
import { Chat } from '../peers/chat.js'
|
import { Chat } from '../peers/chat.js'
|
||||||
import { PeersIndex } from '../peers/peers-index.js'
|
import { PeersIndex } from '../peers/peers-index.js'
|
||||||
import { User } from '../peers/user.js'
|
import { User } from '../peers/user.js'
|
||||||
|
@ -257,6 +258,15 @@ export class Message {
|
||||||
return entities
|
return entities
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get textWithEntities(): TextWithEntities {
|
||||||
|
if (this.raw._ === 'messageService') return { text: '', entities: [] }
|
||||||
|
|
||||||
|
return {
|
||||||
|
text: this.raw.message,
|
||||||
|
entities: this.raw.entities,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message action. `null` for non-service messages
|
* Message action. `null` for non-service messages
|
||||||
* or for unsupported events.
|
* or for unsupported events.
|
||||||
|
|
Loading…
Reference in a new issue