ワンクリックで
add-notifier
Create a new notification backend (e.g., Telegram, Email, Slack). Use when adding custom notification channels.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Create a new notification backend (e.g., Telegram, Email, Slack). Use when adding custom notification channels.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Search OLX.pt listings, track prices, and detect deals. Use for finding products, monitoring prices, and getting alerts on good deals in Portugal and other OLX regions.
Create a new filter for the tracker system. Use when adding custom filtering logic or when the user asks to create a filter.
Build the olx-tracker project. Use when compiling the project or when the user asks to build.
Create a git commit following project conventions. Use when the user asks to commit changes or create a commit.
Check code quality and formatting. Use when checking code style, running pre-commit checks, or when the user asks to lint or format code.
Run olx-tracker CLI commands. Use when executing tracker operations, managing searches, or testing the application.
SOC 職業分類に基づく
| name | add-notifier |
| description | Create a new notification backend (e.g., Telegram, Email, Slack). Use when adding custom notification channels. |
| user-invocable | false |
Create a new notification backend for olx-tracker (e.g., Telegram, Email, Slack).
Notifiers implement the Notifier trait using async_trait and send notifications for three event types:
Create src/notify/$ARGUMENTS.rs or src/notify/my_notifier.rs:
use anyhow::Result;
use async_trait::async_trait;
use crate::db::Listing;
use super::Notifier;
pub struct MyNotifier {
// Configuration fields (webhook URL, API key, etc.)
api_url: String,
}
impl MyNotifier {
pub fn new(api_url: String) -> Self {
Self { api_url }
}
}
#[async_trait]
impl Notifier for MyNotifier {
async fn notify_new_listings(&self, listings: &[Listing]) -> Result<()> {
// Send notification for new listings
if listings.is_empty() {
return Ok(());
}
// TODO: Send HTTP request or call API
Ok(())
}
async fn notify_price_drops(&self, drops: &[(Listing, f64, f64)]) -> Result<()> {
// drops: Vec<(listing, old_price, new_price)>
if drops.is_empty() {
return Ok(());
}
// TODO: Send price drop notification
Ok(())
}
async fn notify_deals(&self, deals: &[Listing], avg_price: Option<f64>) -> Result<()> {
// deals: listings below average or target price
if deals.is_empty() {
return Ok(());
}
// TODO: Send deal notification
Ok(())
}
}
Add to src/notify/mod.rs:
mod my_notifier;
pub use my_notifier::MyNotifier;
Add config fields to src/config.rs if your notifier needs configuration:
#[derive(Debug, Deserialize, Clone)]
pub struct NotificationConfig {
// ... existing fields ...
pub my_notifier_url: Option<String>,
}
Add to MultiNotifier::from_config() in src/notify/mod.rs:
if let Some(url) = config.my_notifier_url {
notifiers.push(Box::new(MyNotifier::new(url)));
}
Add tests under #[cfg(test)] module:
#[cfg(test)]
mod tests {
use super::*;
#[tokio::test]
async fn test_my_notifier() {
let notifier = MyNotifier::new("https://api.example.com".to_string());
// Test notification logic
}
}
DiscordNotifier: Sends rich embeds to Discord webhooksWebhookNotifier: Sends JSON payloads to generic webhooks#[async_trait]
pub trait Notifier {
async fn notify_new_listings(&self, listings: &[Listing]) -> Result<()>;
async fn notify_price_drops(&self, drops: &[(Listing, f64, f64)]) -> Result<()>;
async fn notify_deals(&self, deals: &[Listing], avg_price: Option<f64>) -> Result<()>;
}
All methods are async and should handle empty inputs gracefully.