1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-03 00:15:27 +00:00

replace all usernames which was as strings by Username class usage

This commit is contained in:
InsanusMokrassar 2019-02-18 12:56:50 +08:00
parent 0009d211bc
commit f6581ff3be
6 changed files with 10 additions and 13 deletions

View File

@ -25,6 +25,7 @@ work with media groups lists
* Fixes in `Username` * Fixes in `Username`
* Now you can create username object using string which is not starting with `@` * Now you can create username object using string which is not starting with `@`
* Now `Username` correctly comparing with strings, which are not starting with `@` * Now `Username` correctly comparing with strings, which are not starting with `@`
* Now most part of usernames in library have type `Username`
## 0.9.0 ## 0.9.0

View File

@ -17,7 +17,7 @@ data class User(
val lastName: String? = null, val lastName: String? = null,
@SerialName(usernameField) @SerialName(usernameField)
@Optional @Optional
val username: String? = null, val username: Username? = null,
@SerialName(languageCodeField) @SerialName(languageCodeField)
@Optional @Optional
private val languageCode: String? = null private val languageCode: String? = null

View File

@ -1,13 +1,12 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.chat package com.github.insanusmokrassar.TelegramBotAPI.types.chat
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
data class ChannelChat( data class ChannelChat(
override val id: ChatId, override val id: ChatId,
override val title: String? = null, override val title: String? = null,
val username: String? = null, val username: Username? = null,
val description: String? = null, val description: String? = null,
override val inviteLink: String? = null, override val inviteLink: String? = null,
override val chatPhoto: ChatPhoto? = null, override val chatPhoto: ChatPhoto? = null,

View File

@ -1,11 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.chat package com.github.insanusmokrassar.TelegramBotAPI.types.chat
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
data class PrivateChat( data class PrivateChat(
override val id: ChatId, override val id: ChatId,
val username: String? = null, val username: Username? = null,
val firstName: String? = null, val firstName: String? = null,
val lastName: String? = null, val lastName: String? = null,
override val chatPhoto: ChatPhoto? = null override val chatPhoto: ChatPhoto? = null

View File

@ -1,7 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.chat package com.github.insanusmokrassar.TelegramBotAPI.types.chat
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import kotlinx.serialization.* import kotlinx.serialization.*
@ -10,7 +9,7 @@ data class RawChat(
override val id: ChatId, override val id: ChatId,
private val type: String, private val type: String,
@Optional private val title: String? = null, @Optional private val title: String? = null,
@Optional private val username: String? = null, @Optional private val username: Username? = null,
@Optional private val first_name: String? = null, @Optional private val first_name: String? = null,
@Optional private val last_name: String? = null, @Optional private val last_name: String? = null,
@Optional private val all_members_are_administrators: Boolean? = null, @Optional private val all_members_are_administrators: Boolean? = null,

View File

@ -1,13 +1,12 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.chat package com.github.insanusmokrassar.TelegramBotAPI.types.chat
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
data class SupergroupChat( data class SupergroupChat(
override val id: ChatId, override val id: ChatId,
override val title: String? = null, override val title: String? = null,
val username: String? = null, val username: Username? = null,
val description: String? = null, val description: String? = null,
override val allMembersAreAdmins: Boolean, override val allMembersAreAdmins: Boolean,
override val inviteLink: String? = null, override val inviteLink: String? = null,