mirror of
https://github.com/InsanusMokrassar/ConfigurableInlineTelegramBot.git
synced 2026-05-20 12:57:16 +00:00
init
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package dev.inmo.configurable_inline_telegram_bot.config
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.abstracts.InlineQuery
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Restrictions(
|
||||
val allowedUsers: List<ChatIdentifier> = emptyList()
|
||||
) {
|
||||
fun check(query: InlineQuery): Boolean {
|
||||
return query.from.id in allowedUsers || query.from.username ?.let { it in allowedUsers } ?: false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user