Giter VIP home page Giter VIP logo

jda-command's Introduction

Welcome to my GitHub Profile

Feel free to check out anything -- a lot of this is just temporary or testing stuff and mainly kept for my own purposes. I still need to go through and prune what is available publicly, a lot of my interesting stuff is private.

jda-command's People

Contributors

akio08 avatar ineanto avatar rainegimme avatar rainestormee avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

iamtails

jda-command's Issues

Attribute utils

Make it easy to get the value of an attribute value with a provided key.

Suggestion: Add syntax option

It would be a good addition to have a "syntax" option for @CommandDescription to have a simple way for showing the syntax in f.e. a help-command (Like f.e. !help <command> shows the description and also the syntax)

How it would look like:

import com.github.rainestormee.jdacommand.Command;
import com.github.rainestormee.jdacommand.CommandAttribute;
import com.github.rainestormee.jdacommand.CommandDescription;

@CommandDescription(
        name = "Help",
        description = "Shows all commands or gives information about a command,",
        triggers = {"help", "commands"},
        attributes = {@CommandAttribute(key = "category:help")},
        syntax = "!help [command]"
)
public class HelpCommand implements Command {
        
        private MessageEmbed commandInfo(Command cmd, String prefix){
                CommandDescription desc = cmd.getDescription();
                EmbedBuilder builder = new EmbedBuilder()
                        .setTitle(desc.name())
                        .setDescription(desc.description())
                        .addField("Usage:", String.format("%s%s", prefix, desc.syntax(), true)
                        .addField("Aliases:", String.join(", ", desc.triggers()), true)
                        .setColor(0x50E3C2);
                
                return builder.build();
        }
        
        @Override
        public void execute(Message msg, String args){
                // We do stuff here like getting a MessageEmbed from above method
        }
}

This would be the result (Made with the Embed Visualizer):
image

Help

How can i register an command?

Is it possible to find which command alias was used?

I would like to know if there would be a way to retrieve the command alias that was used to trigger the execute.

The only solution I could think of would be in combination with a message receive listener to check if received message equals x, which seems a bit much.
An additional (optional) argument of some sort (or something similar) would be nice as I want to customize certain commands depending on what alias was used.

I hope this makes sense.

Slash-command support

JDA is currently in the progress of adding support for Discord's Slash commands. See discord-jda/JDA#1501 for the current state and noteworthy info.

I feel like JDA-Command should consider looking at a way to natively support slash commands from JDA. I don't say you should work on something straight away, but more like thinking about what changes might be necessary to make supporting (and especially handling), slash commands easy.

I myself tried to implement support for slash-commands using the AbstractCommand class, but it's rather difficult to achieve, especially since we only have an Event here rather than a distinct entity (i.e. Message) to go from.
Especially having a proper way for supporting Command options or similar could be a major complication here.

So, I open this issue here to start an initial discussion on what jda-command could or should do to provide proper support as a command framework for Slash-commands, as I doubt that with the support from JDA, you would have a simple and good way of handling commands the way you can do in jda-command.

Update for JDA4.

Let’s make sure that everything will still be compatible with the new JDA when that is released.

Static command handler

This shouldn't be static, people should be allowed to have different commands per shard ect

Is 1.1.13 latest release?

I just now received a PR where JDA-Command was updated from 1.1.5 which feels kind of suspicious, since the code itself here is still on 1.1.6 (which I never received an update for strangely enough) and the latest release also is only on 1.1.6

So my question now is: Is that really an official release or could there be a possibility that someone managed to publish a possible malicious release here?

Rework command

Possibly extend an abstract Command which implements ICommand. Remove functional interface.

Rewrite readme

Make it easier to look at/read and use less vertical space.
tags.

Dead examples link in README

I was just checking out this repo and I noticed the link on the readme leads here, which is a deleted user, or a typo in the username (it 404s).

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.