mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
all PublicChat implementations may have pinned message, chats abstractions refactoring
This commit is contained in:
parent
3bb1cb1552
commit
8b67f16da3
@ -12,6 +12,9 @@
|
||||
* Most part of requests which are working with identifiers of messages now implement `MessageAction` directly or
|
||||
by their parents
|
||||
* `StopPoll` implemented
|
||||
* All current `Chat` abstractions are deprecated and rewritten as typealiases. Use `Chat` abstractions from
|
||||
`com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts` package
|
||||
* Common Groups now may have pinned message
|
||||
|
||||
## 0.12.0 Webhooks
|
||||
|
||||
|
@ -1,14 +1,16 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
|
||||
data class ChannelChat(
|
||||
override val id: ChatId,
|
||||
override val title: String? = null,
|
||||
val username: Username? = null,
|
||||
val description: String? = null,
|
||||
override val username: Username? = null,
|
||||
override val description: String? = null,
|
||||
override val inviteLink: String? = null,
|
||||
override val chatPhoto: ChatPhoto? = null,
|
||||
val pinnedMessage: RawMessage?
|
||||
) : PublicChat
|
||||
override val pinnedMessage: RawMessage?
|
||||
) : PublicChat, UsernameChat, DescriptionChat
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
|
||||
interface Chat {
|
||||
val id: ChatId
|
||||
val chatPhoto: ChatPhoto?
|
||||
}
|
||||
@Deprecated(
|
||||
"Replaced into another package",
|
||||
ReplaceWith("Chat", "com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat")
|
||||
)
|
||||
typealias Chat = Chat
|
@ -1,15 +1,9 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.GroupChat
|
||||
|
||||
interface GroupChat : PublicChat {
|
||||
val allMembersAreAdmins: Boolean
|
||||
}
|
||||
|
||||
data class GroupChatImpl(
|
||||
override val id: ChatId,
|
||||
override val title: String? = null,
|
||||
override val allMembersAreAdmins: Boolean,
|
||||
override val inviteLink: String? = null,
|
||||
override val chatPhoto: ChatPhoto? = null) : GroupChat
|
||||
@Deprecated(
|
||||
"Replaced into another package",
|
||||
ReplaceWith("GroupChat", "com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.GroupChat")
|
||||
)
|
||||
typealias GroupChat = GroupChat
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.GroupChat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
|
||||
data class GroupChatImpl(
|
||||
override val id: ChatId,
|
||||
override val title: String? = null,
|
||||
override val allMembersAreAdmins: Boolean,
|
||||
override val inviteLink: String? = null,
|
||||
override val chatPhoto: ChatPhoto? = null,
|
||||
override val pinnedMessage: RawMessage? = null
|
||||
) : GroupChat
|
@ -1,11 +1,13 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.UsernameChat
|
||||
|
||||
data class PrivateChat(
|
||||
override val id: ChatId,
|
||||
val username: Username? = null,
|
||||
override val username: Username? = null,
|
||||
val firstName: String? = null,
|
||||
val lastName: String? = null,
|
||||
override val chatPhoto: ChatPhoto? = null
|
||||
) : Chat
|
||||
) : Chat, UsernameChat
|
||||
|
@ -1,6 +1,9 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
|
||||
|
||||
interface PublicChat : Chat {
|
||||
val title: String?
|
||||
val inviteLink: String?
|
||||
}
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat
|
||||
|
||||
@Deprecated(
|
||||
"Replaced into another package",
|
||||
ReplaceWith("PublicChat", "com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat")
|
||||
)
|
||||
typealias PublicChat = PublicChat
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
@ -1,17 +1,19 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.GroupChat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
|
||||
data class SupergroupChat(
|
||||
override val id: ChatId,
|
||||
override val title: String? = null,
|
||||
val username: Username? = null,
|
||||
val description: String? = null,
|
||||
override val username: Username? = null,
|
||||
override val description: String? = null,
|
||||
override val allMembersAreAdmins: Boolean,
|
||||
override val inviteLink: String? = null,
|
||||
override val chatPhoto: ChatPhoto? = null,
|
||||
val pinnedMessage: RawMessage? = null,
|
||||
override val pinnedMessage: RawMessage? = null,
|
||||
val stickerSetName: String? = null,
|
||||
val canSetStickerSet: Boolean
|
||||
) : GroupChat
|
||||
) : GroupChat, UsernameChat, DescriptionChat
|
||||
|
@ -0,0 +1,9 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
|
||||
|
||||
interface Chat {
|
||||
val id: ChatId
|
||||
val chatPhoto: ChatPhoto?
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts
|
||||
|
||||
interface DescriptionChat : PublicChat {
|
||||
val description: String?
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts
|
||||
|
||||
interface GroupChat : PublicChat {
|
||||
val allMembersAreAdmins: Boolean
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
|
||||
interface PublicChat : Chat {
|
||||
val title: String?
|
||||
val inviteLink: String?
|
||||
val pinnedMessage: RawMessage?
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.Username
|
||||
|
||||
interface UsernameChat : Chat {
|
||||
val username: Username?
|
||||
}
|
@ -2,7 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MediaGroupIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.MediaGroupMessage
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaGroupContent
|
||||
|
@ -2,7 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.AuthorSignature
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.CommonMessage
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaGroupContent
|
||||
import org.joda.time.DateTime
|
||||
|
@ -2,7 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.User
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.payments.abstracts.PaymentInfo
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
|
||||
sealed class ForwardedMessage {
|
||||
abstract val messageId: MessageIdentifier
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.GroupChat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.GroupChat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.ChatEvents.abstracts.GroupEvent
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ChatEventMessage
|
||||
import org.joda.time.DateTime
|
||||
|
@ -4,6 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessageEntities
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessageEntitiesSerializer
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.GroupChat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.games.Game
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.ChatEvents.*
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
import org.joda.time.DateTime
|
||||
|
||||
interface Message {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.utils
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MediaGroupIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.ForwardedMessage
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseMessageUpdate
|
||||
|
Loading…
Reference in New Issue
Block a user