fix(core): remove type assertion from channels.readHistory
for some reason it returns false sometimes 🥴 closes #84
This commit is contained in:
parent
766f0399f1
commit
fe722fbb61
1 changed files with 1 additions and 4 deletions
|
@ -1,6 +1,5 @@
|
||||||
import type { ITelegramClient } from '../../client.types.js'
|
import type { ITelegramClient } from '../../client.types.js'
|
||||||
import type { InputPeerLike } from '../../types/index.js'
|
import type { InputPeerLike } from '../../types/index.js'
|
||||||
import { assertTrue } from '../../../utils/type-assertions.js'
|
|
||||||
import { createDummyUpdate } from '../../updates/utils.js'
|
import { createDummyUpdate } from '../../updates/utils.js'
|
||||||
import { isInputPeerChannel, toInputChannel } from '../../utils/peer-utils.js'
|
import { isInputPeerChannel, toInputChannel } from '../../utils/peer-utils.js'
|
||||||
import { resolvePeer } from '../users/resolve-peer.js'
|
import { resolvePeer } from '../users/resolve-peer.js'
|
||||||
|
@ -53,13 +52,11 @@ export async function readHistory(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isInputPeerChannel(peer)) {
|
if (isInputPeerChannel(peer)) {
|
||||||
const r = await client.call({
|
await client.call({
|
||||||
_: 'channels.readHistory',
|
_: 'channels.readHistory',
|
||||||
channel: toInputChannel(peer),
|
channel: toInputChannel(peer),
|
||||||
maxId,
|
maxId,
|
||||||
})
|
})
|
||||||
|
|
||||||
assertTrue('channels.readHistory', r)
|
|
||||||
} else {
|
} else {
|
||||||
const res = await client.call({
|
const res = await client.call({
|
||||||
_: 'messages.readHistory',
|
_: 'messages.readHistory',
|
||||||
|
|
Loading…
Reference in a new issue