diff --git a/library/build.gradle b/library/build.gradle
index 180a547..6d8ac47 100644
--- a/library/build.gradle
+++ b/library/build.gradle
@@ -7,7 +7,7 @@ plugins {
}
group = 'net.stelitop'
-version = '0.0.4'
+version = '0.0.5'
java {
sourceCompatibility = '17'
diff --git a/library/src/main/java/net/stelitop/mad4j/DiscordEventsComponent.java b/library/src/main/java/net/stelitop/mad4j/DiscordEventsComponent.java
index b4b4abf..f17f238 100644
--- a/library/src/main/java/net/stelitop/mad4j/DiscordEventsComponent.java
+++ b/library/src/main/java/net/stelitop/mad4j/DiscordEventsComponent.java
@@ -1,7 +1,7 @@
package net.stelitop.mad4j;
import net.stelitop.mad4j.commands.SlashCommand;
-import net.stelitop.mad4j.components.ComponentInteraction;
+import net.stelitop.mad4j.commands.components.ComponentInteraction;
import org.springframework.stereotype.Component;
import java.lang.annotation.ElementType;
diff --git a/library/src/main/java/net/stelitop/mad4j/Mad4jConfig.java b/library/src/main/java/net/stelitop/mad4j/Mad4jConfig.java
index d8eeb99..1dbbb5d 100644
--- a/library/src/main/java/net/stelitop/mad4j/Mad4jConfig.java
+++ b/library/src/main/java/net/stelitop/mad4j/Mad4jConfig.java
@@ -1,19 +1,7 @@
package net.stelitop.mad4j;
-import discord4j.core.GatewayDiscordClient;
-import net.stelitop.mad4j.autocomplete.AutocompletionExecutor;
-import net.stelitop.mad4j.listeners.CommandOptionAutocompleteListener;
-import net.stelitop.mad4j.listeners.ComponentEventListener;
-import net.stelitop.mad4j.listeners.SlashCommandListener;
-import net.stelitop.mad4j.requirements.CommandRequirementExecutor;
-import org.checkerframework.checker.units.qual.C;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
-import org.springframework.core.env.Environment;
-
-import java.util.List;
/**
*
Configuration for mad4j.
diff --git a/library/src/main/java/net/stelitop/mad4j/commands/Command.java b/library/src/main/java/net/stelitop/mad4j/commands/Command.java
new file mode 100644
index 0000000..a77e3a4
--- /dev/null
+++ b/library/src/main/java/net/stelitop/mad4j/commands/Command.java
@@ -0,0 +1,30 @@
+package net.stelitop.mad4j.commands;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation for all commands to be used by the bot.
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Command {
+ /**
+ * The name of the command.
+ */
+ String name();
+ /**
+ * The description of the command.
+ */
+ String description();
+ /**
+ * The types this command registers as. Can be multiple types. The existing types
+ * are "text" for commands from messages used a prefix, and "slash" for slash commands.
+ * If no types are given, then the default type is slash commands only, unless changed
+ * in the properties file.
+ */
+ // TODO: Replace these with enum types
+ CommandType[] types() default {};
+}
diff --git a/library/src/main/java/net/stelitop/mad4j/commands/CommandData.java b/library/src/main/java/net/stelitop/mad4j/commands/CommandData.java
new file mode 100644
index 0000000..7deac39
--- /dev/null
+++ b/library/src/main/java/net/stelitop/mad4j/commands/CommandData.java
@@ -0,0 +1,115 @@
+package net.stelitop.mad4j.commands;
+
+import discord4j.core.GatewayDiscordClient;
+import lombok.Builder;
+import lombok.Getter;
+import net.stelitop.mad4j.DiscordEventsComponent;
+import net.stelitop.mad4j.listeners.CommandOptionAutocompleteListener;
+import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.context.ApplicationContext;
+import org.springframework.core.annotation.Order;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Component
+@Order(0)
+public class CommandData implements ApplicationRunner {
+
+ private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
+
+ private final GatewayDiscordClient gatewayDiscordClient;
+ private final CommandOptionAutocompleteListener commandOptionAutocompleteListener;
+ private final ApplicationContext applicationContext;
+ private final Environment environment;
+ private final List commandsInfo = new ArrayList<>();
+
+ private static final Set DEFAULT_COMMAND_TYPES = Set.of(CommandType.Slash);
+
+ @Builder
+ @Getter
+ public static class Entry {
+ private String name;
+ private String description;
+ private Set types;
+ private Object bean;
+ private Method method;
+ }
+
+ @Autowired
+ public CommandData(
+ GatewayDiscordClient gatewayDiscordClient,
+ CommandOptionAutocompleteListener commandOptionAutocompleteListener,
+ ApplicationContext applicationContext,
+ Environment environment
+ ) {
+ this.gatewayDiscordClient = gatewayDiscordClient;
+ this.commandOptionAutocompleteListener = commandOptionAutocompleteListener;
+ this.applicationContext = applicationContext;
+ this.environment = environment;
+ }
+
+ @Override
+ public void run(ApplicationArguments args) {
+ Collection