feat(core): expose untilDate
in banChatMember
This commit is contained in:
parent
69f715e814
commit
5b00ce4a63
2 changed files with 6 additions and 2 deletions
|
@ -1322,6 +1322,8 @@ export interface TelegramClient extends ITelegramClient {
|
|||
/** ID of the user/channel to ban */
|
||||
participantId: InputPeerLike
|
||||
|
||||
untilDate?: number | Date
|
||||
|
||||
/**
|
||||
* Whether to dispatch the returned service message (if any)
|
||||
* to the client's update handler.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import type { ITelegramClient } from '../../client.types.js'
|
||||
import type { InputPeerLike, Message } from '../../types/index.js'
|
||||
import { MtInvalidPeerTypeError } from '../../types/index.js'
|
||||
import { normalizeDate } from '../../utils/index.js'
|
||||
import { isInputPeerChannel, isInputPeerChat, toInputChannel, toInputUser } from '../../utils/peer-utils.js'
|
||||
import { _findMessageInUpdate } from '../messages/find-in-update.js'
|
||||
import { resolvePeer } from '../users/resolve-peer.js'
|
||||
|
@ -24,6 +25,8 @@ export async function banChatMember(
|
|||
/** ID of the user/channel to ban */
|
||||
participantId: InputPeerLike
|
||||
|
||||
untilDate?: number | Date
|
||||
|
||||
/**
|
||||
* Whether to dispatch the returned service message (if any)
|
||||
* to the client's update handler.
|
||||
|
@ -43,8 +46,7 @@ export async function banChatMember(
|
|||
participant: peer,
|
||||
bannedRights: {
|
||||
_: 'chatBannedRights',
|
||||
// bans can't be temporary.
|
||||
untilDate: 0,
|
||||
untilDate: normalizeDate(params?.untilDate) ?? 0,
|
||||
viewMessages: true,
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue