mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 00:03:48 +00:00
chats sealing
This commit is contained in:
parent
323c4de858
commit
a930423955
11
CHANGELOG.md
11
CHANGELOG.md
@ -11,6 +11,17 @@ __All the `tgbotapi.extensions.*` packages have been removed__
|
||||
* **`CallbackQuery` package renamed. Migration:** `dev.inmo.tgbotapi.types.CallbackQuery([\s\\.])` -> `dev.inmo.tgbotapi.types.queries.callback$1`
|
||||
* **`ChatMember` package renamed. Migration:** `dev.inmo.tgbotapi.types.ChatMember([\s\\.])` -> `dev.inmo.tgbotapi.types.chat.member$1`
|
||||
* **`ChatAdministratorRightsImpl` replaced. Migration:** `dev.inmo.tgbotapi.types.ChatAdministratorRightsImpl` -> `dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl`
|
||||
* **`chat.abstract.extended` replaced. Migration:** `dev.inmo.tgbotapi.types.chat.abstract.extended` -> `dev.inmo.tgbotapi.types.chat.member.chat`
|
||||
* **`chat.abstract` replaced. Migration:** `dev.inmo.tgbotapi.types.chat.abstract` -> `dev.inmo.tgbotapi.types.chat.member.chat`
|
||||
* **`chat.extended` replaced. Migration:** `dev.inmo.tgbotapi.types.chat.extended` -> `dev.inmo.tgbotapi.types.chat.member.chat`
|
||||
* **User interfaces have been fully replaced**:
|
||||
* `dev.inmo.tgbotapi.types.User` -> `dev.inmo.tgbotapi.types.chat.User`
|
||||
* `dev.inmo.tgbotapi.types.CommonUser` -> `dev.inmo.tgbotapi.types.chat.CommonUser`
|
||||
* `dev.inmo.tgbotapi.types.ExtendedUser` -> `dev.inmo.tgbotapi.types.chat.ExtendedUser`
|
||||
* `dev.inmo.tgbotapi.types.Bot` -> `dev.inmo.tgbotapi.types.chat.Bot`
|
||||
* `dev.inmo.tgbotapi.types.CommonBot` -> `dev.inmo.tgbotapi.types.chat.CommonBot`
|
||||
* `dev.inmo.tgbotapi.types.ExtendedBot` -> `dev.inmo.tgbotapi.types.chat.ExtendedBot`
|
||||
* `dev.inmo.tgbotapi.types.UserSerializer` -> `dev.inmo.tgbotapi.types.chat.UserSerializer`
|
||||
* Constructor of `UnknownInlineKeyboardButton` is not internal and can be created with any `json` ([#563](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/563))
|
||||
* All the interfaces from `dev.inmo.tgbotapi.types.files.abstracts` have been replaced to `dev.inmo.tgbotapi.types.files` and converted to sealed ([#550](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/550))
|
||||
* `PassportFile` has been replaced to `dev.inmo.tgbotapi.types.files`
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.DeleteMessage
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
|
||||
suspend fun TelegramBot.deleteMessage(
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.ForwardMessage
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
|
||||
suspend fun TelegramBot.forwardMessage(
|
||||
|
@ -9,7 +9,7 @@ import dev.inmo.tgbotapi.requests.send.SendLiveLocation
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.StopPoll
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
|
||||
/**
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.ExportChatInviteLink
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.exportChatInviteLink(
|
||||
chatId: ChatIdentifier
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.LeaveChat
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.leaveChat(
|
||||
chatId: ChatIdentifier
|
||||
|
@ -2,11 +2,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.get.GetChat
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.extended.*
|
||||
import dev.inmo.tgbotapi.types.chat.extended.*
|
||||
import dev.inmo.tgbotapi.utils.PreviewFeature
|
||||
|
||||
suspend fun TelegramBot.getChat(
|
||||
@ -18,7 +15,7 @@ suspend fun TelegramBot.getChat(
|
||||
) = getChat(chat.id)
|
||||
|
||||
/**
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||
* [ExtendedPublicChat] with unsafe operator "as"
|
||||
*
|
||||
* @throws ClassCastException
|
||||
@ -30,7 +27,7 @@ suspend fun TelegramBot.getChat(
|
||||
|
||||
|
||||
/**
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||
* [ExtendedChannelChat] with unsafe operator "as"
|
||||
*
|
||||
* @throws ClassCastException
|
||||
@ -41,7 +38,7 @@ suspend fun TelegramBot.getChat(
|
||||
) = getChat(chat.id) as ExtendedChannelChat
|
||||
|
||||
/**
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||
* [ExtendedChannelChatImpl] with unsafe operator "as"
|
||||
*
|
||||
* @throws ClassCastException
|
||||
@ -53,7 +50,7 @@ suspend fun TelegramBot.getChat(
|
||||
|
||||
|
||||
/**
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||
* [ExtendedGroupChat] with unsafe operator "as"
|
||||
*
|
||||
* @throws ClassCastException
|
||||
@ -64,7 +61,7 @@ suspend fun TelegramBot.getChat(
|
||||
) = getChat(chat.id) as ExtendedGroupChat
|
||||
|
||||
/**
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||
* [ExtendedGroupChatImpl] with unsafe operator "as"
|
||||
*
|
||||
* @throws ClassCastException
|
||||
@ -76,7 +73,7 @@ suspend fun TelegramBot.getChat(
|
||||
|
||||
|
||||
/**
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||
* [ExtendedSupergroupChat] with unsafe operator "as"
|
||||
*
|
||||
* @throws ClassCastException
|
||||
@ -87,7 +84,7 @@ suspend fun TelegramBot.getChat(
|
||||
) = getChat(chat.id) as ExtendedSupergroupChat
|
||||
|
||||
/**
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||
* [ExtendedSupergroupChatImpl] with unsafe operator "as"
|
||||
*
|
||||
* @throws ClassCastException
|
||||
@ -99,7 +96,7 @@ suspend fun TelegramBot.getChat(
|
||||
|
||||
|
||||
/**
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||
* [ExtendedPrivateChat] with unsafe operator "as"
|
||||
*
|
||||
* @throws ClassCastException
|
||||
@ -110,7 +107,7 @@ suspend fun TelegramBot.getChat(
|
||||
) = getChat(chat.id) as ExtendedPrivateChat
|
||||
|
||||
/**
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||
* [ExtendedPrivateChatImpl] with unsafe operator "as"
|
||||
*
|
||||
* @throws ClassCastException
|
||||
@ -121,7 +118,7 @@ suspend fun TelegramBot.getChat(
|
||||
) = getChat(chat.id) as ExtendedPrivateChatImpl
|
||||
|
||||
/**
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
|
||||
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
|
||||
* [ExtendedUser] with unsafe operator "as"
|
||||
*
|
||||
* @throws ClassCastException
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.get.GetChatAdministrators
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.getChatAdministrators(
|
||||
chatId: ChatIdentifier
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.get.GetChatMemberCount
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.getChatMemberCount(
|
||||
chatId: ChatIdentifier
|
||||
|
@ -2,9 +2,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.get.GetChatMenuButton
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PrivateChat
|
||||
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||
|
||||
suspend fun TelegramBot.getChatMenuButton(
|
||||
chatId: ChatId
|
||||
|
@ -3,7 +3,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.invite_links.ApproveChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.*
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
||||
|
||||
suspend fun TelegramBot.approveChatJoinRequest(
|
||||
|
@ -4,7 +4,7 @@ import com.soywiz.klock.DateTime
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.createChatInviteLinkUnlimited(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -1,10 +1,10 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.invite_links.ApproveChatJoinRequest
|
||||
import dev.inmo.tgbotapi.requests.chat.invite_links.DeclineChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.*
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
|
||||
|
||||
suspend fun TelegramBot.declineChatJoinRequest(
|
||||
|
@ -4,7 +4,7 @@ import com.soywiz.klock.DateTime
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.editChatInviteLinkUnlimited(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.invite_links.RevokeChatInviteLink
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.ChatInviteLink
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.revokeChatInviteLink(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -3,7 +3,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.BanChatMember
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
suspend fun TelegramBot.banChatMember(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -1,10 +1,9 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.BanChatMember
|
||||
import dev.inmo.tgbotapi.requests.chat.members.BanChatSenderChat
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.banChatSenderChat(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -3,7 +3,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.GetChatMember
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
suspend fun TelegramBot.getChatMember(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -3,7 +3,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
suspend fun TelegramBot.promoteChatMember(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -3,8 +3,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.RestrictChatMember
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.ChatPermissions
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.*
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
suspend fun TelegramBot.restrictChatMember(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -3,7 +3,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.SetChatAdministratorCustomTitle
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
suspend fun TelegramBot.setChatAdministratorCustomTitle(
|
||||
chatId: ChatId,
|
||||
|
@ -3,7 +3,8 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.UnbanChatMember
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
suspend fun TelegramBot.unbanChatMember(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.members.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.unbanChatSenderChat(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.DeleteChatPhoto
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.deleteChatPhoto(
|
||||
chatId: ChatIdentifier
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.PinChatMessage
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
|
||||
suspend fun TelegramBot.pinChatMessage(
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.SetChatDescription
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.setChatDescription(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PrivateChat
|
||||
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||
|
||||
suspend fun TelegramBot.setChatMenuButton(
|
||||
chatId: ChatId,
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.SetChatPermissions
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.ChatPermissions
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.setDefaultChatMembersPermissions(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.SetChatPhoto
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.setChatPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.SetChatTitle
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
|
||||
import dev.inmo.tgbotapi.types.chat.PublicChat
|
||||
|
||||
suspend fun TelegramBot.setChatTitle(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.UnpinAllChatMessages
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
|
||||
suspend fun TelegramBot.unpinAllChatMessages(
|
||||
chatId: ChatIdentifier
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.modify.UnpinChatMessage
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
|
||||
suspend fun TelegramBot.unpinChatMessage(
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.stickers
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.stickers.DeleteChatStickerSet
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.SupergroupChat
|
||||
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
||||
|
||||
suspend fun TelegramBot.deleteChatStickerSet(
|
||||
chatId: ChatIdentifier
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.chat.stickers.SetChatStickerSet
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.StickerSetName
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.SupergroupChat
|
||||
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
||||
|
||||
suspend fun TelegramBot.setChatStickerSet(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.edit.LiveLocation.EditChatMessageLiveLocation
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.location.LiveLocation
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||
|
@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.edit.LiveLocation.StopChatMessageLiveLocation
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.LocationContent
|
||||
|
||||
|
@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.edit.ReplyMarkup.EditChatMessageReplyMarkup
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent
|
||||
|
||||
|
@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.InputMedia.InputMedia
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent
|
||||
|
||||
|
@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||
|
||||
|
@ -3,7 +3,8 @@ package dev.inmo.tgbotapi.extensions.api.games
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.games.GetGameHighScoresByChat
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.GameContent
|
||||
|
||||
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.games
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.games.GetGameHighScoresByInlineMessageId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
|
||||
suspend fun TelegramBot.getGameScore(
|
||||
userId: UserId,
|
||||
|
@ -3,7 +3,8 @@ package dev.inmo.tgbotapi.extensions.api.games
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.games.SetGameScoreByChatId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.GameContent
|
||||
|
||||
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.games
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.games.SetGameScoreByInlineMessageId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
|
||||
suspend fun TelegramBot.setGameScore(
|
||||
userId: UserId,
|
||||
|
@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.get
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.get.GetUserProfilePhotos
|
||||
import dev.inmo.tgbotapi.types.CommonUser
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
|
||||
suspend fun TelegramBot.getUserProfilePhotos(
|
||||
|
@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.passport
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.SetPassportDataErrors
|
||||
import dev.inmo.tgbotapi.types.User
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.message.PassportMessage
|
||||
import dev.inmo.tgbotapi.types.passport.PassportData
|
||||
|
@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.InputMedia.*
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.media.MediaGroupContent
|
||||
import dev.inmo.tgbotapi.types.update.MediaGroupUpdates.SentMediaGroupUpdate
|
||||
|
@ -15,7 +15,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
||||
import dev.inmo.tgbotapi.types.files.*
|
||||
import dev.inmo.tgbotapi.types.files.TelegramMediaFile
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendAction
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.actions.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
|
||||
suspend fun TelegramBot.sendBotAction(
|
||||
chatId: ChatIdentifier,
|
||||
|
@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendAction
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.actions.*
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import kotlinx.coroutines.*
|
||||
import kotlin.contracts.*
|
||||
import kotlin.coroutines.coroutineContext
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendContact
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.send.SendDice
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.dice.DiceAnimationType
|
||||
|
||||
/**
|
||||
|
@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.send.SendStaticLocation
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
|
||||
/**
|
||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.SendVenue
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||
import dev.inmo.tgbotapi.types.venue.Venue
|
||||
|
||||
|
@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.send.games.SendGame
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.games.Game
|
||||
|
||||
/**
|
||||
|
@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.AnimationFile
|
||||
|
||||
/**
|
||||
|
@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.AudioFile
|
||||
|
||||
/**
|
||||
|
@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.DocumentFile
|
||||
|
||||
/**
|
||||
|
@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.requests.send.media.*
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.InputMedia.*
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.message.content.media.MediaGroupContent
|
||||
import dev.inmo.tgbotapi.types.message.content.media.VisualMediaGroupContent
|
||||
import dev.inmo.tgbotapi.types.message.content.media.AudioContent
|
||||
|
@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.*
|
||||
|
||||
/**
|
||||
|
@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.requests.send.media.SendSticker
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.Sticker
|
||||
|
||||
/**
|
||||
|
@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.VideoFile
|
||||
|
||||
/**
|
||||
|
@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.requests.send.media.SendVideoNote
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.VideoNoteFile
|
||||
|
||||
/**
|
||||
|
@ -7,9 +7,8 @@ import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.files.VoiceFile
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.send.payments.SendInvoice
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||
|
||||
|
@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
||||
import dev.inmo.tgbotapi.types.chat.Chat
|
||||
import dev.inmo.tgbotapi.types.polls.*
|
||||
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.AddAnimatedStickerToSet
|
||||
import dev.inmo.tgbotapi.types.CommonUser
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||
import dev.inmo.tgbotapi.types.stickers.StickerSet
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.AddStaticStickerToSet
|
||||
import dev.inmo.tgbotapi.types.CommonUser
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||
import dev.inmo.tgbotapi.types.stickers.StickerSet
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.AddVideoStickerToSet
|
||||
import dev.inmo.tgbotapi.types.CommonUser
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||
import dev.inmo.tgbotapi.types.stickers.StickerSet
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.CreateNewAnimatedStickerSet
|
||||
import dev.inmo.tgbotapi.types.CommonUser
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.CreateNewStaticStickerSet
|
||||
import dev.inmo.tgbotapi.types.CommonUser
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.CreateNewVideoStickerSet
|
||||
import dev.inmo.tgbotapi.types.CommonUser
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.SetStickerSetThumb
|
||||
import dev.inmo.tgbotapi.types.CommonUser
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.stickers.StickerSet
|
||||
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.stickers
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.UploadStickerFile
|
||||
import dev.inmo.tgbotapi.types.CommonUser
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
|
||||
suspend fun TelegramBot.uploadStickerFile(
|
||||
|
@ -4,9 +4,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||
import dev.inmo.tgbotapi.extensions.utils.*
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.types.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||
import kotlinx.coroutines.flow.toList
|
||||
|
||||
typealias ChatJoinRequestsMapper = suspend ChatJoinRequest.() -> ChatJoinRequest?
|
||||
|
@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.types.ChatMemberUpdated
|
||||
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
||||
import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate
|
||||
import dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate
|
||||
|
@ -3,8 +3,8 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.filters
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver
|
||||
import dev.inmo.tgbotapi.extensions.utils.extensions.sourceChat
|
||||
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
||||
import dev.inmo.tgbotapi.types.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.ChatMemberUpdated
|
||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.Message
|
||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||
|
@ -5,9 +5,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.*
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.*
|
||||
import dev.inmo.tgbotapi.extensions.utils.asChatJoinRequestUpdate
|
||||
import dev.inmo.tgbotapi.extensions.utils.asShippingQueryUpdate
|
||||
import dev.inmo.tgbotapi.types.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.ChatMemberUpdatedF
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatChatMemberUpdatedMarkerFactory
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||
import dev.inmo.tgbotapi.types.ChatMemberUpdated
|
||||
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
||||
import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate
|
||||
import dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate
|
||||
import dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate
|
||||
|
@ -1,6 +1,6 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories
|
||||
|
||||
import dev.inmo.tgbotapi.types.ChatMemberUpdated
|
||||
import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated
|
||||
|
||||
object ByChatChatMemberUpdatedMarkerFactory : MarkerFactory<ChatMemberUpdated, Any> {
|
||||
override suspend fun invoke(data: ChatMemberUpdated) = data.chat
|
||||
|
@ -1,7 +1,7 @@
|
||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories
|
||||
|
||||
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
|
||||
import dev.inmo.tgbotapi.types.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package dev.inmo.tgbotapi.CommonAbstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.User
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
/**
|
||||
* Inheritors of this interface have some [User] as a source of data. For example, any [dev.inmo.tgbotapi.types.queries.callback.CallbackQuery]
|
||||
|
@ -1,6 +1,6 @@
|
||||
package dev.inmo.tgbotapi.CommonAbstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.User
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
/**
|
||||
* All inheritors of this type have [User] in their data as one of the main data
|
||||
|
@ -1,7 +1,7 @@
|
||||
package dev.inmo.tgbotapi.requests.bot
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.types.ExtendedBot
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedBot
|
||||
import kotlinx.serialization.*
|
||||
|
||||
@Serializable
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.CommonAbstracts.types.ChatRequest
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedChatSerializer
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat
|
||||
import dev.inmo.tgbotapi.types.chat.ExtendedChat
|
||||
import dev.inmo.tgbotapi.types.chatIdField
|
||||
import kotlinx.serialization.*
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import dev.inmo.micro_utils.common.Warning
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
|
@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types
|
||||
|
||||
import com.soywiz.klock.DateTime
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.WithUser
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
|
@ -8,7 +8,7 @@ import kotlinx.serialization.Serializable
|
||||
* Represents a location to which a chat is connected.
|
||||
*
|
||||
* @see dev.inmo.tgbotapi.requests.chat.get.GetChat
|
||||
* @see dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedSupergroupChat
|
||||
* @see dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat
|
||||
*/
|
||||
@Serializable
|
||||
data class ChatLocation(
|
||||
|
@ -1,6 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
@ -1,6 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.location.StaticLocation
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
@ -1,7 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.query
|
||||
|
||||
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
|
||||
import dev.inmo.tgbotapi.types.User
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.chat.ChatType
|
||||
|
||||
data class BaseInlineQuery(
|
||||
|
@ -1,7 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.query
|
||||
|
||||
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
|
||||
import dev.inmo.tgbotapi.types.User
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.chat.ChatType
|
||||
import dev.inmo.tgbotapi.types.location.Location
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.query
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.ChatType
|
||||
import dev.inmo.tgbotapi.types.chat.ChatTypeSerializer
|
||||
import dev.inmo.tgbotapi.types.chat.*
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.types.location.Location
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
@ -1,7 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.MessageEntity
|
||||
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.*
|
||||
import dev.inmo.tgbotapi.types.User
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
|
@ -1,6 +1,8 @@
|
||||
package dev.inmo.tgbotapi.types.MessageEntity.textsources
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.chat.User
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeString
|
||||
import dev.inmo.tgbotapi.utils.internal.*
|
||||
|
@ -1,121 +1,22 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
|
||||
import dev.inmo.micro_utils.language_codes.IetfLanguageCodeSerializer
|
||||
import dev.inmo.tgbotapi.types.abstracts.WithOptionalLanguageCode
|
||||
import dev.inmo.tgbotapi.types.chat.abstracts.PrivateChat
|
||||
import dev.inmo.tgbotapi.types.chat.extended.ExtendedPrivateChatImpl
|
||||
import dev.inmo.tgbotapi.utils.*
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import kotlinx.serialization.encoding.Decoder
|
||||
import kotlinx.serialization.encoding.Encoder
|
||||
import kotlinx.serialization.json.*
|
||||
@Deprecated("Replaced", ReplaceWith("User", "dev.inmo.tgbotapi.types.chat.User"))
|
||||
typealias User = dev.inmo.tgbotapi.types.chat.User
|
||||
|
||||
@Serializable(UserSerializer::class)
|
||||
sealed class User : PrivateChat
|
||||
@Deprecated("Replaced", ReplaceWith("CommonUser", "dev.inmo.tgbotapi.types.chat.CommonUser"))
|
||||
typealias CommonUser = dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
|
||||
@Serializable
|
||||
data class CommonUser(
|
||||
override val id: UserId,
|
||||
@SerialName(firstNameField)
|
||||
override val firstName: String,
|
||||
@SerialName(lastNameField)
|
||||
override val lastName: String = "",
|
||||
@SerialName(usernameField)
|
||||
override val username: Username? = null,
|
||||
@SerialName(languageCodeField)
|
||||
@Serializable(IetfLanguageCodeSerializer::class)
|
||||
override val ietfLanguageCode: IetfLanguageCode? = null
|
||||
) : User(), WithOptionalLanguageCode {
|
||||
constructor(
|
||||
id: UserId,
|
||||
firstName: String,
|
||||
lastName: String = "",
|
||||
username: Username? = null,
|
||||
languageCode: String
|
||||
) : this(id, firstName, lastName, username, IetfLanguageCode(languageCode))
|
||||
}
|
||||
@Deprecated("Replaced", ReplaceWith("ExtendedUser", "dev.inmo.tgbotapi.types.chat.ExtendedUser"))
|
||||
typealias ExtendedUser = dev.inmo.tgbotapi.types.chat.ExtendedUser
|
||||
|
||||
@PreviewFeature
|
||||
typealias ExtendedUser = ExtendedPrivateChatImpl
|
||||
@Deprecated("Replaced", ReplaceWith("Bot", "dev.inmo.tgbotapi.types.chat.Bot"))
|
||||
typealias Bot = dev.inmo.tgbotapi.types.chat.Bot
|
||||
|
||||
@Serializable(UserSerializer::class)
|
||||
sealed class Bot : User() {
|
||||
abstract override val username: Username
|
||||
}
|
||||
@Deprecated("Replaced", ReplaceWith("CommonBot", "dev.inmo.tgbotapi.types.chat.CommonBot"))
|
||||
typealias CommonBot = dev.inmo.tgbotapi.types.chat.CommonBot
|
||||
|
||||
@Serializable
|
||||
data class CommonBot(
|
||||
override val id: UserId,
|
||||
@SerialName(usernameField)
|
||||
override val username: Username,
|
||||
@SerialName(firstNameField)
|
||||
override val firstName: String,
|
||||
@SerialName(lastNameField)
|
||||
override val lastName: String = ""
|
||||
) : Bot() {
|
||||
@SerialName(isBotField)
|
||||
private val isBot = true
|
||||
}
|
||||
@Deprecated("Replaced", ReplaceWith("ExtendedBot", "dev.inmo.tgbotapi.types.chat.ExtendedBot"))
|
||||
typealias ExtendedBot = dev.inmo.tgbotapi.types.chat.ExtendedBot
|
||||
|
||||
@Serializable
|
||||
data class ExtendedBot(
|
||||
override val id: UserId,
|
||||
@SerialName(usernameField)
|
||||
override val username: Username,
|
||||
@SerialName(firstNameField)
|
||||
override val firstName: String,
|
||||
@SerialName(lastNameField)
|
||||
override val lastName: String = "",
|
||||
@SerialName(canJoinGroupsField)
|
||||
val canJoinGroups: Boolean = false,
|
||||
@SerialName(canReadAllGroupMessagesField)
|
||||
val canReadAllGroupMessages: Boolean = false,
|
||||
@SerialName(supportInlineQueriesField)
|
||||
val supportsInlineQueries: Boolean = false
|
||||
) : Bot() {
|
||||
@SerialName(isBotField)
|
||||
private val isBot = true
|
||||
}
|
||||
|
||||
|
||||
@RiskFeature
|
||||
object UserSerializer : KSerializer<User> {
|
||||
private val internalSerializer = JsonObject.serializer()
|
||||
override val descriptor: SerialDescriptor = internalSerializer.descriptor
|
||||
override fun deserialize(decoder: Decoder): User {
|
||||
val asJson = internalSerializer.deserialize(decoder)
|
||||
|
||||
return when {
|
||||
asJson[isBotField] ?.jsonPrimitive ?.booleanOrNull != true -> nonstrictJsonFormat.decodeFromJsonElement(
|
||||
CommonUser.serializer(),
|
||||
asJson
|
||||
)
|
||||
else -> {
|
||||
if ((asJson[canJoinGroupsField]
|
||||
?: asJson[canReadAllGroupMessagesField]
|
||||
?: asJson[supportInlineQueriesField]) != null
|
||||
) {
|
||||
nonstrictJsonFormat.decodeFromJsonElement(
|
||||
ExtendedBot.serializer(),
|
||||
asJson
|
||||
)
|
||||
} else {
|
||||
nonstrictJsonFormat.decodeFromJsonElement(
|
||||
CommonBot.serializer(),
|
||||
asJson
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun serialize(encoder: Encoder, value: User) {
|
||||
when (value) {
|
||||
is CommonUser -> CommonUser.serializer().serialize(encoder, value)
|
||||
is CommonBot -> CommonBot.serializer().serialize(encoder, value)
|
||||
is ExtendedBot -> ExtendedBot.serializer().serialize(encoder, value)
|
||||
}
|
||||
}
|
||||
}
|
||||
@Deprecated("Replaced", ReplaceWith("UserSerializer", "dev.inmo.tgbotapi.types.chat.UserSerializer"))
|
||||
typealias UserSerializer = dev.inmo.tgbotapi.types.chat.UserSerializer
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user