centauri

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 5 Imported by: 0

README

Centauri

Go Reference Badge CI Badge Discord Server Badge Last Commit Badge Conventional Commits Badge

Note Due to my military service from July 2023 until April 2024 I will not be able to work on this project a lot, most likely only during weekends if I have time and motivation ^-^

Warning This is a WIP library that may be very unstable and eventually not fully optimised, use at your own care! This README will also be reworked.

A Discord API wrapper written in Go with the goal of being easily understandable and simple to use, even for newcomers.

Features

The plan for Centauri would be for it to cover Discord's APIs in their entirety. A small list of features that will be, or are already in Centauri are:

  • ANSI Colors
  • Background Tasks
  • Caching
  • Easy Commands Creation
  • Gateway API
  • Interactions (Buttons, Modals, etc.)
  • OAuth 2.0
  • Rate Limiter
  • REST API
  • RPC
  • Sharding
  • Webhooks

Getting Started

Installation

To get started you will simply need to install the library in your project by executing the following command.

go get github.com/kkrypt0nn/centauri
Example Usage
REST Client

If you just want to interact with the REST API, you may use the following code.

package main

import (
	"fmt"

	"github.com/kkrypt0nn/centauri"
)

func main() {
	botClient := centauri.NewRestClient("Bot BOT_TOKEN")
	bot, err := botClient.GetCurrentUser()
	if err != nil {
		fmt.Println("err:", err)
	} else {
		fmt.Println(fmt.Sprintf("Got bot %s with ID %s", bot.Username, bot.ID))
	}
}

More examples are available here

Documentation

The documentation is available for reading here. There is also the Go reference page available here

Troubleshooting

Some troubleshooting articles and guides may be found in the documentation mentioned above.

Contributing

Before the version 1.0.0 of the project, contributions are mostly closed as I'd like to lay down the foundations of the library. Afterward contributions will be more than welcome if following the Contributing Guidelines.

License

This library was made with 💜 by Krypton and is under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRestClient

func NewRestClient(token string) *rest.Client

NewRestClient returns a new rest.Client to make REST API calls only, may be a bot or a user token

Types

This section is empty.

Directories

Path Synopsis
_examples
Package constants holds the constants used across the library
Package constants holds the constants used across the library
Package discord holds the different structures of Discord's API
Package discord holds the different structures of Discord's API
Package errors is a package where internal errors used across the library are stored
Package errors is a package where internal errors used across the library are stored
ext
tasks
Package tasks in an experimental package which serves as an extension that lets users run a function at a specified interval
Package tasks in an experimental package which serves as an extension that lets users run a function at a specified interval
Package oauth2 handle the OAuth 2.0 flow for Discord
Package oauth2 handle the OAuth 2.0 flow for Discord
Package ptr is a package to get a pointer for given types
Package ptr is a package to get a pointer for given types
Package rest handles the REST API of Discord
Package rest handles the REST API of Discord

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL