#discord-bot #sender #discord-token

bin+lib discord_notify

A Rust library to send notifications to Discord channels

2 unstable releases

0.2.0 Feb 8, 2025
0.1.0 Feb 2, 2025

#961 in Web programming

MIT license

545KB
102 lines

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

Dependencies

~9–25MB
~289K SLoC