Skip to content

Commit

Permalink
Remove listeners, add gradle.properties to !fabric
Browse files Browse the repository at this point in the history
Signed-off-by: shedaniel <[email protected]>
  • Loading branch information
shedaniel committed Apr 17, 2021
1 parent 1ef24e2 commit 12a27bb
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 765 deletions.
18 changes: 0 additions & 18 deletions src/main/kotlin/me/shedaniel/linkie/discord/LinkieBot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import me.shedaniel.linkie.discord.commands.GoogleCommand
import me.shedaniel.linkie.discord.commands.HelpCommand
import me.shedaniel.linkie.discord.commands.ListAllTricksCommand
import me.shedaniel.linkie.discord.commands.ListTricksCommand
import me.shedaniel.linkie.discord.commands.ListenerCommand
import me.shedaniel.linkie.discord.commands.NamespacesCommand
import me.shedaniel.linkie.discord.commands.QueryMappingsCommand
import me.shedaniel.linkie.discord.commands.QueryTranslateMappingsCommand
Expand All @@ -59,12 +58,6 @@ import me.shedaniel.linkie.discord.commands.TricksCommand
import me.shedaniel.linkie.discord.commands.ValueCommand
import me.shedaniel.linkie.discord.commands.ValueListCommand
import me.shedaniel.linkie.discord.config.ConfigManager
import me.shedaniel.linkie.discord.listener.ChannelListeners
import me.shedaniel.linkie.discord.listener.listeners.ArchitecturyVersionListener
import me.shedaniel.linkie.discord.listener.listeners.FabricMCVersionListener
import me.shedaniel.linkie.discord.listener.listeners.MinecraftVersionListener
import me.shedaniel.linkie.discord.listener.listeners.ModMenuVersionListener
import me.shedaniel.linkie.discord.listener.listeners.ShedanielVersionListener
import me.shedaniel.linkie.discord.tricks.TricksManager
import me.shedaniel.linkie.discord.utils.event
import me.shedaniel.linkie.namespaces.LegacyYarnNamespace
Expand Down Expand Up @@ -117,15 +110,13 @@ fun main() {
// val slashCommands = SlashCommands()
// register the commands
registerCommands(CommandHandler)
registerListeners(ChannelListeners)
// registerSlashCommands(slashCommands)
// slashCommands.register()

event<ReadyEvent> {
gateway.updatePresence(Presence.online(Activity.watching("cool mappings"))).subscribe()
}
}
ChannelListeners.init()
}

private operator fun File.div(s: String): File = File(this, s)
Expand Down Expand Up @@ -222,15 +213,6 @@ fun registerCommands(commands: CommandHandler) {
commands.registerCommand(FabricCommand, "fabric")
commands.registerCommand(ForgeCommand, "forge")
commands.registerCommand(GoogleCommand, "google")
commands.registerCommand(ListenerCommand, "listener")
}

fun registerListeners(listeners: ChannelListeners) {
listeners["minecraft"] = MinecraftVersionListener
listeners["fabricmc"] = FabricMCVersionListener
listeners["architectury"] = ArchitecturyVersionListener
listeners["shedaniel"] = ShedanielVersionListener
listeners["modmenu"] = ModMenuVersionListener
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package me.shedaniel.linkie.discord.commands
import discord4j.core.spec.EmbedCreateSpec
import kotlinx.serialization.json.*
import me.shedaniel.cursemetaapi.CurseMetaAPI
import me.shedaniel.linkie.discord.utils.addField
import me.shedaniel.linkie.discord.utils.addInlineField
import me.shedaniel.linkie.utils.tryToVersion
import java.net.URL
Expand Down Expand Up @@ -104,9 +105,19 @@ object FabricCommand : AbstractPlatformVersionCommand<FabricCommand.FabricVersio
addInlineField("Loader Version", loaderVersion)
addInlineField("Installer Version", installerVersion)
addInlineField("Yarn Version", yarnVersion)
val fapiDescription: String
if (apiVersion != null) {
addInlineField("Api Version", apiVersion!!.version)
fapiDescription = "\n\nfabric_version=${apiVersion!!.version}"
} else {
fapiDescription = ""
}
addField("gradle.properties", """```
|minecraft_version=$version
|yarn_mappings=$yarnVersion
|loader_version=$loaderVersion$fapiDescription
|```
""".trimMargin())
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data class GuildConfig(
var evalEnabled: Boolean = true,
var whitelistedMappings: List<String> = listOf(),
var blacklistedMappings: List<String> = listOf(),
var listenerChannels: MutableMap<String, MutableSet<Long>> = mutableMapOf(),
) {
fun isMappingsEnabled(namespace: String): Boolean {
if (whitelistedMappings.isNotEmpty())
Expand Down

This file was deleted.

Loading

0 comments on commit 12a27bb

Please sign in to comment.