mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-04 15:49:41 +00:00
Foursquare and fixes of deprecations in methods
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.extensions.venue
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.venue.Venue
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
val Venue.foursquare: Foursquare?
|
||||
get() = foursquareId ?.let {
|
||||
Foursquare(it, foursquareType)
|
||||
}
|
||||
|
||||
fun Venue(
|
||||
location: Location,
|
||||
title: String,
|
||||
address: String,
|
||||
foursquare: Foursquare
|
||||
) = Venue(location, title, address, foursquare.id, foursquare.type)
|
||||
|
||||
@Serializable
|
||||
data class Foursquare(
|
||||
@SerialName(foursquareIdField)
|
||||
val id: FoursquareId,
|
||||
@SerialName(foursquareTypeField)
|
||||
val type: FoursquareType? = null
|
||||
)
|
Reference in New Issue
Block a user