Skip to content
Perl 6 module for interacting with the Discord API.
Raku
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
examples
lib/API
t
.gitattributes
.gitignore
LICENSE
META6.json
README.md
architecture.dia

README.md

logo

API::Discord is a 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/p6-api-discord
cd p6-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.

#!perl6

use API::Discord;

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.

You can’t perform that action at this time.