Perl 6 module for interacting with the Discord API.
Switch branches/tags
Clone or download
Latest commit 7134143 Nov 29, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Also support custom emoji Sep 17, 2018
lib/API Fix multi-method Oct 27, 2018
t Fix test Oct 27, 2018
.gitattributes correct linguist attribute to detect test files as p6 Aug 16, 2018
.gitignore Ignore tags file Aug 29, 2018
LICENSE Initial commit Jun 29, 2018
META6.json Update META6.json Nov 29, 2018
README.md minor readme formatting changes Nov 19, 2018
architecture.dia rename architecture diagram and ignore export in release packages Aug 15, 2018
test.p6 Add shard support Aug 28, 2018
todos.md More TODOs Sep 25, 2018

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.

Acknowledgements