feat(delta): rewrite emoji routes w/o quark

#283
This commit is contained in:
Paul Makles
2023-09-05 12:36:18 +01:00
parent 895de86f1e
commit 9789909061
9 changed files with 101 additions and 91 deletions

View File

@@ -7,7 +7,7 @@ use schemars::{
JsonSchema,
};
use crate::{Bot, Channel, Database, Message, Webhook};
use crate::{Bot, Channel, Database, Emoji, Message, Webhook};
/// Reference to some object in the database
#[derive(Serialize, Deserialize)]
@@ -27,6 +27,11 @@ impl Reference {
db.fetch_bot(&self.id).await
}
/// Fetch emoji from Ref
pub async fn as_emoji(&self, db: &Database) -> Result<Emoji> {
db.fetch_emoji(&self.id).await
}
/// Fetch channel from Ref
pub async fn as_channel(&self, db: &Database) -> Result<Channel> {
db.fetch_channel(&self.id).await