diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index a244fb1..b9ff9a7 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -1,6 +1,9 @@ KittyBot Style Guide --- + +# Formatting + #### Indenting Tabs are used so that individual developers can configure their own indent width settings that won't be enforced on others working on the project. @@ -44,4 +47,16 @@ public class MyClass #### Ternary Operator (`?:`) Don't. -#### \ No newline at end of file + +# Architecture + +#### Commands + All commands get spawned on their own threads, and should be implemented in a thread-safe way. Commands all derive from the Command.java class, and use the custom types defined in KittyBot. In order to make any later changes easier and decouple the command logic from core and routing, no JDA structures should be directly exposed in commands, and instead everything needed should be added to the kitty structures that add space to the system. Commands should override the `HelpText` and `Run` functions. Commands are registered in the ObjectBuilderFactory, and the command registration structure can be used for sub-commands as needed. See the RPG for an example. + +#### Tracked Values +Does something need to be tracked in a database? Make sure the class with the data you want inherits from DatabaseTrackedObject, and override the appropriate functions. The object, when marked as dirty, will automatically be written to the database when the next database upkeep tick occurs. Refer to CommandBoop to see an example of a tracked global value, and KittyUser for tracked per-user values. + +#### Tokens, Secrets, etc +Things like tokens, private keys, an secrets are kept in the offline package. This file is intentionally excluded from the repo. If it shouldn't be in the repo, put it in the offline package. + + diff --git a/src/core/Command.java b/src/core/Command.java index e252f9c..a8defdb 100644 --- a/src/core/Command.java +++ b/src/core/Command.java @@ -1,7 +1,6 @@ package core; import java.util.ArrayList; - import dataStructures.KittyChannel; import dataStructures.KittyGuild; import dataStructures.KittyRating; @@ -42,7 +41,7 @@ public abstract class Command return false; } - //TODO(wisp, rin): ADD CHANNEL CHECK HERE + //TODO: ADD CHANNEL CHECK HERE if(user.GetRole().getValue() >= roleLevel.getValue()) {