2021-02-22 12:11:12 +00:00
|
|
|
package dev.inmo.tgbotapi.libraries.cache.admins
|
|
|
|
|
|
|
|
import dev.inmo.tgbotapi.types.*
|
|
|
|
import dev.inmo.tgbotapi.types.ChatMember.abstracts.AdministratorChatMember
|
|
|
|
|
|
|
|
interface AdminsCacheAPI {
|
|
|
|
suspend fun getChatAdmins(chatId: ChatId): List<AdministratorChatMember>?
|
2021-02-23 07:21:04 +00:00
|
|
|
suspend fun isAdmin(chatId: ChatId, userId: UserId): Boolean = getChatAdmins(chatId) ?.any {
|
|
|
|
it.user.id == userId
|
|
|
|
} == true
|
2021-02-22 12:11:12 +00:00
|
|
|
|
|
|
|
suspend fun settings(): AdminsCacheSettingsAPI
|
|
|
|
}
|