This repository has been archived by the owner on Nov 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More abstraction, a few test commands, and a ton of other changes
Full changelog: * Most JavaDocs have been added; all the least-straightforward code has been documented * Command is now renamed to Module * Further abstraction of Module, new UX features, more elegant and redundant class code - New ModuleInfo container class for command module metadata, with a Builder included - Added command descriptions - Separated required permissions into bot permissions and user permissions * package-info.java for all packages and package-level categorization via @CommandPackage(CommandType) * CommandType is now automatically populated in ModuleInfo * Added 'help', 'purge', and 'claimoperator' modules * Operator commands no longer rely on a hardcoded ID to check operator status; use 'claimoperator' to set and change bot operator * User permissions are now properly calculated & checked * CommandType now provides Emoji icons for each type * Migrated property configuration from Spring to Owner * Added '--debug' command-line option to make lower-level logging accessible * CommandDispatcher now uses an ExecutorService to start command threads instead of manually creating threads * Module scanning & instantiation moved to separate CommandRegistry class * CommandContext now provides the bot's Member as well as the invoker's * Upgrade to Java 10 and modularize the application - Note: 11 is definitely preferable, since it's the current LTS, but Hibernate depends on the java.activation module which was removed in 11. Once I can find a way to get jlink to recognize either the module from the Java 10 JDK or the non-modular Maven artifact, ghost2 will be migrated to 11 immediately.
- Loading branch information
Showing
33 changed files
with
830 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,4 @@ pluginManagement { | |
gradlePluginPortal() | ||
} | ||
} | ||
rootProject.name = 'ghost2' | ||
|
||
rootProject.name = 'ghost2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 13 additions & 12 deletions
25
src/main/java/com/github/coleb1911/ghost2/GhostConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
package com.github.coleb1911.ghost2; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.PropertySource; | ||
import org.springframework.stereotype.Component; | ||
import org.aeonbits.owner.Accessible; | ||
import org.aeonbits.owner.Config; | ||
import org.aeonbits.owner.Config.Sources; | ||
import org.aeonbits.owner.Mutable; | ||
import org.aeonbits.owner.Reloadable; | ||
|
||
@Component | ||
@PropertySource(value = {"classpath:ghost.properties"}) | ||
class GhostConfig { | ||
@Value("${ghost.token}") | ||
private transient String token; | ||
@Sources("classpath:ghost.properties") | ||
public interface GhostConfig extends Config, Accessible, Mutable, Reloadable { | ||
@Key("ghost.token") | ||
String token(); | ||
|
||
String getToken() { | ||
return token; | ||
} | ||
} | ||
@Key("ghost.operatorid") | ||
@DefaultValue("-1") | ||
Long operatorId(); | ||
} |
Oops, something went wrong.