Code Monkey home page Code Monkey logo

discordac's Introduction

Discord Applied Commands

Go Report Card License GoDoc

Discord Applied Commands is a Go package that provides an easy way to manage Discord commands. It provides a high level API to make and register commands for your Discord Bot.

The package is in an early state of development, any kind of contribution is welcomed!

Getting Started

Installing

go get github.com/vlaetansky/discordac

Usage

Import the package

import "github.com/vlaetansky/discordac"

Firstly you need to create a DiscordGo session, it will be referred to as discordGoSession further. Please refer to a DiscordGo documentation to learn on how to create a DiscordGo Session.

Create a new DiscordAC manager which provides a high level API for managing commands

DAC = discordac.New(discordGoSession)

Next, the manager must be initialized

DAC.Init()

In order to register application commands you must first open a websocket connection

discordGoSession.Open()

You can now create your own commands (example commands) and register them with

DAC.RegisterCommands(...SlashedCommands)

You can register a particular command separately, this can be useful to register a command in a specific guild:

DAC.RegisterCommand(...SlashedCommands)

Note: generally you should register your commands using RegisterCommands(..SlashedCommands) method to avoid sending too many command creation requests to Discord API

(Please refer to the examples folder to learn more)

discordac's People

Contributors

xchgeax avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

schmille

discordac's Issues

Cannot compile with current version of discordgo and discordac

After initializing a new project with discordac and discordgo, I get a compiler error when trying to build my project.

G:\Programming\Go\DiscordAcRepro> go build .
# github.com/vlaetansky/discordac
C:\Users\MyName\go\pkg\mod\github.com\vlaetansky\[email protected]\commandcontext.go:49:12: cannot use content (variable of type string) as type *string in struct literal
C:\Users\MyName\go\pkg\mod\github.com\vlaetansky\[email protected]\commandcontext.go:81:12: cannot use content (variable of type string) as type *string in struct literal

Use this gist sample for a quick reproduction.
I was able to fix the issue by passing a pointer in the lines indicated by the error message.
Is this an isolated issue on my part, or are you able to reproduce it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.