-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EXPERIMENTAL: Implements sharding manager
- Loading branch information
1 parent
7a60fa3
commit 62fd9fd
Showing
15 changed files
with
151 additions
and
59 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
24 changes: 24 additions & 0 deletions
24
foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/PingExecutor.kt
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,24 @@ | ||
package net.cakeyfox.foxy.command.vanilla.utils | ||
|
||
import net.cakeyfox.common.FoxyEmotes | ||
import net.cakeyfox.foxy.command.FoxyInteractionContext | ||
import net.cakeyfox.foxy.command.structure.FoxyCommandExecutor | ||
import net.cakeyfox.foxy.utils.pretty | ||
import java.net.InetAddress | ||
|
||
class PingExecutor : FoxyCommandExecutor() { | ||
override suspend fun execute(context: FoxyInteractionContext) { | ||
val gatewayPing = context.jda.gatewayPing | ||
val currentShardId = context.jda.shardInfo.shardId + 1 | ||
val totalShards = context.jda.shardInfo.shardTotal | ||
|
||
val response = pretty(FoxyEmotes.FoxyHowdy, "Ping\n") + | ||
pretty(FoxyEmotes.FoxyWow, "Gateway Ping: ${gatewayPing}ms\n") + | ||
pretty(FoxyEmotes.FoxyThink, "Shard ID: ${currentShardId}/${totalShards}\n") + | ||
pretty(FoxyEmotes.FoxyCupcake, "Cluster: `${InetAddress.getLocalHost().hostName}`") | ||
|
||
context.reply { | ||
content = response | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/TopCakesExecutor.kt
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
16 changes: 16 additions & 0 deletions
16
foxy/src/main/kotlin/net/cakeyfox/foxy/command/vanilla/utils/declarations/PingCommand.kt
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,16 @@ | ||
package net.cakeyfox.foxy.command.vanilla.utils.declarations | ||
|
||
import net.cakeyfox.foxy.command.structure.FoxyCommandDeclarationBuilder | ||
import net.cakeyfox.foxy.command.structure.FoxyCommandDeclarationWrapper | ||
import net.cakeyfox.foxy.command.vanilla.utils.PingExecutor | ||
|
||
class PingCommand : FoxyCommandDeclarationWrapper { | ||
override fun create(): FoxyCommandDeclarationBuilder = command( | ||
"ping", | ||
"ping.description", | ||
|
||
block = { | ||
executor = PingExecutor() | ||
} | ||
) | ||
} |
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
# Basic settings | ||
ownerId= | ||
guildId= | ||
applicationId= | ||
|
||
# Environment type | ||
environment=development | ||
|
||
# Basic Authentication | ||
discordToken= | ||
|
||
# Database Settings | ||
mongoUri="YOUR-MONGODB-URI" | ||
dbName=Foxy | ||
minShards = 0 | ||
maxShards = 0 | ||
totalShards = 1 | ||
|
||
mongoUri= | ||
dbName=foxy | ||
mongoTimeout=5000 | ||
|
||
# Others | ||
foxyApiKey=key | ||
dblToken=key | ||
artistryKey=key | ||
foxyApiKey= | ||
dblToken= | ||
artistryKey= | ||
activityPort=8080 |
Oops, something went wrong.