Crate discord_notify

Source
Expand description

§Discord Notification Sender

A simple library for sending notifications to Discord channels using a Discord bot.

§Example

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);
    }
}

Structs§

DiscordBot