Skip to content

Raku module for interacting with the Discord API.

License

Notifications You must be signed in to change notification settings

shuppet/raku-api-discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

API::Discord is a Raku (formerly Perl 6) module for interacting with the Discord API. Built on top of Cro::WebSocket::Client and Cro::HTTP::Client, this allows for fast asynchronous operations between your application and the API.

Installation

... from zef

zef install API::Discord

... from source

git clone https://github.com/shuppet/raku-api-discord
cd raku-api-discord/ && zef install ${PWD}

Usage

Full documentation can be found by reading the pod6 directly from the module source.

p6doc API::Discord

Example

API::Discord is designed to do all the hard work for you. Let us handle the connection, authentication, heartbeats, message parsing and all that other boring stuff - leaving you to focus on writing logic for your applications.

#!raku

use API::Discord;
use API::Discord::Debug; # remove to disable debug output

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

    $discord.connect;
    await $discord.ready;

    react {
        whenever $discord.messages -> $message {
            $message.channel.send-message($message.content);
        }
    }
}

More examples can be found within the examples/ directory of this repository.

Support

Official

Join our official Discord server where we discuss development, bugs and test changes or new features to our library. Please note that this is a volunteer project and we all have real lives, day jobs and other responsiblities outside of the Internet. Replies may not be immediate and a resolution of your problem is not guaranteed outside of valid bug reports (for which raising an issue here on GitHub is far preferable).

image

Community

If you have a more general Raku question, or need help with a programming issue then it might be best to join the Raku Discord community instead. Some of the members there are also familiar with API::Discord and it's quite likely they'll be able to help you faster than we can. They're also really nice people. :)

image