discord_notify

Crates.iodiscord_notify
lib.rsdiscord_notify
version0.2.0
sourcesrc
created_at2025-02-02 10:11:44.88643
updated_at2025-02-08 11:04:32.632621
descriptionA Rust library to send notifications to Discord channels.
homepage
repository
max_upload_size
id1539444
size584,391
Kumar Shantanu (piper-of-dawn)

documentation

README

A simple discord bot struct in Rust that just sends notifications on a channel ID.

use discord_notify::DiscordBot;
#[tokio::main]
async fn main() {
    // Ensure you have a .env file with a valid DISCORD_TOKEN
    let channel_id = "<YOUR CHANNEL ID>";
    let identifier = "My Discord Bot";
    let bot = DiscordBot::new(identifier, channel_id);
    if let Err(e) = bot.send_notification("Hello from the Discord Notification Sender!").await {
        eprintln!("Failed to send notification: {}", e);
    }
}

alt text

Commit count: 0

cargo fmt