diff --git a/Cargo.lock b/Cargo.lock index ee751a7..f33f8ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -485,17 +485,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "discord-webhook" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4453db59b7305e07e41cb100c0dd81c2950d1f8e7d8fb03efcee7504f54b99" -dependencies = [ - "reqwest", - "serde", - "serde_json", -] - [[package]] name = "easy-parallel" version = "3.2.0" @@ -850,7 +839,6 @@ dependencies = [ "clap_mangen", "colored", "dirs", - "discord-webhook", "log", "notify-rust", "reqwest", diff --git a/Cargo.toml b/Cargo.toml index 6bfdd1c..1fb59ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,6 @@ better-panic = "0.3.0" validator = "0.15.0" colored = "2.0.0" clap_mangen = "0.1.10" -discord-webhook = "0.1.0" thiserror = "1.0.31" serde = { version = "1.0.138", features = ["derive"] } clap = { version = "3.2.8", features = ["derive"] } diff --git a/config.toml b/config.toml index d4c616d..e630a86 100644 --- a/config.toml +++ b/config.toml @@ -7,7 +7,3 @@ enabled = true [clipboard] enabled = true - -[discord_webhook] -enabled = false -uri = '' diff --git a/renovate.json b/renovate.json index 8d7db27..d5d1e0b 100644 --- a/renovate.json +++ b/renovate.json @@ -1,8 +1,14 @@ { + "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:base" + "config:base", + "schedule:weekly", + "group:allNonMajor", + ":semanticCommits" + ], + "labels": [ + "dependencies" ], - "prHourlyLimit": 0, "automergeType": "pr", "prCreation": "immediate", "packageRules": [ diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 14b769e..b1876a1 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -5,7 +5,6 @@ pub mod credits; pub mod delete_image; pub mod info_image; pub mod upload_image; -pub mod webhook; pub use parse::*; diff --git a/src/cli/upload_image.rs b/src/cli/upload_image.rs index 2635837..e8ed99b 100644 --- a/src/cli/upload_image.rs +++ b/src/cli/upload_image.rs @@ -2,7 +2,7 @@ use imgurs::ImgurClient; use notify_rust::Notification; use crate::{ - cli::{clipboard::set_clipboard, print_image_info, webhook::send_discord_webhook}, + cli::{clipboard::set_clipboard, print_image_info}, config::toml, }; @@ -46,11 +46,4 @@ pub async fn upload_image(client: ImgurClient, path: String) { if config.clipboard.enabled { set_clipboard(&i.data.link) } - - // if enabled send embed with link and deletehash to discord (something like logger) - if config.discord_webhook.enabled { - send_discord_webhook(&i.data.link, &i.data.deletehash.unwrap()) - .await - .expect("send discord webhook"); - } } diff --git a/src/cli/webhook.rs b/src/cli/webhook.rs deleted file mode 100644 index 8208b79..0000000 --- a/src/cli/webhook.rs +++ /dev/null @@ -1,34 +0,0 @@ -use discord_webhook::client::WebhookClient; -use std::error::Error; - -use crate::config::toml; - -// send embed with link and deletehash to discord (something like logger) -pub async fn send_discord_webhook( - link: &str, - deletehash: &str, -) -> Result<(), Box> { - // get discord webhook uri from config - let url = toml::parse().discord_webhook.uri; - - // create WebhookClient - let client: WebhookClient = WebhookClient::new(&url); - - // get program version - let version = option_env!("CARGO_PKG_VERSION").unwrap_or("unknown"); - - // send discord webhook - client - .send(|message| { - message.username("Imgurs").embed(|embed| { - embed - .title(link) - .description(&format!("Delete Hash ||{deletehash}||")) - .image(link) - .footer(&format!("Imgurs v{version}"), None) - }) - }) - .await?; - - Ok(()) -} diff --git a/src/config/mod.rs b/src/config/mod.rs index 2f4a95c..ba4d260 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -7,7 +7,6 @@ pub struct Config { pub imgur: ConfigImgur, pub notification: ConfigNotification, pub clipboard: ConfigClipboard, - pub discord_webhook: ConfigDiscordWebhook, } #[derive(Debug, Serialize, Deserialize)] @@ -25,9 +24,3 @@ pub struct ConfigNotification { pub struct ConfigClipboard { pub enabled: bool, } - -#[derive(Debug, Serialize, Deserialize)] -pub struct ConfigDiscordWebhook { - pub enabled: bool, - pub uri: String, -}