inital webhook support
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::models::channel::{Channel, FieldsChannel, PartialChannel};
|
||||
use crate::models::{channel::{Channel, FieldsChannel, PartialChannel}};
|
||||
use crate::{OverrideField, Result};
|
||||
|
||||
#[async_trait]
|
||||
|
||||
11
crates/quark/src/traits/channels/webhook.rs
Normal file
11
crates/quark/src/traits/channels/webhook.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use crate::models::webhook::{Webhook, PartialWebhook, FieldsWebhook};
|
||||
use crate::Result;
|
||||
|
||||
#[async_trait]
|
||||
pub trait AbstractWebhook: Sync + Send {
|
||||
async fn insert_webhook(&self, webhook: &Webhook) -> Result<()>;
|
||||
async fn fetch_webhook(&self, webhook_id: &str) -> Result<Webhook>;
|
||||
async fn delete_webhook(&self, webhook_id: &str) -> Result<()>;
|
||||
async fn update_webook(&self, webhook_id: &str, partial_webhook: &PartialWebhook, remove: &[FieldsWebhook]) -> Result<()>;
|
||||
async fn fetch_webhooks_for_channel(&self, channel: &str) -> Result<Vec<Webhook>>;
|
||||
}
|
||||
@@ -12,6 +12,7 @@ mod channels {
|
||||
pub mod channel_invite;
|
||||
pub mod channel_unread;
|
||||
pub mod message;
|
||||
pub mod webhook;
|
||||
}
|
||||
|
||||
mod servers {
|
||||
@@ -35,6 +36,7 @@ pub use channels::channel::AbstractChannel;
|
||||
pub use channels::channel_invite::AbstractChannelInvite;
|
||||
pub use channels::channel_unread::AbstractChannelUnread;
|
||||
pub use channels::message::AbstractMessage;
|
||||
pub use channels::webhook::AbstractWebhook;
|
||||
|
||||
pub use servers::server::AbstractServer;
|
||||
pub use servers::server_ban::AbstractServerBan;
|
||||
@@ -60,5 +62,6 @@ pub trait AbstractDatabase:
|
||||
+ AbstractBot
|
||||
+ AbstractUser
|
||||
+ AbstractUserSettings
|
||||
+ AbstractWebhook
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user