Skip to content

Fixed command system issues #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

Tais993
Copy link
Member

@Tais993 Tais993 commented Sep 15, 2021

Moved AbstractCommand to the Commands package instead of the example package, this was an accident.
Improved docs:

  • Added docs to the AbstractCommand constructor
  • Added multiple @see tags
  • Elaborated on the effect of Command#isGuildOnly

And optimized imports

@Zabuzard Zabuzard added the enhancement New feature or request label Sep 15, 2021
@Zabuzard Zabuzard added this to the Initial Setup milestone Sep 15, 2021
@Tais993
Copy link
Member Author

Tais993 commented Sep 16, 2021

Made a few mistakes causing the merge commit, I'll squash

@Tais993 Tais993 requested a review from Zabuzard September 16, 2021 09:07
I-Al-Istannen
I-Al-Istannen previously approved these changes Sep 18, 2021
Copy link
Contributor

@I-Al-Istannen I-Al-Istannen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer qualifying the javadoc link and not the code itself.

@Tais993
Copy link
Member Author

Tais993 commented Sep 18, 2021

Just a suggestion, but maybe you should learn Java @Tais993

I-Al-Istannen
I-Al-Istannen previously approved these changes Sep 18, 2021
@marko-radosavljevic marko-radosavljevic dismissed stale reviews from I-Al-Istannen and themself via 28515f8 September 18, 2021 20:02
new ErrorHandler().handle(ErrorResponse.MISSING_ACCESS, errorResponseException -> {
// * Hard to read, there's no other accurate way to get a channel you've the write
// * permission in.
guild.getTextChannelCache().stream().filter(textChannel -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be a utility method Optional<TextChannel> getTextChannelWithWritePermissions(Guild) to aid readability

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating something like

ChannelUtil#getChannelsWithPermissions(Guild, Permissions) seems fair
But this should be done within another PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I have already created one JDAUtils. I will move it in my PR instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't remember JDAUtils having anything relating, and JDAUtils is extremely outdated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 thats something I have written and will pull out your piece.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thought you were talking about JDA utlities

}).findFirst().ifPresent(textChannel -> {
textChannel
.sendMessage("This bot needs the commands scope, please invite it correctly!\n"
+ "You can join https://discord.gg/UJBwS2Hvcx for more info, I'll leave now.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this url? May be a constant

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Together Java Discord, should be a constant in the main/application/whatever the main is called in that case imo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also be moved out into the "config system" #100

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See PR #142 which will add a discordGuildInvite property for this.

@@ -47,17 +49,20 @@ public CommandExample() {
// * adds the second option
new OptionData(OptionType.STRING, "times-to-ping",
"Amount of times the user will be pinged, default 1")
.addChoices(new Command.Choice("Once", "1"),
new Command.Choice("Twice", "2"))
.addChoices(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is formatter related but the deleted lines look more readable to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd assume formatter since I don't remember it myself

Zabuzard
Zabuzard previously approved these changes Sep 19, 2021
Copy link
Contributor

@marko-radosavljevic marko-radosavljevic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spotlessApply ^^

@Tais993 Tais993 marked this pull request as draft September 20, 2021 07:47
@Tais993
Copy link
Member Author

Tais993 commented Sep 20, 2021

Since requested, requires some time to develop a proper permission system.

@Zabuzard
Copy link
Member

Since requested, requires some time to develop a proper permission system.

This branch contains quite some useful improvements to the command system. If the permission thing needs more time, why not split this into two PRs and get this finally merged?

@Tais993
Copy link
Member Author

Tais993 commented Sep 28, 2021

Sure, will look at this later today.

@Tais993 Tais993 marked this pull request as ready for review September 28, 2021 11:12
@Zabuzard Zabuzard closed this Oct 8, 2021
@Zabuzard Zabuzard force-pushed the fix-issues-command-system branch from 0424e3f to 4e2b591 Compare October 8, 2021 07:22
@Zabuzard
Copy link
Member

Zabuzard commented Oct 8, 2021

Sorry, I messed up the rebase. Ill rescue it, gimme a minute

@Zabuzard
Copy link
Member

Zabuzard commented Oct 8, 2021

Split this into #169 and #170. Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants