even more grrrr
This commit is contained in:
parent
bb5b124b33
commit
5550016d79
3 changed files with 6 additions and 3 deletions
|
@ -1,11 +1,14 @@
|
|||
package dev.jansel.aglaea.database.entities
|
||||
|
||||
import dev.kord.common.entity.Snowflake
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class ReplayData(
|
||||
val id: String,
|
||||
val replayFile: ByteArray,
|
||||
val submitTime: Long,
|
||||
val userId: Snowflake,
|
||||
) {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
|
|
|
@ -57,13 +57,13 @@ class ReplayExtension : Extension() {
|
|||
if (file.filename.endsWith(".osr")) {
|
||||
val id = Uuid.random().toString()
|
||||
|
||||
ReplayCollection().set(ReplayData(id, file.download()))
|
||||
ReplayCollection().set(ReplayData(id, file.download(), System.currentTimeMillis(), event.interaction.user.id))
|
||||
respond {
|
||||
content = "Your Auth Code is: $id"
|
||||
}
|
||||
} else {
|
||||
respond {
|
||||
content = ""
|
||||
content = "Invalid Replay file."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ class Twitch : KordExKoinComponent {
|
|||
.getChannelOf<GuildMessageChannel>(Snowflake(1130954956892029060))
|
||||
val replay = ReplayCollection().get(event.message) ?: return@launch
|
||||
channel.createMessage {
|
||||
content = "Replay redeemed by: ${event.user.name}"
|
||||
content = "Replay redeemed by: ${event.user.name}, submitted to the Database at <t:${replay.submitTime / 1000}> by <@${replay.userId}>"
|
||||
this.addFile("replay.osr", ChannelProvider(null) { ByteReadChannel(replay.replayFile) })
|
||||
}
|
||||
// remove the replay from the database
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue