feat(models/bot): Adding enum to for presence / activity
This commit is contained in:
parent
7a248785ac
commit
950c7b444a
1 changed files with 21 additions and 2 deletions
|
|
@ -1,9 +1,28 @@
|
|||
use sqlx::FromRow;
|
||||
|
||||
#[derive(Debug, Clone, sqlx::Type)]
|
||||
#[sqlx(type_name = "bot_presence", rename_all = "lowercase")]
|
||||
pub enum BotPresence {
|
||||
Online,
|
||||
Idle,
|
||||
Dnd,
|
||||
Invisible,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, sqlx::Type)]
|
||||
#[sqlx(type_name = "bot_activity")]
|
||||
pub enum BotActivity {
|
||||
Playing,
|
||||
Streaming,
|
||||
Listening,
|
||||
Watching,
|
||||
Competing,
|
||||
}
|
||||
|
||||
#[derive(Debug, FromRow)]
|
||||
pub struct Bot {
|
||||
pub id: i32,
|
||||
pub status: String,
|
||||
pub activity_type: String,
|
||||
pub presence: String,
|
||||
pub activity_type: BotActivity,
|
||||
pub presence: BotPresence,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue