Skip to content

Cyntaax/luacord

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Luacord


· Report Bug · Request Feature

About The Project

This is a library for interacting with the Discord API in an object-oriented fashion. It is very fresh and still lacking some features, but has proven useful for my personal cases. For the time being, most things are read-only, however this will change.

Getting Started

Simply download the Latest Release, place into your resources directory and start!

Prerequisites

  • You will need knowledge on how to create/add a discord bot to your server. Guide

Configuration

  • Set a new key in your server.cfg of luacord_token along with starting luacord after. See example below
... (otherconfig)
set luacord_token="abcdefg123"

... (other resources)
ensure luacord

Usage

The resource alone does nothing. It is a library to be included with another resource to interact with discord. For example:

--- fxmanifest.lua

server_scripts {
    '@luacord/server/server.lua',
    'server/server.lua'
}
--- server/server.lua

local discord_client = LuaCord.new()

local guild = Guild.new(discord_client, "YOUR_GUILD_ID")

--- you'll have to get player's discord identifier without the 'discord:'

local memberId = "MEMBER ID FROM SOMETHING"

guild:GetMember(memberId, function(member)
    print('Member Stuff', json.encode(member.User))
end)

Roadmap

  • Provide Promise based API to avoid callback disaster

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'chore: added some amazing feature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Cyntaax - @cyntaax - cyntaax@gmail.com

Project Link: https://github.com/cyntaax/luacord