Skip to content

Argument modifications, LockCommand and ExternalFile modifications#60

Merged
Owen1212055 merged 9 commits intoMCDiamondFire:masterfrom
ryandev2:master
Sep 12, 2021
Merged

Argument modifications, LockCommand and ExternalFile modifications#60
Owen1212055 merged 9 commits intoMCDiamondFire:masterfrom
ryandev2:master

Conversation

@ryandev2
Copy link
Contributor

  • Several argument refactors, including:

    • Added FallbackArgument and AbstractSimpleValueFallbackArgument,
      which will let the argument return a custom value (CommandEvent provided) if the normal parsed value threw an exception or is null.
      This also gives the possibility of having an optional argument in the middle of an ArgumentSet.
    • Moved all non-abstract argument type classes in their own package.
    • ArgumentContainer#optional now uses a lambda instead of T with the CommandEvent.
    • Added TextChannelArgument (extending FallbackArgument) which will return the channel the command was executed in if the mentioned one is invalid.
    • Moved EnumArgument#setEnum to be in the constructor.
  • Renamed Permission to Rank for convenience with JDA's Permission

  • Added LockCommand (Exclusive to Rank.MODERATION). This command will toggle a lock in the mentioned or executed channel, and send a message with the reason for it.

I do not understand how git forks work, it keeps adding old commits lol

# Conflicts:
#	src/main/java/com/diamondfire/helpbot/sys/tag/TagHandler.java
# Conflicts:
#	src/main/java/com/diamondfire/helpbot/bot/command/impl/other/tag/AddTagSubCommand.java
#	src/main/java/com/diamondfire/helpbot/bot/command/impl/other/tag/EditTagSubCommand.java
#	src/main/java/com/diamondfire/helpbot/bot/command/impl/other/tag/ListTagsSubCommand.java
@ryandev2
Copy link
Contributor Author

I've refactored the ExternalFile system and made TagHandler take advantage of it

@ryandev2 ryandev2 changed the title LockCommand and Argument modifications Argument modifications, LockCommand and ExternalFile modifications Aug 18, 2021
…e advantage of the new ExternalFile system and added a #copy method
@ryandev2
Copy link
Contributor Author

Made SwearFilter, DisableCommandHandler and CodeDifferenceHandler take advantage of the new ExternalFile system and added the ExternalFile#copy method

Copy link
Contributor

@Owen1212055 Owen1212055 left a comment

Choose a reason for hiding this comment

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

These changes are pretty critical. Please make sure that default values with null in it still work properly.

@Owen1212055 Owen1212055 merged commit 9ed2176 into MCDiamondFire:master Sep 12, 2021
@Owen1212055
Copy link
Contributor

Thank you :)

Owen1212055 added a commit that referenced this pull request Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants