Skip to content
Perl 6 module for interacting with the Discord API.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
lib/API
t Fix test Oct 27, 2018
.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 wiki attached to this repository, or by reading the pod 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);

    await $discord.connect;

    react {
        whenever $discord.messages -> $message {
            (await $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.