-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from caffeine-moe/dev
v2.2.0
- Loading branch information
Showing
114 changed files
with
1,829 additions
and
973 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 |
---|---|---|
@@ -1,14 +1,30 @@ | ||
package org.caffeine.chaos | ||
|
||
import org.caffeine.chaos.api.client.Client | ||
import org.caffeine.chaos.api.client.message.Message | ||
import org.caffeine.chaos.api.client.message.MessageBuilder | ||
import org.caffeine.chaos.api.client.message.MessageCreateEvent | ||
|
||
abstract class Command(commandNames: Array<String>) { | ||
data class CommandInfo( | ||
val name : String, | ||
val usage : String, | ||
val description : String, | ||
) | ||
|
||
abstract class Command(val commandNames : Array<String>, val commandInfo : CommandInfo) { | ||
init { | ||
for (name in commandNames) { | ||
this.also { commandList[name] = it } | ||
} | ||
} | ||
|
||
open suspend fun onCalled(client: Client, event: MessageCreateEvent, args: MutableList<String>, cmd: String) {} | ||
open suspend fun onCalled(client : Client, event : MessageCreateEvent, args : MutableList<String>, cmd : String) {} | ||
|
||
open suspend fun error(client : Client, event : MessageCreateEvent, error : String, info : CommandInfo) : Message { | ||
return MessageBuilder() | ||
.appendLine("**Incorrect usage** '${event.message.content}'") | ||
.appendLine("**Error:** $error") | ||
.appendLine("**Correct usage:** `${client.config.prefix}${info.usage}`") | ||
.build() | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.caffeine.chaos | ||
|
||
import org.caffeine.chaos.api.client.Client | ||
|
||
suspend fun ready(client : Client) { | ||
log("\u001B[38;5;33mWelcome to CHAOS!") | ||
clear() | ||
registerCommands() | ||
loginPrompt(client) | ||
configWatcher(client) | ||
} |
Oops, something went wrong.