TelegramBotAPI Venue and foursquare additions

This commit is contained in:
InsanusMokrassar 2020-07-01 23:57:20 +06:00
parent cfb7f35d20
commit 975898660c
4 changed files with 28 additions and 16 deletions

View File

@ -54,6 +54,9 @@
* `TelegramBotAPI`:
* `UnknownUpdateType` was renamed to `UnknownUpdate`
* Refactoring and optimization of `FlowsUpdatesFilter`
* `Venue` type was replaced to a new package: `com.github.insanusmokrassar.TelegramBotAPI.types.venue.Venue`
* `Venue` type now implements `Locationed` and delegate realisation to its `location` field
* `FoursquareId` and `FoursquareType` typealiases were added
* `TelegramBotAPI-extensions-utils`:
* Several new functions `makeLinkToMessage` was added

View File

@ -22,6 +22,8 @@ typealias PollIdentifier = String
typealias StickerSetName = String
typealias FileUniqueId = String
typealias DiceResult = Int
typealias FoursquareId = String
typealias FoursquareType = String
typealias Seconds = Int
typealias LongSeconds = Long

View File

@ -1,19 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonVenueData
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import com.github.insanusmokrassar.TelegramBotAPI.types.venue.Venue
@Serializable
data class Venue(
@SerialName(locationField)
val location: Location,
@SerialName(titleField)
override val title: String,
@SerialName(addressField)
override val address: String,
@SerialName(foursquareIdField)
override val foursquareId: String? = null,
@SerialName(foursquareTypeField)
override val foursquareType: String? = null
) : CommonVenueData
@Deprecated("Replaced", ReplaceWith("Venue", "com.github.insanusmokrassar.TelegramBotAPI.types.venue.Venue"))
typealias Venue = Venue

View File

@ -0,0 +1,20 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.venue
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonVenueData
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Locationed
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*
@Serializable
data class Venue(
@SerialName(locationField)
val location: Location,
@SerialName(titleField)
override val title: String,
@SerialName(addressField)
override val address: String,
@SerialName(foursquareIdField)
override val foursquareId: FoursquareId? = null,
@SerialName(foursquareTypeField)
override val foursquareType: FoursquareType? = null
) : CommonVenueData, Locationed by location