Skip to content

Fixed command system issues - #119

Closed
Tais993 wants to merge 0 commit into
Together-Java:developfrom
Tais993:fix-issues-command-system
Closed

Tais993 wants to merge 0 commit into
Together-Java:developfrom
Tais993:fix-issues-command-system

Conversation

@Tais993

@Tais993 Tais993 commented Sep 15, 2021

Copy link
Copy Markdown
Member

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

Tais993 commented Sep 16, 2021

Copy link
Copy Markdown
Member Author

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

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

Copy link
Copy Markdown
Contributor

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

Tais993 commented Sep 18, 2021

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

"Amount of times the user will be pinged, default 1")
.addChoices(new Command.Choice("Once", "1"),
new Command.Choice("Twice", "2"))
.addChoices(

Copy link
Copy Markdown
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
Copy Markdown
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

@marko-radosavljevic marko-radosavljevic left a comment

Copy link
Copy Markdown
Contributor

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

Tais993 commented Sep 20, 2021

Copy link
Copy Markdown
Member Author

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

@Zabuzard

Copy link
Copy Markdown
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

Tais993 commented Sep 28, 2021

Copy link
Copy Markdown
Member Author

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

Zabuzard commented Oct 8, 2021

Copy link
Copy Markdown
Member

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

@Zabuzard

Zabuzard commented Oct 8, 2021

Copy link
Copy Markdown
Member

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