2021-03-11 15:25:11 +00:00
|
|
|
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
|
|
|
|
2023-05-27 12:19:14 +00:00
|
|
|
import korlibs.time.DateTime
|
2021-03-11 15:25:11 +00:00
|
|
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
|
|
import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink
|
2022-11-06 10:01:05 +00:00
|
|
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
|
|
import dev.inmo.tgbotapi.types.ChatInviteLink
|
|
|
|
import dev.inmo.tgbotapi.types.MembersLimit
|
|
|
|
import dev.inmo.tgbotapi.types.TelegramDate
|
2022-04-21 18:16:41 +00:00
|
|
|
import dev.inmo.tgbotapi.types.chat.PublicChat
|
2022-11-06 10:01:05 +00:00
|
|
|
import dev.inmo.tgbotapi.types.toTelegramDate
|
2021-03-11 15:25:11 +00:00
|
|
|
|
2021-11-08 11:27:15 +00:00
|
|
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
2021-03-11 15:25:11 +00:00
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: String,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-11-08 11:27:15 +00:00
|
|
|
expiration: TelegramDate? = null
|
2021-11-08 12:00:43 +00:00
|
|
|
) = execute(EditChatInviteLink.unlimited(chatId, previousLink, name, expiration))
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: String,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-03-11 15:25:11 +00:00
|
|
|
expiration: TelegramDate? = null,
|
2021-11-08 12:00:43 +00:00
|
|
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: String,
|
2021-11-08 12:00:43 +00:00
|
|
|
expiration: DateTime,
|
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkUnlimited(chatId, previousLink, name , expiration.toTelegramDate())
|
2021-03-11 15:25:11 +00:00
|
|
|
|
2021-11-08 11:27:15 +00:00
|
|
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
2021-03-11 15:25:11 +00:00
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: String,
|
2021-11-08 12:00:43 +00:00
|
|
|
expiration: DateTime,
|
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: String,
|
|
|
|
membersLimit: MembersLimit,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-11-08 11:27:15 +00:00
|
|
|
expiration: TelegramDate? = null
|
2021-11-08 12:00:43 +00:00
|
|
|
) = execute(EditChatInviteLink.withLimitedMembers(chatId, previousLink, membersLimit, name, expiration))
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: String,
|
|
|
|
membersLimit: MembersLimit,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-03-11 15:25:11 +00:00
|
|
|
expiration: TelegramDate? = null,
|
2021-11-08 12:00:43 +00:00
|
|
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
2021-03-11 15:25:11 +00:00
|
|
|
|
2021-11-08 11:27:15 +00:00
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
2021-03-11 15:25:11 +00:00
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: String,
|
2021-11-08 11:27:15 +00:00
|
|
|
membersLimit: MembersLimit,
|
2021-03-11 15:25:11 +00:00
|
|
|
expiration: DateTime,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
2021-03-11 15:25:11 +00:00
|
|
|
|
2021-11-08 11:27:15 +00:00
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
2021-03-11 15:25:11 +00:00
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: String,
|
2021-11-08 11:27:15 +00:00
|
|
|
membersLimit: MembersLimit,
|
2021-03-11 15:25:11 +00:00
|
|
|
expiration: DateTime,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: String,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-11-08 11:27:15 +00:00
|
|
|
expiration: TelegramDate? = null
|
2021-11-08 12:00:43 +00:00
|
|
|
) = execute(EditChatInviteLink.withJoinRequest(chatId, previousLink, name, expiration))
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: String,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-11-08 11:27:15 +00:00
|
|
|
expiration: TelegramDate? = null,
|
2021-11-08 12:00:43 +00:00
|
|
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: String,
|
|
|
|
expiration: DateTime,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: String,
|
|
|
|
expiration: DateTime,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: ChatInviteLink,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-11-08 11:27:15 +00:00
|
|
|
expiration: TelegramDate? = null
|
2021-11-08 12:00:43 +00:00
|
|
|
) = editChatInviteLinkUnlimited(chatId, previousLink.inviteLink, name, expiration)
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: ChatInviteLink,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-11-08 11:27:15 +00:00
|
|
|
expiration: TelegramDate? = null,
|
2021-11-08 12:00:43 +00:00
|
|
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
|
2021-03-11 15:25:11 +00:00
|
|
|
|
2021-11-08 11:27:15 +00:00
|
|
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
|
|
|
chatId: ChatIdentifier,
|
2021-03-11 15:25:11 +00:00
|
|
|
previousLink: ChatInviteLink,
|
2021-11-08 12:00:43 +00:00
|
|
|
expiration: DateTime,
|
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkUnlimited(chatId, previousLink, name, expiration.toTelegramDate())
|
2021-03-11 15:25:11 +00:00
|
|
|
|
2021-11-08 11:27:15 +00:00
|
|
|
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
|
|
|
chat: PublicChat,
|
2021-03-11 15:25:11 +00:00
|
|
|
previousLink: ChatInviteLink,
|
2021-11-08 12:00:43 +00:00
|
|
|
expiration: DateTime,
|
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: ChatInviteLink,
|
|
|
|
membersLimit: MembersLimit,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-11-08 11:27:15 +00:00
|
|
|
expiration: TelegramDate? = null
|
2021-11-08 12:00:43 +00:00
|
|
|
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink.inviteLink, membersLimit, name, expiration)
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: ChatInviteLink,
|
|
|
|
membersLimit: MembersLimit,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-11-08 11:27:15 +00:00
|
|
|
expiration: TelegramDate? = null,
|
2021-11-08 12:00:43 +00:00
|
|
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: ChatInviteLink,
|
|
|
|
membersLimit: MembersLimit,
|
2021-03-11 15:25:11 +00:00
|
|
|
expiration: DateTime,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
|
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: ChatInviteLink,
|
|
|
|
membersLimit: MembersLimit,
|
|
|
|
expiration: DateTime,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: ChatInviteLink,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-11-08 11:27:15 +00:00
|
|
|
expiration: TelegramDate? = null
|
2021-11-08 12:00:43 +00:00
|
|
|
) = editChatInviteLinkWithJoinRequest(chatId, previousLink.inviteLink, name, expiration)
|
2021-03-11 15:25:11 +00:00
|
|
|
|
2021-11-08 11:27:15 +00:00
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
2021-03-11 15:25:11 +00:00
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: ChatInviteLink,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
2021-11-08 11:27:15 +00:00
|
|
|
expiration: TelegramDate? = null,
|
2021-11-08 12:00:43 +00:00
|
|
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
|
2021-11-08 11:27:15 +00:00
|
|
|
|
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
previousLink: ChatInviteLink,
|
|
|
|
expiration: DateTime,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
|
2021-03-11 15:25:11 +00:00
|
|
|
|
2021-11-08 11:27:15 +00:00
|
|
|
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
|
2021-03-11 15:25:11 +00:00
|
|
|
chat: PublicChat,
|
|
|
|
previousLink: ChatInviteLink,
|
|
|
|
expiration: DateTime,
|
2021-11-08 12:00:43 +00:00
|
|
|
name: String? = null,
|
|
|
|
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
|