[go: up one dir, main page]

hxdiscord

hxdiscord is an API wrapper for Haxe!
https://github.com/FurretLol/discord-hx/

To install, run:

haxelib install hxdiscord 0.5.1 

See using Haxelib in Haxelib documentation for more information.

README.md

hxdiscord

hxdiscord

hxdiscord is a Discord API Wrapper for Haxe.

Installation

haxelib git hxdiscord https://github.com/FurretDev/hxdiscord.git

haxelib install hxdiscord

About

hxdiscord is a Discord Library for Haxe. It's still in development. More things will be added, but for now, you can make your own Discord Bot with this!

Targets

I don't know how many targets does hxdiscord support, since I've not tried them all. But here's a list of them

NOTE (08/03/2022): I made attachments work for every single target that hxdiscord supports, so you don't have to worry about using Neko

  • ✅ C++
  • ✅ Neko (RECOMMENDED)
  • ✅ HashLink
  • ⚠️ NodeJS (Partially usable)
  • ❌ Python (I want to support it tho)

Need help with something?

Feel free to join our Discord server. Here you can talk with the developer, make questions or even ask for help! https://discord.gg/gKQh5cC59w

Example

Here's an example of a Discord Bot, using the hxdiscord library.

import hxdiscord.DiscordClient;
import hxdiscord.utils.Intents;
import hxdiscord.types.*;

class Main
{
    static var Bot:DiscordClient;
    static function main()
    {
        Bot = new DiscordClient("your token here", [Intents.ALL], false);
        Bot.
        Bot.
        Bot.connect();
    }

    public static function onReady()
    {
        trace("The bot is ready");
    }

    public static function onMessageCreate(m:Message)
    {
        if (m.content == "hi")
        {
            m.reply({content:"Hello!"}, true); //true or false, the bot will mention the user
        }
    }
}
Contributors
Furret
Version
0.5.1
Published
2 years ago
License
GPL

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub