mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-12-22 08:37:18 +00:00
updates according to 3.0.0
This commit is contained in:
parent
21692d16ca
commit
e039f90961
@ -20,10 +20,10 @@ suspend fun main(vararg args: String) {
|
||||
val toAnswer = buildEntities {
|
||||
when (val forwardInfo = it.forwardInfo) {
|
||||
null -> +"There is no forward info"
|
||||
is AnonymousForwardInfo -> {
|
||||
is ForwardInfo.ByAnonymous -> {
|
||||
regular("Anonymous user which signed as \"") + code(forwardInfo.senderName) + "\""
|
||||
}
|
||||
is UserForwardInfo -> {
|
||||
is ForwardInfo.ByUser -> {
|
||||
val user = forwardInfo.from
|
||||
when (user) {
|
||||
is CommonUser -> {
|
||||
@ -37,9 +37,9 @@ suspend fun main(vararg args: String) {
|
||||
is ExtendedBot -> regular("Bot ")
|
||||
} + code(user.id.chatId.toString()) + " (${user.firstName} ${user.lastName}: ${user.username ?.username ?: "Without username"})"
|
||||
}
|
||||
is ForwardFromPublicChatInfo.FromChannel -> regular("Channel (") + code(forwardInfo.channelChat.title) + ")"
|
||||
is ForwardFromPublicChatInfo.FromSupergroup -> regular("Supergroup (") + code(forwardInfo.group.title) + ")"
|
||||
is ForwardFromPublicChatInfo.SentByChannel -> regular("Sent by channel (") + code(forwardInfo.channelChat.title) + ")"
|
||||
is ForwardInfo.PublicChat.FromChannel -> regular("Channel (") + code(forwardInfo.channelChat.title) + ")"
|
||||
is ForwardInfo.PublicChat.FromSupergroup -> regular("Supergroup (") + code(forwardInfo.group.title) + ")"
|
||||
is ForwardInfo.PublicChat.SentByChannel -> regular("Sent by channel (") + code(forwardInfo.channelChat.title) + ")"
|
||||
}
|
||||
}
|
||||
reply(it, toAnswer)
|
||||
|
@ -100,6 +100,7 @@ suspend fun activateKeyboardsBot(
|
||||
}
|
||||
}
|
||||
)
|
||||
answer(it)
|
||||
}
|
||||
|
||||
onUnhandledCommand {
|
||||
|
Loading…
Reference in New Issue
Block a user