Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build.gradle #23

Merged
merged 2 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Since the library is based on Java Spring, it contains components that have to b
- The first is to import the Mad4jConfig into a custom configuration component. This is the recommended way, as this way you have
more control over the library. It is also easier to disable when testing needs to be done on other parts of the bot, such as testing JPA repositories.
```java
import net.stelitop.mad4j.Mad4jConfig;
import io.github.stelitop.mad4j.Mad4jConfig;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

Expand All @@ -38,7 +38,7 @@ Since the library is based on Java Spring, it contains components that have to b
- The second way is to directly import the Mad4jConfig to the main class of the Spring application. This is a bit simpler, but it might be problematic
in bigger applications.
```java
import net.stelitop.mad4j.Mad4jConfig;
import io.github.stelitop.mad4j.Mad4jConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
Expand Down
40 changes: 20 additions & 20 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'maven-publish'
}

group = 'net.stelitop'
group = 'io.github.stelitop'
version = '0.0.5'

java {
Expand Down Expand Up @@ -40,29 +40,29 @@ dependencies {
testImplementation 'org.mockito:mockito-core:5.4.0'
}

publishing {
repositories {
maven {
name = "mad4j"
url = uri("https://maven.pkg.github.com/stelitop/mad4j")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}
//publishing {
// repositories {
// maven {
// name = "mad4j"
// url = uri("https://maven.pkg.github.com/stelitop/mad4j")
// credentials {
// username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
// password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
// }
// }
// }
// publications {
// gpr(MavenPublication) {
// from(components.java)
// }
// }
//}

tasks.named('test') {
useJUnitPlatform()
jacoco {
enabled = true
includes = ['net.stelitop.mad4j.*']
includes = ['io.github.stelitop.mad4j.*']
excludes = []
}
}
Expand All @@ -73,7 +73,7 @@ jacocoTestCoverageVerification() {
rule {
enabled = true
element = 'CLASS'
includes = ['net.stelitop.madj4.*']
includes = ['io.github.stelitop.madj4.*']

limit {
counter = 'BRANCH'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.stelitop.mad4j;
package io.github.stelitop.mad4j;

import net.stelitop.mad4j.commands.SlashCommand;
import net.stelitop.mad4j.commands.components.ComponentInteraction;
import io.github.stelitop.mad4j.commands.SlashCommand;
import io.github.stelitop.mad4j.commands.components.ComponentInteraction;
import org.springframework.stereotype.Component;

import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j;
package io.github.stelitop.mad4j;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
Expand All @@ -8,7 +8,7 @@
*
* <p>This loads all components part of the package when used into another project.</p>
*/
@ComponentScan("net.stelitop.mad4j")
@ComponentScan("io.github.stelitop.mad4j")
@Configuration
public class Mad4jConfig {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands;
package io.github.stelitop.mad4j.commands;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package net.stelitop.mad4j.commands;
package io.github.stelitop.mad4j.commands;

import discord4j.core.GatewayDiscordClient;
import io.github.stelitop.mad4j.DiscordEventsComponent;
import lombok.Builder;
import lombok.Getter;
import net.stelitop.mad4j.DiscordEventsComponent;
import net.stelitop.mad4j.listeners.CommandOptionAutocompleteListener;
import io.github.stelitop.mad4j.listeners.CommandOptionAutocompleteListener;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.stelitop.mad4j.commands;
package io.github.stelitop.mad4j.commands;

import net.stelitop.mad4j.commands.autocomplete.AutocompletionExecutor;
import net.stelitop.mad4j.commands.autocomplete.NullAutocompleteExecutor;
import io.github.stelitop.mad4j.commands.autocomplete.AutocompletionExecutor;
import io.github.stelitop.mad4j.commands.autocomplete.NullAutocompleteExecutor;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands;
package io.github.stelitop.mad4j.commands;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands;
package io.github.stelitop.mad4j.commands;

public enum CommandType {
Text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands;
package io.github.stelitop.mad4j.commands;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands;
package io.github.stelitop.mad4j.commands;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands;
package io.github.stelitop.mad4j.commands;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands;
package io.github.stelitop.mad4j.commands;

import discord4j.core.GatewayDiscordClient;
import discord4j.core.event.domain.interaction.ChatInputInteractionEvent;
Expand All @@ -8,15 +8,15 @@
import discord4j.discordjson.json.ApplicationCommandRequest;
import discord4j.discordjson.json.ImmutableApplicationCommandOptionData;
import discord4j.rest.RestClient;
import io.github.stelitop.mad4j.DiscordEventsComponent;
import io.github.stelitop.mad4j.utils.ActionResult;
import io.github.stelitop.mad4j.utils.OptionType;
import lombok.AllArgsConstructor;
import lombok.ToString;
import net.stelitop.mad4j.DiscordEventsComponent;
import net.stelitop.mad4j.commands.autocomplete.NullAutocompleteExecutor;
import net.stelitop.mad4j.commands.convenience.EventUser;
import net.stelitop.mad4j.commands.convenience.EventUserId;
import net.stelitop.mad4j.listeners.CommandOptionAutocompleteListener;
import net.stelitop.mad4j.utils.ActionResult;
import net.stelitop.mad4j.utils.OptionType;
import io.github.stelitop.mad4j.commands.autocomplete.NullAutocompleteExecutor;
import io.github.stelitop.mad4j.commands.convenience.EventUser;
import io.github.stelitop.mad4j.commands.convenience.EventUserId;
import io.github.stelitop.mad4j.listeners.CommandOptionAutocompleteListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -25,7 +25,6 @@
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.*;
import java.util.stream.Collectors;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.stelitop.mad4j.commands.autocomplete;
package io.github.stelitop.mad4j.commands.autocomplete;

import discord4j.core.event.domain.interaction.ChatInputAutoCompleteEvent;
import net.stelitop.mad4j.commands.CommandParam;
import io.github.stelitop.mad4j.commands.CommandParam;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands.autocomplete;
package io.github.stelitop.mad4j.commands.autocomplete;

import lombok.Getter;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands.autocomplete;
package io.github.stelitop.mad4j.commands.autocomplete;

import discord4j.core.event.domain.interaction.ChatInputAutoCompleteEvent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands.components;
package io.github.stelitop.mad4j.commands.components;

import discord4j.core.event.domain.interaction.ComponentInteractionEvent;
import org.intellij.lang.annotations.RegExp;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands.convenience;
package io.github.stelitop.mad4j.commands.convenience;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands.convenience;
package io.github.stelitop.mad4j.commands.convenience;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.commands.requirements;
package io.github.stelitop.mad4j.commands.requirements;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.stelitop.mad4j.commands.requirements;
package io.github.stelitop.mad4j.commands.requirements;

import discord4j.core.event.domain.interaction.ChatInputInteractionEvent;
import net.stelitop.mad4j.utils.ActionResult;
import io.github.stelitop.mad4j.utils.ActionResult;

/**
* Interface for creating implementations of a custom command requirement. The extending
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.stelitop.mad4j.commands.requirements.standard;
package io.github.stelitop.mad4j.commands.requirements.standard;

import net.stelitop.mad4j.commands.requirements.CommandRequirement;
import io.github.stelitop.mad4j.commands.requirements.CommandRequirement;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package net.stelitop.mad4j.commands.requirements.standard;
package io.github.stelitop.mad4j.commands.requirements.standard;

import discord4j.core.event.domain.interaction.ChatInputInteractionEvent;
import discord4j.core.object.entity.channel.Channel;
import discord4j.core.object.entity.channel.MessageChannel;
import net.stelitop.mad4j.DiscordEventsComponent;
import net.stelitop.mad4j.commands.requirements.CommandRequirement;
import net.stelitop.mad4j.commands.requirements.CommandRequirementExecutor;
import net.stelitop.mad4j.utils.ActionResult;
import org.springframework.stereotype.Component;
import io.github.stelitop.mad4j.DiscordEventsComponent;
import io.github.stelitop.mad4j.utils.ActionResult;
import io.github.stelitop.mad4j.commands.requirements.CommandRequirementExecutor;

@DiscordEventsComponent
public class DMCommandRequirementImplementation implements CommandRequirementExecutor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.stelitop.mad4j.commands.requirements.standard;
package io.github.stelitop.mad4j.commands.requirements.standard;

import net.stelitop.mad4j.commands.requirements.CommandRequirement;
import io.github.stelitop.mad4j.commands.requirements.CommandRequirement;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package net.stelitop.mad4j.commands.requirements.standard;
package io.github.stelitop.mad4j.commands.requirements.standard;

import discord4j.core.event.domain.interaction.ChatInputInteractionEvent;
import net.stelitop.mad4j.DiscordEventsComponent;
import net.stelitop.mad4j.commands.requirements.CommandRequirement;
import net.stelitop.mad4j.commands.requirements.CommandRequirementExecutor;
import net.stelitop.mad4j.utils.ActionResult;
import org.springframework.stereotype.Component;
import io.github.stelitop.mad4j.DiscordEventsComponent;
import io.github.stelitop.mad4j.utils.ActionResult;
import io.github.stelitop.mad4j.commands.requirements.CommandRequirementExecutor;

@DiscordEventsComponent
public class GuildCommandRequirementImplementation implements CommandRequirementExecutor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.events;
package io.github.stelitop.mad4j.events;

import discord4j.core.event.domain.Event;
import reactor.core.publisher.Mono;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.stelitop.mad4j.events;
package io.github.stelitop.mad4j.events;

import discord4j.core.event.domain.Event;
import net.stelitop.mad4j.utils.ActionResult;
import io.github.stelitop.mad4j.utils.ActionResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.events;
package io.github.stelitop.mad4j.events;

import discord4j.core.event.domain.Event;
import discord4j.core.event.domain.interaction.ChatInputInteractionEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package net.stelitop.mad4j.events;
package io.github.stelitop.mad4j.events;

import discord4j.core.event.domain.Event;
import discord4j.core.event.domain.interaction.ChatInputInteractionEvent;
import discord4j.core.event.domain.interaction.InteractionCreateEvent;
import net.stelitop.mad4j.interactions.EventResponse;
import io.github.stelitop.mad4j.interactions.EventResponse;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.events;
package io.github.stelitop.mad4j.events;

import discord4j.core.event.domain.Event;
import discord4j.core.event.domain.interaction.ChatInputInteractionEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.stelitop.mad4j.events;
package io.github.stelitop.mad4j.events;

import discord4j.core.event.domain.Event;
import discord4j.core.event.domain.interaction.ChatInputInteractionEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
package net.stelitop.mad4j.interactions;
package io.github.stelitop.mad4j.interactions;

import discord4j.core.event.domain.interaction.ChatInputInteractionEvent;
import discord4j.core.event.domain.interaction.ComponentInteractionEvent;
import discord4j.core.event.domain.interaction.InteractionCreateEvent;
import discord4j.core.object.component.LayoutComponent;
import discord4j.core.spec.EmbedCreateSpec;
import discord4j.core.spec.InteractionApplicationCommandCallbackReplyMono;
import net.stelitop.mad4j.commands.components.ComponentInteraction;
import reactor.core.publisher.Mono;

import java.awt.*;
import java.util.ArrayList;
import java.util.List;

public class EventResponse {

private enum ResponseContent {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package net.stelitop.mad4j.listeners;
package io.github.stelitop.mad4j.listeners;

import discord4j.core.GatewayDiscordClient;
import discord4j.core.event.domain.interaction.ChatInputAutoCompleteEvent;
import discord4j.core.object.command.ApplicationCommandInteractionOption;
import discord4j.discordjson.json.ApplicationCommandOptionChoiceData;
import net.stelitop.mad4j.utils.OptionType;
import net.stelitop.mad4j.commands.autocomplete.AutocompletionExecutor;
import net.stelitop.mad4j.commands.autocomplete.InputSuggestion;
import io.github.stelitop.mad4j.utils.OptionType;
import io.github.stelitop.mad4j.commands.autocomplete.AutocompletionExecutor;
import io.github.stelitop.mad4j.commands.autocomplete.InputSuggestion;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Loading
Loading