@@ -2,10 +2,17 @@ import com.github.kotlintelegrambot.Bot
2
2
import com.github.kotlintelegrambot.entities.InlineQuery
3
3
import com.github.kotlintelegrambot.entities.inlinequeryresults.InlineQueryResult
4
4
import com.github.kotlintelegrambot.entities.inlinequeryresults.InputMessageContent
5
+ import com.github.kotlintelegrambot.entities.Message
6
+ import com.github.kotlintelegrambot.entities.Update
7
+ import com.github.kotlintelegrambot.entities.ChatId
8
+ import com.github.kotlintelegrambot.entities.User
5
9
import services.soundcloud.AllPodcasts
6
- import services.telegram.Message
7
10
import services.telegram.Service
11
+ import services.telegram.Message as ServiceMessage
8
12
13
+ /* *
14
+ * The inline query mode, which provide podcast sharing to the chats
15
+ */
9
16
fun handleInlineQuery (bot : Bot , iq : InlineQuery , podcastsTitles : AllPodcasts ? ) {
10
17
val queryText = iq.query.toLowerCase()
11
18
if (queryText.isBlank() || queryText.isEmpty() || podcastsTitles == null ) return
@@ -17,7 +24,7 @@ fun handleInlineQuery(bot: Bot, iq: InlineQuery, podcastsTitles: AllPodcasts?) {
17
24
id = podcast.title,
18
25
title = podcast.title,
19
26
inputMessageContent = InputMessageContent .Text (
20
- Message .podcastMessage(podcast, true ),
27
+ ServiceMessage .podcastMessage(podcast, true ),
21
28
parseMode = Service .PARSE_MODE
22
29
),
23
30
description = " Найдено"
@@ -26,3 +33,10 @@ fun handleInlineQuery(bot: Bot, iq: InlineQuery, podcastsTitles: AllPodcasts?) {
26
33
27
34
bot.answerInlineQuery(iq.id, list)
28
35
}
36
+
37
+ /*
38
+ * Spam bots checker and banner
39
+ */
40
+ fun handleNewChatMembers (bot : Bot , update : Update , message : Message , newChatMembers : List <User >) {
41
+ bot.sendMessage(chatId = ChatId .fromId(message.chat.id), text = " Привет додя!" )
42
+ }
0 commit comments