mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-08-08 05:11:12 +00:00
add chzzk chat handler, command handler
This commit is contained in:
21
src/main/kotlin/space/mori/chzzk_bot/models/Command.kt
Normal file
21
src/main/kotlin/space/mori/chzzk_bot/models/Command.kt
Normal file
@@ -0,0 +1,21 @@
|
||||
package space.mori.chzzk_bot.models
|
||||
|
||||
import org.jetbrains.exposed.dao.IntEntity
|
||||
import org.jetbrains.exposed.dao.IntEntityClass
|
||||
import org.jetbrains.exposed.dao.id.EntityID
|
||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
||||
import org.jetbrains.exposed.sql.ReferenceOption
|
||||
|
||||
object Commands: IntIdTable("commands") {
|
||||
val user = reference("user", Users, onDelete = ReferenceOption.CASCADE)
|
||||
val command = varchar("command", 255)
|
||||
val content = text("content")
|
||||
}
|
||||
|
||||
class Command(id: EntityID<Int>) : IntEntity(id) {
|
||||
companion object : IntEntityClass<Command>(Commands)
|
||||
|
||||
var user by User referencedOn Commands.user
|
||||
var command by Commands.command
|
||||
var content by Commands.content
|
||||
}
|
Reference in New Issue
Block a user