Skip to content

Commit

Permalink
Fix getting some elements from the database
Browse files Browse the repository at this point in the history
  • Loading branch information
NoComment1105 committed Sep 12, 2023
1 parent 8557d4f commit 94634e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.hyacinthbots.lilybot.database.collections

import com.kotlindiscord.kord.extensions.koin.KordExKoinComponent
import kotlinx.coroutines.flow.firstOrNull
import org.hyacinthbots.lilybot.database.Database
import org.hyacinthbots.lilybot.database.deleteOne
import org.hyacinthbots.lilybot.database.entities.StatusData
import org.hyacinthbots.lilybot.database.findOne
import org.koin.core.component.inject

/**
Expand All @@ -29,7 +29,7 @@ class StatusCollection : KordExKoinComponent {
* @since 3.0.0
*/
suspend inline fun getStatus(): String? =
collection.findOne()?.status
collection.find().firstOrNull()?.status

/**
* Add the given [newStatus] to the database.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.hyacinthbots.lilybot.database.collections

import com.kotlindiscord.kord.extensions.koin.KordExKoinComponent
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.datetime.Instant
import org.hyacinthbots.lilybot.database.Database
import org.hyacinthbots.lilybot.database.entities.UptimeData
import org.hyacinthbots.lilybot.database.findOne
import org.koin.core.component.inject

/**
Expand All @@ -29,7 +29,7 @@ class UptimeCollection : KordExKoinComponent {
* @since 4.2.0
*/
suspend fun get(): UptimeData? =
collection.findOne()
collection.find().firstOrNull()

/**
* Sets the on time.
Expand Down

0 comments on commit 94634e8

Please sign in to comment.