### ----------------------------------------------------
### -- API::Discord
### -- Licenses: BSD-3-Clause
### -- Authors: Alastair 'altreus' Douglas <altreus@altre.us>, Jonathan 'jnthn' Worthington <jnthn@jnthn.net>, Kane 'kawaii' Valentine <kane@cute.im>
### -- File: examples/automessage.raku
### ----------------------------------------------------
#!perl6

use API::Discord;

sub MAIN($token, $channel-id) {
    my $discord = API::Discord.new(:$token);

    $discord.connect;
    await $discord.ready;

    react {
        whenever Supply.interval(300) {
            my $time = DateTime.now;
            $discord.get-channel($channel-id).send-message("Test message sent at $time.");
        }
    }
}


