small fixes

This commit is contained in:
InsanusMokrassar 2022-09-19 01:56:41 +06:00
parent 539515da43
commit 7845b7cc5f

View File

@ -40,9 +40,9 @@ fun TelegramBot.createAdminsCacheAPI(
"AdminsTable" "AdminsTable"
).withMapper<ChatId, AdministratorChatMember, Identifier, String>( ).withMapper<ChatId, AdministratorChatMember, Identifier, String>(
keyFromToTo = { chatId }, keyFromToTo = { chatId },
valueFromToTo = { telegramAdminsSerializationFormat.encodeToString(this) }, valueFromToTo = { telegramAdminsSerializationFormat.encodeToString(AdministratorChatMember.serializer(), this) },
keyToToFrom = { toChatId() }, keyToToFrom = { toChatId() },
valueToToFrom = { telegramAdminsSerializationFormat.decodeFromString(this) } valueToToFrom = { telegramAdminsSerializationFormat.decodeFromString(AdministratorChatMember.serializer(), this) }
), ),
ExposedKeyValueRepo( ExposedKeyValueRepo(
database, database,
@ -65,9 +65,9 @@ fun TelegramBot.createAdminsCacheAPI(
"DynamicAdminsCacheSettingsAPI" "DynamicAdminsCacheSettingsAPI"
).withMapper<ChatId, AdminsCacheSettings, Identifier, String>( ).withMapper<ChatId, AdminsCacheSettings, Identifier, String>(
keyFromToTo = { chatId }, keyFromToTo = { chatId },
valueFromToTo = { telegramAdminsSerializationFormat.encodeToString(this) }, valueFromToTo = { telegramAdminsSerializationFormat.encodeToString(AdminsCacheSettings.serializer() , this) },
keyToToFrom = { toChatId() }, keyToToFrom = { toChatId() },
valueToToFrom = { telegramAdminsSerializationFormat.decodeFromString(this) } valueToToFrom = { telegramAdminsSerializationFormat.decodeFromString(AdminsCacheSettings.serializer() , this) }
), ),
scope scope
) )