mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 00:03:48 +00:00
commit
347a6212d4
15
CHANGELOG.md
15
CHANGELOG.md
@ -42,6 +42,21 @@
|
|||||||
* `HttpClient#loadFile`
|
* `HttpClient#loadFile`
|
||||||
* `PathedFile#download`
|
* `PathedFile#download`
|
||||||
|
|
||||||
|
### 0.28.4
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* Version updates:
|
||||||
|
* `Ktor`: `1.4.0` -> `1.4.1`
|
||||||
|
* `TelegramBotAPI-core`
|
||||||
|
* Interface `GroupEventMessage` has been added ([#140](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/140))
|
||||||
|
* Old `GroupEventMessage` was renamed to `CommonGroupEventMessage` ([#140](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/140))
|
||||||
|
* Interface `SupergroupEventMessage` has been added ([#140](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/140))
|
||||||
|
* Old `SupergroupEventMessage` was renamed to `CommonSupergroupEventMessage` ([#140](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/140))
|
||||||
|
* Any `GroupEventMessage` now have `from` field ([#140](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/140))
|
||||||
|
* `TelegramBotAPI-extensions-utils`
|
||||||
|
* Extensions `Flow<ChatEventMessage>#onlyGroupEvents` and `Flow<ChatEventMessage>#onlySupergroupEvents` now returns
|
||||||
|
`CommonGroupEventMessage` and `CommonSupergroupEventMessage`
|
||||||
|
|
||||||
### 0.28.3
|
### 0.28.3
|
||||||
|
|
||||||
* Common:
|
* Common:
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.User
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.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.ChatEvents.abstracts.GroupEvent
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ChatEventMessage
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.GroupEventMessage
|
||||||
import com.soywiz.klock.DateTime
|
import com.soywiz.klock.DateTime
|
||||||
|
|
||||||
data class GroupEventMessage(
|
@Deprecated("Renamed", ReplaceWith("CommonGroupEventMessage"))
|
||||||
|
typealias GroupEventMessage = CommonGroupEventMessage
|
||||||
|
|
||||||
|
data class CommonGroupEventMessage(
|
||||||
override val messageId: MessageIdentifier,
|
override val messageId: MessageIdentifier,
|
||||||
|
override val user: User,
|
||||||
override val chat: GroupChat,
|
override val chat: GroupChat,
|
||||||
override val chatEvent: GroupEvent,
|
override val chatEvent: GroupEvent,
|
||||||
override val date: DateTime
|
override val date: DateTime
|
||||||
) : ChatEventMessage
|
) : GroupEventMessage
|
@ -1,14 +1,19 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
package com.github.insanusmokrassar.TelegramBotAPI.types.message
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.User
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.SupergroupChat
|
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.SupergroupChat
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.ChatEvents.abstracts.SupergroupEvent
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.ChatEvents.abstracts.SupergroupEvent
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ChatEventMessage
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.SupergroupEventMessage
|
||||||
import com.soywiz.klock.DateTime
|
import com.soywiz.klock.DateTime
|
||||||
|
|
||||||
data class SupergroupEventMessage(
|
@Deprecated("Renamed", ReplaceWith("CommonSupergroupEventMessage"))
|
||||||
|
typealias SupergroupEventMessage = CommonSupergroupEventMessage
|
||||||
|
|
||||||
|
data class CommonSupergroupEventMessage(
|
||||||
override val messageId: MessageIdentifier,
|
override val messageId: MessageIdentifier,
|
||||||
|
override val user: User,
|
||||||
override val chat: SupergroupChat,
|
override val chat: SupergroupChat,
|
||||||
override val chatEvent: SupergroupEvent,
|
override val chatEvent: SupergroupEvent,
|
||||||
override val date: DateTime
|
override val date: DateTime
|
||||||
) : ChatEventMessage
|
) : SupergroupEventMessage
|
@ -192,14 +192,16 @@ internal data class RawMessage(
|
|||||||
try {
|
try {
|
||||||
chatEvent?.let { chatEvent ->
|
chatEvent?.let { chatEvent ->
|
||||||
when (chat) {
|
when (chat) {
|
||||||
is SupergroupChat -> SupergroupEventMessage(
|
is SupergroupChat -> CommonSupergroupEventMessage(
|
||||||
messageId,
|
messageId,
|
||||||
|
from ?: error("Supergroup events are expected to contain 'from' field"),
|
||||||
chat,
|
chat,
|
||||||
chatEvent as? SupergroupEvent ?: throwWrongChatEvent(SupergroupEvent::class, chatEvent),
|
chatEvent as? SupergroupEvent ?: throwWrongChatEvent(SupergroupEvent::class, chatEvent),
|
||||||
date.asDate
|
date.asDate
|
||||||
)
|
)
|
||||||
is GroupChat -> GroupEventMessage(
|
is GroupChat -> CommonGroupEventMessage(
|
||||||
messageId,
|
messageId,
|
||||||
|
from ?: error("Supergroup events are expected to contain 'from' field"),
|
||||||
chat,
|
chat,
|
||||||
chatEvent as? GroupEvent ?: throwWrongChatEvent(GroupChat::class, chatEvent),
|
chatEvent as? GroupEvent ?: throwWrongChatEvent(GroupChat::class, chatEvent),
|
||||||
date.asDate
|
date.asDate
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts
|
||||||
|
|
||||||
|
interface GroupEventMessage : ChatEventMessage, FromUserMessage
|
@ -0,0 +1,3 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts
|
||||||
|
|
||||||
|
interface SupergroupEventMessage : GroupEventMessage
|
@ -17,5 +17,5 @@ fun <T : ChatEventMessage> Flow<ChatEventMessage>.divideBySource(contentType: KC
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Flow<ChatEventMessage>.onlyChannelEvents() = divideBySource(ChannelEventMessage::class)
|
fun Flow<ChatEventMessage>.onlyChannelEvents() = divideBySource(ChannelEventMessage::class)
|
||||||
fun Flow<ChatEventMessage>.onlyGroupEvents() = divideBySource(GroupEventMessage::class)
|
fun Flow<ChatEventMessage>.onlyGroupEvents() = divideBySource(CommonGroupEventMessage::class)
|
||||||
fun Flow<ChatEventMessage>.onlySupergroupEvents() = divideBySource(SupergroupEventMessage::class)
|
fun Flow<ChatEventMessage>.onlySupergroupEvents() = divideBySource(CommonSupergroupEventMessage::class)
|
||||||
|
@ -10,12 +10,12 @@ kotlin_coroutines_version=1.3.9
|
|||||||
kotlin_serialisation_runtime_version=1.0.0-RC2
|
kotlin_serialisation_runtime_version=1.0.0-RC2
|
||||||
klock_version=1.12.1
|
klock_version=1.12.1
|
||||||
uuid_version=0.2.2
|
uuid_version=0.2.2
|
||||||
ktor_version=1.4.0
|
ktor_version=1.4.1
|
||||||
|
|
||||||
javax_activation_version=1.1.1
|
javax_activation_version=1.1.1
|
||||||
|
|
||||||
library_group=com.github.insanusmokrassar
|
library_group=com.github.insanusmokrassar
|
||||||
library_version=0.28.3
|
library_version=0.28.4
|
||||||
|
|
||||||
gradle_bintray_plugin_version=1.8.5
|
gradle_bintray_plugin_version=1.8.5
|
||||||
github_release_plugin_version=2.2.12
|
github_release_plugin_version=2.2.12
|
||||||
|
Loading…
Reference in New Issue
Block a user