1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-12-02 20:35:43 +00:00

Compare commits

..

10 Commits

Author SHA1 Message Date
e10e257c80 update ktor 2020-09-28 13:18:03 +06:00
5e7bc96b44 add deprecations 2020-09-28 13:11:41 +06:00
79d0eda61d add changelog 2020-09-28 13:09:58 +06:00
9916b3f469 Merge pull request #140 from madhead/issues/139
Fix #139: Add "from" field to chat events
2020-09-28 12:55:13 +06:00
2bac5f0eed start 0.28.4 2020-09-28 12:54:01 +06:00
madhead
01eb072caa Fix #139: Add "from" field to chat events 2020-09-27 13:26:10 +03:00
496af479b0 Revert "add karma for tests"
This reverts commit 386e91e28b.
2020-09-22 22:42:01 +06:00
386e91e28b add karma for tests 2020-09-22 22:33:45 +06:00
91dbcecefc add autoPublishing 2020-09-22 18:53:48 +06:00
2d743e4c19 Merge pull request #136 from InsanusMokrassar/0.28.3
0.28.3
2020-09-22 18:32:06 +06:00
18 changed files with 61 additions and 16 deletions

View File

@@ -42,6 +42,21 @@
* `HttpClient#loadFile`
* `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
* Common:

View File

@@ -1 +1 @@
{"bintrayConfig":{"repo":"StandardRepository","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Core","description":"Library for Object-Oriented and type-safe work with Telegram Bot API","url":"https://insanusmokrassar.github.io/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"}
{"bintrayConfig":{"repo":"StandardRepository","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Core","description":"Library for Object-Oriented and type-safe work with Telegram Bot API","url":"https://insanusmokrassar.github.io/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"}

View File

@@ -25,6 +25,9 @@ bintray {
}
into "${project.group}".replace(".", "/")
}
publish = true
pkg {
repo = "StandardRepository"
name = "${project.name}"

View File

@@ -1,14 +1,19 @@
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.abstracts.GroupChat
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
data class GroupEventMessage(
@Deprecated("Renamed", ReplaceWith("CommonGroupEventMessage"))
typealias GroupEventMessage = CommonGroupEventMessage
data class CommonGroupEventMessage(
override val messageId: MessageIdentifier,
override val user: User,
override val chat: GroupChat,
override val chatEvent: GroupEvent,
override val date: DateTime
) : ChatEventMessage
) : GroupEventMessage

View File

@@ -1,14 +1,19 @@
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.abstracts.SupergroupChat
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
data class SupergroupEventMessage(
@Deprecated("Renamed", ReplaceWith("CommonSupergroupEventMessage"))
typealias SupergroupEventMessage = CommonSupergroupEventMessage
data class CommonSupergroupEventMessage(
override val messageId: MessageIdentifier,
override val user: User,
override val chat: SupergroupChat,
override val chatEvent: SupergroupEvent,
override val date: DateTime
) : ChatEventMessage
) : SupergroupEventMessage

View File

@@ -192,14 +192,16 @@ internal data class RawMessage(
try {
chatEvent?.let { chatEvent ->
when (chat) {
is SupergroupChat -> SupergroupEventMessage(
is SupergroupChat -> CommonSupergroupEventMessage(
messageId,
from ?: error("Supergroup events are expected to contain 'from' field"),
chat,
chatEvent as? SupergroupEvent ?: throwWrongChatEvent(SupergroupEvent::class, chatEvent),
date.asDate
)
is GroupChat -> GroupEventMessage(
is GroupChat -> CommonGroupEventMessage(
messageId,
from ?: error("Supergroup events are expected to contain 'from' field"),
chat,
chatEvent as? GroupEvent ?: throwWrongChatEvent(GroupChat::class, chatEvent),
date.asDate

View File

@@ -0,0 +1,3 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts
interface GroupEventMessage : ChatEventMessage, FromUserMessage

View File

@@ -0,0 +1,3 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts
interface SupergroupEventMessage : GroupEventMessage

View File

@@ -1 +0,0 @@
{"bintrayConfig":{"repo":"StandardRepository","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Extensions for API","description":"API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"}

View File

@@ -0,0 +1 @@
{"bintrayConfig":{"repo":"StandardRepository","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Extensions for API","description":"API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"}

View File

@@ -25,6 +25,9 @@ bintray {
}
into "${project.group}".replace(".", "/")
}
publish = true
pkg {
repo = "StandardRepository"
name = "${project.name}"

View File

@@ -1 +0,0 @@
{"bintrayConfig":{"repo":"StandardRepository","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Utility Extensions","description":"Util extensions for more useful work with updates and other things","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-utils","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"}

View File

@@ -0,0 +1 @@
{"bintrayConfig":{"repo":"StandardRepository","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Utility Extensions","description":"Util extensions for more useful work with updates and other things","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-utils","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"}

View File

@@ -25,6 +25,9 @@ bintray {
}
into "${project.group}".replace(".", "/")
}
publish = true
pkg {
repo = "StandardRepository"
name = "${project.name}"

View File

@@ -17,5 +17,5 @@ fun <T : ChatEventMessage> Flow<ChatEventMessage>.divideBySource(contentType: KC
}
fun Flow<ChatEventMessage>.onlyChannelEvents() = divideBySource(ChannelEventMessage::class)
fun Flow<ChatEventMessage>.onlyGroupEvents() = divideBySource(GroupEventMessage::class)
fun Flow<ChatEventMessage>.onlySupergroupEvents() = divideBySource(SupergroupEventMessage::class)
fun Flow<ChatEventMessage>.onlyGroupEvents() = divideBySource(CommonGroupEventMessage::class)
fun Flow<ChatEventMessage>.onlySupergroupEvents() = divideBySource(CommonSupergroupEventMessage::class)

View File

@@ -1 +1 @@
{"bintrayConfig":{"repo":"StandardRepository","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI"},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API","description":"This project just include all subproject of TelegramBotAPI","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"}
{"bintrayConfig":{"repo":"StandardRepository","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API","description":"This project just include all subproject of TelegramBotAPI","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]},"type":"Multiplatform"}

View File

@@ -25,6 +25,9 @@ bintray {
}
into "${project.group}".replace(".", "/")
}
publish = true
pkg {
repo = "StandardRepository"
name = "${project.name}"

View File

@@ -10,12 +10,12 @@ kotlin_coroutines_version=1.3.9
kotlin_serialisation_runtime_version=1.0.0-RC2
klock_version=1.12.1
uuid_version=0.2.2
ktor_version=1.4.0
ktor_version=1.4.1
javax_activation_version=1.1.1
library_group=com.github.insanusmokrassar
library_version=0.28.3
library_version=0.28.4
gradle_bintray_plugin_version=1.8.5
github_release_plugin_version=2.2.12