Skip to content

Commit

Permalink
Merge branch 'version/1.20.1' into version/1.19.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	fabric/gradle.properties
#	forge/gradle.properties
  • Loading branch information
Erdragh committed Mar 24, 2024
2 parents fac614b + cbb7b30 commit 141fbf7
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ jobs:
distribution: 'temurin'

- name: Build with Gradle and generate dependency Graph
if: ${{github.ref == 'refs/heads/main' && github.event_name != 'pull_request'}}
if: ${{github.ref == 'refs/heads/version/1.20.1' && github.event_name != 'pull_request'}}
uses: gradle/gradle-build-action@v2
with:
arguments: build
dependency-graph: 'generate-and-submit'

- name: Build with Gradle
if: ${{github.ref != 'refs/heads/main' || github.event_name == 'pull_request'}}
if: ${{github.ref != 'refs/heads/version/1.20.1' || github.event_name == 'pull_request'}}
uses: gradle/gradle-build-action@v2
with:
arguments: build
Expand Down
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.2.1
Allow providing token via config

# 1.2.0
- Unlink other Discord users with permissions
- Customizable text for basically anything
Expand Down
8 changes: 5 additions & 3 deletions common/src/main/kotlin/dev/erdragh/astralbot/Bot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,17 @@ fun startAstralbot(server: MinecraftServer) {
LOGGER.debug("Created $MODID directory")
}

if (!env.containsKey("DISCORD_TOKEN")) {
LOGGER.warn("Not starting AstralBot because of missing DISCORD_TOKEN environment variable.")
val token: String? = env["DISCORD_TOKEN"] ?: AstralBotConfig.DISCORD_TOKEN.get()

if (token == null || token == "") {
LOGGER.warn("Not starting AstralBot because no token was not provided")
return
}

minecraftHandler = MinecraftHandler(server)

jda = JDABuilder.createLight(
env["DISCORD_TOKEN"],
token,
GatewayIntent.MESSAGE_CONTENT,
GatewayIntent.GUILD_MESSAGES,
GatewayIntent.GUILD_MEMBERS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ import java.net.URL
object AstralBotConfig {
val SPEC: ForgeConfigSpec

/**
* If the `DISCORD_TOKEN` environment variable isn't set, the bot will
* look for a token in this config option.
*/
val DISCORD_TOKEN: ForgeConfigSpec.ConfigValue<String>

/**
* Whether the default whitelisting process is respected or ignored.
* Setting this to `true` will *force* every user who wants to join
Expand Down Expand Up @@ -80,6 +86,9 @@ object AstralBotConfig {

builder.comment("AstralBot Config")

DISCORD_TOKEN = builder.comment("Discord token for the bot. Can also be supplied via DISCORD_TOKEN environment variable")
.define("token", "")

REQUIRE_LINK_FOR_WHITELIST = builder.comment("Whether to require being linked to be whitelisted")
.define("requireLinkForWhitelist", false)
DISCORD_LINK = builder.comment("Link to the discord where your users can run the /link command")
Expand Down
2 changes: 1 addition & 1 deletion fabric/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
fabricApiVersion=0.77.0
fabricKotlinVersion=1.10.17+kotlin.1.9.22
fabricKotlinVersion=1.10.19+kotlin.1.9.23
2 changes: 1 addition & 1 deletion forge/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
loom.platform=forge
forgeVersion=43.3.7
kotlinForgeVersion=4.6.1
kotlinForgeVersion=4.10.0
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ org.gradle.jvmargs=-Xmx3G
# Minecraft things
enabledPlatforms=fabric,forge
# Specified here because it's used in both the fabric and common subproject
fabricLoaderVersion=0.15.6
fabricLoaderVersion=0.15.7

version=1.2.0
version=1.2.1
group=dev.erdragh.astralbot

minecraftVersion=1.19.2
Expand All @@ -16,8 +16,8 @@ forgeConfigAPIVersion=4.2.11
nightConfig=3.6.5

# Discord Interactions
jdaVersion=5.0.0-beta.20
jdaVersion=5.0.0-beta.21

# Database Interactions
exposedVersion=0.47.0
exposedVersion=0.48.0
sqliteJDBCVersion=3.44.1.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pluginManagement {
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

include("common")
Expand Down

0 comments on commit 141fbf7

Please sign in to comment.